ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1::gFexTowerBuilder Class Reference

#include <gFexTowerBuilder.h>

Inheritance diagram for LVL1::gFexTowerBuilder:
Collaboration diagram for LVL1::gFexTowerBuilder:

Public Member Functions

 gFexTowerBuilder (const std::string &name, ISvcLocator *svc)
virtual StatusCode initialize () override
 Function initialising the algorithm.
virtual StatusCode execute (const EventContext &) const override
 Function executing the algorithm.
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

StatusCode ReadFibersfromFile (const std::string &)
StatusCode ReadTilefromFile (const std::string &)
StatusCode ReadSCfromFile (const std::string &)
bool isBadSCellID (const std::string &) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< CaloCellContainerm_SCellKey
SG::ReadHandleKey< xAOD::TriggerTowerContainerm_triggerTowerKey
SG::WriteHandleKey< xAOD::gFexTowerContainerm_gTowersWriteKey
Gaudi::Property< std::string > m_FiberMapping
Gaudi::Property< bool > m_apply_masking
Gaudi::Property< bool > m_isDATA
Gaudi::Property< std::string > m_gFEX2Scellmapping
Gaudi::Property< std::string > m_gFEX2Tilemapping
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCells
std::unordered_map< uint32_t, std::vector< uint32_t > > m_map_TTower2Tile
std::unordered_map< unsigned int, std::array< float, 4 > > m_Firm2Tower_map
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 gFexTowerBuilder.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ gFexTowerBuilder()

LVL1::gFexTowerBuilder::gFexTowerBuilder ( const std::string & name,
ISvcLocator * svc )

Definition at line 30 of file gFexTowerBuilder.cxx.

31 : AthReentrantAlgorithm(name, svc) {}

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.

64{
65 return 0;
66}

◆ 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.

◆ 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 LVL1::gFexTowerBuilder::execute ( const EventContext & ctx) const
overridevirtual

Function executing the algorithm.

Definition at line 55 of file gFexTowerBuilder.cxx.

55 {
56
57 // Reading the Scell container
58 SG::ReadHandle<CaloCellContainer> ScellContainer(m_SCellKey, ctx);
59 if (!ScellContainer.isValid()) {
60 ATH_MSG_ERROR("Could not retrieve collection " << ScellContainer.key());
61 return StatusCode::FAILURE;
62 }
63
64 // Reading the TriggerTower container
65 SG::ReadHandle<xAOD::TriggerTowerContainer> triggerTowerContainer(
67 if (!triggerTowerContainer.isValid()) {
68 ATH_MSG_ERROR("Could not retrieve collection "
69 << triggerTowerContainer.key());
70 return StatusCode::FAILURE;
71 }
72
73 // WriteHandle for gFEX EDMs
74 SG::WriteHandle<xAOD::gFexTowerContainer> gTowersContainer(m_gTowersWriteKey, ctx);
75 ATH_CHECK( gTowersContainer.record(std::make_unique<xAOD::gFexTowerContainer>(),
76 std::make_unique<xAOD::gFexTowerAuxContainer>()) );
77 ATH_MSG_DEBUG("Recorded gFexEmulatedTower container with key " << gTowersContainer.key());
78
79 if (ScellContainer->empty() || triggerTowerContainer->empty()) {
81 "Cannot fill gTowers here, at least one container is empty. "
82 "ScellContainer.size="
83 << ScellContainer->size()
84 << " or triggerTowerContainer.size=" << triggerTowerContainer->size());
85 return StatusCode::SUCCESS;
86 }
87
88 // building Scell ID pointers
89 std::unordered_map<uint64_t, const CaloCell*> map_ScellID2ptr;
90 map_ScellID2ptr.reserve(ScellContainer->size());
91
92 for (const CaloCell* scell : *ScellContainer) {
93 const uint64_t ID = scell->ID().get_compact();
94 map_ScellID2ptr[ID] = scell;
95 }
96
97 // building Tile ID pointers
98 std::unordered_map<uint32_t, const xAOD::TriggerTower*> map_TileID2ptr;
99 map_TileID2ptr.reserve(triggerTowerContainer->size());
100
101 for (const xAOD::TriggerTower* tower : *triggerTowerContainer) {
102 map_TileID2ptr[tower->coolId()] = tower;
103 }
104 for (const auto& [key, element] : m_Firm2Tower_map) {
105 unsigned int towerID = key;
106 const auto [fpga, eta, phi, source] = element;
107
108 // the summed encoded Et from LAr or Tile
109 uint16_t total_et_encoded = 0;
110 char gTower_sat = 0;
111 // Note input fpga distinguishes between LAr (0,1,2), Tile (3) and duplicated channels (4)
112 if (source == 0) {
113
114 // check if the towerID exists in the LAr map
115 auto it_TTower2SCells = m_map_TTower2SCells.find(towerID);
116 if (it_TTower2SCells == m_map_TTower2SCells.end()) {
117 ATH_MSG_ERROR("gFEX ID: " << towerID
118 << " not found on map m_map_TTower2SCells");
119 return StatusCode::FAILURE;
120 }
121
122
123 bool invalid = m_apply_masking && m_isDATA; // the isDATA is because there is no concept of invalid supercell in MC (the provenance bit is actually used for BCID in MC), so can never have an invalid jTower
124 bool masked = m_apply_masking;
125
126 // loop over the SCell IDs and calculate encoded Et
127 int total_Et = 0;
128 bool isConnected = true;
129 for (const auto& scellID : it_TTower2SCells->second) {
130 // check if the SCell ID exists in the map
131 auto it_ScellID2ptr = map_ScellID2ptr.find(scellID);
132
133 // unconnected Towers have a single SCell with special id, set energy to zero
134 if (scellID == 0xffffffffffffffff) {
135 isConnected = false;
136 continue;
137 }
138
139 // check if other SCells are in the map
140 std::string str_hex = std::format("{:x}", scellID);
141
142 if (it_ScellID2ptr == map_ScellID2ptr.end()) {
143 if (m_isDATA)
144 ATH_MSG_WARNING("SCell ID: "
145 << scellID
146 << " not found in the CaloCellContainer, skipping");
147 continue;
148 }
149
150 const CaloCell* scell = it_ScellID2ptr->second;
151 int val = std::round(
152 scell->energy() /
153 (12.5 * std::cosh(scell->eta()))); // 12.5 is b.c. energy is in
154 // units of 12.5 MeV per count
155
156 bool isMasked =
157 m_apply_masking ? ((scell)->provenance() & 0x80) : false;
158 bool isInvalid =
159 (m_apply_masking&&m_isDATA) ? ((scell)->provenance()&0x40) : false;
160 bool isSaturated = (m_isDATA) ? scell->quality() : false; // saturation algorithm not implemented in MC yet
161
162 invalid &= isInvalid;
163 masked &= isMasked;
164 if (!isMasked) {
165 gTower_sat |= isSaturated;
166 }
167
168 if (isMasked) {
169 val = 0;
170 } else if( isInvalid&&m_isDATA) {
171 val = 0;
172 }
173
174 if (val != 0)
175 total_Et += val;
176
177 } // end of SCell loop
178
179 // now must convert Total_Et int value into fex value: multi-level encoding
180 if(!isConnected) {
181 total_et_encoded = 0; // no data
182 } else if(masked) {
183 total_et_encoded = 0; // no data
184 } else if(invalid) {
185 total_et_encoded = 4095; // invalid
186 } else {
187 total_et_encoded = gFEXCompression::compress(12.5 * total_Et);
188 }
189
190
191 } else if (source == 1) {
192
193 // Tile
194 // check that the gFEX Tower ID exists in the Tile map
195 auto it_TTower2Tile = m_map_TTower2Tile.find(towerID);
196
197 int Tile_Et = 0;
198 for (auto const& TileTowerID : it_TTower2Tile->second) {
199 auto it_TileID2ptr = map_TileID2ptr.find(TileTowerID);
200 if (it_TileID2ptr == map_TileID2ptr.end()) {
201 if(m_isDATA) {
202 ATH_MSG_WARNING("Tile cool ID: " << TileTowerID
203 << " not found in the xAOD::TriggerTower (map_TileID2ptr)");
204 }
205 continue; // in MC the xAODTriggerTowers have variable size due to noise cuts, continue on to the next tower
206 } else {
207 const xAOD::TriggerTower* tileTower = it_TileID2ptr->second;
208 unsigned int jepEt = tileTower->jepET();
209 Tile_Et += jepEt; // add the encoded energies
210 }
211 }
212 total_et_encoded = Tile_Et;
213
214 } else if (source == 2) {
215 // duplicated Towers, LATOME sends 0
216 total_et_encoded = 0;
217 }
218
219 // the EDM requires a float
220 float total_et_encoded_flt = total_et_encoded;
221
222 unsigned int fpga_out = (towerID < 10000) ? 0 : (towerID < 20000) ? 1 : 2;
223 unsigned int iEta = 0;
224 unsigned int iPhi = 0;
225
226 gTowersContainer->push_back(std::make_unique<xAOD::gFexTower>());
227 gTowersContainer->back()->initialize(iEta, iPhi, eta, phi,
228 total_et_encoded_flt, fpga_out,
229 gTower_sat, towerID);
230 }
231
232 return StatusCode::SUCCESS;
233 }
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
std::vector< Identifier > ID
double energy() const
get energy (data member)
Definition CaloCell.h:327
virtual double eta() const override final
get eta (through CaloDetDescrElement)
Definition CaloCell.h:382
uint16_t quality() const
get quality (data member)
Definition CaloCell.h:348
static unsigned int compress(float Energy)
Compress data.
std::unordered_map< uint32_t, std::vector< uint64_t > > m_map_TTower2SCells
Gaudi::Property< bool > m_apply_masking
virtual StatusCode initialize() override
Function initialising the algorithm.
SG::ReadHandleKey< xAOD::TriggerTowerContainer > m_triggerTowerKey
SG::WriteHandleKey< xAOD::gFexTowerContainer > m_gTowersWriteKey
SG::ReadHandleKey< CaloCellContainer > m_SCellKey
std::unordered_map< unsigned int, std::array< float, 4 > > m_Firm2Tower_map
Gaudi::Property< bool > m_isDATA
std::unordered_map< uint32_t, std::vector< uint32_t > > m_map_TTower2Tile
uint8_t jepET() const
get jepET from peak of lut_jep
@ iPhi
Definition ParamDefs.h:47
setScale setgFexType iEta
TriggerTower_v2 TriggerTower
Define the latest version of the TriggerTower class.
setWord1 uint16_t

◆ 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.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
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 LVL1::gFexTowerBuilder::initialize ( )
overridevirtual

Function initialising the algorithm.

Definition at line 33 of file gFexTowerBuilder.cxx.

33 {
34
36 "Initializing L1CaloFEXAlgos/gFexEmulatedTowers algorithm with name: "
37 << name());
38 ATH_MSG_INFO("Writing into SG key: " << m_gTowersWriteKey);
39 ATH_MSG_INFO("SCell masking: " << m_apply_masking);
40
41 ATH_CHECK(m_SCellKey.initialize());
42 ATH_CHECK(m_triggerTowerKey.initialize());
43 ATH_CHECK(m_gTowersWriteKey.initialize());
44
45 // Reading from CVMFS Fiber mapping
47
48 // Reading from CVMFS Trigger Tower and their corresponding SCell ID
51
52 return StatusCode::SUCCESS;
53 }
#define ATH_MSG_INFO(x)
StatusCode ReadFibersfromFile(const std::string &)
Gaudi::Property< std::string > m_FiberMapping
Gaudi::Property< std::string > m_gFEX2Scellmapping
StatusCode ReadTilefromFile(const std::string &)
Gaudi::Property< std::string > m_gFEX2Tilemapping
StatusCode ReadSCfromFile(const std::string &)
static std::string find_calib_file(const std::string &logical_file_name)

◆ 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.

◆ isBadSCellID()

bool LVL1::gFexTowerBuilder::isBadSCellID ( const std::string & ID) const
private

Definition at line 336 of file gFexTowerBuilder.cxx.

336 {
337
338 // does it start with "0x"?, if so then is a GOOD SCell ID!
339 if (ID.find("0x") == std::string::npos) {
340 ATH_MSG_ERROR("Invalid SuperCell ID "
341 << ID
342 << ". Expecting hexadecimal number on the mapping file");
343 return true;
344 }
345 return false;
346 }

◆ 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.

◆ ReadFibersfromFile()

StatusCode LVL1::gFexTowerBuilder::ReadFibersfromFile ( const std::string & fileName)
private

Definition at line 235 of file gFexTowerBuilder.cxx.

235 {
236 // opening file with ifstream
237 std::ifstream file(fileName);
238
239 if (!file.is_open()) {
240 ATH_MSG_ERROR("Could not open file:" << fileName);
241 return StatusCode::FAILURE;
242 }
243 std::string line;
244 // loading the mapping information
245 while (std::getline(file, line)) {
246 // removing the header of the file (it is just information!)
247 if (line[0] == '#') continue;
248
249 // Splitting line in different substrings
250 std::stringstream oneLine(line);
251 // reading elements
252 std::vector<float> elements;
253 elements.reserve(5);
254 std::string element;
255 while (std::getline(oneLine, element, ' ')) {
256 elements.push_back(std::stof(element));
257 }
258
259 // It should have 5 elements
260 // ordered as: towerID fpga source eta phi
261
262 if (elements.size() != 5) {
264 "Unexpected number of elements (5 expected) in file: " << fileName);
265 return StatusCode::FAILURE;
266 }
267
268 // building array of <fpga, eta, phi, source>
269 std::array<float, 4> aux_arr{{elements.at(1), elements.at(3),
270 elements.at(4), elements.at(2)}};
271
272 // filling the map with the hash given by mapIndex()
273 m_Firm2Tower_map[elements.at(0)] = aux_arr;
274 }
275
276 file.close();
277
278 return StatusCode::SUCCESS;
279 }
TFile * file

◆ ReadSCfromFile()

StatusCode LVL1::gFexTowerBuilder::ReadSCfromFile ( const std::string & fileName)
private

Definition at line 281 of file gFexTowerBuilder.cxx.

281 {
282
283 // opening file with ifstream
284 std::ifstream file(fileName);
285
286 if (!file.is_open()) {
287 ATH_MSG_ERROR("Could not open file:" << fileName);
288 return StatusCode::FAILURE;
289 }
290
291 std::string line;
292 // loading the mapping information into an unordered_map <Fex Tower ID, vector
293 // of SCell IDs>
294 while (std::getline(file, line)) {
295 // removing the header of the file (it is just information!)
296 if (line[0] == '#')
297 continue;
298
299 std::vector<uint64_t> SCellvector;
300
301 // Splitting line in different substrings
302 std::stringstream oneSCellID(line);
303
304 // reading elements
305 std::string substr = "";
306 int TTID = 0;
307 int elem = 0;
308
309 while (std::getline(oneSCellID, substr, ' ')) {
310 ++elem;
311 if (elem == 1) {
312 TTID = std::stoi(substr);
313 } else {
314 // Check if it looks like a SCell Identifier
315 if (isBadSCellID(substr)) {
316 return StatusCode::FAILURE;
317 }
318
319 // converts hex number to unsigned long long int
320 // unconnnected slots are filled with 0xffffffffffffffff
321 // otherwise SCell map used shorter form, add extra zeroes back
322 std::string scell_full =
323 (substr == "0xffffffffffffffff") ? substr : substr + "00000000";
324 uint64_t scid_uint64 = std::strtoull(scell_full.c_str(), nullptr, 0);
325 SCellvector.push_back(scid_uint64);
326 }
327 }
328
329 m_map_TTower2SCells[TTID] = std::move(SCellvector);
330 }
331 file.close();
332
333 return StatusCode::SUCCESS;
334 }
bool isBadSCellID(const std::string &) const

◆ ReadTilefromFile()

StatusCode LVL1::gFexTowerBuilder::ReadTilefromFile ( const std::string & fileName)
private

Definition at line 348 of file gFexTowerBuilder.cxx.

348 {
349
350 std::string myline;
351
352 // openning file with ifstream
353 std::ifstream myfile(fileName);
354
355 if (!myfile.is_open()) {
356 ATH_MSG_FATAL("Could not open file:" << fileName);
357 return StatusCode::FAILURE;
358 }
359
360 // loading the mapping information into an unordered_map <Fex Tower ID, vector
361 // of Tile IDs>
362 while (std::getline(myfile, myline)) {
363 // removing the header of the file
364 myline.erase(myline.begin(),
365 std::find_if(myline.begin(), myline.end(),
366 [](int ch) { return !std::isspace(ch); }));
367 if (myline[0] == '#')
368 continue;
369
370 std::vector<uint32_t> Tilevector;
371
372 // Splitting myline in different substrings
373 std::stringstream oneTileID(myline);
374
375 // reading elements
376 std::string substr = "";
377 int gTowerID = 0;
378 int elem = 0;
379
380 while (std::getline(oneTileID, substr, ' ')) {
381 ++elem;
382 if (elem == 1) {
383 gTowerID = std::stoi(substr);
384 } else {
385 uint32_t tileid_uint32 = std::strtoul(substr.c_str(), nullptr, 0);
386 Tilevector.push_back(tileid_uint32);
387 }
388 }
389 m_map_TTower2Tile[gTowerID] = std::move(Tilevector);
390 }
391 myfile.close();
392
393 return StatusCode::SUCCESS;
394 }
#define ATH_MSG_FATAL(x)
setEventNumber uint32_t

◆ 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.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ 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.

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

Gaudi::Property<bool> LVL1::gFexTowerBuilder::m_apply_masking
private
Initial value:
{this, "SCellMasking", true,
"Applies masking. Only use for data"}

Definition at line 65 of file gFexTowerBuilder.h.

65 {this, "SCellMasking", true,
66 "Applies masking. Only use for data"};

◆ 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_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_FiberMapping

Gaudi::Property<std::string> LVL1::gFexTowerBuilder::m_FiberMapping
private
Initial value:
{
this, "gFexFiberTowerMapping",
PathResolver::find_calib_file("Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gFex_gCaloTowerMap_weighted_v1.txt"),
"Text file to convert from hardware fiber to eta-phi location"}

Definition at line 58 of file gFexTowerBuilder.h.

58 {
59 this, "gFexFiberTowerMapping",
60 // PathResolver::find_calib_file("L1CaloFEXAlgos/gFexFibrTowerMap.txt"),
61 PathResolver::find_calib_file("Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gFex_gCaloTowerMap_weighted_v1.txt"),
62 "Text file to convert from hardware fiber to eta-phi location"};

◆ m_Firm2Tower_map

std::unordered_map<unsigned int, std::array<float, 4> > LVL1::gFexTowerBuilder::m_Firm2Tower_map
private

Definition at line 93 of file gFexTowerBuilder.h.

◆ m_gFEX2Scellmapping

Gaudi::Property<std::string> LVL1::gFexTowerBuilder::m_gFEX2Scellmapping
private
Initial value:
{
this, "gFEX2SCmapping",
"Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_scells_v1.txt",
"Text file to convert from simulation ID to SuperCell Identifier"}

Definition at line 72 of file gFexTowerBuilder.h.

72 {
73 this, "gFEX2SCmapping",
74 "Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_scells_v1.txt",
75 "Text file to convert from simulation ID to SuperCell Identifier"};

◆ m_gFEX2Tilemapping

Gaudi::Property<std::string> LVL1::gFexTowerBuilder::m_gFEX2Tilemapping
private
Initial value:
{
this, "gFEX2Tilemapping",
"Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_tile_v1.txt",
"Text file to convert from simulation ID to Tile Identifier"}

Definition at line 77 of file gFexTowerBuilder.h.

77 {
78 this, "gFEX2Tilemapping",
79 "Run3L1CaloSimulation/L1CaloFEXAlgos/gFEX/gCaloTowers_to_tile_v1.txt",
80 "Text file to convert from simulation ID to Tile Identifier"};

◆ m_gTowersWriteKey

SG::WriteHandleKey<xAOD::gFexTowerContainer> LVL1::gFexTowerBuilder::m_gTowersWriteKey
private
Initial value:
{
this, "gTowersWriteKey", "L1_gFexDataTowers",
"Write gFexEDM Trigger Tower container"}

Definition at line 53 of file gFexTowerBuilder.h.

53 {
54 this, "gTowersWriteKey", "L1_gFexDataTowers",
55 "Write gFexEDM Trigger Tower container"};

◆ m_isDATA

Gaudi::Property<bool> LVL1::gFexTowerBuilder::m_isDATA
private
Initial value:
{
this, "isDATA", true,
"Tells the algorithm if it is data. Used for xAOD::TriggerTower WARNING "
"due to the 0 supression"}

Definition at line 67 of file gFexTowerBuilder.h.

67 {
68 this, "isDATA", true,
69 "Tells the algorithm if it is data. Used for xAOD::TriggerTower WARNING "
70 "due to the 0 supression"};

◆ m_map_TTower2SCells

std::unordered_map<uint32_t, std::vector<uint64_t> > LVL1::gFexTowerBuilder::m_map_TTower2SCells
private

Definition at line 90 of file gFexTowerBuilder.h.

◆ m_map_TTower2Tile

std::unordered_map<uint32_t, std::vector<uint32_t> > LVL1::gFexTowerBuilder::m_map_TTower2Tile
private

Definition at line 91 of file gFexTowerBuilder.h.

◆ m_SCellKey

SG::ReadHandleKey<CaloCellContainer> LVL1::gFexTowerBuilder::m_SCellKey
private
Initial value:
{this, "SCell", "SCell",
"SCell container"}

Definition at line 44 of file gFexTowerBuilder.h.

44 {this, "SCell", "SCell",
45 "SCell container"};

◆ m_triggerTowerKey

SG::ReadHandleKey<xAOD::TriggerTowerContainer> LVL1::gFexTowerBuilder::m_triggerTowerKey
private
Initial value:
{
this, "xODTriggerTowers", "xAODTriggerTowers",
"xAODTriggerTowers container"}

Definition at line 48 of file gFexTowerBuilder.h.

48 {
49 this, "xODTriggerTowers", "xAODTriggerTowers",
50 "xAODTriggerTowers container"};

◆ 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: