ATLAS Offline Software
Loading...
Searching...
No Matches
TrigInDetAccelerationSvc.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7
12
19#include "GaudiKernel/ConcurrencyFlags.h"
20
21#include <dlfcn.h>
22
26
27TrigInDetAccelerationSvc::TrigInDetAccelerationSvc( const std::string& name, ISvcLocator* pSvcLocator) :
28 base_class( name, pSvcLocator ),
29 m_nDCs(12),
30 m_moduleName("libTrigInDetCUDA.so"),
31 m_useITkGeometry(false),
32 m_libHandle(0),
33 m_pWF(0),
34 m_module(0),
35 m_detStore("DetectorStore", name),
36 m_evtStore("StoreGateSvc",name),
37 m_cudaCheckSvc("GPUSystemInfoSvc", "AthCUDA::GPUSystemInfoSvc"),
38 m_factoryConfigured(false) {
39
40 declareProperty( "NumberOfDCs", m_nDCs = 8 );
41 declareProperty( "ModuleName", m_moduleName = "libTrigInDetCUDA.so");
42 declareProperty( "useITkGeometry", m_useITkGeometry = false);
43 declareProperty( "MiddleSpacePointLayers", m_middleSpacePointLayers = std::vector<int>(), "Global IDs of layers that can contain middle spacepoints of track seeds" );
44}
45
46
50
52
53 ATH_MSG_INFO("TrigInDetAccelerationSvc: initialize");
54
55 ATH_CHECK (m_evtStore.retrieve() );
56 ATH_CHECK (m_detStore.retrieve() );
57 ATH_CHECK (m_cudaCheckSvc.retrieve() );
58
59 for(int i=0;i<3;i++) m_layerInfo[i].clear();
60
61 /*
62 * Ask to be informed at the beginning of a new run so that we
63 * can collect geometry, conditions, etc. and copy them to on-GPU data structures
64 * For athenaHLT this should be UpdateAfterFork
65 */
66
67 SmartIF<IIncidentSvc> incsvc{service("IncidentSvc")};
68 const int priority = 100;
69 if( incsvc ) {
70 const bool is_multiprocess = (Gaudi::Concurrency::ConcurrencyFlags::numProcs() > 0);
71 if (is_multiprocess) {
72 incsvc->addListener( this, AthenaInterprocess::UpdateAfterFork::type(), priority);
73 }
74 else {
75 incsvc->addListener( this, "BeginRun", priority);
76 }
77 }
78
79 return StatusCode::SUCCESS;
80}
81
82
84 // Check if CUDA device is available before creating a factory
85 if (m_cudaCheckSvc->getAvailableDevices().size() == 0) {
86 ATH_MSG_INFO("TrigInDetAccelerationSvc: no CUDA device available");
87 return StatusCode::FAILURE;
88 }
89
90
91 //load the OffloadFactory library
92 m_libHandle = dlopen(m_moduleName.c_str(), RTLD_LAZY);
93
94 if(!m_libHandle) {
95 ATH_MSG_INFO("TrigInDetAccelerationSvc: cannot load the factory library, error:"<<dlerror());
96 return StatusCode::SUCCESS;
97 }
98
99 dlerror();
100
101 //declare library interface methods
102 TrigAccel::Module* (*getModule)();
103
104 getModule = (TrigAccel::Module* (*)()) dlsym(m_libHandle, "getModule");
105
107
108 int factory_id_to_load = 0;
109
111 factory_id_to_load = TrigAccel::TrigITkModuleID_CUDA;
112 }else{
113 factory_id_to_load = TrigAccel::TrigInDetModuleID_CUDA;
114 }
115
116 m_pWF = m_module->getFactoryById(factory_id_to_load);
117
118 if(m_pWF == nullptr){
119 ATH_MSG_INFO("OffloadFactory with id "<<std::hex<<factory_id_to_load<<" not available from the module");
120 m_factoryConfigured = false;
121 return StatusCode::SUCCESS;
122 }
123
124
125 m_factoryConfigured = true;
126 ATH_MSG_INFO("TrigInDetAccelerationSvc: created OffloadFactory, factory id = "<<std::hex<<m_pWF->getFactoryId()<<std::dec);
127 return StatusCode::SUCCESS;
128}
129
134
135 delete m_pWF;
136 // in HLTMPPU the worker factory is only initialized in workers
137 if (m_libHandle) {
138 dlclose(m_libHandle);
139 }
140
141 return StatusCode::SUCCESS;
142}
143
144
148
149void TrigInDetAccelerationSvc::handle(const Incident&) {
150
151 ATH_MSG_INFO("OnBeginRun ");
152
153 if (initializeWorkFactory() != StatusCode::SUCCESS){
154 ATH_MSG_ERROR("Offloading Work Factory failed");
155 return;
156 }
157
158 if (m_useITkGeometry) {
159 // barrel ec, subdetector id, itk volume id, itk layer disk id
160 std::map<std::tuple<short,short, int, int>,std::vector<PhiEtaHash> > hashMap;
161 if(!extractITkGeometryInformation(hashMap)) {
162 ATH_MSG_INFO("ITk Geometry extraction failed");
163 return;
164 }
165
166 if(!exportITkGeometryInformation(hashMap)) {
167 ATH_MSG_INFO("ITk Geometry export failed");
168 }
169
170 } else {
171 // subdetector id, barrel ec, layer disk
172 std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> > hashMap;
173
174 if(!extractGeometryInformation(hashMap)) {
175 ATH_MSG_INFO("Geometry extraction failed");
176 return;
177 }
178
179 if(!exportGeometryInformation(hashMap)) {
180 ATH_MSG_INFO("Geometry export failed");
181 }
182
183 }
184
185 return;
186}
187
188TrigAccel::Work* TrigInDetAccelerationSvc::createWork(unsigned int jobCode, std::shared_ptr<TrigAccel::OffloadBuffer> pB) const {
189
190 if(!m_factoryConfigured) return 0;
191
192 // To remove this, WorkFactory::createWork() should be made const
193 // (and thread-safe).
194 std::scoped_lock lock (m_workMutex);
196 return wf->createWork(jobCode, pB);
197
198}
199
200
201const std::vector<short>& TrigInDetAccelerationSvc::getLayerInformation(int i) const {
202 if (i<0 || i>2) i = 0;
203 return m_layerInfo[i];
204}
205
206bool TrigInDetAccelerationSvc::exportITkGeometryInformation(const std::map<std::tuple<short,short, int, int>,std::vector<PhiEtaHash> >& hashMap) const {
207
208 const InDetDD::PixelDetectorManager * pix_mgr = nullptr;
209
210 if (m_detStore->retrieve(pix_mgr,"ITkPixel").isFailure()) {
211 ATH_MSG_WARNING("failed to get ITkPixel Manager");
212 return false;
213 }
214
215 //export layer structure
216
217 size_t dataTypeSize = sizeof(TrigAccel::ITk::DETECTOR_MODEL);
218 const size_t bufferOffset = 256;
219 size_t totalSize = bufferOffset + dataTypeSize;
220
222
223 if(!pBG->fit(totalSize)) pBG->reallocate(totalSize);
224
225 TrigAccel::ITk::DETECTOR_MODEL* pArray = reinterpret_cast<TrigAccel::ITk::DETECTOR_MODEL*>(pBG->m_buffer + bufferOffset);
226
227 // cppcheck-suppress memsetClassFloat; deliberate
228 memset(pArray,0,dataTypeSize);
229
230 int nLayers = (int)hashMap.size();
231 pArray->m_nLayers = nLayers;
232 pArray->m_nModules=0;
233
234 int layerIdx=0;
235 int middleLayerIdx=0;
236
237 for(std::map<std::tuple<short,short, int, int>,std::vector<PhiEtaHash> >::const_iterator it = hashMap.begin();it!=hashMap.end();++it, layerIdx++) {
238
239 short barrel_ec = std::get<0>((*it).first);
240 int vol_id = std::get<2>((*it).first);
241 int lay_id = std::get<3>((*it).first);
242 if(barrel_ec == -100) barrel_ec = 0;
243 int globalLayerId = vol_id*1000 + lay_id;
244
245 pArray->m_layers[layerIdx].m_nElements = 0;
246 pArray->m_layers[layerIdx].m_subdet = globalLayerId;
247 pArray->m_layers[layerIdx].m_type = barrel_ec;
248
249 // Fill in a table of layer ids that can contain the middle SPs
250 if (std::find(m_middleSpacePointLayers.begin(), m_middleSpacePointLayers.end(), globalLayerId) != m_middleSpacePointLayers.end()){
251 pArray->m_middleSpacePointLayers[middleLayerIdx] = layerIdx;
252 ++middleLayerIdx;
253 }
254
255 std::vector<std::vector<PhiEtaHash>::const_iterator> vStops;
256 vStops.push_back((*it).second.begin());
257 std::vector<PhiEtaHash>::const_iterator firstIt = (*it).second.begin();
258 std::vector<PhiEtaHash>::const_iterator nextIt = (*it).second.begin();
259 ++nextIt;
260
261 int nPhiSlices=0;
262
263 for(; nextIt!=(*it).second.end();++nextIt, ++firstIt) {
264 if((*nextIt).m_phiIndex!=(*firstIt).m_phiIndex) {
265 vStops.push_back(nextIt);
266 nPhiSlices++;
267 }
268 }
269
270 nPhiSlices++;
271
272 vStops.push_back((*it).second.end());
273
274 float rc=0.0;
275 float minBound = 100000.0;
276 float maxBound =-100000.0;
277
278 pArray->m_layers[layerIdx].m_nPhiSlices = nPhiSlices;
279
280 //3. iterating over phi sectors
281
282 for(unsigned int iStops = 1; iStops<vStops.size();iStops++) {
283 bool first = true;
284
285 for(std::vector<PhiEtaHash>::const_iterator hIt = vStops[iStops-1];hIt!=vStops[iStops];++hIt) {
286
287 pArray->m_hashArray[pArray->m_nModules] = (*hIt).m_hash;
288 const InDetDD::SiDetectorElement *p = pix_mgr->getDetectorElement((*hIt).m_hash);
289
290 if (first) {
291 first = false;
292 }
293
294 pArray->m_layers[layerIdx].m_nElements++;
295
296 const Amg::Vector3D& C = p->center();
297 if (barrel_ec == 0) {
298 rc += sqrt(C(0)*C(0)+C(1)*C(1));
299 if(p->zMin() < minBound) minBound = p->zMin();
300 if(p->zMax() > maxBound) maxBound = p->zMax();
301 pArray->m_minRZ[pArray->m_nModules] = p->zMin();
302 pArray->m_maxRZ[pArray->m_nModules] = p->zMax();
303 } else {
304 rc += C(2);
305 if(p->rMin() < minBound) minBound = p->rMin();
306 if(p->rMax() > maxBound) maxBound = p->rMax();
307 pArray->m_minRZ[pArray->m_nModules] = p->rMin();
308 pArray->m_maxRZ[pArray->m_nModules] = p->rMax();
309 }
310
311 pArray->m_nModules++;
312 }
313
314 }
315 pArray->m_layers[layerIdx].m_refCoord = rc/pArray->m_layers[layerIdx].m_nElements;
316 pArray->m_layers[layerIdx].m_minBound = minBound;
317 pArray->m_layers[layerIdx].m_maxBound = maxBound;
318 }
319
320 std::shared_ptr<TrigAccel::OffloadBuffer> pDMBuff = std::make_shared<TrigAccel::OffloadBuffer>(pBG);
321
322 delete pBG;
323
325
327
328 return pW == 0;//request is actioned immediately, no actual WorkItem is created
329
330}
331
332
333bool TrigInDetAccelerationSvc::extractITkGeometryInformation(std::map<std::tuple<short,short,int,int>, std::vector<PhiEtaHash> >& hashMap) {
334
335 const PixelID* pixelId = nullptr;
336
337 if (m_detStore->retrieve(pixelId, "PixelID").isFailure()) {
338 ATH_MSG_WARNING("Could not get Pixel ID helper");
339 return false;
340 }
341
342 // Read Pixel layer details
343 short subdetid = 1;
344 for(int hash = 0; hash<(int)pixelId->wafer_hash_max(); hash++) {
345
346 Identifier offlineId = pixelId->wafer_id(hash);
347
348 if(offlineId==0) continue;
349
350 short barrel_ec = pixelId->barrel_ec(offlineId);
351 if(abs(barrel_ec)>2) continue;//no DBM needed
352
353 short phi_index = pixelId->phi_module(offlineId);
354 short eta_index = pixelId->eta_module(offlineId);
355 short layer_disk = pixelId->layer_disk(offlineId);
356
357 // Calculate new volume and layer id for ITk
358 int vol_id = -1;
359 if (barrel_ec== 0) vol_id = 8;
360 if (barrel_ec==-2) vol_id = 7;
361 if (barrel_ec== 2) vol_id = 9;
362
363 int new_vol=0, new_lay=0;
364
365 if (vol_id == 7 || vol_id == 9) {
366 new_vol = 10*vol_id + layer_disk;
367 new_lay = eta_index;
368 } else if (vol_id == 8) {
369 new_lay = 0;
370 new_vol = 10*vol_id + layer_disk;
371 }
372
373 auto t = std::make_tuple(barrel_ec==0 ? -100 : barrel_ec, subdetid, new_vol, new_lay);
374 std::map<std::tuple<short,short,int,int>,std::vector<PhiEtaHash> >::iterator it = hashMap.find(t);
375 if(it==hashMap.end())
376 hashMap.insert(std::pair<std::tuple<short,short,int,int>,std::vector<PhiEtaHash> >(t,std::vector<PhiEtaHash>(1, PhiEtaHash(phi_index, eta_index, hash) )));
377 else (*it).second.push_back(PhiEtaHash(phi_index, eta_index, hash));
378 }
379
380 m_layerInfo[0].clear();
381 m_layerInfo[1].clear();
382
383 m_layerInfo[0].resize(hashMap.size()); // Mapping from layerId to barrel_ec
384 m_layerInfo[1].resize(pixelId->wafer_hash_max(), -1); // Mapping from layerId to the module hash
385
386 // Map layer geometry details to module hash id
387 int layerId=0;
388 for(std::map<std::tuple<short,short,int,int>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it, layerId++) {
389
390 short barrel_ec = std::get<0>((*it).first);
391 short subdetId = std::get<1>((*it).first);
392 if(barrel_ec == -100) barrel_ec = 0;
393
394 m_layerInfo[0][layerId] = barrel_ec;
395
396 if(subdetId == 1) {//pixel
397 for(std::vector<PhiEtaHash>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
398 m_layerInfo[subdetId][(*hIt).m_hash] = layerId;
399 }
400 }
401 }
402
403 for(std::map<std::tuple<short,short,int,int>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it) {
404
405 //sorting along phi first, then along eta
406 std::sort((*it).second.begin(), (*it).second.end(), PhiEtaHash::compare());
407
408 }
409
410 return true;
411}
412
413
414bool TrigInDetAccelerationSvc::exportGeometryInformation(const std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >& hashMap) const {
415
416 const InDetDD::SCT_DetectorManager * sct_mgr = nullptr;
417 const InDetDD::PixelDetectorManager * pix_mgr = nullptr;
418
419 if (m_detStore->retrieve(sct_mgr, "SCT").isFailure()) {
420 ATH_MSG_WARNING("failed to get SCT Manager");
421 return false;
422
423 }
424 if (m_detStore->retrieve(pix_mgr,"Pixel").isFailure()) {
425 ATH_MSG_WARNING("failed to get SCT Manager");
426 return false;
427 }
428
429 //export layer structure
430
431 size_t dataTypeSize = sizeof(TrigAccel::DETECTOR_MODEL);
432 const size_t bufferOffset = 256;
433 size_t totalSize = bufferOffset + dataTypeSize;
434
436
437 if(!pBG->fit(totalSize)) pBG->reallocate(totalSize);
438
439 TrigAccel::DETECTOR_MODEL* pArray = reinterpret_cast<TrigAccel::DETECTOR_MODEL*>(pBG->m_buffer + bufferOffset);
440
441 // cppcheck-suppress memsetClassFloat; deliberate
442 memset(pArray,0,dataTypeSize);
443
444 int nLayers = (int)hashMap.size();
445 pArray->m_nLayers = nLayers;
446 pArray->m_nModules=0;
447
448 int layerIdx=0;
449
450 for(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::const_iterator it = hashMap.begin();it!=hashMap.end();++it, layerIdx++) {
451 short subdetid = std::get<0>((*it).first);
452 short barrel_ec = std::get<1>((*it).first);
453
454 pArray->m_layers[layerIdx].m_nElements = 0;
455 pArray->m_layers[layerIdx].m_subdet = subdetid;
456 pArray->m_layers[layerIdx].m_type = barrel_ec;
457
458 std::vector<std::vector<PhiEtaHash>::const_iterator> vStops;
459 vStops.push_back((*it).second.begin());
460 std::vector<PhiEtaHash>::const_iterator firstIt = (*it).second.begin();
461 std::vector<PhiEtaHash>::const_iterator nextIt = (*it).second.begin();
462 ++nextIt;
463
464 int nPhiSlices=0;
465
466 for(; nextIt!=(*it).second.end();++nextIt, ++firstIt) {
467 if((*nextIt).m_phiIndex!=(*firstIt).m_phiIndex) {
468 vStops.push_back(nextIt);
469 nPhiSlices++;
470 }
471 }
472
473 nPhiSlices++;
474
475 vStops.push_back((*it).second.end());
476
477 float rc=0.0;
478 float minBound = 100000.0;
479 float maxBound =-100000.0;
480
481 pArray->m_layers[layerIdx].m_nPhiSlices = nPhiSlices;
482
483 //3. iterating over phi sectors
484
485 for(unsigned int iStops = 1; iStops<vStops.size();iStops++) {
486
487 bool first = true;
488
489 for(std::vector<PhiEtaHash>::const_iterator hIt = vStops[iStops-1];hIt!=vStops[iStops];++hIt) {
490
491 pArray->m_hashArray[pArray->m_nModules] = (*hIt).m_hash;
492
493 const InDetDD::SiDetectorElement *p = (subdetid==1) ? pix_mgr->getDetectorElement((*hIt).m_hash) : sct_mgr->getDetectorElement((*hIt).m_hash);
494
495 if(first) {
496 first = false;
497 }
498
499 pArray->m_layers[layerIdx].m_nElements++;
500
501 const Amg::Vector3D& C = p->center();
502 if(barrel_ec == 0) {
503 rc += sqrt(C(0)*C(0)+C(1)*C(1));
504 if(p->zMin() < minBound) minBound = p->zMin();
505 if(p->zMax() > maxBound) maxBound = p->zMax();
506 pArray->m_minRZ[pArray->m_nModules] = p->zMin();
507 pArray->m_maxRZ[pArray->m_nModules] = p->zMax();
508 }
509 else {
510 rc += C(2);
511 if(p->rMin() < minBound) minBound = p->rMin();
512 if(p->rMax() > maxBound) maxBound = p->rMax();
513 pArray->m_minRZ[pArray->m_nModules] = p->rMin();
514 pArray->m_maxRZ[pArray->m_nModules] = p->rMax();
515 }
516
517 pArray->m_nModules++;
518 }
519
520 }
521 pArray->m_layers[layerIdx].m_refCoord = rc/pArray->m_layers[layerIdx].m_nElements;
522 pArray->m_layers[layerIdx].m_minBound = minBound;
523 pArray->m_layers[layerIdx].m_maxBound = maxBound;
524 }
525
526 std::shared_ptr<TrigAccel::OffloadBuffer> pDMBuff = std::make_shared<TrigAccel::OffloadBuffer>(pBG);
527
528 delete pBG;
529
531
533
534 return pW == 0;//request is actioned immediately, no actual WorkItem is created
535
536}
537
538
539bool TrigInDetAccelerationSvc::extractGeometryInformation(std::map<std::tuple<short,short,short>, std::vector<PhiEtaHash> >& hashMap) {
540
541 const PixelID* pixelId = nullptr;
542 const SCT_ID* sctId = nullptr;
543
544 if (m_detStore->retrieve(pixelId, "PixelID").isFailure()) {
545 ATH_MSG_WARNING("Could not get Pixel ID helper");
546 return false;
547 }
548
549 if (m_detStore->retrieve(sctId, "SCT_ID").isFailure()) {
550 ATH_MSG_WARNING("Could not get Pixel ID helper");
551 return false;
552 }
553
554 short subdetid = 1;
555
556 for(int hash = 0; hash<(int)pixelId->wafer_hash_max(); hash++) {
557
558 Identifier offlineId = pixelId->wafer_id(hash);
559
560 if(offlineId==0) continue;
561
562 short barrel_ec = pixelId->barrel_ec(offlineId);
563 if(abs(barrel_ec)>2) continue;//no DBM needed
564 short layer_disk = pixelId->layer_disk(offlineId);
565 short phi_index = pixelId->phi_module(offlineId);
566 short eta_index = pixelId->eta_module(offlineId);
567 auto t = std::make_tuple(subdetid, barrel_ec, layer_disk);
568 std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.find(t);
569 if(it==hashMap.end())
570 hashMap.insert(std::pair<std::tuple<short,short,short>,std::vector<PhiEtaHash> >(t,std::vector<PhiEtaHash>(1, PhiEtaHash(phi_index, eta_index, hash) )));
571 else (*it).second.push_back(PhiEtaHash(phi_index, eta_index, hash));
572 }
573 subdetid = 2;
574 for(int hash = 0; hash<(int)sctId->wafer_hash_max(); hash++) {
575
576 Identifier offlineId = sctId->wafer_id(hash);
577
578 if(offlineId==0) continue;
579
580 short barrel_ec = sctId->barrel_ec(offlineId);
581 short layer_disk = sctId->layer_disk(offlineId);
582 short phi_index = sctId->phi_module(offlineId);
583 short eta_index = sctId->eta_module(offlineId);
584
585 auto t = std::make_tuple(subdetid, barrel_ec, layer_disk);
586 std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.find(t);
587 if(it==hashMap.end())
588 hashMap.insert(std::pair<std::tuple<short,short,short>,std::vector<PhiEtaHash> >(t,std::vector<PhiEtaHash>(1, PhiEtaHash(phi_index, eta_index, hash))));
589 else (*it).second.push_back(PhiEtaHash(phi_index, eta_index, hash));
590 }
591
592 m_layerInfo[1].resize(pixelId->wafer_hash_max(), -1);
593 m_layerInfo[2].resize(sctId->wafer_hash_max(), -1);
594
595 int layerId=0;
596
597 for(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it, layerId++) {
598
599 short subdetId = std::get<0>((*it).first);
600 short barrel_ec = std::get<1>((*it).first);
601
602 m_layerInfo[0].push_back(barrel_ec);
603
604 if(subdetId == 1) {//pixel
605 for(std::vector<PhiEtaHash>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
606 m_layerInfo[subdetId][(*hIt).m_hash] = layerId;
607 }
608 }
609 if(subdetId == 2) {//SCT
610 for(std::vector<PhiEtaHash>::iterator hIt = (*it).second.begin();hIt != (*it).second.end();++hIt) {
611 m_layerInfo[subdetId][(*hIt).m_hash] = layerId;
612 }
613 }
614 }
615
616
617 for(std::map<std::tuple<short,short,short>,std::vector<PhiEtaHash> >::iterator it = hashMap.begin();it!=hashMap.end();++it) {
618
619 //sorting along phi first, then along eta
620
621 std::sort((*it).second.begin(), (*it).second.end(), PhiEtaHash::compare());
622
623 }
624 return true;
625}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
virtual void lock()=0
Interface to allow an object to lock itself when made const in SG.
static Double_t rc
static unsigned int totalSize(const MultiDimArray< T, N > &ht)
This is an Identifier helper class for the Pixel subdetector.
bool getModule(std::istream &s, RegSelModule &m)
This is an Identifier helper class for the SCT subdetector.
void clear()
Empty the pool.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
static const std::string & type()
Incident type.
Definition Incidents.h:49
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated pixel ...
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier
Dedicated detector manager extending the functionality of the SiDetectorManager with dedicated SCT in...
virtual const SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Class to hold geometrical description of a silicon detector element.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
int layer_disk(const Identifier &id) const
Definition PixelID.h:602
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
Definition PixelID.h:355
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0).
Definition PixelID.h:595
size_type wafer_hash_max() const
Definition PixelID.cxx:703
int eta_module(const Identifier &id) const
Definition PixelID.h:627
int phi_module(const Identifier &id) const
Definition PixelID.h:620
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
size_type wafer_hash_max() const
Definition SCT_ID.cxx:621
int layer_disk(const Identifier &id) const
Definition SCT_ID.h:687
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition SCT_ID.h:459
int phi_module(const Identifier &id) const
Definition SCT_ID.h:693
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0).
Definition SCT_ID.h:681
int eta_module(const Identifier &id) const
Definition SCT_ID.h:699
virtual void handle(const Incident &) override
OnBeginRun data gathering and export.
ServiceHandle< StoreGateSvc > m_evtStore
virtual const std::vector< short > & getLayerInformation(int) const override
ServiceHandle< StoreGateSvc > m_detStore
virtual StatusCode initialize() override
Initialize.
bool exportITkGeometryInformation(const std::map< std::tuple< short, short, int, int >, std::vector< PhiEtaHash > > &hashMap) const
bool exportGeometryInformation(const std::map< std::tuple< short, short, short >, std::vector< PhiEtaHash > > &) const
std::vector< short > m_layerInfo[3]
virtual StatusCode finalize() override
Finalize.
virtual TrigAccel::Work * createWork(unsigned int, std::shared_ptr< TrigAccel::OffloadBuffer >) const override
bool extractITkGeometryInformation(std::map< std::tuple< short, short, int, int >, std::vector< PhiEtaHash > > &)
TrigInDetAccelerationSvc(const std::string &, ISvcLocator *)
Constructor.
std::vector< int > m_middleSpacePointLayers
TrigAccel::WorkFactory * m_pWF
bool extractGeometryInformation(std::map< std::tuple< short, short, short >, std::vector< PhiEtaHash > > &)
ServiceHandle< AthCUDA::IGPUSystemInfoSvc > m_cudaCheckSvc
struct color C
Eigen::Matrix< double, 3, 1 > Vector3D
struct TrigAccel::ITk::DetectorModel DETECTOR_MODEL
struct TrigAccel::DataExportBuffer DATA_EXPORT_BUFFER
constexpr unsigned int TrigITkModuleID_CUDA
constexpr unsigned int TrigInDetModuleID_CUDA
struct TrigAccel::DetectorModel DETECTOR_MODEL
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
SILICON_LAYER m_layers[MAX_SILICON_LAYERS]
float m_minRZ[MAX_NUMBER_PIX_MODULES+MAX_NUMBER_SCT_MODULES]
float m_maxRZ[MAX_NUMBER_PIX_MODULES+MAX_NUMBER_SCT_MODULES]
int m_hashArray[MAX_NUMBER_PIX_MODULES+MAX_NUMBER_SCT_MODULES]
int m_hashArray[MAX_NUMBER_PIX_MODULES+MAX_NUMBER_SCT_MODULES]
int m_middleSpacePointLayers[MAX_SILICON_LAYERS]
float m_minRZ[MAX_NUMBER_PIX_MODULES+MAX_NUMBER_SCT_MODULES]
SILICON_LAYER m_layers[MAX_SILICON_LAYERS]
float m_maxRZ[MAX_NUMBER_PIX_MODULES+MAX_NUMBER_SCT_MODULES]