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

level 1 TRT trigger simulation More...

#include <TrigT1TRT.h>

Inheritance diagram for LVL1::TrigT1TRT:
Collaboration diagram for LVL1::TrigT1TRT:

Public Member Functions

 TrigT1TRT (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
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

int BarrelChipToBoard (int chip) const
int EndcapChipToBoard (int chip) const
int EndcapStrawNumber (int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const
int BarrelStrawNumber (int strawNumber, int strawlayerNumber, int LayerNumber) const
int BarrelStrawLayerNumber (int strawLayerNumber, int LayerNumber) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::WriteHandleKey< TrtCTPm_trtCTPLocation {this, "TrtCTPLocation", LVL1::DEFAULT_TrtCTPLocation, "Write handle key for TrtCTP"}
SG::ReadHandleKey< TRT_RDO_Containerm_trtRDOKey {this, "TrtRDOLocation", "TRT_RDOs", "Read handle key for TRT_RDO_Container"}
ToolHandle< ITRT_StrawStatusSummaryToolm_ConditionsSummary {this, "ConditionsSummaryTool", "TRT_StrawStatusSummaryTool"}
ServiceHandle< ITRT_StrawNeighbourSvcm_TRTStrawNeighbourSvc {this, "StrawNeighbourSvc", "TRT_StrawNeighbourSvc"}
const InDetDD::TRT_DetectorManagerm_mgr {}
const TRT_IDm_pTRTHelper {}
Gaudi::Property< int > m_TTCMultiplicity {this, "TTCMultiplicity", 4, "TTC board multiplicity required to fire the trigger"}
Gaudi::Property< std::string > m_maskedChipsFile {this, "maskedChipsFile", "TrigT1TRT/fastORmaskedChips.json", "path to file with list of masked chips"}
std::array< std::array< std::vector< int >, 32 >, 2 > m_maskedChipsBarrel
std::array< std::array< std::vector< int >, 32 >, 2 > m_maskedChipsEc
unsigned char m_mat_chip_barrel [64][1642] {}
unsigned char m_mat_chip_endcap [64][3840] {}
int m_numberOfStraws [75] {}
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

level 1 TRT trigger simulation

Definition at line 32 of file TrigT1TRT.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

◆ TrigT1TRT()

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

Definition at line 19 of file TrigT1TRT.cxx.

19 :
20 AthReentrantAlgorithm(name, pSvcLocator)
21 {
22 }

Member Function Documentation

◆ BarrelChipToBoard()

int LVL1::TrigT1TRT::BarrelChipToBoard ( int chip) const
private

Definition at line 303 of file TrigT1TRT.cxx.

303 {
304 // return logical board index:
305 // 0 for Board 1S (has 10 chips) 0 - 9
306 // 1 for 1L (11) 10 - 20
307 // 2 for 2S (15) 21 - 35
308 // 3 for 2L, first 9 chips 36 - 44
309 // 4 for 2L, second 9 chips 45 - 53
310 // 5 for 3S, first 11 54 - 64
311 // 6 for 3S, second 12 65 - 76
312 // 7 for 3L, first 13 77 - 89
313 // 8 for 3L, second 14 90 - 103
314
315 int list[] = {10, 11, 15, 9, 9, 11, 12, 13, 14};
316 int count = 0;
317 chip--;
318
319 for (int i=0; i<9; i++) {
320 count += list[i];
321 if (chip < count) return i+1;
322 else if (chip == 104) return 9;
323 }
324
325 throw std::runtime_error("Board not found!");
326 return -1;
327 }
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:146
list(name, path='/')
Definition histSizes.py:38

◆ BarrelStrawLayerNumber()

int LVL1::TrigT1TRT::BarrelStrawLayerNumber ( int strawLayerNumber,
int LayerNumber ) const
private

Definition at line 421 of file TrigT1TRT.cxx.

421 {
422 if(LayerNumber==0) {
423 strawLayerNumber+=0;
424 } else if(LayerNumber==1) {
425 strawLayerNumber+=19;
426 } else if(LayerNumber==2) {
427 strawLayerNumber+=43;
428 }
429 return strawLayerNumber;
430 }

◆ BarrelStrawNumber()

int LVL1::TrigT1TRT::BarrelStrawNumber ( int strawNumber,
int strawlayerNumber,
int LayerNumber ) const
private

Definition at line 406 of file TrigT1TRT.cxx.

406 {
407 int addToStrawNumber=0;
408 int addToStrawNumberNext=0;
409 int i=0;
410
411 do {
412 i++;
413 addToStrawNumber+=m_numberOfStraws[i-1];
414 addToStrawNumberNext = addToStrawNumber+m_numberOfStraws[i];
415 }
416 while(BarrelStrawLayerNumber(strawlayerNumber,LayerNumber)!=i-1);
417 strawNumber = addToStrawNumberNext - strawNumber-1;
418 return strawNumber;
419 }
int m_numberOfStraws[75]
Definition TrigT1TRT.h:77
int BarrelStrawLayerNumber(int strawLayerNumber, int LayerNumber) const

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

◆ EndcapChipToBoard()

int LVL1::TrigT1TRT::EndcapChipToBoard ( int chip) const
private

Definition at line 329 of file TrigT1TRT.cxx.

329 {
330 int Board = -1;
331
332 int remainder = (chip-1) % 12;
333 Board = int(((chip -1) - remainder) / 12);
334 return Board;
335 }
std::vector< std::string > remainder(const std::vector< std::string > &v1, const std::vector< std::string > &v2)

◆ EndcapStrawNumber()

int LVL1::TrigT1TRT::EndcapStrawNumber ( int strawNumber,
int strawLayerNumber,
int LayerNumber,
int phi_stack,
int side ) const
private

Definition at line 337 of file TrigT1TRT.cxx.

337 {
338
339 // before perfoming map, corrections need to be perfomed.
341
342 // for eca, rotate triplets by 180 for stacks 9-16, and 25-32.
343 static const int TripletOrientation[2][32] = {
344 {1,1,1,1,1,1,1,1,
345 0,0,0,0,0,0,0,0,
346 1,1,1,1,1,1,1,1,
347 0,0,0,0,0,0,0,0},
348 {1,1,1,1,1,1,1,1,
349 0,0,0,0,0,0,0,0,
350 1,1,1,1,1,1,1,1,
351 0,0,0,0,0,0,0,0}
352 };
353
354 int phi1=-1;
355 if(side==2) phi1=phi_stack, side=1;
356 else if (side==-2) phi1=31-phi_stack, side=0;
357 if (phi1>-1){
358 if (TripletOrientation[side][phi1]){
359 // change straw number from 0-23 in straw layer to 0-192
360 if (strawLayerNumber < 8)strawNumber = strawNumber + 24*strawLayerNumber;
361 if (strawLayerNumber > 7)strawNumber = strawNumber + 24*(strawLayerNumber -8);
362 strawNumber = (192-1)*TripletOrientation[side][phi1]+strawNumber*(1-2*TripletOrientation[side][phi1]);//actual rotation
363
364 // take strawNumber back to 0-23
365 if (strawLayerNumber<8) strawLayerNumber = int(strawNumber/24);
366 if (strawLayerNumber>7) strawLayerNumber = int(strawNumber/24) + 8;
367 strawNumber = strawNumber%24;
368 }
369
370 // finish rotation
371
372 // flip straw in layer.
373
374 if (side==0) strawNumber = 23 - strawNumber;
375
376 // finish flipping
377 }
378
379 // done with corrections
380
381 // start mapping from athena identifiers to TRTViewer maps
382 int strawNumberNew=0;
383
384 if(LayerNumber<6 && strawLayerNumber>7) {
385 strawNumberNew=strawNumberNew+(384*LayerNumber);
386 strawNumberNew=strawNumberNew+192+(strawLayerNumber%8)+(strawNumber*8);
387 }
388 else if(LayerNumber<6 && strawLayerNumber<8) {
389 strawNumberNew=strawNumberNew+(384*LayerNumber);
390 strawNumberNew=strawNumberNew + (strawLayerNumber%8) + (strawNumber*8);
391 }
392 else if(LayerNumber>5 && strawLayerNumber>7) {
393 strawNumberNew = strawNumberNew + 2304 + 192*(LayerNumber-6);
394 strawNumberNew = strawNumberNew + 192 + (strawLayerNumber%8) + (8*strawNumber);
395 }
396 else if(LayerNumber>5 && strawLayerNumber<8) {
397 strawNumberNew = strawNumberNew + 2304 + 192*(LayerNumber-6);
398 strawNumberNew = strawNumberNew + (strawLayerNumber%8) + (8*strawNumber);
399 }
400
401 strawNumber=strawNumberNew;
402
403 return strawNumber;
404 }

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

Definition at line 164 of file TrigT1TRT.cxx.

164 {
165
166 // initialise and empty board score table
167 int barrel_trigger_board[2][32][9] = {{{0}}};
168 int endcap_trigger_board[2][32][20] = {{{0}}};
169
170 // initialise and empty empty ttc score table
171 int barrel_trigger_ttc[2][8] = {{0}};
172 int endcap_trigger_ttc[2][16] = {{0}};
173
174 // access TRT RDO hits container
175 SG::ReadHandle<TRT_RDO_Container> trtRDOs(m_trtRDOKey, ctx);
176
177 ATH_CHECK( trtRDOs.isValid() );
178
179 for (const auto trtRDO : *trtRDOs) {
180 const InDetRawDataCollection<TRT_RDORawData>* TRT_Collection(trtRDO);
181
182 if(!TRT_Collection) {
183 ATH_MSG_WARNING("InDetRawDataCollection<TRT_RDORawData> is empty");
184 continue;
185 }
186 else {
187 // loop over TRT RDOs
188 for (const auto p_rdo : *TRT_Collection) {// p_rdo is pointer to trt rdo data vector
189 if(!p_rdo)
190 ATH_MSG_WARNING("pointer to TRT_RDORawData is nullptr");
191 else {
192 Identifier TRT_Identifier = p_rdo->identify();
193
194 int barrel_ec = m_pTRTHelper->barrel_ec(TRT_Identifier);
195
196 const TRT_LoLumRawData* p_lolum = dynamic_cast<const TRT_LoLumRawData*>(p_rdo);
197 if(!p_lolum) continue;
198
199 // get TRT Identifier (need to know phi module, module layer, straw layer, and straw # with in the layer, to get proper straw numbering.
200 TRT_Identifier = p_lolum->identify();
201 int phi_module = m_pTRTHelper->phi_module(TRT_Identifier);
202 int layer_or_wheel = m_pTRTHelper->layer_or_wheel(TRT_Identifier);
203 int straw_layer = m_pTRTHelper->straw_layer(TRT_Identifier);
204 int straw = m_pTRTHelper->straw(TRT_Identifier);
205 int strawNumber = 0;
206 int chip = 0;
207 int board = 0;
208
209 // Require good straw status
210 if (m_ConditionsSummary->getStatus(TRT_Identifier,ctx) != TRTCond::StrawStatus::Good)
211 continue;
212
213 if (barrel_ec == 1 || barrel_ec == -1) {
214 int side = barrel_ec>0?1:0;
215 strawNumber = BarrelStrawNumber(straw, straw_layer, layer_or_wheel);
216 chip = m_mat_chip_barrel[phi_module][strawNumber];
217 board = BarrelChipToBoard(chip);
218 if (board < 0) {
219 ATH_MSG_FATAL( "Failure in BarrelChipToBoard" );
220 return StatusCode::FAILURE;
221 }
222
223 // check if chip is masked
224 std::vector<int> maskedChips = m_maskedChipsBarrel.at(side).at(phi_module);
225 if(std::find(maskedChips.begin(), maskedChips.end(), chip) != maskedChips.end())
226 continue;
227
228 if ( (p_lolum)->highLevel() ) {
229 barrel_trigger_board[side][phi_module][board]++;
230 }
231
232 }
233 else if (barrel_ec == 2 || barrel_ec == -2) {
234
235 int side = barrel_ec>0?1:0;
236 strawNumber = EndcapStrawNumber(straw, straw_layer, layer_or_wheel, phi_module, barrel_ec);
237 chip = m_mat_chip_endcap[phi_module][strawNumber];
238 board = EndcapChipToBoard(chip);
239
240 // check if chip is masked
241 std::vector<int> maskedChips = m_maskedChipsEc.at(side).at(phi_module);
242 if(std::find(maskedChips.begin(), maskedChips.end(), chip) != maskedChips.end())
243 continue;
244
245 if ( (p_lolum)->highLevel() ) {
246 endcap_trigger_board[side][phi_module][board]++;
247 }
248 }
249 }
250 }
251 }
252 }
253
254 // analyse board score table - fill ttc score table
255 for (int i=0; i<2; i++) {
256 for (int j=0; j<32; j++) {
257 for (int k=0; k<9; k++) {
258 if (barrel_trigger_board[i][j][k]) {
259 barrel_trigger_ttc[i][j%4]++;
260 }
261 }
262 for (int k=0; k<20; k++) {
263 if (endcap_trigger_board[i][j][k]) {
264 endcap_trigger_ttc[i][j%2]++;
265 }
266 }
267 }
268 }
269
270 unsigned int cableWord0 = 0;
271
272 // analyse ttc score table - set cable word
273 for (int i=0; i<2; i++) {
274 for (int j=0; j<8; j++) {
275 if (barrel_trigger_ttc[i][j] >= m_TTCMultiplicity) {
276 cableWord0 |= (uint64_t(0x1) << 21); // use of hard coded cable start
277 }
278 }
279 for (int j=0; j<16; j++) {
280 if (endcap_trigger_ttc[i][j] >= m_TTCMultiplicity) {
281 cableWord0 |= (uint64_t(0x1) << 21); // use of hard coded cable start
282 }
283 }
284 }
285
286 ATH_MSG_DEBUG( " cableWord: " << cableWord0 );
287
288 // form CTP obejct
289 SG::WriteHandle<TrtCTP> trtCTP = SG::makeHandle(m_trtCTPLocation, ctx);
290
291 // record CTP object
292 ATH_CHECK(trtCTP.record(std::make_unique<TrtCTP>(cableWord0)));
293 ATH_MSG_DEBUG("Stored TRT CTP object with bit " << std::dec << cableWord0);
294
295 return StatusCode::SUCCESS;
296 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
virtual Identifier identify() const override final
ToolHandle< ITRT_StrawStatusSummaryTool > m_ConditionsSummary
Definition TrigT1TRT.h:50
Gaudi::Property< int > m_TTCMultiplicity
Definition TrigT1TRT.h:60
SG::WriteHandleKey< TrtCTP > m_trtCTPLocation
Definition TrigT1TRT.h:44
const TRT_ID * m_pTRTHelper
Definition TrigT1TRT.h:57
SG::ReadHandleKey< TRT_RDO_Container > m_trtRDOKey
Definition TrigT1TRT.h:47
int BarrelStrawNumber(int strawNumber, int strawlayerNumber, int LayerNumber) const
unsigned char m_mat_chip_endcap[64][3840]
Definition TrigT1TRT.h:75
unsigned char m_mat_chip_barrel[64][1642]
Definition TrigT1TRT.h:74
std::array< std::array< std::vector< int >, 32 >, 2 > m_maskedChipsBarrel
Definition TrigT1TRT.h:64
int EndcapStrawNumber(int strawNumber, int strawLayerNumber, int LayerNumber, int phi_stack, int side) const
int EndcapChipToBoard(int chip) const
int BarrelChipToBoard(int chip) const
std::array< std::array< std::vector< int >, 32 >, 2 > m_maskedChipsEc
Definition TrigT1TRT.h:65
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
bool highLevel(unsigned int m_word)
Definition driftCircle.h:88
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
@ straw
Definition HitInfo.h:82

◆ 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::TrigT1TRT::initialize ( )
overridevirtual

Definition at line 28 of file TrigT1TRT.cxx.

28 {
29
30 ATH_CHECK( m_trtCTPLocation.initialize() );
31
32 ATH_CHECK( m_trtRDOKey.initialize() );
33
34 ATH_CHECK( detStore()->retrieve(m_mgr, "TRT") );
35 ATH_MSG_DEBUG( "Connected to TRT DetectorManager" );
36
37 ATH_CHECK( detStore()->retrieve(m_pTRTHelper, "TRT_ID") );
38 ATH_MSG_DEBUG( "Connected to TRT Helper" );
39
40 ATH_CHECK( m_ConditionsSummary.retrieve() );
41
43
44 ATH_MSG_INFO("Setting Fast-OR trigger multiplicity" << m_TTCMultiplicity );
45
46 // Find the full path to filename:
47 std::string file = PathResolver::find_file(m_maskedChipsFile, "DATAPATH");
48 ATH_MSG_INFO("Reading file " << file);
49 std::ifstream fin(file.c_str());
50 if(!fin){
51 ATH_MSG_ERROR("Can not read file: " << file);
52 return StatusCode::FAILURE;
53 }
54 nlohmann::json data = nlohmann::json::parse(fin);
55
58
59 // initialize numberOfStraws array for use in strawNumber function.
60 for(int j=0; j<75; j++) {
62 }
63
64 // numberofstraws in a phi module layer. m_numberOfStraws[<layer number>]
65 m_numberOfStraws[1]=15;
70 m_numberOfStraws[19]=18;
71 m_numberOfStraws[20]=19;
77 m_numberOfStraws[43]=23;
78 m_numberOfStraws[44]=23;
85 m_numberOfStraws[73]=28;
86
87 // loop over straw hash index to create straw number mapping for TRTViewer
88 unsigned int maxHash = m_pTRTHelper->straw_layer_hash_max();
89 for (unsigned int index = 0; index < maxHash; index++) {
90 IdentifierHash idHash = index;
91 Identifier id = m_pTRTHelper->layer_id(idHash);
92
93 int idBarrelEndcap = m_pTRTHelper->barrel_ec(id);
94 int idLayerWheel = m_pTRTHelper->layer_or_wheel(id);
95 int idPhiModule = m_pTRTHelper->phi_module(id);
96 int idStrawLayer = m_pTRTHelper->straw_layer(id);
97
98 const InDetDD::TRT_BaseElement * element= nullptr;
99
100 // BARREL
101 if (m_pTRTHelper->is_barrel(id)) {
102 int idSide = idBarrelEndcap?1:-1;
103 if(m_pTRTHelper->barrel_ec(id)==-1) {
104 element = m_mgr->getBarrelElement(idSide, idLayerWheel, idPhiModule, idStrawLayer);
105 if (element == nullptr) continue;
106
107 for(unsigned int istraw = 0; istraw < element->nStraws(); istraw++) {
108
109 Identifier strawID = m_pTRTHelper->straw_id(id, int(istraw));
110 int i_chip;
111
112 int tempStrawNumber = BarrelStrawNumber(istraw, idStrawLayer, idLayerWheel);
113
114 m_TRTStrawNeighbourSvc->getChip(strawID,i_chip);
115
116 //21 chips in mod layer 0
117 //33 chips in mod layer 1
118 //50 chips in mod layer 2
119 if (idLayerWheel == 1) i_chip+=21;
120 if (idLayerWheel == 2) i_chip+=54;
121
122 m_mat_chip_barrel[idPhiModule][tempStrawNumber]=i_chip;
123 m_mat_chip_barrel[idPhiModule+32][tempStrawNumber]=i_chip;
124 }
125 }
126 }
127 // ENDCAP
128 else if (m_pTRTHelper->barrel_ec(id)!=1) {
129 int idSide = idBarrelEndcap?2:-2;
130 if(((m_pTRTHelper->barrel_ec(id)==-2) || (m_pTRTHelper->barrel_ec(id)==2))) {
131
132 if (m_pTRTHelper->barrel_ec(id)==-2) idSide =0;
133 else idSide=1;
134
135 element = m_mgr->getEndcapElement(idSide, idLayerWheel, idStrawLayer, idPhiModule);
136 if (element == nullptr) continue;
137
138 for(unsigned int istraw = 0; istraw < element->nStraws(); istraw++) {
139
140 int tempStrawNumber = EndcapStrawNumber(istraw, idStrawLayer, idLayerWheel, idPhiModule, idSide);
141
142 Identifier strawID = m_pTRTHelper->straw_id(id, int(istraw));
143
144 int i_chip = 0;
145
146 m_TRTStrawNeighbourSvc->getChip(strawID,i_chip);
147 i_chip -= 103;
148
149 m_mat_chip_endcap[idPhiModule][tempStrawNumber]=i_chip;
150 m_mat_chip_endcap[idPhiModule+32][tempStrawNumber]=i_chip;
151 }
152 }
153 }
154 }
155
156 ATH_MSG_DEBUG("TrigT1TRT initilized");
157 return StatusCode::SUCCESS;
158 }
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
const ServiceHandle< StoreGateSvc > & detStore() const
unsigned int nStraws() const
Number of straws in the element.
Gaudi::Property< std::string > m_maskedChipsFile
Definition TrigT1TRT.h:61
ServiceHandle< ITRT_StrawNeighbourSvc > m_TRTStrawNeighbourSvc
Definition TrigT1TRT.h:53
const InDetDD::TRT_DetectorManager * m_mgr
Definition TrigT1TRT.h:56
static std::string find_file(const std::string &logical_file_name, const std::string &search_path)
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:130
str index
Definition DeMoScan.py:362
retrieve(aClass, aKey=None)
Definition PyKernel.py:110
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.

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

ToolHandle<ITRT_StrawStatusSummaryTool> LVL1::TrigT1TRT::m_ConditionsSummary {this, "ConditionsSummaryTool", "TRT_StrawStatusSummaryTool"}
private

Definition at line 50 of file TrigT1TRT.h.

50{this, "ConditionsSummaryTool", "TRT_StrawStatusSummaryTool"};

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

std::array<std::array<std::vector<int>, 32>, 2> LVL1::TrigT1TRT::m_maskedChipsBarrel
private

Definition at line 64 of file TrigT1TRT.h.

◆ m_maskedChipsEc

std::array<std::array<std::vector<int>, 32>, 2> LVL1::TrigT1TRT::m_maskedChipsEc
private

Definition at line 65 of file TrigT1TRT.h.

◆ m_maskedChipsFile

Gaudi::Property<std::string> LVL1::TrigT1TRT::m_maskedChipsFile {this, "maskedChipsFile", "TrigT1TRT/fastORmaskedChips.json", "path to file with list of masked chips"}
private

Definition at line 61 of file TrigT1TRT.h.

61{this, "maskedChipsFile", "TrigT1TRT/fastORmaskedChips.json", "path to file with list of masked chips"};

◆ m_mat_chip_barrel

unsigned char LVL1::TrigT1TRT::m_mat_chip_barrel[64][1642] {}
private

Definition at line 74 of file TrigT1TRT.h.

74{};

◆ m_mat_chip_endcap

unsigned char LVL1::TrigT1TRT::m_mat_chip_endcap[64][3840] {}
private

Definition at line 75 of file TrigT1TRT.h.

75{};

◆ m_mgr

const InDetDD::TRT_DetectorManager* LVL1::TrigT1TRT::m_mgr {}
private

Definition at line 56 of file TrigT1TRT.h.

56{};

◆ m_numberOfStraws

int LVL1::TrigT1TRT::m_numberOfStraws[75] {}
private

Definition at line 77 of file TrigT1TRT.h.

77{};

◆ m_pTRTHelper

const TRT_ID* LVL1::TrigT1TRT::m_pTRTHelper {}
private

Definition at line 57 of file TrigT1TRT.h.

57{};

◆ m_trtCTPLocation

SG::WriteHandleKey<TrtCTP> LVL1::TrigT1TRT::m_trtCTPLocation {this, "TrtCTPLocation", LVL1::DEFAULT_TrtCTPLocation, "Write handle key for TrtCTP"}
private

Definition at line 44 of file TrigT1TRT.h.

44{this, "TrtCTPLocation", LVL1::DEFAULT_TrtCTPLocation, "Write handle key for TrtCTP"};
static const std::string DEFAULT_TrtCTPLocation
default StoreGate location for TRT to CTP input

◆ m_trtRDOKey

SG::ReadHandleKey<TRT_RDO_Container> LVL1::TrigT1TRT::m_trtRDOKey {this, "TrtRDOLocation", "TRT_RDOs", "Read handle key for TRT_RDO_Container"}
private

Definition at line 47 of file TrigT1TRT.h.

47{this, "TrtRDOLocation", "TRT_RDOs", "Read handle key for TRT_RDO_Container"};

◆ m_TRTStrawNeighbourSvc

ServiceHandle<ITRT_StrawNeighbourSvc> LVL1::TrigT1TRT::m_TRTStrawNeighbourSvc {this, "StrawNeighbourSvc", "TRT_StrawNeighbourSvc"}
private

Definition at line 53 of file TrigT1TRT.h.

53{this, "StrawNeighbourSvc", "TRT_StrawNeighbourSvc"};

◆ m_TTCMultiplicity

Gaudi::Property<int> LVL1::TrigT1TRT::m_TTCMultiplicity {this, "TTCMultiplicity", 4, "TTC board multiplicity required to fire the trigger"}
private

Definition at line 60 of file TrigT1TRT.h.

60{this, "TTCMultiplicity", 4, "TTC board multiplicity required to fire the trigger"};

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