ATLAS Offline Software
Loading...
Searching...
No Matches
PixelGeometryManagerTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
9
12
14
18
19
21
27
28
29using namespace InDetDD;
30
31namespace InDet {
32
33 //________________________________________________________________________
35 const std::string& name,
36 const IInterface * parent)
37 : AthAlgTool(type,name,parent)
38 , m_rdbAccessSvc("RDBAccessSvc",name)
39 , m_geoModelSvc("GeoModelSvc",name)
40 {
41 declareInterface<IGeometryManagerTool>(this);
42 }
43
44 //________________________________________________________________________
46 {
47 ATH_MSG_DEBUG("deleting alignModuleList");
48 for (const auto & p:m_alignModuleList) delete p;
49 m_alignModuleList.clear();
50
51 ATH_MSG_DEBUG("deleting fullAlignParList");
52 delete m_fullAlignParList;
53 ATH_MSG_DEBUG("deleting alignParList");
54 delete m_alignParList;
55 }
56
57 //________________________________________________________________________
59 {
60 ATH_MSG_DEBUG("initialize() of PixelGeometryManagerTool");
61
62 // alignment levels are members of the IGeometryManagerTool base class
66
67 // retrieve AlignModuleTool
68 ATH_CHECK( m_alignModuleTool.retrieve() );
69
70 // retrieve Pixel helper
71 ATH_CHECK( detStore()->retrieve(m_idHelper) );
72
73 // retrieve PIX detector manager
75
76 // retrieve geomodel service
77 ATH_CHECK( m_geoModelSvc.retrieve());
78
79
80 // retrieve geometry DB access service
81 ATH_CHECK( m_rdbAccessSvc.retrieve());
82
83 // dump module selection
84 if(m_doModuleSelection && msgLvl(MSG::INFO)) {
85 int idx{};
86 ATH_MSG_INFO("Creating geometry for selected "<<m_moduleSelection.value().size()<<" modules:");
87 for(const auto mod:m_moduleSelection.value())
88 ATH_MSG_INFO(" "<<idx++<<". "<<mod);
89 }
90
91 // check the allowed geometry levels
92 if(!checkAlignLevel())
93 return StatusCode::FAILURE;
94
95 return StatusCode::SUCCESS;
96 }
97
98 //________________________________________________________________________
100 {
101 ATH_MSG_DEBUG("finalize() of PixelGeometryManagerTool");
102
103 return StatusCode::SUCCESS;
104 }
105
106 //________________________________________________________________________
112
113 //________________________________________________________________________
115 {
116 if(!m_alignDBM && m_alignLevel == 1) {
117 ATH_MSG_INFO("Alignment level for Pixel is "<<m_alignLevel);
118 return true;
119 }
120
121 // new IBL alignment level
122 if(!m_alignDBM && m_alignLevel == 11) {
123 ATH_MSG_INFO("Alignment level for Pixel is "<<m_alignLevel);
124 return true;
125 }
126
127 // check for DBM
128 if(m_alignDBM && (m_alignLevel == 1 || m_alignLevel == 2 || m_alignLevel == 3)) {
129 ATH_MSG_INFO("Alignment level for DBM is configured and set to "<<m_alignLevel);
130 return true;
131 }
132
133 if(m_alignLevelBarrel == -1)
135
136 if(m_alignLevelEndcaps == -1)
138
140
141 // if the alignment level for barrel and EC is set correctly
142 // reset the global alignment level
143 if(ok)
144 m_alignLevel = -1;
145
146 return ok;
147 }
148
149 //________________________________________________________________________
151 {
152 // check whether geometry level is allowed
153 switch(m_alignLevelBarrel) {
154 case 12: case 16: case 2: case 26: case 27: case 3:
155 ATH_MSG_INFO("Alignment level for Pixel Barrel is "<<m_alignLevelBarrel);
156 return true;
157 case 15:
158 if(m_detManager->numerology().numLayers() > 3){
159 ATH_MSG_FATAL("This level is not supported with the configured geometry");
160 ATH_MSG_FATAL("The pixel barrel has "<<m_detManager->numerology().numLayers()<<" layers; Only 3 layer geometries supported");
161 return false;
162 }
163 else {
164 ATH_MSG_INFO("Alignment level for Pixel Barrel is "<<m_alignLevelBarrel);
165 return true;
166 }
167 case 22:
168 if(m_detManager->numerology().numLayers() > 3){
169 ATH_MSG_FATAL("This level is not supported with the configured geometry");
170 ATH_MSG_FATAL("The pixel barrel has "<<m_detManager->numerology().numLayers()<<" layers; Only 3 layer geometries supported");
171 return false;
172 }
173 else {
174 ATH_MSG_INFO("Alignment level for Pixel Barrel is "<<m_alignLevelBarrel);
175 return true;
176 }
177 default:
178 ATH_MSG_FATAL("Alignment level "<<m_alignLevelBarrel<<" does not exist for Pixel Barrel");
179 return false;
180 }
181 }
182
183 //________________________________________________________________________
185 {
186 // check whether geometry level is allowed
187 switch(m_alignLevelEndcaps) {
188 case 12: case 16: case 2: case 3:
189 ATH_MSG_INFO("Alignment level for Pixel Endcaps is "<<m_alignLevelEndcaps);
190 return true;
191 default:
192 ATH_MSG_FATAL("Alignment level "<<m_alignLevelEndcaps<<" does not exist for Pixel Endcaps");
193 return false;
194 }
195 }
196
197 //________________________________________________________________________
199 {
200 ATH_MSG_DEBUG("in ReadGeometry() solveLevel="<<solveLevel);
201
202 // set pointers
205
206 // build alignment geometry
208
209 // now set the alignment parameters
210 // first prepare the parameter lists
213 // loop over modules
214 ATH_MSG_DEBUG("Adding module parameters to modules");
215 //std::vector<Trk::AlignModule *>::const_iterator imod = m_alignModuleList.begin();
216 //std::vector<Trk::AlignModule *>::const_iterator imod_end = m_alignModuleList.end();
217 for( const auto & imod:m_alignModuleList)
219
220 // set alignModuleList and hash table in the alignModuleTool
222 ATH_MSG_DEBUG(" geometry set in m_alignModuleTool");
223
224 // set alignPar lists in the alignModuleTool
225 ATH_MSG_DEBUG(" alignParList = "<<m_alignParList);
226 ATH_MSG_DEBUG(" fullAlignParList = "<<m_fullAlignParList);
228 ATH_MSG_DEBUG(" AlignParLists set in m_alignModuleTool");
229
230 // dump summary about the geometry setup
231 if (m_dumpGeometry)
232 dumpGeometry();
233
234 int nDoF= m_alignModuleTool->nAlignParameters();
235 ATH_MSG_INFO("Total number of degrees of freedom: "<<nDoF);
236
237 return nDoF;
238 }
239
240 //_______________________________________________________________________
242 {
243 ATH_MSG_INFO("Preparing the Pixel geometry");
244
245 // Get skipetazero value for IBL layer if module with eta=0 value is set (e.g. ATLAS-IBL-03-00-00)
246 // if noSkipEtaZero is set, loop over iEta stops earlier ( because eta=0 module is defined)
247 m_etaCorrection = 0;
248 int iLayer = 0;
249 if (!m_detManager->numerology().useLayer(iLayer))
250 ATH_MSG_INFO(" When checking for IBL-Layer, layer "<<iLayer<<" not present");
251
253 int noSkipEtaZero=getNoSkipEtaValueFromGeometry();
254 if(noSkipEtaZero>0 && m_detManager->numerology().skipEtaZeroForLayer(iLayer)){
255 m_etaCorrection = 1;
256 }
257 ATH_MSG_DEBUG("IBL-etaCorrection value set to: "<<m_etaCorrection);
258 }
259
260 if(!m_alignDBM && m_alignLevel == 1 && (m_alignLevelBarrel == -1 || m_alignLevelEndcaps == -1))
261 buildL1();
262 else if (!m_alignDBM && m_alignLevel == 11 && (m_alignLevelBarrel == -1 || m_alignLevelEndcaps == -1))
263 buildL11();
264
265 else if (m_alignDBM){
266
267 switch(m_alignLevel) {
268 case 1:
269 buildL1DBM();
270 break;
271 case 2:
272 buildL2DBM();
273 break;
274 case 3:
275 buildL3DBM();
276 break;
277 }
278 }
279
280 else {
281
282 if(m_alignBarrel)
283 switch(m_alignLevelBarrel) {
284 case 12:
286 break;
287 case 15:
289 break;
290 case 16:
292 break;
293 case 2:
295 break;
296 case 22:
298 break;
299 case 26:
301 break;
302 case 27:
304 break;
305 case 3:
307 break;
308 default:
309 break;
310 }
311
313 switch(m_alignLevelEndcaps) {
314 case 12: case 16:
316 break;
317 case 2:
319 else buildL2Endcaps();
320 break;
321 case 3:
323 break;
324 default:
325 break;
326 }
327
328 }
329 }
330
331 //_______________________________________________________________________
333 {
334 ATH_MSG_INFO("Preparing the Pixel geometry for L1 : whole Pixel");
335 // ========================================
336 // get all modules for Level 1 alignment
337 // Level 1 is just one module for Pixel
338 // - the whole Pixel
339
340 // get maximum number of elements from the helper
341 unsigned int pixelmaxHash = m_idHelper->wafer_hash_max();
342 ATH_MSG_DEBUG("maxHash for the Pixel "<<pixelmaxHash);
343
345 m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::Pixel) = new Trk::AlignModuleList((size_t)(pixelmaxHash),nullptr);
347
348 // use the 'real' identifier of the Pixel
350 pixel->setIdHash(getNextIDHash());
351 pixel->setName("Pixel");
352 pixel->setIdentifier(m_idHelper->wafer_id(0,0,0,0));
353
354 // check if we're aligning Pixel
356 ATH_MSG_DEBUG("Module "<<pixel->name()<<" NOT selected");
357 delete pixel;
358 return;
359 }
360
361 ATH_MSG_DEBUG("Created module "<<pixel->name()<<" idHash: "<<pixel->identifyHash()<<" identifier: "<<pixel->identify());
362
363 // for L1 alignment the alignment frame is equal to the global frame
364 // and since the PIXEL detector element positions are also stored in
365 // the global frame in DB, transform is identity
366 const Amg::Transform3D transform = Amg::Transform3D::Identity();
367
368 // ==================================================================
369 // loop over Pixel elements and add them to respective alignModules
370 // ==================================================================
371 for (unsigned int index = 0; index < pixelmaxHash; index++)
372 {
373 IdentifierHash idHash = index;
374 Identifier id = m_idHelper->wafer_id(idHash);
375
376 ATH_MSG_DEBUG(" Pixel DetectorElement idhash: " << index);
377 // ATH_MSG_DEBUG(" DetectorElement id: " << id);
378
379 // just to be sure check for DBM module
380 if(m_idHelper->is_dbm(id)){
381 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
382 continue;
383 }
384
385 // get the element via hash
386 const SiDetectorElement * element2 = m_detManager->getDetectorElement(id);
387 if (element2) {
388 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
389
390 // add element to the AlignModule
391 pixel->addDetElement(Trk::AlignModule::Pixel,element,transform);
392 // and fill the corresponding map
393 (*pixelIdHashMap)[idHash] = pixel;
394 }
395 else
396 ATH_MSG_DEBUG("No Pixel detector with id:" << id);
397 }
398 ATH_MSG_DEBUG("-------------------------------------------------------");
399
400 // add created module to the geometry
401 m_alignModuleListPtr->push_back(pixel);
402
403 ATH_MSG_DEBUG("Pixel L1 module successfully added to the list");
404 }
405
406
407 //_______________________________________________________________________
409 {
410 // ========================================
411 // alignment for IBL with respect to "old" pixel detector
412 // 1 module for all IBL-pixels + 1 module for all other pixels
413 ATH_MSG_INFO("Preparing the Pixel geometry for L11 : IBL + rest of pixel detector");
414
415 if(m_detManager->numerology().numLayers() < 4) {
416 ATH_MSG_WARNING("No IBL in geometry; Maybe this is not the level you want to use");
417 }
418
419 Amg::Transform3D transform = Amg::Transform3D::Identity();
420
421 // get maximum number of elements from the helper
422 unsigned int maxHash = m_idHelper->wafer_hash_max();
423 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
424
428
429 // create two AlignModules: IBL and rest of pixel
430 Trk::AlignModule * ibl = new Trk::AlignModule(this);
431 ibl->setIdHash(getNextIDHash());
432 ibl->setName("Pixel/IBL");
433
434 Trk::AlignModule * pixel_old = new Trk::AlignModule(this);
435 pixel_old->setIdHash(getNextIDHash());
436 pixel_old->setName("Pixel/oldPixel");
437
438 // we use identifier of 0th module in the 0th and 1st layer of barrel
439 ibl->setIdentifier(m_idHelper->wafer_id(0, 0, 0, 0));
440 pixel_old->setIdentifier(m_idHelper->wafer_id(0, 1, 0, 0));
441
442 ATH_MSG_DEBUG("Building module "<<ibl->name());
443 ATH_MSG_DEBUG("Building module "<<pixel_old->name());
444
445
446 // ==================================================================
447 // loop over Pixel elements and add them to respective alignModules
448 // ==================================================================
449 for (unsigned int index = 0; index < maxHash; index++)
450 {
451 IdentifierHash idHash = index;
452 Identifier id = m_idHelper->wafer_id(idHash);
453
454 // just to be sure check for DBM module
455 if(m_idHelper->is_dbm(id)){
456 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
457 continue;
458 }
459
460 // check what we're filling
461 Trk::AlignModule * mod = nullptr;
462 if( m_idHelper->is_barrel(id) && m_idHelper->is_blayer(id) && m_idHelper->layer_disk(id)==0) {
463 ATH_MSG_DEBUG("pixel element "<<id<<" at index "<<index<<" is in IBL-layer");
464 mod = ibl;
465 }
466 else {
467 ATH_MSG_DEBUG("pixel element "<<id<<" at index "<<index<<" is not in IBL-layer");
468 mod = pixel_old;
469 }
470
471 // get the element via hash
472 const SiDetectorElement * element2 = m_detManager->getDetectorElement(id);
473 if (element2) {
474 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
475
476 // add element to the AlignModule
477 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
478 // and fill the corresponding map
479 (*pixelIdHashMap)[element->identifyHash()] = mod;
480 }
481 else
482 ATH_MSG_DEBUG("No Pixel detector with id:" << id);
483 }
484 ATH_MSG_DEBUG("-------------------------------------------------------");
485
486 // alignment fram for the barrel is the global frame
487 // so we don't have to set any additional transform
488 if(!moduleSelected(ibl)) {
489 ATH_MSG_DEBUG("Module "<<ibl->name()<<" NOT selected");
490 delete ibl;
491 }
492 else
493 m_alignModuleListPtr->push_back(ibl);
494
495 if(!moduleSelected(pixel_old)) {
496 ATH_MSG_DEBUG("Module "<<pixel_old->name()<<" NOT selected");
497 delete pixel_old;
498 }
499 else
500 m_alignModuleListPtr->push_back(pixel_old);
501
502 }
503
504
505 //_______________________________________________________________________
507 {
508 // ========================================
509 // BARREL
510 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L12 : whole barrel");
511
512 if(!m_alignBarrel) {
513 ATH_MSG_DEBUG("Not aligning barrel");
514 return;
515 }
516
517 // ========================================
518 // get all modules for Level 12 alignment of the barrel
519
520 Amg::Transform3D transform = Amg::Transform3D::Identity();
521
522 unsigned int maxHash = m_idHelper->wafer_hash_max();
523 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
524
528
529 // create two AlignModules: top half and bottom half
530 Trk::AlignModule * mod = new Trk::AlignModule(this);
531 mod->setIdHash(getNextIDHash());
532 mod->setName("Pixel/Barrel");
533
534 // we use identifier of 0th module in the barrel
535 mod->setIdentifier(m_idHelper->wafer_id(0, 0, 0, 0));
536
537 if(!moduleSelected(mod)) {
538 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
539 delete mod;
540 return;
541 }
542
543 ATH_MSG_DEBUG("Building module "<<mod->name());
544
545 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
546 if (!m_detManager->numerology().useLayer(iLayer))
547 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
548
549 // make sure that we do not correct if we are not looking at IBL
550 if(iLayer!=0) m_etaCorrection = 0;
551
552 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
553 ATH_MSG_DEBUG("iPhi "<<iPhi);
554
555 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
556 ATH_MSG_DEBUG("iEta "<<iEta);
557 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
558 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
559
560 if (element) {
561
562 // just to be sure check for DBM module
563 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
564 if(m_idHelper->is_dbm(id)){
565 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
566 continue;
567 }
568 // add element to the AlignModule
569 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
570 // and fill the corresponding map
571 (*pixelIdHashMap)[element->identifyHash()] = mod;
572 }
573 }
574 }
575 }
576
577 // alignment fram for the barrel is the global frame
578 // so we don't have to set any additional transform
579 m_alignModuleListPtr->push_back(mod);
580 }
581
582 //_______________________________________________________________________
584 {
585 // ========================================
586 // BARREL
587 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L15 : 2 barrel halfs");
588
589 if(!m_alignBarrel) {
590 ATH_MSG_DEBUG("Not aligning barrel");
591 return;
592 }
593
594 // ========================================
595 // get all modules for Level 15 alignment of the barrel
596 // 2 Pixel half-shells
597 Amg::Transform3D transform = Amg::Transform3D::Identity();
598
599 unsigned int maxHash = m_idHelper->wafer_hash_max();
600 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
601
605
606 // create two AlignModules: top half and bottom half
607 Trk::AlignModule * top = new Trk::AlignModule(this);
608 top->setIdHash(getNextIDHash());
609 top->setName("Pixel/Barrel/Top-half");
610
611 Trk::AlignModule * bottom = new Trk::AlignModule(this);
612 bottom->setIdHash(getNextIDHash());
613 bottom->setName("Pixel/Barrel/Bottom-half");
614
615 // we use identifier of 0th eta module in the layer 0 in the 10th phi
616 // stave for the top module and 20th stave in the bottom module
617 top->setIdentifier(m_idHelper->wafer_id(0, 0, 10, 0));
618 bottom->setIdentifier(m_idHelper->wafer_id(0, 0, 20, 0));
619
620 ATH_MSG_DEBUG("Building module "<<top->name());
621 ATH_MSG_DEBUG("Building module "<<bottom->name());
622
623 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
624 if (!m_detManager->numerology().useLayer(iLayer))
625 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
626
627 // make sure that we do not correct if we are not looking at IBL
628 if(iLayer!=0) m_etaCorrection = 0;
629
630 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
631 ATH_MSG_DEBUG("iPhi "<<iPhi);
632
633 // check which half we're filling
634 Trk::AlignModule * mod = nullptr;
635 if(isTopHalf(iPhi,iLayer)) {
636 ATH_MSG_DEBUG("iPhi "<<iPhi<<" is in top half of layer "<<iLayer);
637 mod = top;
638 }
639 else {
640 ATH_MSG_DEBUG("iPhi "<<iPhi<<" is in bottom half of layer "<<iLayer);
641 mod = bottom;
642 }
643
644 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
645 ATH_MSG_DEBUG("iEta "<<iEta);
646 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
647 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
648
649 if (element) {
650 // add element to the AlignModule
651 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
652 // and fill the corresponding map
653 (*pixelIdHashMap)[element->identifyHash()] = mod;
654 }
655 }
656 }
657 }
658
659 if(!moduleSelected(top)) {
660 ATH_MSG_DEBUG("Module "<<top->name()<<" NOT selected");
661 delete top;
662 }
663 else
664 m_alignModuleListPtr->push_back(top);
665
666 if(!moduleSelected(bottom)) {
667 ATH_MSG_DEBUG("Module "<<bottom->name()<<" NOT selected");
668 delete bottom;
669 }
670 else
671 m_alignModuleListPtr->push_back(bottom);
672 }
673
674 //_______________________________________________________________________
676 {
677 // ========================================
678 // END CAPS
679 ATH_MSG_INFO("Preparing the Pixel Endcap geometry for L12 : 2 endcaps");
680
681 if(!m_alignEndcaps) {
682 ATH_MSG_DEBUG("Not aligning endcaps");
683 return;
684 }
685
686 Amg::Transform3D transform = Amg::Transform3D::Identity();
687
688 unsigned int maxHash = m_idHelper->wafer_hash_max();
689 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
690
694
695 for (int iEndcapIndex = 0; iEndcapIndex < m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
696 int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
697
698 Trk::AlignModule * mod = new Trk::AlignModule(this);
699 mod->setIdHash(getNextIDHash());
700 mod->setIdentifier(m_idHelper->wafer_id(iSide,0,0,0));
701
702 const std::string name = (iEndcapIndex == 0)? "Pixel/EndcapA":"Pixel/EndcapC";
703 mod->setName(name);
704
705 if(!moduleSelected(mod)) {
706 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
707 delete mod;
708 continue;
709 }
710
711 ATH_MSG_DEBUG("Building module "<<mod->name());
712
713 for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
714 if (!m_detManager->numerology().useDisk(iWheel))
715 ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
716
717 // there is only one eta module for all Pixel endcap disks but anyway ...
718 for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
719 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
720 ATH_MSG_DEBUG("iPhi "<<iPhi);
721 const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta);
722 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
723
724 if (element) {
725
726 // just to be sure check for DBM module
727 Identifier id = m_idHelper->wafer_id(iSide, iWheel, iPhi, iEta);
728 if(m_idHelper->is_dbm(id)){
729 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
730 continue;
731 }
732 // add to the AlignModule
733 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
734 // and fill the corresponding map
735 (*pixelIdHashMap)[element->identifyHash()] = mod;
736 }
737 }
738 }
739 }
740
741 // for endcap we move the CoG
742 Amg::Translation3D translation(mod->centerOfGravity());
743 ATH_MSG_DEBUG("Endcap:" << iSide << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
744 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
745 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
746
747 m_alignModuleListPtr->push_back(mod);
748 }
749 }
750
751
753 {
754 // ========================================
755 // BARREL
756 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L26 : IBL stave Pixel whole barrel");
757
758 if(!m_alignBarrel) {
759 ATH_MSG_DEBUG("Not aligning barrel");
760 return;
761 }
762
763 // ========================================
764 // get all modules for Level 16 alignment of the barrel
765 // 14 Pixel ladders (staves) in the IBL
766 // 1 piece for the remainder of the Pixel barrel
767
768 Amg::Transform3D transform = Amg::Transform3D::Identity();
769
770 unsigned int maxHash = m_idHelper->wafer_hash_max();
771 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
772
776
777
778 // create two AlignModules: IBL and rest of pixel
779 Trk::AlignModule * pixel_old = new Trk::AlignModule(this);
780 pixel_old->setIdHash(getNextIDHash());
781 pixel_old->setName("Pixel/oldPixel");
782
783 // we use identifier of 0th module in the 0th and 1st layer of barrel
784 pixel_old->setIdentifier(m_idHelper->wafer_id(0, 1, 0, 0));
785
786 ATH_MSG_DEBUG("Building module "<<pixel_old->name());
787
788
789
790 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
791 if (!m_detManager->numerology().useLayer(iLayer))
792 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
793
794 // make sure that we do not correct if we are not looking at IBL
795 if(iLayer!=0){
796 m_etaCorrection = 0;
797
798 if(!moduleSelected(pixel_old)) {
799 ATH_MSG_DEBUG("Module "<<pixel_old->name()<<" NOT selected");
800 continue;
801 }
802
803 ATH_MSG_DEBUG("Adding to module "<<pixel_old->name());
804
805 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
806 ATH_MSG_DEBUG("iPhi "<<iPhi);
807 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
808 ATH_MSG_DEBUG("iEta "<<iEta);
809 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
810 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
811
812 if (element) {
813
814 // just to be sure check for DBM module
815 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
816 if(m_idHelper->is_dbm(id)){
817 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
818 continue;
819 }
820 // add element to the AlignModule
821 pixel_old->addDetElement(Trk::AlignModule::Pixel,element,transform);
822 // and fill the corresponding map
823 (*pixelIdHashMap)[element->identifyHash()] = pixel_old;
824 }
825 }
826 }
827 } else {
828
829 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
830 ATH_MSG_DEBUG("iPhi "<<iPhi);
831
832 // create AlignModule
833 Trk::AlignModule * mod = new Trk::AlignModule(this);
834 mod->setIdHash(getNextIDHash());
835
836 // we use identifier of 0th eta module in the stave
837 mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, iPhi, 0));
838
839 std::string name="Pixel/Barrel/Layer_"+std::to_string(iLayer)+"/PhiStave_"+std::to_string(iPhi);
840 mod->setName(name);
841
842 if(!moduleSelected(mod)) {
843 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
844 delete mod;
845 continue;
846 }
847
848 ATH_MSG_DEBUG("Building module "<<mod->name());
849
850 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
851 ATH_MSG_DEBUG("iEta "<<iEta);
852 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
853 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
854
855 if (element) {
856
857 // just to be sure check for DBM module
858 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
859 if(m_idHelper->is_dbm(id)){
860 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
861 continue;
862 }
863 // add element to the AlignModule
864 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
865 // and fill the corresponding map
866 (*pixelIdHashMap)[element->identifyHash()] = mod;
867 }
868
869 }
870 // we use create the align frame from the sum of all modules ;
871 Amg::Transform3D alignModuleToGlobal = mod->calculateAlignModuleToGlobal();
872 mod->setGlobalFrameToAlignFrameTransform( alignModuleToGlobal.inverse() );
873 mod->resetAlignModuleToDetElementTransforms();
874
875
876 // add AlignModule to the geometry
877 m_alignModuleListPtr->push_back(mod);
878 }
879 } //end loop over staves
880 }
881
882 if(!moduleSelected(pixel_old)) {
883 ATH_MSG_DEBUG("Module "<<pixel_old->name()<<" NOT selected");
884 delete pixel_old;
885 }
886 else
887 m_alignModuleListPtr->push_back(pixel_old);
888
889
890 }
891
892
893
894
895 //_______________________________________________________________________
897 {
898 // ========================================
899 // BARREL
900 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L2 : "<<m_detManager->numerology().numLayers()<<" layers");
901
902 if(!m_alignBarrel) {
903 ATH_MSG_DEBUG("Not aligning barrel");
904 return;
905 }
906
907 // ========================================
908 // get all modules for Level 2 alignment of the barrel
909 // 3 Pixel layers
910
911 Amg::Transform3D transform = Amg::Transform3D::Identity();
912
913 unsigned int maxHash = m_idHelper->wafer_hash_max();
914 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
915
919
920 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
921 if (!m_detManager->numerology().useLayer(iLayer))
922 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
923
924 // make sure that we do not correct if we are not looking at IBL
925 if(iLayer!=0) m_etaCorrection = 0;
926
927 // create the AlignModule
928 Trk::AlignModule * mod = new Trk::AlignModule(this);
929 mod->setIdHash(getNextIDHash());
930 mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, 0, 0));
931
932 std::string name="Pixel/Barrel/Layer_" +std::to_string( iLayer);
933 mod->setName(name);
934
935 if(!moduleSelected(mod)) {
936 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
937 delete mod;
938 continue;
939 }
940
941 ATH_MSG_DEBUG("Building module "<<mod->name());
942
943 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
944 ATH_MSG_DEBUG("iPhi "<<iPhi);
945 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
946 ATH_MSG_DEBUG("iEta "<<iEta);
947 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
948 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
949
950 if (element) {
951
952 // just to be sure check for DBM module
953 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
954 if(m_idHelper->is_dbm(id)){
955 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
956 continue;
957 }
958 // add element to the AlignModule
959 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
960 // and fill the corresponding map
961 (*pixelIdHashMap)[element->identifyHash()] = mod;
962 }
963 }
964 }
965
966 m_alignModuleListPtr->push_back(mod);
967 }
968 }
969
970 //_______________________________________________________________________
972 {
973 // ========================================
974 // BARREL
975 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L22 "<<m_detManager->numerology().numLayers()*2<<" half-layers");
976
977 if(!m_alignBarrel) {
978 ATH_MSG_DEBUG("Not aligning barrel");
979 return;
980 }
981
982 // ========================================
983 // get all modules for Level 22 alignment of the barrel
984 // 6 Pixel half-layers
985
986 Amg::Transform3D transform = Amg::Transform3D::Identity();
987
988 unsigned int maxHash = m_idHelper->wafer_hash_max();
989 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
990
994
995 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
996 if (!m_detManager->numerology().useLayer(iLayer))
997 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
998
999 // create two AlignModules: top half and bottom half
1000 Trk::AlignModule * top = new Trk::AlignModule(this);
1001 Trk::AlignModule * bottom = new Trk::AlignModule(this);
1002 top->setIdHash(getNextIDHash());
1003 bottom->setIdHash(getNextIDHash());
1004
1005 // we use identifier of 0th eta module in following phi stave based on the layer
1006 //
1007 // layer phi-top phi-bottom
1008 // 0 10 20
1009 // 1 10 30
1010 // 2 10 30
1011 //
1012 unsigned int phi_top = 10;
1013 top->setIdentifier(m_idHelper->wafer_id(0, iLayer, phi_top, 0));
1014 unsigned int phi_bottom = iLayer ? 30 : 20;
1015 bottom->setIdentifier(m_idHelper->wafer_id(0, iLayer, phi_bottom, 0));
1016
1017 std::string nametop="Pixel/Barrel/Layer_"+std::to_string(iLayer)+"_top";
1018 top->setName(nametop);
1019
1020 std::string namebottom="Pixel/Barrel/Layer_"+std::to_string(iLayer)+"_bottom";
1021 bottom->setName(namebottom);
1022
1023 ATH_MSG_DEBUG("Building module "<<top->name());
1024 ATH_MSG_DEBUG("Building module "<<bottom->name());
1025
1026 if(iLayer!=0) m_etaCorrection = 0;
1027
1028 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1029 ATH_MSG_DEBUG("iPhi "<<iPhi);
1030
1031 // check which half we're filling
1032 Trk::AlignModule * mod = nullptr;
1033 if(isTopHalf(iPhi,iLayer)) {
1034 ATH_MSG_DEBUG("iPhi "<<iPhi<<" is in top half of layer "<<iLayer);
1035 mod = top;
1036 }
1037 else {
1038 ATH_MSG_DEBUG("iPhi "<<iPhi<<" is in bottom half of layer "<<iLayer);
1039 mod = bottom;
1040 }
1041
1042 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
1043 ATH_MSG_DEBUG("iEta "<<iEta);
1044 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
1045 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1046
1047 if (element) {
1048 // add element to the AlignModule
1049 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1050 // and fill the corresponding map
1051 (*pixelIdHashMap)[element->identifyHash()] = mod;
1052 }
1053 }
1054 }
1055
1056 if(!moduleSelected(top)) {
1057 ATH_MSG_DEBUG("Module "<<top->name()<<" NOT selected");
1058 delete top;
1059 }
1060 else
1061 m_alignModuleListPtr->push_back(top);
1062
1063 if(!moduleSelected(bottom)) {
1064 ATH_MSG_DEBUG("Module "<<bottom->name()<<" NOT selected");
1065 delete bottom;
1066 }
1067 else
1068 m_alignModuleListPtr->push_back(bottom);
1069 }
1070 }
1071
1072
1073 //_______________________________________________________________________
1075 {
1076 // ========================================
1077 // BARREL
1078 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L26 : IBL stave Pixel L2");
1079
1080 if(!m_alignBarrel) {
1081 ATH_MSG_DEBUG("Not aligning barrel");
1082 return;
1083 }
1084
1085
1086 // ========================================
1087 // get all modules for Level 16 alignment of the barrel
1088 // 14 Pixel ladders (staves) in the IBL
1089 // 3 layers for the remainder of the Pixel barrel
1090
1091 Amg::Transform3D transform = Amg::Transform3D::Identity();
1092
1093 unsigned int maxHash = m_idHelper->wafer_hash_max();
1094 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1095
1099
1100 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
1101 if (!m_detManager->numerology().useLayer(iLayer))
1102 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
1103
1104 // make sure that we do not correct if we are not looking at IBL
1105 if(iLayer!=0){
1106 m_etaCorrection = 0;
1107 // create the AlignModule
1108 Trk::AlignModule * mod = new Trk::AlignModule(this);
1109 mod->setIdHash(getNextIDHash());
1110 mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, 0, 0));
1111
1112 std::string name="Pixel/Barrel/Layer_" +std::to_string( iLayer);
1113 mod->setName(name);
1114
1115 if(!moduleSelected(mod)) {
1116 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1117 delete mod;
1118 continue;
1119 }
1120
1121 ATH_MSG_DEBUG("Building module "<<mod->name());
1122
1123 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1124 ATH_MSG_DEBUG("iPhi "<<iPhi);
1125 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
1126 ATH_MSG_DEBUG("iEta "<<iEta);
1127 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
1128 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1129
1130 if (element) {
1131
1132 // just to be sure check for DBM module
1133 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
1134 if(m_idHelper->is_dbm(id)){
1135 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
1136 continue;
1137 }
1138 // add element to the AlignModule
1139 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1140 // and fill the corresponding map
1141 (*pixelIdHashMap)[element->identifyHash()] = mod;
1142 }
1143 }
1144 }
1145
1146 m_alignModuleListPtr->push_back(mod);
1147 } else {
1148
1149 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1150 ATH_MSG_DEBUG("iPhi "<<iPhi);
1151
1152 // create AlignModule
1153 Trk::AlignModule * mod = new Trk::AlignModule(this);
1154 mod->setIdHash(getNextIDHash());
1155
1156 // we use identifier of 0th eta module in the stave
1157 mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, iPhi, 0));
1158
1159 std::string name="Pixel/Barrel/Layer_"+std::to_string(iLayer)+"/PhiStave_"+std::to_string(iPhi);
1160 mod->setName(name);
1161
1162 if(!moduleSelected(mod)) {
1163 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1164 delete mod;
1165 continue;
1166 }
1167
1168 ATH_MSG_DEBUG("Building module "<<mod->name());
1169
1170 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
1171 ATH_MSG_DEBUG("iEta "<<iEta);
1172 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
1173 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1174
1175 if (element) {
1176
1177 // just to be sure check for DBM module
1178 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
1179 if(m_idHelper->is_dbm(id)){
1180 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
1181 continue;
1182 }
1183 // add element to the AlignModule
1184 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1185 // and fill the corresponding map
1186 (*pixelIdHashMap)[element->identifyHash()] = mod;
1187 }
1188 }
1189
1190 // we use create the align frame from the sum of all modules ;
1191 Amg::Transform3D alignModuleToGlobal = mod->calculateAlignModuleToGlobal();
1192 mod->setGlobalFrameToAlignFrameTransform( alignModuleToGlobal.inverse() );
1193 mod->resetAlignModuleToDetElementTransforms();
1194
1195
1196 // add AlignModule to the geometry
1197 m_alignModuleListPtr->push_back(mod);
1198 }
1199 } //end loop over staves
1200 }
1201 }
1202
1203
1204
1205
1206 //_______________________________________________________________________
1208 {
1209 // ========================================
1210 // BARREL
1211 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L27 : 112(132 incl. IBL) staves (ladders)");
1212
1213 if(!m_alignBarrel) {
1214 ATH_MSG_DEBUG("Not aligning barrel");
1215 return;
1216 }
1217
1218 // ========================================
1219 // get all modules for Level 27 alignment of the barrel
1220 // 112 Pixel ladders (staves)
1221
1222 Amg::Transform3D transform = Amg::Transform3D::Identity();
1223
1224 unsigned int maxHash = m_idHelper->wafer_hash_max();
1225 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1226
1230
1231 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
1232 if (!m_detManager->numerology().useLayer(iLayer))
1233 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
1234
1235 // make sure that we do not correct if we are not looking at IBL
1236 if(iLayer!=0) m_etaCorrection = 0;
1237
1238 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1239 ATH_MSG_DEBUG("iPhi "<<iPhi);
1240
1241 // create AlignModule
1242 Trk::AlignModule * mod = new Trk::AlignModule(this);
1243 mod->setIdHash(getNextIDHash());
1244
1245 // we use identifier of 0th eta module in the stave
1246 mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, iPhi, 0));
1247
1248 std::string name="Pixel/Barrel/Layer_"+std::to_string(iLayer)+"/PhiStave_"+std::to_string(iPhi);
1249 mod->setName(name);
1250
1251 if(!moduleSelected(mod)) {
1252 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1253 delete mod;
1254 continue;
1255 }
1256
1257 ATH_MSG_DEBUG("Building module "<<mod->name());
1258
1259 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
1260 ATH_MSG_DEBUG("iEta "<<iEta);
1261 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
1262 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1263
1264 if (element) {
1265
1266 // just to be sure check for DBM module
1267 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
1268 if(m_idHelper->is_dbm(id)){
1269 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
1270 continue;
1271 }
1272 // add element to the AlignModule
1273 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1274 // and fill the corresponding map
1275 (*pixelIdHashMap)[element->identifyHash()] = mod;
1276 }
1277
1278 // we use the local frame for the 0th eta wafer as the stave alignment frame
1279 if (iEta==0) {
1280 if (!element) {
1281 throw std::logic_error("No detector element at the 0th eta wafer.");
1282 }
1283 mod->setGlobalFrameToAlignFrameTransform(element->transform().inverse());
1284 }
1285 }
1286
1287 // add AlignModule to the geometry
1288 m_alignModuleListPtr->push_back(mod);
1289 }
1290 }
1291 }
1292
1294 {
1295 // ========================================
1296 // ITk PIXEL END CAPS L2
1297 // ========================================
1298 ATH_MSG_INFO("Preparing the ITk Pixel Endcap geometry for L2");
1299
1300 if (!m_alignEndcaps) {
1301 ATH_MSG_DEBUG("Not aligning ITk Pixel endcaps");
1302 return;
1303 }
1304
1305 Amg::Transform3D transform = Amg::Transform3D::Identity();
1306 const auto& numerology = m_detManager->numerology();
1307
1308 unsigned int maxHash = m_idHelper->wafer_hash_max();
1309
1311 m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::Pixel) = new Trk::AlignModuleList((size_t)(maxHash), nullptr);
1312
1314
1315 ATH_MSG_INFO("ITk Pixel L2 Endcap numerology: numEndcaps = " << numerology.numEndcaps() << ", numDiskLayers = " << numerology.numDiskLayers());
1316
1317 // ========================================
1318 // Loop over Endcap A / C
1319 // ========================================
1320 for (int iEndcapIndex = 0; iEndcapIndex < numerology.numEndcaps(); iEndcapIndex++) {
1321 int iSide = numerology.endcapId(iEndcapIndex);
1322
1323 // ========================================
1324 // Loop over EC layers (EC1–EC9)
1325 // One AlignModule per layer
1326 // ========================================
1327 for (int iLayer = 0; iLayer < numerology.numDiskLayers(); iLayer++) {
1328
1329 Trk::AlignModule* mod = new Trk::AlignModule(this);
1330 mod->setIdHash(getNextIDHash());
1331 mod->setIdentifier(m_idHelper->wafer_id(iSide, iLayer, 0, 0));
1332
1333 const std::string layerStr{std::to_string(iLayer + 1)};
1334 std::string name = (iSide == 2) ? "Pixel/EndcapA/Layer_" + layerStr : "Pixel/EndcapC/Layer_" + layerStr;
1335 mod->setName(name);
1336
1337 if (!moduleSelected(mod)) {
1338 ATH_MSG_DEBUG("Module " << mod->name() << " NOT selected");
1339 delete mod;
1340 continue;
1341 }
1342
1343 ATH_MSG_DEBUG("Building module " << mod->name());
1344
1345 unsigned int nElements = 0;
1346 const int nRings = numerology.numDisksForLayer(iLayer);
1347 ATH_MSG_DEBUG("ITk Pixel L2: " << mod->name() << " | Layer index = " << iLayer << " | Number of rings = " << nRings);
1348 // ========================================
1349 // Loop over rings within this EC layer
1350 // ========================================
1351 for (int iRing = 0; iRing < nRings; iRing++) {
1352
1353 const int nPhi = numerology.numPhiModulesForLayerDisk(iLayer, iRing);
1354 unsigned int nRingElements = 0;
1355
1356 // Loop over phi sensors (both faces)
1357 for (int iPhi = 0; iPhi < nPhi; iPhi++) {
1358
1359 const SiDetectorElement* element2 = m_detManager->getDetectorElement(iSide, iLayer, iPhi, iRing);
1360 const Trk::TrkDetElementBase* element = static_cast<const Trk::TrkDetElementBase*>(element2);
1361
1362 if (element) {
1363 mod->addDetElement(Trk::AlignModule::Pixel, element, transform);
1364 (*pixelIdHashMap)[element->identifyHash()] = mod;
1365 ++nElements;
1366 ++nRingElements;
1367 }
1368 }
1369 ATH_MSG_DEBUG(" " << mod->name() << " | Ring " << iRing << " | Phi slots = " << nPhi << " | Sensors found = " << nRingElements);
1370 }
1371
1372 ATH_MSG_INFO("ITk Pixel L2 module " << mod->name() << " contains " << nElements << " detector elements");
1373
1374 if (nElements == 0) {
1375 ATH_MSG_WARNING("Skipping empty ITk Pixel module " << mod->name());
1376 delete mod;
1377 continue;
1378 }
1379
1380 // ========================================
1381 // Set alignment frame at layer CoG
1382 // ========================================
1383 Amg::Translation3D translation(mod->centerOfGravity());
1384 ATH_MSG_DEBUG("Endcap: " << iSide << ", Layer: " << iLayer << ", CoG (" << translation.x() << ", " << translation.y() << ", " << translation.z() << ")");
1385
1386 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1387 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1388
1389 m_alignModuleListPtr->push_back(mod);
1390 ATH_MSG_INFO("Adding alignment module " << mod->name());
1391 }
1392 }
1393 }
1394
1395 //_______________________________________________________________________
1397 {
1398 // ========================================
1399 // END CAPS
1400 ATH_MSG_INFO("Preparing the Pixel Endcap geometry for L2 : 2 x 3 disks");
1401
1402 if(!m_alignEndcaps) {
1403 ATH_MSG_DEBUG("Not aligning endcaps");
1404 return;
1405 }
1406
1407 // ========================================
1408 // get all modules for Level 2 alignment for the endcaps
1409 // 2 x 3 Pixel Endcap disks
1410 Amg::Transform3D transform = Amg::Transform3D::Identity();
1411
1412 unsigned int maxHash = m_idHelper->wafer_hash_max();
1413 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1414
1418
1419 for (int iEndcapIndex = 0; iEndcapIndex < m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
1420 int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
1421 for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
1422 if (!m_detManager->numerology().useDisk(iWheel))
1423 ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
1424
1425 Trk::AlignModule * mod = new Trk::AlignModule(this);
1426 mod->setIdHash(getNextIDHash());
1427 mod->setIdentifier(m_idHelper->wafer_id(iSide,iWheel,0,0));
1428 const std::string iWheelStr{std::to_string(iWheel)};
1429 std::string name= (iEndcapIndex == 0) ? "Pixel/EndcapA/Disk_" + iWheelStr :"Pixel/EndcapC/Disk_" + iWheelStr;
1430 mod->setName(name);
1431
1432 if(!moduleSelected(mod)) {
1433 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1434 delete mod;
1435 continue;
1436 }
1437
1438 ATH_MSG_DEBUG("Building module "<<mod->name());
1439
1440 // there is only one eta module for all Pixel endcap disks but anyway ...
1441 for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1442 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1443 ATH_MSG_DEBUG("iPhi "<<iPhi);
1444 const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta);
1445 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1446
1447 if (element) {
1448
1449 // just to be sure check for DBM module
1450 Identifier id = m_idHelper->wafer_id(iSide, iWheel, iPhi, iEta);
1451 if(m_idHelper->is_dbm(id)){
1452 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
1453 continue;
1454 }
1455 // add to the AlignModule
1456 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1457 // and fill the corresponding map
1458 (*pixelIdHashMap)[element->identifyHash()] = mod;
1459 }
1460 }
1461 }
1462
1463 // for endcap we move the CoG
1464 Amg::Translation3D translation(mod->centerOfGravity());
1465 ATH_MSG_DEBUG("Endcap:" << iSide << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
1466 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1467 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1468
1469 m_alignModuleListPtr->push_back(mod);
1470 }
1471 }
1472 }
1473
1474 //_______________________________________________________________________
1476 {
1477 // ========================================
1478 // BARREL
1479 ATH_MSG_INFO("Preparing the Pixel Barrel geometry for L3 : module (wafer) level");
1480
1481 if(!m_alignBarrel) {
1482 ATH_MSG_DEBUG("Not aligning barrel");
1483 return;
1484 }
1485
1486 // ========================================
1487 // Pixel Barrel:
1488 unsigned int maxHash = m_idHelper->wafer_hash_max();
1489 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1490
1494
1495 for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
1496 ATH_MSG_DEBUG("iLayer "<<iLayer);
1497 if (!m_detManager->numerology().useLayer(iLayer))
1498 ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
1499
1500 // make sure that we do not correct if we are not looking at IBL
1501 if(iLayer!=0) m_etaCorrection = 0;
1502
1503 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1504 ATH_MSG_DEBUG("iPhi "<<iPhi);
1505 for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer)-m_etaCorrection; iEta++) {
1506 ATH_MSG_DEBUG("iEta "<<iEta);
1507
1508 // just to be sure check for DBM module
1509 Identifier id = m_idHelper->wafer_id(0, iLayer, iPhi, iEta);
1510 if(m_idHelper->is_dbm(id)){
1511 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
1512 continue;
1513 }
1514
1515 // create the AlignModule
1516 Trk::AlignModule * mod = new Trk::AlignModule(this);
1517 mod->setIdHash(getNextIDHash());
1518 mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, iPhi, iEta));
1519
1520 std::string name="Pixel/Barrel/Layer_"+std::to_string(iLayer)+"/Phi_"+std::to_string(iPhi)+"/Eta_"+std::to_string(iEta);
1521 mod->setName(name);
1522
1523 if(!moduleSelected(mod)) {
1524 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1525 delete mod;
1526 continue;
1527 }
1528
1529 ATH_MSG_DEBUG("Building module "<<mod->name());
1530
1531 const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta);
1532 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1533
1534 if (element) {
1535 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1536 // should this be identity? if yes, it means that the
1537 // db frame constants are in the global frame. Or not?
1538 Amg::Transform3D transform = Amg::Transform3D::Identity();
1539 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1540
1541 // add to the AlignModule
1542 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1543 // and fill the corresponding map
1544 (*pixelIdHashMap)[element->identifyHash()] = mod;
1545
1546 // set transformation
1547 mod->setGlobalFrameToAlignFrameTransform(element->transform().inverse());
1548
1549 // add module to the list
1550 m_alignModuleListPtr->push_back(mod);
1551 }
1552 else {
1553 ATH_MSG_WARNING("No element in module "<<mod->name()<<". Ignoring this module.");
1554 delete mod;
1555 }
1556 }
1557 }
1558 }
1559 }
1560
1561 //_______________________________________________________________________
1563 {
1564 // ========================================
1565 // END CAPS
1566 ATH_MSG_INFO("Preparing the Pixel geometry for L3 : module (wafer) level");
1567
1568 if(!m_alignEndcaps) {
1569 ATH_MSG_DEBUG("Not aligning endcaps");
1570 return;
1571 }
1572
1573 // ========================================
1574 // Pixel Endcaps: 2x144 modules
1575
1576 unsigned int maxHash = m_idHelper->wafer_hash_max();
1577 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1578
1582
1583 for (int iEndcapIndex = 0; iEndcapIndex < m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
1584 int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
1585 ATH_MSG_DEBUG("iSide "<<iSide);
1586 for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
1587 ATH_MSG_DEBUG("iWheel "<<iWheel);
1588 if (!m_detManager->numerology().useDisk(iWheel))
1589 ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
1590
1591 // there is only one eta module for all Pixel endcap disks but anyway ...
1592 for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1593 for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1594 ATH_MSG_DEBUG("iPhi "<<iPhi);
1595
1596 // just to be sure check for DBM module
1597 Identifier id = m_idHelper->wafer_id(iSide,iWheel,iPhi,iEta);
1598 if(m_idHelper->is_dbm(id)){
1599 ATH_MSG_DEBUG(" Found DBM element, skipping: " << m_idHelper->is_dbm(id));
1600 continue;
1601 }
1602
1603 Trk::AlignModule * mod = new Trk::AlignModule(this);
1604 mod->setIdHash(getNextIDHash());
1605 mod->setIdentifier(m_idHelper->wafer_id(iSide,iWheel,iPhi,iEta));
1606
1607 std::string name = (iEndcapIndex == 0)? "Pixel/EndcapA" : "Pixel/EndcapC";
1608
1609 name+="/Disk_"+std::to_string(iWheel)+"/Phi_"+std::to_string(iPhi);
1610 mod->setName(name);
1611
1612 if(!moduleSelected(mod)) {
1613 ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1614 delete mod;
1615 continue;
1616 }
1617
1618 ATH_MSG_DEBUG("Building module "<<mod->name());
1619
1620 const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta);
1621 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1622
1623 if (element) {
1624 // add element to respective AlignModule
1625
1626 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1627 // should this be identity? if yes, it means that the
1628 // db frame constants are in the global frame. Or not?
1629 Amg::Transform3D transform = Amg::Transform3D::Identity();
1630 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1631
1632 // add to the barrel
1633 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1634 // and fill the corresponding map
1635 (*pixelIdHashMap)[element->identifyHash()] = mod;
1636
1637 // set transformation
1638 mod->setGlobalFrameToAlignFrameTransform(element->transform().inverse());
1639
1640 // add module to the list
1641 m_alignModuleListPtr->push_back(mod);
1642 }
1643 else {
1644 ATH_MSG_WARNING("No element in module "<<mod->name()<<". Ignoring this module.");
1645 delete mod;
1646 }
1647 }
1648 }
1649 }
1650 }
1651 }
1652
1653 //_____________ some new DBM alignment levels (1, 2, and 3)_______________
1654 //________________________________________________________________________
1656 {
1657 // ========================================
1658 // DBM END CAPS
1659 ATH_MSG_INFO("Preparing the DBM Endcap geometry for L1 : 2 endcaps");
1660
1661 unsigned int maxHash = m_idHelper->wafer_hash_max();
1662 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1663
1667
1668 // create two AlignModules:
1669 Trk::AlignModule * dbm1 = new Trk::AlignModule(this);
1670 dbm1->setIdHash(getNextIDHash());
1671 dbm1->setName("Pixel/ECDBM");
1672
1673 Trk::AlignModule * dbm2 = new Trk::AlignModule(this);
1674 dbm2->setIdHash(getNextIDHash());
1675 dbm2->setName("Pixel/EADBM");
1676
1677 dbm1->setIdentifier(m_idHelper->wafer_id(-4, 0, 0, 0));
1678 dbm2->setIdentifier(m_idHelper->wafer_id(4, 0, 0, 0));
1679
1680 ATH_MSG_DEBUG("Building module "<<dbm1->name());
1681 ATH_MSG_DEBUG("Building module "<<dbm2->name());
1682
1683 const Amg::Transform3D transform = Amg::Transform3D::Identity();
1684
1685 for (unsigned int index = 0; index < maxHash; index++)
1686 {
1687 IdentifierHash idHash = index;
1688 Identifier id = m_idHelper->wafer_id(idHash);
1689
1690 // just to be sure check for DBM module
1691 if(!m_idHelper->is_dbm(id)) continue;
1692
1693// ATH_MSG_DEBUG(" Found DBM element " << m_idHelper->is_dbm(id));
1694// ATH_MSG_DEBUG("DBM bec "<<m_idHelper->barrel_ec(id));
1695// ATH_MSG_DEBUG("DBM layer disk "<<m_idHelper->layer_disk(id));
1696// ATH_MSG_DEBUG("DBM ring (eta module) "<< m_idHelper->eta_module(id));
1697// ATH_MSG_DEBUG("DBM sector (phi module) "<< m_idHelper->phi_module(id));
1698
1699 // check what we're filling
1700 Trk::AlignModule * mod = nullptr;
1701 if( m_idHelper->is_dbm(id) && m_idHelper->barrel_ec(id)==-4) {
1702 ATH_MSG_DEBUG("pixel element "<<id<<" at index "<<index<<" is in ECDBM");
1703 mod = dbm1;
1704 }
1705 else if( m_idHelper->is_dbm(id) && m_idHelper->barrel_ec(id)==4) {
1706 ATH_MSG_DEBUG("pixel element "<<id<<" at index "<<index<<" is in EADBM");
1707 mod = dbm2;
1708 }
1709
1710 // get the element via hash
1711 const SiDetectorElement * element2 = m_detManager->getDetectorElement(id);
1712 if (element2) {
1713 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1714 if (mod){
1715 // add element to the AlignModule
1716 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1717 // and fill the corresponding map
1718 (*pixelIdHashMap)[element->identifyHash()] = mod;
1719 }else{
1720 ATH_MSG_WARNING("Module pointer is null in buildL1DBM()");
1721 }
1722 }
1723 else
1724 ATH_MSG_DEBUG("No Pixel detector with id:" << id);
1725 }
1726 ATH_MSG_DEBUG("-------------------------------------------------------");
1727
1728 // alignment fram for the barrel is the global frame
1729 // so we don't have to set any additional transform
1730 if(!moduleSelected(dbm1)) {
1731 ATH_MSG_DEBUG("Module "<<dbm1->name()<<" NOT selected");
1732 delete dbm1;
1733 }
1734 else {
1735 // for endcap we move the CoG
1736 Amg::Translation3D translation(dbm1->centerOfGravity());
1737 ATH_MSG_DEBUG("Endcap:" << dbm1->name() << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
1738 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1739 dbm1->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1740
1741 m_alignModuleListPtr->push_back(dbm1);
1742 }
1743
1744
1745 if(!moduleSelected(dbm2)) {
1746 ATH_MSG_DEBUG("Module "<<dbm2->name()<<" NOT selected");
1747 delete dbm2;
1748 }
1749 else {
1750 // for endcap we move the CoG
1751 Amg::Translation3D translation(dbm2->centerOfGravity());
1752 ATH_MSG_DEBUG("Endcap:" << dbm2->name() << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
1753 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1754 dbm2->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1755
1756 m_alignModuleListPtr->push_back(dbm2);
1757 }
1758 }
1759
1760
1761 //________________________________________________________________________
1763 {
1764 // ========================================
1765 // DBM telescopes
1766 ATH_MSG_INFO("Preparing the DBM telescope geometry for L2 : 8 telescopes");
1767
1768 unsigned int maxHash = m_idHelper->wafer_hash_max();
1769 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1770
1774
1775 std::vector<Trk::AlignModule*> mod_list;
1776 // create 8 AlignModules:
1777 for (unsigned int i = 0; i < 8; i++)
1778 {
1779
1780 Trk::AlignModule * mod = new Trk::AlignModule(this);
1781 mod->setIdHash(getNextIDHash());
1782 std::string name = (i<4) ? "Pixel/ECDBM"+std::to_string(i) : "Pixel/EADBM"+std::to_string(i-4);
1783 mod->setName(name);
1784 if(i<4) mod->setIdentifier(m_idHelper->wafer_id(-4, 0, i, 0));
1785 else mod->setIdentifier(m_idHelper->wafer_id(4, 0, i-4, 0));
1786
1787 mod_list.push_back(mod);
1788 ATH_MSG_DEBUG("Building module "<<mod->name());
1789 }
1790
1791 const Amg::Transform3D transform = Amg::Transform3D::Identity();
1792
1793 // ==================================================================
1794 // loop over Pixel elements and add them to respective alignModules
1795 // ==================================================================
1796 for (unsigned int index = 0; index < maxHash; index++)
1797 {
1798 IdentifierHash idHash = index;
1799 Identifier id = m_idHelper->wafer_id(idHash);
1800
1801 // just to be sure check for DBM module
1802 if(!m_idHelper->is_dbm(id)) continue;
1803
1804// ATH_MSG_DEBUG(" Found DBM element " << m_idHelper->is_dbm(id));
1805// ATH_MSG_DEBUG("DBM bec "<<m_idHelper->barrel_ec(id));
1806// ATH_MSG_DEBUG("DBM layer disk "<<m_idHelper->layer_disk(id));
1807// ATH_MSG_DEBUG("DBM ring (eta module) "<< m_idHelper->eta_module(id));
1808// ATH_MSG_DEBUG("DBM sector (phi module) "<< m_idHelper->phi_module(id));
1809
1810 // check what we're filling
1811 unsigned int telescope = -1; // set to non existing telescope
1812 Trk::AlignModule * mod = nullptr;
1813 if( m_idHelper->is_dbm(id) && m_idHelper->barrel_ec(id)==-4) {
1814 ATH_MSG_DEBUG("pixel element "<<id<<" at index "<<index<<" with sector "<<m_idHelper->phi_module(id)<<" is in ECDBM");
1815 telescope = int(m_idHelper->phi_module(id));
1816 mod = mod_list.at(telescope);
1817 }
1818 else if( m_idHelper->is_dbm(id) && m_idHelper->barrel_ec(id)==4) {
1819 ATH_MSG_DEBUG("pixel element "<<id<<" at index "<<index<<" with sector "<<m_idHelper->phi_module(id)<<" is in EADBM");
1820 telescope = int(4+m_idHelper->phi_module(id));
1821 mod = mod_list.at(telescope);
1822 }
1823
1824 // get the element via hash
1825 const SiDetectorElement * element2 = m_detManager->getDetectorElement(id);
1826 if (element2 && mod) {
1827 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1828
1829 // add element to the AlignModule
1830 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1831 // and fill the corresponding map
1832 (*pixelIdHashMap)[element->identifyHash()] = mod;
1833 }
1834 else
1835 ATH_MSG_DEBUG("No Pixel detector with id:" << id);
1836 }
1837 ATH_MSG_DEBUG("-------------------------------------------------------");
1838
1839 // alignment fram for the barrel is the global frame
1840 // so we don't have to set any additional transform
1841 for(unsigned int i=0;i<mod_list.size();i++) {
1842 if(!moduleSelected(mod_list.at(i))) {
1843 ATH_MSG_DEBUG("Module "<<mod_list.at(i)->name()<<" NOT selected");
1844 //delete mod_list(i);
1845 }
1846 else {
1847 // for endcap we move the CoG
1848 Amg::Translation3D translation(mod_list.at(i)->centerOfGravity());
1849 ATH_MSG_DEBUG("Endcap:" << mod_list.at(i)->name() << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
1850 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1851 mod_list.at(i)->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1852
1853 m_alignModuleListPtr->push_back(mod_list.at(i));
1854 }
1855 }
1856 }
1857
1858
1859 //________________________________________________________________________
1861 {
1862 // ========================================
1863 // DBM telescopes
1864 ATH_MSG_INFO("Preparing the DBM module geometry for L3 : 24 modules");
1865
1866 unsigned int maxHash = m_idHelper->wafer_hash_max();
1867 ATH_MSG_DEBUG("maxHash for the Pixel "<<maxHash);
1868
1872
1873 // ==================================================================
1874 // loop over Pixel elements and add them to respective alignModules
1875 // ==================================================================
1876 for (unsigned int index = 0; index < maxHash; index++)
1877 {
1878 IdentifierHash idHash = index;
1879 Identifier id = m_idHelper->wafer_id(idHash);
1880
1881 // just to be sure check for DBM module
1882 if(!m_idHelper->is_dbm(id)) continue;
1883
1884// ATH_MSG_DEBUG(" Found DBM element " << m_idHelper->is_dbm(id));
1885// ATH_MSG_DEBUG("DBM bec "<<m_idHelper->barrel_ec(id));
1886// ATH_MSG_DEBUG("DBM layer disk "<<m_idHelper->layer_disk(id));
1887// ATH_MSG_DEBUG("DBM ring (eta module) "<< m_idHelper->eta_module(id));
1888// ATH_MSG_DEBUG("DBM sector (phi module) "<< m_idHelper->phi_module(id));
1889
1890 Trk::AlignModule * mod = new Trk::AlignModule(this);
1891 mod->setIdHash(getNextIDHash());
1892 std::string name = (m_idHelper->barrel_ec(id)==-4) ? "Pixel/ECDBM" : "Pixel/EADBM";
1893 name += "/Disk_"+std::to_string(m_idHelper->layer_disk(id))+"/Sector_"+std::to_string(m_idHelper->phi_module(id));
1894 mod->setName(name);
1895 mod->setIdentifier(m_idHelper->wafer_id(m_idHelper->barrel_ec(id), m_idHelper->layer_disk(id), m_idHelper->phi_module(id), 0));
1896
1897
1898 ATH_MSG_DEBUG("Building module "<<mod->name());
1899
1900 const SiDetectorElement * element2 = m_detManager->getDetectorElement(id);
1901 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
1902
1903 if (element) {
1904
1905 // db frame constants are in the global frame. Or not?
1906 Amg::Transform3D transform = Amg::Transform3D::Identity();
1907 // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1908
1909 // add to the barrel
1910 mod->addDetElement(Trk::AlignModule::Pixel,element,transform);
1911 // and fill the corresponding map
1912 (*pixelIdHashMap)[element->identifyHash()] = mod;
1913
1914 // set transformation
1915 mod->setGlobalFrameToAlignFrameTransform(element->transform().inverse());
1916
1917 // add module to the list
1918 m_alignModuleListPtr->push_back(mod);
1919 }
1920 else {
1921 ATH_MSG_WARNING("No element in module "<<mod->name()<<". Ignoring this module.");
1922 delete mod;
1923 }
1924 }
1925 }
1926
1927
1928 //________________________________________________________________________
1930 {
1931 // prepare all parameters
1933 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::TransX));
1934 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::TransY));
1935 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::TransZ));
1936 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::RotX));
1937 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::RotY));
1938 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::RotZ));
1939 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::BowX));
1940
1941 // set sigmas
1942 setSigmas(module,fullModPars);
1943
1944 // select active parameters based on jobOption properties
1946 for(unsigned int ipar=0;ipar<fullModPars->size();++ipar) {
1947
1948 Identifier AlimodID = module->identify();
1949
1950 Identifier modID = ((module->detElementCollection(Trk::AlignModule::Pixel))->at(0))->identify();
1951
1952 if( m_idHelper->is_barrel(modID) || m_alignLevel==1 || m_alignLevel==11) {
1953 ATH_MSG_DEBUG("Pixel barrel module with id "<<AlimodID);
1954 if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignBarrelX)
1955 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignBarrelY)
1956 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignBarrelZ)
1957 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignBarrelRotX)
1958 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignBarrelRotY)
1959 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignBarrelRotZ)
1960 || (m_idHelper->layer_disk(modID)==0 && m_idHelper->is_blayer(modID) && fullModPars->at(ipar)->paramType() == Trk::AlignModule::BowX && m_alignBarrelBowX) ) { //Bowing is only allowed for the IBL for now
1961 ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" \'"<<fullModPars->at(ipar)->dumpType()<<"\' is now active");
1962 activeModPars->push_back(fullModPars->at(ipar));
1963 }
1964 else
1965 ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" \'"<<fullModPars->at(ipar)->dumpType()<<"\' is NOT active");
1966 }
1967 else {
1968 ATH_MSG_DEBUG("Pixel endcap module with id "<<AlimodID);
1969 if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignEndcapX)
1970 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignEndcapY)
1971 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignEndcapZ)
1972 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignEndcapRotX)
1973 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignEndcapRotY)
1974 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignEndcapRotZ) ) {
1975 ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" \'"<<fullModPars->at(ipar)->dumpType()<<"\' is now active");
1976 activeModPars->push_back(fullModPars->at(ipar));
1977 }
1978 else
1979 ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" \'"<<fullModPars->at(ipar)->dumpType()<<"\' is NOT active");
1980 }
1981 }
1982
1983 // now add parameters to the list
1984 allFullModPars->push_back(fullModPars);
1985 allActiveModPars->push_back(activeModPars);
1986 }
1987
1988 //________________________________________________________________________
1990 {
1991 for(unsigned int ipar=0;ipar<modPars->size();++ipar) {
1992 // barrel
1993 if(m_idHelper->is_barrel(module->identify()))
1994 switch(modPars->at(ipar)->paramType()) {
1996 modPars->at(ipar)->setSigma(m_sigmaBarrelX);
1997 modPars->at(ipar)->setSoftCut(m_softcutBarrelX);
1998 break;
2000 modPars->at(ipar)->setSigma(m_sigmaBarrelY);
2001 modPars->at(ipar)->setSoftCut(m_softcutBarrelY);
2002 break;
2004 modPars->at(ipar)->setSigma(m_sigmaBarrelZ);
2005 modPars->at(ipar)->setSoftCut(m_softcutBarrelZ);
2006 break;
2008 modPars->at(ipar)->setSigma(m_sigmaBarrelRotX);
2009 modPars->at(ipar)->setSoftCut(m_softcutBarrelRotX);
2010 break;
2012 modPars->at(ipar)->setSigma(m_sigmaBarrelRotY);
2013 modPars->at(ipar)->setSoftCut(m_softcutBarrelRotY);
2014 break;
2016 modPars->at(ipar)->setSigma(m_sigmaBarrelRotZ);
2017 modPars->at(ipar)->setSoftCut(m_softcutBarrelRotZ);
2018 break;
2020 modPars->at(ipar)->setSigma(m_sigmaBarrelBowX);
2021 modPars->at(ipar)->setSoftCut(m_softcutBarrelBowX);
2022 default:
2023 break;
2024 }
2025 // end-caps
2026 else
2027 switch(modPars->at(ipar)->paramType()) {
2029 modPars->at(ipar)->setSigma(m_sigmaEndcapX);
2030 modPars->at(ipar)->setSoftCut(m_softcutEndcapX);
2031 break;
2033 modPars->at(ipar)->setSigma(m_sigmaEndcapY);
2034 modPars->at(ipar)->setSoftCut(m_softcutEndcapY);
2035 break;
2037 modPars->at(ipar)->setSigma(m_sigmaEndcapZ);
2038 modPars->at(ipar)->setSoftCut(m_softcutEndcapZ);
2039 break;
2041 modPars->at(ipar)->setSigma(m_sigmaEndcapRotX);
2042 modPars->at(ipar)->setSoftCut(m_softcutEndcapRotX);
2043 break;
2045 modPars->at(ipar)->setSigma(m_sigmaEndcapRotY);
2046 modPars->at(ipar)->setSoftCut(m_softcutEndcapRotY);
2047 break;
2049 modPars->at(ipar)->setSigma(m_sigmaEndcapRotZ);
2050 modPars->at(ipar)->setSoftCut(m_softcutEndcapRotZ);
2051 break;
2052 default:
2053 break;
2054 }
2055 }
2056 }
2057
2058 //________________________________________________________________________
2060 {
2062 return true;
2063
2064 int nsel = m_moduleSelection.value().size();
2065 for(int i=0;i<nsel;++i)
2066 if(m_moduleSelection.value().at(i) == id)
2067 return true;
2068
2069 return false;
2070 }
2071
2072 //________________________________________________________________________
2074 {
2075 return moduleSelected(mod->identify().get_compact());
2076 }
2077
2078 //________________________________________________________________________
2080 {
2081 ATH_MSG_INFO("---------------------------------------------------");
2082 ATH_MSG_INFO("Summary of the alignment geometry");
2083 ATH_MSG_INFO("Number of alignable objects: "<< m_alignModuleList.size());
2084 for(unsigned int i=0;i<m_alignModuleList.size();i++) {
2085 const Trk::AlignModule* module = m_alignModuleList.at(i);
2086 ATH_MSG_INFO(i<<". "<< module->name());
2087 ATH_MSG_INFO(" - identifier: "<<module->identify());
2088 ATH_MSG_INFO(" - has "<<module->detElementCollection(Trk::AlignModule::Pixel)->size()<<" Pixel modules");
2089
2090 Amg::Transform3D localtoglobal = (module->globalFrameToAlignFrame()).inverse();
2091 ATH_MSG_DEBUG(" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<" "<<localtoglobal.rotation());
2092
2093 DataVector<Trk::AlignPar> * pars = m_alignModuleTool->getAlignPars(module);
2094 int npars = pars->size();
2095 ATH_MSG_DEBUG(" - number of active transform parameters: "<<npars);
2096 for(int j=0;j<npars;j++)
2097 ATH_MSG_DEBUG(" * par "<<j<<" \'"<<(*pars)[j]->dumpType()<<"\' : sigma = "<<(*pars)[j]->sigma()<<" , softCut = "<<(*pars)[j]->softCut());
2098 }
2099 ATH_MSG_INFO("---------------------------------------------------");
2100 }
2101
2102 //________________________________________________________________________
2103 bool PixelGeometryManagerTool::isTopHalf(unsigned int phi, unsigned int layer) const
2104 {
2105 // boundary between top and botom halfs is different for each layer
2106 // B-layer top, phi index from 1 to 10
2107 // B-layer bottom, phi index 0 and from 11 to 21
2108 // Layer-1 top, from 0 to 19
2109 // Layer-1 botttom, from 20 to 37
2110 // Layer-2 top, from 49 to 51 and from 0 to 22
2111 // Layer-2 bottom, from 23 to 48
2112 if (layer==0) {
2113 if (phi>21) {
2114 msg(MSG::ERROR)<<"Layer 0 has only 22 phi modules: range 0-21, requested "<<phi<<endmsg;
2115 return false;
2116 }
2117 return phi>0 && phi<11;
2118 }
2119 else if (layer==1) {
2120 if(phi>37) {
2121 msg(MSG::ERROR)<<"Layer 1 has only 38 phi modules: range 0-37, requested "<<phi<<endmsg;
2122 return false;
2123 }
2124 else if (phi<20)
2125 return true;
2126 else
2127 return false;
2128 }
2129 else if (layer==2) {
2130 if(phi>52) {
2131 msg(MSG::ERROR)<<"Layer 2 has only 52 phi modules: range 0-51, requested "<<phi<<endmsg;
2132 return false;
2133 }
2134 else if (phi<23 || phi>48)
2135 return true;
2136 else
2137 return false;
2138 }
2139
2140 // if we got here layer number is wrong
2141 msg(MSG::ERROR)<<"Pixel barrel only 3 layers: range 0-2, requested "<<layer<<endmsg;
2142 return false;
2143 }
2144
2145 //________________________________________________________________________
2147 {
2148 ATH_MSG_DEBUG(" - translation: "<<tr.translation().x()<<" "<<tr.translation().y()<<" "<<tr.translation().z());
2149 ATH_MSG_DEBUG(" - rotation:");
2150 ATH_MSG_DEBUG(" "<<tr.rotation()(0,0)<<" "<<tr.rotation()(0,1)<<" "<<tr.rotation()(0,2));
2151 ATH_MSG_DEBUG(" "<<tr.rotation()(1,0)<<" "<<tr.rotation()(1,1)<<" "<<tr.rotation()(1,2));
2152 ATH_MSG_DEBUG(" "<<tr.rotation()(2,0)<<" "<<tr.rotation()(2,1)<<" "<<tr.rotation()(2,2));
2153 }
2154
2155 //________________________________________________________________________
2157 {
2158
2159 ATH_MSG_INFO("Decode geometry version key");
2160 DecodeVersionKey versionKey(&*m_geoModelSvc, "Pixel");
2161
2162 const std::string& detectorKey = versionKey.tag();
2163 const std::string& detectorNode = versionKey.node();
2164
2165 ATH_MSG_INFO("--------------------- decode version key " << detectorKey<<" "<<detectorNode);
2166
2167 // Read geometry DB to get NOSKIPZERO value
2168
2169 // StaveIndex corresponding to IBL layer : CAUTION the assumption is made that layer 0 is defined at line 0
2170 IRDBRecordset_ptr geoSet_layer = m_rdbAccessSvc->getRecordsetPtr("PixelLayer", detectorKey, detectorNode);
2171 const IRDBRecord *geoTable_layer = (*geoSet_layer)[0];
2172 int staveIndex=0;
2173 if (!geoTable_layer->isFieldNull("STAVEINDEX")) staveIndex=geoTable_layer->getInt("STAVEINDEX");
2174
2175 // Read NoSkipEtaZero for IBL layer
2176 IRDBRecordset_ptr geoSet_stave = m_rdbAccessSvc->getRecordsetPtr("PixelStave", detectorKey, detectorNode);
2177 const IRDBRecord *geoTable_stave = (*geoSet_stave)[staveIndex];
2178 int noSkipZero=0;
2179 if (!geoTable_stave->isFieldNull("NOSKIPZERO")) noSkipZero=geoTable_stave->getInt("NOSKIPZERO");
2180
2181 return noSkipZero;
2182}
2183
2184} // end namespace
2185
Scalar phi() const
phi method
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_WARNING(x,...)
#define ATH_MSG_INFO(x,...)
#define ATH_MSG_FATAL(x,...)
An STL vector of pointers that by default owns its pointed-to elements.
Definition of the abstract IRDBAccessSvc interface.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
Definition of the abstract IRDBRecord interface.
Definition of the abstract IRDBRecordset interface.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for both the Pixel and SCT subdetectors.
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
Derived DataVector<T>.
Definition DataVector.h:818
const T * at(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
const std::string & tag() const
Return version tag.
const std::string & node() const
Return the version node.
IRDBRecord is one record in the IRDBRecordset object.
Definition IRDBRecord.h:28
virtual bool isFieldNull(std::string_view fieldName) const =0
Check if the field value is NULL.
virtual int getInt(std::string_view fieldName) const =0
Get int field value.
This is a "hash" representation of an Identifier.
Class to hold geometrical description of a silicon detector element.
Gaudi::Property< int > m_alignLevelBarrelProp
property, copied to m_alignLevelBarrel in initialize()
Gaudi::Property< double > m_sigmaBarrelRotX
void buildL15Barrel()
creates L15 AlignModules for Pixel Barrel : 2 half-shells
Gaudi::Property< std::string > m_pixelDetManagerName
void buildL11()
creates L11 IBL as 1 module and old-pixel as 1 module
Gaudi::Property< int > m_alignLevelEndcapsProp
property, copied to m_alignLevelEndcaps in initialize()
void buildL16Barrel()
creates L16 AlignModules for Pixel Barrel : IBL staves , remainder of barrel 1 Module
Gaudi::Property< double > m_softcutEndcapRotY
Gaudi::Property< double > m_softcutEndcapX
void printTransform(const Amg::Transform3D &tr) const
void buildL2DBM()
creates L2 AlignModules for Pixel DBM : 8 telescopes
Gaudi::Property< double > m_softcutBarrelRotZ
PublicToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
pointer to AlignModuleTool
void buildL1DBM()
creates L1 AlignModules for Pixel DBM : 2 endcaps
void buildL3DBM()
creates L2 AlignModules for Pixel DBM : 24 modules
Gaudi::Property< double > m_sigmaEndcapRotZ
void dumpGeometry()
print basic geometry info to screen
DataVector< DataVector< Trk::AlignPar > > * m_fullAlignParList
Gaudi::Property< double > m_sigmaBarrelRotY
Gaudi::Property< double > m_softcutEndcapY
void buildL3Endcaps()
creates L3 AlignModules for Pixel Endcaps : module (wafer) level
PixelGeometryManagerTool(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< double > m_softcutBarrelRotY
void buildGeometry()
builds geometry for Silicon alignment
Gaudi::Property< int > m_alignLevelProp
property, copied to m_alignLevel in initialize()
Gaudi::Property< std::vector< unsigned long long > > m_moduleSelection
Gaudi::Property< double > m_softcutEndcapRotX
const InDetDD::PixelDetectorManager * m_detManager
pointer to PIX detector manager
Gaudi::Property< double > m_sigmaBarrelBowX
void buildL1()
creates L1 AlignModules for Pixel : full Pixel
void buildL2Endcaps()
creates L2 AlignModules for Pixel Endcaps : 2 x 3 disks
Gaudi::Property< double > m_softcutBarrelBowX
bool checkAlignLevelEndcaps()
check whether the alignment level for the endcaps is correct
void buildL2Barrel()
creates L2 AlignModules for Pixel Barrel : 3 layers
Gaudi::Property< double > m_softcutEndcapRotZ
Gaudi::Property< double > m_softcutBarrelY
bool checkAlignLevel()
check whether the alignment level is correct
int getNoSkipEtaValueFromGeometry() const
get sipeta value from geometry DB
void buildL12Barrel()
creates L12 AlignModules for Pixel Barrel : whole barrel as 1 module
void addModuleParameters(Trk::AlignModule *module, DataVector< DataVector< Trk::AlignPar > > *allFullModPars, DataVector< DataVector< Trk::AlignPar > > *allActiveModPars)
adds alignment parameters for the module checks for active parameters and calls setSigmas()
ServiceHandle< IRDBAccessSvc > m_rdbAccessSvc
Gaudi::Property< double > m_softcutBarrelRotX
Gaudi::Property< double > m_softcutEndcapZ
void buildL2ITkEndcaps()
creates L2 AlignModules for ITk Pixel Endcaps : 2 x 9 disks
void buildL26Barrel()
creates L26 AlignModules for Pixel Barrel : IBL staves remainder at L2
ServiceHandle< IGeoModelSvc > m_geoModelSvc
Gaudi::Property< double > m_sigmaEndcapRotY
void buildL3Barrel()
creates L3 AlignModules for Pixel Barrel : module (wafer) level
void setAlignLevel(int level)
set alignment level
bool isTopHalf(unsigned int phi, unsigned int layer) const
Checks whether the given phi module in a given barrel layer belongs to top or bottom half.
bool checkAlignLevelBarrel()
check whether the alignment level for the barrel is correct
int m_etaCorrection
eta correction value needed when IBL is present
Gaudi::Property< double > m_sigmaEndcapRotX
void setSigmas(Trk::AlignModule *mod, DataVector< Trk::AlignPar > *modPars)
sets sigmas for modules
const PixelID * m_idHelper
pointer to PIX detector manager
DataVector< DataVector< Trk::AlignPar > > * m_alignParList
void buildL12Endcaps()
creates L12 AlignModules for Pixel Barrel : 2 endcaps
Gaudi::Property< double > m_softcutBarrelZ
int ReadGeometry(int solveLevel)
read the geometry Method is called from the main AlignAlg to build the geometry based on the requeste...
void buildL27Barrel()
creates L27 AlignModules for Pixel Barrel : 112 staves (ladders)
bool moduleSelected(Trk::AlignModule *mod)
check wheather module is selected for module pointer
Gaudi::Property< double > m_softcutBarrelX
std::vector< Trk::AlignModuleList * > m_idHashToAlignModuleMaps
void buildL22Barrel()
creates L22 AlignModules for Pixel Barrel : 6 half-layers
Gaudi::Property< double > m_sigmaBarrelRotZ
static Amg::Vector3D centerOfGravity(const std::vector< DetElementCollection * > &)
Calculates center of gravity (average center of associated det-elements).
void setIdHash(IdentifierHash id)
Definition AlignModule.h:94
void setGlobalFrameToAlignFrameTransform(const Amg::Transform3D &t)
set global to alignment frame transforms
void setIdentifier(Identifier identifier)
Set and return identifier of module.
Definition AlignModule.h:97
const std::string & name() const
Definition AlignModule.h:90
void setName(const std::string &name)
Set and return name of align module (i.e.
Definition AlignModule.h:89
void addDetElement(AlignModule::DetectorType detType, const TrkDetElementBase *det, const Amg::Transform3D &transform, Identifier id=Identifier())
used to add a detector element to the align module with a align frame to detector element local frame...
int m_alignLevelBarrel
alignment level
virtual int getNextIDHash()
get next free IDHash usable for new AlignModule
Trk::AlignModuleList * m_alignModuleListPtr
pointer to module list to which the modules are added
int m_alignLevelEndcaps
alignment level
std::vector< Trk::AlignModuleList * > * m_idHashToAlignModuleMapsPtr
pointer to vector of hashMaps to which the elements are added
This is the base class for all tracking detector elements with read-out relevant information.
virtual const Amg::Transform3D & transform() const =0
Return local to global transform.
virtual IdentifierHash identifyHash() const =0
Identifier hash.
Eigen::Affine3d Transform3D
Eigen::Translation< double, 3 > Translation3D
Message Stream Member.
Primary Vertex Finder.
@ OWN_ELEMENTS
this data object owns its elements
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
std::vector< AlignModule * > AlignModuleList
Definition index.py:1
MsgStream & msg
Definition testRead.cxx:32