ATLAS Offline Software
Loading...
Searching...
No Matches
TGCTriggerDbAlg Class Reference

#include <TGCTriggerDbAlg.h>

Inheritance diagram for TGCTriggerDbAlg:
Collaboration diagram for TGCTriggerDbAlg:

Public Member Functions

 TGCTriggerDbAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~TGCTriggerDbAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode finalize () override
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
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

void fillReadMapBw (TGCTriggerData *writeCdo, const CondAttrListCollection *readKey) const
void fillTrigBitEifi (TGCTriggerData *writeCdo, const CondAttrListCollection *readKey) const
void fillTrigBitTile (TGCTriggerData *writeCdo, const CondAttrListCollection *readKey) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_bw {this, "ReadKeyBw", "/TGC/TRIGGER/CW_BW", "SG key for CW-BW"}
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_eifi {this, "ReadKeyEifi", "/TGC/TRIGGER/CW_EIFI", "SG key for CW-EIFI"}
SG::ReadCondHandleKey< CondAttrListCollectionm_readKey_tile {this, "ReadKeyTile", "/TGC/TRIGGER/CW_TILE", "SG key for CW-TILE"}
SG::WriteCondHandleKey< TGCTriggerDatam_writeKey {this, "WriteKey", "TGCTriggerData", "SG Key of TGCTrigger LUTs"}
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 14 of file TGCTriggerDbAlg.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

◆ TGCTriggerDbAlg()

TGCTriggerDbAlg::TGCTriggerDbAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 9 of file TGCTriggerDbAlg.cxx.

9 :
10 AthCondAlgorithm(name, pSvcLocator)
11{}

◆ ~TGCTriggerDbAlg()

virtual TGCTriggerDbAlg::~TGCTriggerDbAlg ( )
virtualdefault

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

Definition at line 26 of file TGCTriggerDbAlg.cxx.

27{
28 SG::WriteCondHandle<TGCTriggerData> writeHandle{m_writeKey, ctx};
29 if (writeHandle.isValid()) {
30 ATH_MSG_DEBUG("CondHandle " << writeHandle.fullKey() << " is already valid."
31 << ". In theory this should not be called, but may happen"
32 << " if multiple concurrent events are being processed out of order.");
33 return StatusCode::SUCCESS;
34 }
35
36 auto writeCdo = std::make_unique<TGCTriggerData>();
37
38 // Big wheel
39 SG::ReadCondHandle<CondAttrListCollection> readHandle_bw(m_readKey_bw, ctx);
40 const CondAttrListCollection* readCdo_bw(*readHandle_bw);
41
42 if (readCdo_bw == nullptr) {
43 ATH_MSG_ERROR("Null pointer to the read conditions object");
44 return StatusCode::FAILURE;
45 }
46
47 ATH_MSG_INFO("Size of CondAttrListCollection" << readHandle_bw.fullKey() << " = " << readCdo_bw->size());
48
49 EventIDRange rangeW_bw;
50 if ( !readHandle_bw.range(rangeW_bw) ) {
51 ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandle_bw.key());
52 return StatusCode::FAILURE;
53 }
54 ATH_MSG_INFO("Range of input is " << rangeW_bw);
55
56 fillReadMapBw(writeCdo.get(), readCdo_bw);
57
58 // EIFI
59 SG::ReadCondHandle<CondAttrListCollection> readHandle_eifi(m_readKey_eifi, ctx);
60 const CondAttrListCollection* readCdo_eifi(*readHandle_eifi);
61
62 if (readCdo_eifi == nullptr) {
63 ATH_MSG_ERROR("Null pointer to the read conditions object");
64 return StatusCode::FAILURE;
65 }
66
67 ATH_MSG_INFO("Size of CondAttrListCollection" << readHandle_eifi.fullKey() << " = " << readCdo_eifi->size());
68
69 EventIDRange rangeW_eifi;
70 if ( !readHandle_eifi.range(rangeW_eifi) ) {
71 ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandle_eifi.key());
72 return StatusCode::FAILURE;
73 }
74 ATH_MSG_INFO("Range of input is " << rangeW_eifi);
75
76 fillTrigBitEifi(writeCdo.get(), readCdo_eifi);
77
78 // Tile
79 SG::ReadCondHandle<CondAttrListCollection> readHandle_tile(m_readKey_tile, ctx);
80 const CondAttrListCollection* readCdo_tile = *readHandle_tile;
81 if (readCdo_tile == nullptr) {
82 ATH_MSG_ERROR("Null pointer to the read conditions object");
83 return StatusCode::FAILURE;
84 }
85 ATH_MSG_INFO("Size of CondAttrListCollection" << readHandle_tile.fullKey() << " = " << readCdo_tile->size());
86
87 EventIDRange rangeW_tile;
88 if ( !readHandle_tile.range(rangeW_tile) ) {
89 ATH_MSG_ERROR("Failed to retrieve validity range for " << readHandle_tile.key());
90 return StatusCode::FAILURE;
91 }
92 ATH_MSG_INFO("Range of input is " << rangeW_tile);
93
94 fillTrigBitTile(writeCdo.get(), readCdo_tile);
95
96 // write condition object
97 EventIDRange rangeIntersection = EventIDRange::intersect(rangeW_bw,rangeW_eifi,rangeW_tile);
98 if(rangeIntersection.start()>rangeIntersection.stop()) {
99 ATH_MSG_ERROR("Invalid intersection range: " << rangeIntersection);
100 return StatusCode::FAILURE;
101 }
102
103 if (writeHandle.record(rangeIntersection, std::move(writeCdo)).isFailure()) {
104 ATH_MSG_FATAL("Could not record TGCTriggerData " << writeHandle.key()
105 << " with EventRange " << rangeIntersection
106 << " into Conditions Store");
107 return StatusCode::FAILURE;
108 }
109 ATH_MSG_INFO("recorded new " << writeHandle.key() << " with range " << rangeIntersection << " into Conditions Store");
110
111 return StatusCode::SUCCESS;
112}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_DEBUG(x)
size_type size() const
number of Chan/AttributeList pairs
const std::string & key() const
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
const DataObjID & fullKey() const
void fillTrigBitTile(TGCTriggerData *writeCdo, const CondAttrListCollection *readKey) const
void fillTrigBitEifi(TGCTriggerData *writeCdo, const CondAttrListCollection *readKey) const
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_bw
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_eifi
SG::WriteCondHandleKey< TGCTriggerData > m_writeKey
SG::ReadCondHandleKey< CondAttrListCollection > m_readKey_tile
void fillReadMapBw(TGCTriggerData *writeCdo, const CondAttrListCollection *readKey) const

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

◆ fillReadMapBw()

void TGCTriggerDbAlg::fillReadMapBw ( TGCTriggerData * writeCdo,
const CondAttrListCollection * readKey ) const
private

Definition at line 122 of file TGCTriggerDbAlg.cxx.

124{
125 const uint8_t kNMODULETYPE = 12;
126 const uint8_t modulenumber[kNMODULETYPE] = {0, 1, 2, 2, 3, 4, 5, 5, 6, 7, 8, 8};
127 const std::string modulename[kNMODULETYPE] = {"0","1","2a","2b","3","4","5a","5b","6","7","8a","8b"};
128 const std::string sidename[TGCTriggerData::N_SIDE] = {"A","C"};
129
130 bool first = true;
131
132 for(auto& attrmap : *readCdo) {
133 const coral::AttributeList& atr = attrmap.second;
134 writeCdo->m_active[TGCTriggerData::CW_BW] = atr["active"].data<bool>();
135 writeCdo->m_type[TGCTriggerData::CW_BW] = atr["type"].data<std::string>();
136
137 std::string version = *(static_cast<const std::string*>((atr["version"]).addressOfData()));
138 std::string file = *(static_cast<const std::string*>((atr["file"]).addressOfData()));
139 ATH_MSG_DEBUG("channel: " << attrmap.first << ", file: " << file);
140 if ( first ) {
141 ATH_MSG_INFO("type: " << writeCdo->m_type[TGCTriggerData::CW_BW]
142 << " active: " << writeCdo->m_active[TGCTriggerData::CW_BW] << " version: " << version);
143 first = false;
144 }
145 else {
146 ATH_MSG_DEBUG("type: " << writeCdo->m_type[TGCTriggerData::CW_BW]
147 << " active: " << writeCdo->m_active[TGCTriggerData::CW_BW] << " version: " << version);
148 }
149
150 if (!writeCdo->m_active[TGCTriggerData::CW_BW]) continue;
151
152 bool fullCW = (writeCdo->m_type[TGCTriggerData::CW_BW] == "full");
153
154 uint8_t sideId = 0; // if the file is not fullCW, sideId should be zero.
155 if(fullCW) {
156 std::string side = file.substr(strlen("RPhiCoincidenceMap."), 1);
157 for(int id=0; id<TGCTriggerData::N_SIDE; id++) {
158 if(sidename[id] == side) {
159 sideId = id;
160 break;
161 }
162 }
163 }
164
165 uint16_t octantId = 0; // if the file is not fullCW, octantId should be zero.
166 if(fullCW) {
167 octantId = std::stoi(file.substr(strlen("RPhiCoincidenceMap.X"), 1));
168 }
169
172
173 uint16_t moduleId = 0;
174 for(size_t iModule = 0; iModule < kNMODULETYPE; iModule++) {
175 std::ostringstream dbname;
176 dbname << "RPhiCoincidenceMap.";
177 if (fullCW) dbname << sidename[sideId] << octantId << ".";
178 dbname << "mod" << modulename[iModule] + "." + version +"._12.db";
179 if(dbname.str() == file) {
180 moduleId = iModule;
181 break;
182 }
183 }
184
185 std::string data = *(static_cast<const std::string*>((atr["data"]).addressOfData()));
186 std::istringstream stream(data);
187
188 char delimiter = '\n';
189 std::string field, tag;
190 uint32_t phimod2 = modulename[moduleId].find('b') != std::string::npos ? 1 : 0;
191 uint32_t modaddr = ((modulenumber[moduleId] & TGCTriggerData::MODULE_MASK)<<TGCTriggerData::MODULE_SHIFT) +
193
194 while (std::getline(stream, field, delimiter)) {
195
196 std::istringstream header(field);
197 header >> tag;
198
199 if (tag == "#") { // read header part.
200 uint16_t ptLevel, roi, mod;
201 int16_t lDR, hDR, lDPhi, hDPhi;
202 header >> ptLevel >> roi >> mod >> lDR >> hDR >> lDPhi >> hDPhi;
203
204 int16_t type = writeCdo->getTYPE( lDR, hDR, lDPhi, hDPhi );
205
206 // check moduleNumber and ptLevel
207 if( mod != modulenumber[moduleId] ||
208 ptLevel > TGCTriggerData::N_PT_THRESH || type < 0 ) {
209 ATH_MSG_WARNING("Invalid configuration of DB file! - Nothing to load this DB file");
210 break;
211 }
212
215
216 // get window data
217 std::getline(stream, field, delimiter);
218 std::istringstream cont(field);
219
220 for (uint8_t ir = 0; ir < 31; ir++) { // ir=0, 15 and 30 point to -15, 0 and +15 of dR, respectively.
222
223 uint32_t bit;
224 cont >> bit;
225 if (bit == 0) continue; // none of window is opened in this dR
226
227 for(uint8_t iphi=0; iphi<15; iphi++) { // iphi=0, 7 and 14 point to -7, 0 and +7 of dPhi, respectively.
228 if(bit>>iphi & 0x1) {
229 uint32_t theaddr = octaddr + modaddr + cwaddr + draddr + iphi;
230 writeCdo->m_ptmap_bw[theaddr] = (uint8_t)(ptLevel & TGCTriggerData::PT_MASK);
231 }
232 }
233 }
234
235 } // end of if(tag)...
236 } // end of while(getline...)
237
238 } // end of for(attrmap)
239
240 ATH_MSG_DEBUG("BW-CW LUT size: " << writeCdo->m_ptmap_bw.size());
241}
#define ATH_MSG_WARNING(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
static constexpr uint8_t TYPE_SHIFT
Bit position of the octant bits in the GLOBALADDR.
static constexpr uint8_t TYPE_MASK
Mask for extracting the octant from the GLOBALADDR.
bool m_active[CW_NUM]
static constexpr uint8_t MODULE_SHIFT
Bit position of the module number bits in the GLOBALADDR.
static constexpr uint8_t PT_MASK
Mask for pT value for Run-2.
static constexpr uint8_t SIDE_MASK
Mask for extracting the side from the GLOBALADDR.
static constexpr uint8_t SIDE_SHIFT
Bit position of the side bit in the GLOBALADDR.
static constexpr uint8_t PHIMOD2_MASK
Mask for extracting the phi(F or B) from the GLOBALADDR.
std::unordered_map< uint32_t, uint8_t > m_ptmap_bw
Run-2 BW-CW LUT map.
static constexpr uint8_t ROI_SHIFT
Bit position of the module number bits in the GLOBALADDR.
static constexpr uint8_t MODULE_MASK
Mask for extracting the module number from the GLOBALADDR.
static constexpr uint8_t DR_MASK
Mask for extracting the deltaR from the GLOBALADDR.
static constexpr uint8_t OCTANT_SHIFT
Bit position of the octant bits in the GLOBALADDR.
static constexpr uint8_t OCTANT_MASK
Mask for extracting the octant from the GLOBALADDR.
static constexpr uint8_t DR_SHIFT
Bit position of the deltaR bits in the GLOBALADDR.
static constexpr uint8_t PHIMOD2_SHIFT
Bit position of the module number bits in the GLOBALADDR.
int8_t getTYPE(const int16_t lDR, const int16_t hDR, const int16_t lDPhi, const int16_t hDPhi) const
static constexpr uint8_t ROI_MASK
Mask for extracting the module number from the GLOBALADDR.
std::string m_type[CW_NUM]
int ir
counter of the current depth
Definition fastadd.cxx:49
bool first
Definition DeMoScan.py:534
setScaleOne setStatusOne setSaturated int16_t
setWord1 uint16_t
setEventNumber uint32_t
TFile * file

◆ fillTrigBitEifi()

void TGCTriggerDbAlg::fillTrigBitEifi ( TGCTriggerData * writeCdo,
const CondAttrListCollection * readKey ) const
private

preumably, as this is in a loop, there should be some ouput for the channel as well, although that is in a DEBUG statement, so presumably this prinout was demoted to DEBUG, but the following lines were forgotten

Definition at line 243 of file TGCTriggerDbAlg.cxx.

245{
246 const std::string sidename[TGCTriggerData::N_SIDE] = {"A","C"};
247
248 bool first = true;
249
250 for(auto& attrmap : *readCdo) {
251 const coral::AttributeList& atr = attrmap.second;
252 writeCdo->m_active[TGCTriggerData::CW_EIFI] = atr["active"].data<bool>();
253 writeCdo->m_type[TGCTriggerData::CW_EIFI] = atr["type"].data<std::string>();
254
255 std::string version = *(static_cast<const std::string*>((atr["version"]).addressOfData()));
256 std::string file = *(static_cast<const std::string*>((atr["file"]).addressOfData()));
257 ATH_MSG_DEBUG("channel: " << attrmap.first << ", file: " << file);
258
262 if ( first ) {
263 ATH_MSG_INFO("type: " << writeCdo->m_type[TGCTriggerData::CW_EIFI]
264 << " active: " << writeCdo->m_active[TGCTriggerData::CW_EIFI] << " version: " << version);
265 first = false;
266 }
267 else {
268 ATH_MSG_DEBUG("type: " << writeCdo->m_type[TGCTriggerData::CW_EIFI]
269 << " active: " << writeCdo->m_active[TGCTriggerData::CW_EIFI] << " version: " << version);
270 }
271
272 if (!writeCdo->m_active[TGCTriggerData::CW_EIFI]) continue;
273
274 bool fullCW = (writeCdo->m_type[TGCTriggerData::CW_EIFI] == "full");
275
276 uint8_t sideId = 0; // if the file is not fullCW, sideId should be zero.
277 if(fullCW) {
278 std::string side = file.substr(strlen("InnerCoincidenceMap."), 1);
279 for(int id=0; id<TGCTriggerData::N_SIDE; id++) {
280 if(sidename[id] == side) {
281 sideId = id;
282 break;
283 }
284 }
285 }
286
287 std::string dbname="";
288 if (!fullCW) {
289 dbname = "InnerCoincidenceMap." + version + "._12.db";
290 } else {
291 dbname = "InnerCoincidenceMap." + sidename[sideId]
292 + "." + version + "._12.db";
293 }
294 if(file != dbname) {
295 ATH_MSG_WARNING("The file name is different. Skip to load.");
296 continue;
297 }
298
299 std::istringstream stream(*(static_cast<const std::string*>((atr["data"]).addressOfData())));
300
301 char delimiter = '\n';
302 std::string field;
303 std::string tag;
304
305 while (std::getline(stream, field, delimiter)) {
306 int sectorId = -1;
307 int sscId = -1;
308
309 std::istringstream header(field);
310 header >> tag;
311 if(tag=="#"){ // read header part.
312 header >> sectorId >> sscId;
313 }
314
315 if (sectorId < 0 || sectorId >= TGCTriggerData::N_ENDCAP_SECTOR ||
316 sscId < 0 || sscId >= TGCTriggerData::N_ENDCAP_SSC ) {
317 ATH_MSG_WARNING("Invalid configuration of DB file.");
318 return;
319 }
320
324
325 uint8_t flag_pt = 0x0;
326 for (size_t pt = 0; pt < TGCTriggerData::N_PT_THRESH; pt++){
327 uint8_t use;
328 header >> use;
329 flag_pt |= (use&0x1)<<pt;
330 }
331 writeCdo->m_flagpt_eifi[addr] = flag_pt;
332
333 uint8_t flag_roi = 0x0;
334 for (size_t pos = 0; pos < TGCTriggerData::N_ROI_IN_SSC; pos++){
335 uint8_t use;
336 header >> use;
337 flag_roi |= (use&0x1)<<pos;
338 }
339 writeCdo->m_flagroi_eifi[addr] = flag_roi;
340
341 std::getline(stream, field, delimiter);
342 std::istringstream cont(field);
343 for(size_t pos=0; pos < TGCTriggerData::N_EIFI_INPUT; pos++){
344 unsigned int word;
345 cont >> word;
346 uint16_t inputaddr = (addr<<TGCTriggerData::EIFI_TRIGBIT_SHIFT) + pos;
347 writeCdo->m_trigbit_eifi[inputaddr] = word;
348 }
349 } // end of while(std::geline(...))
350
351 if (!fullCW) break;
352
353 } // end of for(attrmap)
354
355 ATH_MSG_DEBUG("EIFI-CW LUT size: " << writeCdo->m_flagpt_eifi.size() + writeCdo->m_flagroi_eifi.size() + writeCdo->m_trigbit_eifi.size());
356}
std::unordered_map< uint16_t, uint8_t > m_flagroi_eifi
static constexpr uint8_t SECTOR_MASK
Mask for trigger sector for the (EIFI/TILE) ADDR.
static constexpr uint8_t EIFI_TRIGBIT_SHIFT
Special bit shift for the EIFI Trigger bit.
std::unordered_map< uint16_t, uint16_t > m_trigbit_eifi
std::unordered_map< uint16_t, uint8_t > m_flagpt_eifi
static constexpr uint8_t ADDR_SIDE_SHIFT
Bit position of the side bit in the (EIFI/TILE) ADDR.
static constexpr uint8_t SSC_MASK
Mask for SSC for the (EIFI/TILE) ADDR.
static constexpr uint8_t ADDR_SECTOR_SHIFT
Bit position of the trigger sector bit in the (EIFI/TILE) ADDR.

◆ fillTrigBitTile()

void TGCTriggerDbAlg::fillTrigBitTile ( TGCTriggerData * writeCdo,
const CondAttrListCollection * readKey ) const
private

Definition at line 358 of file TGCTriggerDbAlg.cxx.

360{
361
362 bool first = true;
363
364 for(auto& attrmap : *readCdo) {
365 const coral::AttributeList& atr = attrmap.second;
366 writeCdo->m_active[TGCTriggerData::CW_TILE] = atr["active"].data<bool>();
367 writeCdo->m_type[TGCTriggerData::CW_TILE] = atr["type"].data<std::string>();
368
369 ATH_MSG_DEBUG("channel: " << attrmap.first << ", file: " << atr["file"].data<std::string>());
370
371 if ( first ) {
372 ATH_MSG_INFO("type: " << writeCdo->m_type[TGCTriggerData::CW_TILE]
373 << " active: " << writeCdo->m_active[TGCTriggerData::CW_TILE]
374 << " version: " << atr["version"].data<std::string>());
375 first = false;
376 }
377 else {
378 ATH_MSG_DEBUG("type: " << writeCdo->m_type[TGCTriggerData::CW_TILE]
379 << " active: " << writeCdo->m_active[TGCTriggerData::CW_TILE]
380 << " version: " << atr["version"].data<std::string>());
381 }
382
383 if(!writeCdo->m_active[TGCTriggerData::CW_TILE]) continue;
384
385 std::istringstream stream(*(static_cast<const std::string*>((atr["data"]).addressOfData())));
386
387 char delimiter = '\n';
388 std::string field;
389
390 while (std::getline(stream, field, delimiter)) {
391
392 int16_t sideId = -1;
393 int16_t sectorId = -1;
394 int16_t sscId = -1;
395
396 std::istringstream header(field);
397 std::string tag;
398 header >> tag;
399 if (tag=="#"){ // read header part.
400 header >> sideId >> sectorId >> sscId;
401 }
402
403 if(sideId < 0 || sideId >= TGCTriggerData::N_SIDE ||
404 sectorId < 0 || sectorId >= TGCTriggerData::N_ENDCAP_SECTOR ||
405 sscId < 0 || sscId >= TGCTriggerData::N_ENDCAP_SSC ) {
406 ATH_MSG_WARNING("Invalid configuration of DB file.");
407 return;
408 }
412
413 uint8_t flagpt = 0;
414 for (size_t pt = 0; pt < TGCTriggerData::N_PT_THRESH; pt++){
415 uint8_t use;
416 header >> use;
417 flagpt |= (use&0x1)<<pt;
418 }
419 writeCdo->m_flagpt_tile[addr] = flagpt;
420
421 uint8_t roi = 0;
422 for (size_t pos=0; pos< TGCTriggerData::N_ROI_IN_SSC; pos++){
423 uint8_t use;
424 header >> use;
425 roi |= (use&0x1)<<pos;
426 }
427 writeCdo->m_flagroi_tile[addr] = roi;
428
429 std::getline(stream, field, delimiter);
430 std::istringstream cont(field);
431 uint16_t trigbit = 0x0;
432 for(size_t pos=0; pos < TGCTriggerData::N_TILE_INPUT; pos++){
433 uint16_t word;
434 cont >> word;
435 trigbit |= (word & 0xf)<<(pos*4);
436 }
437 writeCdo->m_trigbit_tile[addr] = trigbit;
438 }
439 }
440
441 ATH_MSG_DEBUG("Tile-CW LUT size: " << writeCdo->m_flagpt_tile.size() + writeCdo->m_flagroi_tile.size() + writeCdo->m_trigbit_tile.size());
442}
std::unordered_map< uint16_t, uint8_t > m_flagroi_tile
std::unordered_map< uint16_t, uint16_t > m_trigbit_tile
std::unordered_map< uint16_t, uint8_t > m_flagpt_tile

◆ 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

◆ finalize()

StatusCode TGCTriggerDbAlg::finalize ( )
overridevirtual

Definition at line 115 of file TGCTriggerDbAlg.cxx.

115 {
116
117 ATH_MSG_INFO( "finalize " << name() );
118 return StatusCode::SUCCESS;
119}

◆ initialize()

StatusCode TGCTriggerDbAlg::initialize ( )
overridevirtual

Definition at line 13 of file TGCTriggerDbAlg.cxx.

13 {
14
15 ATH_MSG_INFO( "initialize " << name() );
16
17 ATH_CHECK(m_readKey_bw.initialize());
18 ATH_CHECK(m_readKey_eifi.initialize());
19 ATH_CHECK(m_readKey_tile.initialize());
20
21 ATH_CHECK(m_writeKey.initialize());
22
23 return StatusCode::SUCCESS;
24}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ 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()

◆ isReEntrant()

virtual bool AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ return false; }

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

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

SG::ReadCondHandleKey<CondAttrListCollection> TGCTriggerDbAlg::m_readKey_bw {this, "ReadKeyBw", "/TGC/TRIGGER/CW_BW", "SG key for CW-BW"}
private

Definition at line 28 of file TGCTriggerDbAlg.h.

28{this, "ReadKeyBw", "/TGC/TRIGGER/CW_BW", "SG key for CW-BW"};

◆ m_readKey_eifi

SG::ReadCondHandleKey<CondAttrListCollection> TGCTriggerDbAlg::m_readKey_eifi {this, "ReadKeyEifi", "/TGC/TRIGGER/CW_EIFI", "SG key for CW-EIFI"}
private

Definition at line 29 of file TGCTriggerDbAlg.h.

29{this, "ReadKeyEifi", "/TGC/TRIGGER/CW_EIFI", "SG key for CW-EIFI"};

◆ m_readKey_tile

SG::ReadCondHandleKey<CondAttrListCollection> TGCTriggerDbAlg::m_readKey_tile {this, "ReadKeyTile", "/TGC/TRIGGER/CW_TILE", "SG key for CW-TILE"}
private

Definition at line 30 of file TGCTriggerDbAlg.h.

30{this, "ReadKeyTile", "/TGC/TRIGGER/CW_TILE", "SG key for CW-TILE"};

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

◆ m_writeKey

SG::WriteCondHandleKey<TGCTriggerData> TGCTriggerDbAlg::m_writeKey {this, "WriteKey", "TGCTriggerData", "SG Key of TGCTrigger LUTs"}
private

Definition at line 31 of file TGCTriggerDbAlg.h.

31{this, "WriteKey", "TGCTriggerData", "SG Key of TGCTrigger LUTs"};

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