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