ATLAS Offline Software
Loading...
Searching...
No Matches
GlobalSim::LArCellPreparationAlg Class Reference

#include <LArCellPreparationAlg.h>

Inheritance diagram for GlobalSim::LArCellPreparationAlg:
Collaboration diagram for GlobalSim::LArCellPreparationAlg:

Public Member Functions

virtual StatusCode initialize () override
 initialize function running before first event
virtual StatusCode execute (const EventContext &) const override
 execute function running for every event
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

std::pair< float, boost::dynamic_bitset<> > encodeEnergy (float energy) const
 Function to simulate the cell energy as seen by Global.
StatusCode removeCellsFromOverloadedFEB (std::vector< GlobalSim::GlobalLArCell > &cells) const
 Function to simulate the truncation of overflowing FEB2s.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const CaloCell_IDm_calocell_id {}
int m_readoutRanges [5] = {-1,-1,-1,-1,-1}
 array holding the energy edges of the multilinear encoding
int m_stepsPerRange = -1
 number of discrete values per multilinear energy encoding range
unsigned m_maxCellsPerFEB = -1
 maximum number of cells that can be send to Global for each FEB2
std::map< int, GlobalSim::GlobalLArCellm_gblLArCellMap = {}
 LAr cell map where the key is the offline cell ID.
std::unique_ptr< GlobalSim::GlobalLArCellContainerm_gblLArCellContainerTemplate
 GlobalLArCellContainer template which is constructed in initialize and used in execute.
SG::ReadHandleKey< xAOD::EventInfom_eventInfo {this, "EventInfo", "EventInfo", "Key for the EventInfo container"}
 Key for the EventInfo object.
Gaudi::Property< int > m_numberOfEnergyBits {this, "numberOfEnergyBits", 6, "Number of bits reserved for the multilinear energy encoding"}
 Parameters defining the multilinear energy encoding scheme.
Gaudi::Property< int > m_valueLSB {this, "valueLeastSignificantBit", 40, "Value of the least significant bit in MeV"}
Gaudi::Property< int > m_valueGainFactor {this, "valueGainFactor", 4, "Value of the gain factor of the multilinear energey encoding"}
Gaudi::Property< std::string > m_LArCellMap
 Path to the LAr cell map in the CVMFS GroupData space.
SG::ReadHandleKey< CaloCellContainerm_caloCellsKey {this, "caloCells", "AllCalo", "key to read in a CaloCell container"}
 Key to the CaloCell container.
SG::ReadCondHandleKey< CaloNoisem_totalNoiseKey {this, "totalNoiseKey", "totalNoise", "SG Key of CaloNoise data object"}
 Key to the total noise used for each CaloCell.
SG::WriteHandleKey< GlobalSim::GlobalLArCellContainerm_LArCellContainerKey {this, "GlobalLArCellsKey", "GlobalLArCells", "Key for the output container of the LAr cells sent to Global"}
 Key to writing the GlobalLArCellContainer to StoreGate.
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 32 of file LArCellPreparationAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

62{
63 return 0;
64}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ encodeEnergy()

std::pair< float, boost::dynamic_bitset<> > GlobalSim::LArCellPreparationAlg::encodeEnergy ( float energy) const
private

Function to simulate the cell energy as seen by Global.

Definition at line 230 of file LArCellPreparationAlg.cxx.

230 {
231
232 // Negative energy cell
233 if (energy < 0) return std::pair<float,boost::dynamic_bitset<>>(0.0,boost::dynamic_bitset<>(m_numberOfEnergyBits.value(),0));
234
235 // Saturated cell
236 if (energy > m_readoutRanges[4]) {
237 int max_value = ( m_stepsPerRange + m_stepsPerRange*m_valueGainFactor.value() +
240 return std::pair<float,boost::dynamic_bitset<>>(max_value,boost::dynamic_bitset<>(m_numberOfEnergyBits.value(),std::pow(2,m_numberOfEnergyBits.value())-1));
241 }
242
243 int range = 0;
244 for (int i = 1; i <= 3; ++i) {
245 if (energy > m_readoutRanges[i]) range = i;
246 }
247
249
250 float encoded_energy = -1;
251 int used_steps = 0;
252 for (int i = 0; i < m_stepsPerRange; ++i) {
253 encoded_energy = m_readoutRanges[range]+(step*i);
254 used_steps = i;
255 if (energy < (m_readoutRanges[range]+(step*(i+1)))) break;
256 }
257
258 std::size_t n_bitsE = m_numberOfEnergyBits.value() - 2;
259 boost::dynamic_bitset<> energy_bits(m_numberOfEnergyBits.value(), used_steps);
260 energy_bits |= boost::dynamic_bitset<>(m_numberOfEnergyBits.value(), static_cast<unsigned long>(range) << n_bitsE);
261
262 return std::pair<float,boost::dynamic_bitset<>>(encoded_energy,energy_bits);
263 }
Gaudi::Property< int > m_numberOfEnergyBits
Parameters defining the multilinear energy encoding scheme.
int m_readoutRanges[5]
array holding the energy edges of the multilinear encoding
int m_stepsPerRange
number of discrete values per multilinear energy encoding range

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode GlobalSim::LArCellPreparationAlg::execute ( const EventContext & ctx) const
overridevirtual

execute function running for every event

Definition at line 134 of file LArCellPreparationAlg.cxx.

134 {
135
136 ATH_MSG_DEBUG ("Executing LArCellPreparationAlg algorithm");
137
138 SG::ReadHandle<xAOD::EventInfo> eventInfo(m_eventInfo, ctx);
139 CHECK(eventInfo.isValid());
140
141 // Read in container containing calorimeter cells
142 auto h_caloCells = SG::makeHandle(m_caloCellsKey, ctx);
143 CHECK(h_caloCells.isValid());
144 const auto & cells = *h_caloCells;
145
146 ATH_MSG_DEBUG("Reading " << std::to_string(h_caloCells->size()) << " cells in input cell container");
147
148 SG::ReadCondHandle<CaloNoise> totalNoiseHdl{m_totalNoiseKey, ctx};
149 if (!totalNoiseHdl.isValid()) {return StatusCode::FAILURE;}
150 const CaloNoise* totalNoiseCDO = *totalNoiseHdl;
151
152 std::map<std::string,std::vector<GlobalSim::GlobalLArCell>> gblLArCellsPerFEB2;
153
154 // Set up a GlobalLArCellContainer from template
155 const GlobalSim::GlobalLArCellContainer& templateRef = *m_gblLArCellContainerTemplate;
156 auto gblLArCellContainer = std::make_unique<GlobalSim::GlobalLArCellContainer>(templateRef);
157
158 for(const auto *cell: cells){
159
160 int cell_id = (cell->ID().get_identifier32()).get_compact();
161
162 auto gblLArCell_itr = m_gblLArCellMap.find(cell_id);
163 if (gblLArCell_itr == m_gblLArCellMap.end()) continue;
164
165 //Fill a map with the cell location -> Cell ID
166 if(cell->caloDDE()->getSampling() == 1 || cell->caloDDE()->getSampling() == 5){
167 gblLArCellContainer->fillLocToIDMap(cell->ID(), cell);
168 }
169 GlobalSim::GlobalLArCell gblLArCell = gblLArCell_itr->second;
170
171 float totalNoise = totalNoiseCDO->getNoise(cell->ID(), cell->gain());
172 float sigma = cell->energy() / totalNoise;
173
174 // Only send positive-energy 2sigma cells to the GEP
175 if (sigma < 2.0) continue;
176
177 if (cell->badcell()) continue;
178
179 std::pair<float, boost::dynamic_bitset<>> gep_energy = encodeEnergy(cell->energy() / TMath::CosH(cell->eta()));
180
181 gblLArCell.setEnergy(gep_energy.first, std::move(gep_energy.second));
182 gblLArCell.setSigma(sigma);
183 gblLArCell.setPosition(cell->eta(), cell->phi());
184 gblLArCell.setSize(cell->caloDDE()->deta(), cell->caloDDE()->dphi());
185 gblLArCell.setSampling(cell->caloDDE()->getSampling());
186 gblLArCell.setLayer(cell->caloDDE()->getLayer());
187
188 // Fill cells into map according to FEB
189 auto feb2_itr = gblLArCellsPerFEB2.find(gblLArCell.getFEB2());
190 if (feb2_itr != gblLArCellsPerFEB2.end()) feb2_itr->second.push_back(std::move(gblLArCell));
191 else {
192 std::vector<GlobalSim::GlobalLArCell> cellsThisFEB(1, gblLArCell);
193 gblLArCellsPerFEB2.insert(std::pair<std::string,std::vector<GlobalSim::GlobalLArCell>>(gblLArCell.getFEB2(),cellsThisFEB));
194 }
195 }
196
197 // do truncation
198 for (auto& [feb2Name, cells] : gblLArCellsPerFEB2) {
199
200 // Overflow and error flags
201 bool inOverflow = false;
202 bool inError = false;
203
204 // LAr FEBs might overflow, so they will get truncated
205 if (cells.size() > m_maxCellsPerFEB) {
206 ATH_MSG_INFO("FEB " << feb2Name << " is sending " << cells.size() << " cells, which is more cells than GEP can receive. Removing all but the possible " << m_maxCellsPerFEB << " cells.");
208 inOverflow = true;
209 }
210
211 for (auto& gblLArCell : cells){
212 IdentifierHash hashId=m_calocell_id->calo_cell_hash(static_cast<Identifier>(gblLArCell.getID()));
213 gblLArCellContainer->push_back(std::move(gblLArCell),hashId);
214 }
215
216 gblLArCellContainer->setFeb2Flags(feb2Name, inOverflow, inError);
217 }
218 ATH_MSG_DEBUG("Global is receiving a total of " << gblLArCellContainer->size() << " LAr cells in this event");
219
220 SG::WriteHandle<GlobalSim::GlobalLArCellContainer> h_gblLArCellContainer = SG::makeHandle(m_LArCellContainerKey, ctx);
221 ATH_CHECK( h_gblLArCellContainer.record( std::move(gblLArCellContainer) ) );
222
223 return StatusCode::SUCCESS;
224 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
#define CHECK(...)
Evaluate an expression and check for errors.
float getNoise(const IdentifierHash h, const int gain) const
Accessor by IdentifierHash and gain.
Definition CaloNoise.h:35
void setEnergy(float energy)
copy & move c'tor, assignment, and destructor are automatically generated
void setSampling(int sampling)
set sampling of cell
void setSigma(float sigma)
set significancy of energy deposit
void setSize(float deta, float dphi)
set size of cell in eta-phi space
void setLayer(int layer)
set layer of cell
const std::string & getFEB2() const
get the name of the FEB2 this cell is associated with
uint32_t getID() const
get the short identifier of the cell
void setPosition(float eta, float phi)
set position of cell in eta-phi space
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfo
Key for the EventInfo object.
std::pair< float, boost::dynamic_bitset<> > encodeEnergy(float energy) const
Function to simulate the cell energy as seen by Global.
std::map< int, GlobalSim::GlobalLArCell > m_gblLArCellMap
LAr cell map where the key is the offline cell ID.
StatusCode removeCellsFromOverloadedFEB(std::vector< GlobalSim::GlobalLArCell > &cells) const
Function to simulate the truncation of overflowing FEB2s.
std::unique_ptr< GlobalSim::GlobalLArCellContainer > m_gblLArCellContainerTemplate
GlobalLArCellContainer template which is constructed in initialize and used in execute.
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Key to the total noise used for each CaloCell.
unsigned m_maxCellsPerFEB
maximum number of cells that can be send to Global for each FEB2
SG::ReadHandleKey< CaloCellContainer > m_caloCellsKey
Key to the CaloCell container.
SG::WriteHandleKey< GlobalSim::GlobalLArCellContainer > m_LArCellContainerKey
Key to writing the GlobalLArCellContainer to StoreGate.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode GlobalSim::LArCellPreparationAlg::initialize ( )
overridevirtual

initialize function running before first event

Definition at line 28 of file LArCellPreparationAlg.cxx.

28 {
29 ATH_MSG_INFO ("Initializing " << name());
30 ATH_MSG_INFO ("Target name of GlobalLArCellContainer is " << m_LArCellContainerKey);
31
32 CHECK(m_eventInfo.initialize());
33 CHECK(m_caloCellsKey.initialize());
34 CHECK(m_LArCellContainerKey.initialize());
35
36 // retrieve ID helper
37 ATH_CHECK(detStore()->retrieve(m_calocell_id, "CaloCell_ID"));
38
39 ATH_CHECK(m_totalNoiseKey.initialize());
40
41 ATH_MSG_INFO("Active energy encoding scheme for LAr cells is " << m_numberOfEnergyBits.value() << " energy bits with " << m_valueLSB.value() << " MeV for the least significant bit and a gain factor of " << m_valueGainFactor.value());
42
43 m_stepsPerRange = std::pow(2,m_numberOfEnergyBits.value()-2);
44
45 m_readoutRanges[0] = 0;
51
52 ATH_MSG_DEBUG("Readout scheme with " << m_numberOfEnergyBits.value() << "-bits provides the following four energy thresholds (with " << m_stepsPerRange << " discrete steps on each threshold)");
53 ATH_MSG_DEBUG("GEP cell energy range 0: min = " << m_readoutRanges[0] << " MeV -> max = " << m_readoutRanges[1] << " MeV");
54 ATH_MSG_DEBUG("GEP cell energy range 1: min = " << m_readoutRanges[1] + m_valueLSB.value() << " MeV -> max = " << m_readoutRanges[2] << " MeV");
55 ATH_MSG_DEBUG("GEP cell energy range 2: min = " << m_readoutRanges[2]+(m_valueGainFactor.value()*m_valueLSB.value()) << " MeV -> max = " << m_readoutRanges[3] << " MeV");
56 ATH_MSG_DEBUG("GEP cell energy range 3: min = " << m_readoutRanges[3]+(m_valueGainFactor.value()*m_valueGainFactor.value()*m_valueLSB.value()) << " MeV -> max = " << m_readoutRanges[4] << " MeV");
57
58 // At the moment only have a detailed scheme for 6-10 bit readouts, thus rejecting any other value
59 switch(m_numberOfEnergyBits.value()) {
60 case 6: m_maxCellsPerFEB = 62; break;
61 case 7: m_maxCellsPerFEB = 54; break;
62 case 8: m_maxCellsPerFEB = 48; break;
63 case 9: m_maxCellsPerFEB = 43; break;
64 case 10: m_maxCellsPerFEB = 39; break;
65 default: ATH_MSG_FATAL("A LAr cell energy encoding scheme with " << m_numberOfEnergyBits.value() << " energy bits is currently not defined");
66 return StatusCode::FAILURE;
67 }
68
69 ATH_MSG_INFO("Loading cell map associating LAr cells to FEB2s");
70
71 std::string cellMapPath = PathResolverFindCalibFile(m_LArCellMap);
72 if(cellMapPath.empty()) ATH_MSG_ERROR("Could not find file with cell map data: " << m_LArCellMap.value());
73
74 std::ifstream file(cellMapPath.c_str());
75
76 unsigned n_cells = 0;
77 m_gblLArCellMap.clear();
78
79 std::map<std::string,Feb2MuxInfo> feb2MuxAssoc;
80
81 // Read input file
82 if (file.is_open()) {
83
84 int online_id, offline_id, channel, con_num, fbr;
85 std::string assocFEB2, con_type, muxname, muxrack, cnnctr, laspname, lasprack;
86
87 // Skipping header of file
88 std::getline(file, assocFEB2);
89
90 // start reading data
91 while (true) {
92
93 file >> offline_id >> online_id >> assocFEB2 >> channel >> con_type >> con_num >> fbr >> muxname >> muxrack >> cnnctr >> laspname >> lasprack;
94
95 if (file.eof()) break;
96
97 GlobalSim::GlobalLArCell gblLArCell(offline_id, assocFEB2, channel);
98 gblLArCell.setBoardConnector(cnnctr, con_type, con_num, fbr);
99 gblLArCell.setMUX(muxname);
100 gblLArCell.setLASP(laspname);
101
102 m_gblLArCellMap.insert(std::pair<int, GlobalSim::GlobalLArCell>(offline_id, gblLArCell));
103
104 int indexOnMux = fbr;
105 if (cnnctr == "B") indexOnMux += 24;
106 if (cnnctr == "C") indexOnMux += 32;
107
108 // Add FEB2 to MUX association map
109 auto itr = feb2MuxAssoc.find(assocFEB2);
110 if (itr == feb2MuxAssoc.end()) {
111 feb2MuxAssoc.insert(std::pair<std::string,Feb2MuxInfo>(assocFEB2, {muxname, indexOnMux}));
112 }
113
114 ++n_cells;
115 }
116 }
117 else {
118 ATH_MSG_ERROR("Could not open file containing the cell to FEB2 association");
119 return StatusCode::FAILURE;
120 }
121
122 ATH_MSG_DEBUG("Loaded FEB2 information for " << n_cells << " LAr cells");
123
124 // Constructing the GlobalLArCellContainer
125 m_gblLArCellContainerTemplate = std::make_unique<GlobalSim::GlobalLArCellContainer>(feb2MuxAssoc);
127
128 return StatusCode::SUCCESS;
129 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
std::string PathResolverFindCalibFile(const std::string &logical_file_name)
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< std::string > m_LArCellMap
Path to the LAr cell map in the CVMFS GroupData space.
TFile * file

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ removeCellsFromOverloadedFEB()

StatusCode GlobalSim::LArCellPreparationAlg::removeCellsFromOverloadedFEB ( std::vector< GlobalSim::GlobalLArCell > & cells) const
private

Function to simulate the truncation of overflowing FEB2s.

Definition at line 268 of file LArCellPreparationAlg.cxx.

268 {
269
270 // Sort cells by channel
271 std::sort(cells.begin(), cells.end(), [](const auto& a, const auto& b) {
272 return a.getChannel() < b.getChannel(); });
273
274 // Remove overflowing cells from vector
275 if (cells.size() > m_maxCellsPerFEB)
276 cells.erase(std::next(cells.begin(), m_maxCellsPerFEB), cells.end());
277
278 return StatusCode::SUCCESS;
279 }
static Double_t a
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

75{
76 return BaseAlg::sysExecute (ctx);
77}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_calocell_id

const CaloCell_ID* GlobalSim::LArCellPreparationAlg::m_calocell_id {}
private

Definition at line 44 of file LArCellPreparationAlg.h.

44{};

◆ m_caloCellsKey

SG::ReadHandleKey<CaloCellContainer> GlobalSim::LArCellPreparationAlg::m_caloCellsKey {this, "caloCells", "AllCalo", "key to read in a CaloCell container"}
private

Key to the CaloCell container.

Definition at line 76 of file LArCellPreparationAlg.h.

76{this, "caloCells", "AllCalo", "key to read in a CaloCell container"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eventInfo

SG::ReadHandleKey<xAOD::EventInfo> GlobalSim::LArCellPreparationAlg::m_eventInfo {this, "EventInfo", "EventInfo", "Key for the EventInfo container"}
private

Key for the EventInfo object.

Definition at line 64 of file LArCellPreparationAlg.h.

64{this, "EventInfo", "EventInfo", "Key for the EventInfo container"};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_gblLArCellContainerTemplate

std::unique_ptr<GlobalSim::GlobalLArCellContainer> GlobalSim::LArCellPreparationAlg::m_gblLArCellContainerTemplate
private

GlobalLArCellContainer template which is constructed in initialize and used in execute.

Definition at line 61 of file LArCellPreparationAlg.h.

◆ m_gblLArCellMap

std::map<int,GlobalSim::GlobalLArCell> GlobalSim::LArCellPreparationAlg::m_gblLArCellMap = {}
private

LAr cell map where the key is the offline cell ID.

Definition at line 59 of file LArCellPreparationAlg.h.

59{};

◆ m_LArCellContainerKey

SG::WriteHandleKey<GlobalSim::GlobalLArCellContainer> GlobalSim::LArCellPreparationAlg::m_LArCellContainerKey {this, "GlobalLArCellsKey", "GlobalLArCells", "Key for the output container of the LAr cells sent to Global"}
private

Key to writing the GlobalLArCellContainer to StoreGate.

Definition at line 82 of file LArCellPreparationAlg.h.

82{this, "GlobalLArCellsKey", "GlobalLArCells", "Key for the output container of the LAr cells sent to Global"};

◆ m_LArCellMap

Gaudi::Property<std::string> GlobalSim::LArCellPreparationAlg::m_LArCellMap
private
Initial value:
{this, "LArCellMapFile", "UpgradePerformanceFunctions/LAr_Cell_Map_offlineID_1.csv",
"File associating LAr cells with readout FEBs and connection technology"}

Path to the LAr cell map in the CVMFS GroupData space.

Definition at line 72 of file LArCellPreparationAlg.h.

72 {this, "LArCellMapFile", "UpgradePerformanceFunctions/LAr_Cell_Map_offlineID_1.csv",
73 "File associating LAr cells with readout FEBs and connection technology"};

◆ m_maxCellsPerFEB

unsigned GlobalSim::LArCellPreparationAlg::m_maxCellsPerFEB = -1
private

maximum number of cells that can be send to Global for each FEB2

Definition at line 56 of file LArCellPreparationAlg.h.

◆ m_numberOfEnergyBits

Gaudi::Property<int> GlobalSim::LArCellPreparationAlg::m_numberOfEnergyBits {this, "numberOfEnergyBits", 6, "Number of bits reserved for the multilinear energy encoding"}
private

Parameters defining the multilinear energy encoding scheme.

Definition at line 67 of file LArCellPreparationAlg.h.

67{this, "numberOfEnergyBits", 6, "Number of bits reserved for the multilinear energy encoding"};

◆ m_readoutRanges

int GlobalSim::LArCellPreparationAlg::m_readoutRanges[5] = {-1,-1,-1,-1,-1}
private

array holding the energy edges of the multilinear encoding

Definition at line 52 of file LArCellPreparationAlg.h.

52{-1,-1,-1,-1,-1};

◆ m_stepsPerRange

int GlobalSim::LArCellPreparationAlg::m_stepsPerRange = -1
private

number of discrete values per multilinear energy encoding range

Definition at line 54 of file LArCellPreparationAlg.h.

◆ m_totalNoiseKey

SG::ReadCondHandleKey<CaloNoise> GlobalSim::LArCellPreparationAlg::m_totalNoiseKey {this, "totalNoiseKey", "totalNoise", "SG Key of CaloNoise data object"}
private

Key to the total noise used for each CaloCell.

Definition at line 79 of file LArCellPreparationAlg.h.

79{this, "totalNoiseKey", "totalNoise", "SG Key of CaloNoise data object"};

◆ m_valueGainFactor

Gaudi::Property<int> GlobalSim::LArCellPreparationAlg::m_valueGainFactor {this, "valueGainFactor", 4, "Value of the gain factor of the multilinear energey encoding"}
private

Definition at line 69 of file LArCellPreparationAlg.h.

69{this, "valueGainFactor", 4, "Value of the gain factor of the multilinear energey encoding"};

◆ m_valueLSB

Gaudi::Property<int> GlobalSim::LArCellPreparationAlg::m_valueLSB {this, "valueLeastSignificantBit", 40, "Value of the least significant bit in MeV"}
private

Definition at line 68 of file LArCellPreparationAlg.h.

68{this, "valueLeastSignificantBit", 40, "Value of the least significant bit in MeV"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: