ATLAS Offline Software
SCTGeometryManagerTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
9 
10 #include "InDetIdentifier/SCT_ID.h"
11 
13 
16 #include "TrkAlignEvent/AlignPar.h"
17 
18 
19 
21 
22 
23 #include <iostream>
24 
25 using namespace InDetDD;
26 
27 namespace InDet {
28 
29  //________________________________________________________________________
30  SCTGeometryManagerTool::SCTGeometryManagerTool(const std::string& type,
31  const std::string& name,
32  const IInterface * parent)
34  , m_detManager(nullptr)
35  , m_idHelper()
36  , m_alignModuleTool("Trk::AlignModuleTool/AlignModuleTool")
37  , m_idHashToAlignModuleMaps(Trk::AlignModule::NDetectorTypes,(Trk::AlignModuleList*)nullptr)
38  , m_alignParList(nullptr)
39  , m_fullAlignParList(nullptr)
40  {
41  declareInterface<IGeometryManagerTool>(this);
42  declareProperty("AlignModuleTool", m_alignModuleTool);
43 
44  // Pixel joboptions
45  declareProperty("AlignBarrel", m_alignBarrel = true);
46  declareProperty("AlignEndcaps", m_alignEndcaps = true);
47 
48  declareProperty("AlignBarrelX", m_alignBarrelX = true);
49  declareProperty("AlignBarrelY", m_alignBarrelY = true);
50  declareProperty("AlignBarrelZ", m_alignBarrelZ = true);
51  declareProperty("AlignBarrelRotX", m_alignBarrelRotX = true);
52  declareProperty("AlignBarrelRotY", m_alignBarrelRotY = true);
53  declareProperty("AlignBarrelRotZ", m_alignBarrelRotZ = true);
54 
55  declareProperty("AlignEndcapX", m_alignEndcapX = true);
56  declareProperty("AlignEndcapY", m_alignEndcapY = true);
57  declareProperty("AlignEndcapZ", m_alignEndcapZ = true);
58  declareProperty("AlignEndcapRotX", m_alignEndcapRotX = true);
59  declareProperty("AlignEndcapRotY", m_alignEndcapRotY = true);
60  declareProperty("AlignEndcapRotZ", m_alignEndcapRotZ = true);
61 
62  declareProperty("SetSigmaBarrelX", m_sigmaBarrelX = 1.);
63  declareProperty("SetSigmaBarrelY", m_sigmaBarrelY = 1.);
64  declareProperty("SetSigmaBarrelZ", m_sigmaBarrelZ = 1.);
65  declareProperty("SetSigmaBarrelRotX", m_sigmaBarrelRotX = 0.001);
66  declareProperty("SetSigmaBarrelRotY", m_sigmaBarrelRotY = 0.001);
67  declareProperty("SetSigmaBarrelRotZ", m_sigmaBarrelRotZ = 0.001);
68 
69  declareProperty("SetSigmaEndcapX", m_sigmaEndcapX = 1.);
70  declareProperty("SetSigmaEndcapY", m_sigmaEndcapY = 1.);
71  declareProperty("SetSigmaEndcapZ", m_sigmaEndcapZ = 1.);
72  declareProperty("SetSigmaEndcapRotX", m_sigmaEndcapRotX = 0.001);
73  declareProperty("SetSigmaEndcapRotY", m_sigmaEndcapRotY = 0.001);
74  declareProperty("SetSigmaEndcapRotZ", m_sigmaEndcapRotZ = 0.001);
75 
76  declareProperty("SetSoftCutBarrelX", m_softcutBarrelX = 1.);
77  declareProperty("SetSoftCutBarrelY", m_softcutBarrelY = 1.);
78  declareProperty("SetSoftCutBarrelZ", m_softcutBarrelZ = 1.);
79  declareProperty("SetSoftCutBarrelRotX", m_softcutBarrelRotX = 1.);
80  declareProperty("SetSoftCutBarrelRotY", m_softcutBarrelRotY = 1.);
81  declareProperty("SetSoftCutBarrelRotZ", m_softcutBarrelRotZ = 1.);
82 
83  declareProperty("SetSoftCutEndcapX", m_softcutEndcapX = 1.);
84  declareProperty("SetSoftCutEndcapY", m_softcutEndcapY = 1.);
85  declareProperty("SetSoftCutEndcapZ", m_softcutEndcapZ = 1.);
86  declareProperty("SetSoftCutEndcapRotX", m_softcutEndcapRotX = 1.);
87  declareProperty("SetSoftCutEndcapRotY", m_softcutEndcapRotY = 1.);
88  declareProperty("SetSoftCutEndcapRotZ", m_softcutEndcapRotZ = 1.);
89 
90  // defines alignment level
91  declareProperty("AlignmentLevel", m_alignLevel = 1);
92  declareProperty("AlignmentLevelBarrel", m_alignLevelBarrel = -1);
93  declareProperty("AlignmentLevelEndcaps", m_alignLevelEndcaps = -1);
94 
95  declareProperty("doModuleSelection", m_doModuleSelection = false);
96  declareProperty("ModuleSelection", m_moduleSelection);
97 
98  declareProperty("UseOldL2", m_useOldL2 = false);
99  declareProperty("DumpGeometry", m_dumpGeometry = true);
100 
101  m_hashCounter = 0;
102  m_logStream = nullptr;
103  }
104 
105  //________________________________________________________________________
107  {
108  ATH_MSG_DEBUG("deleting alignModuleList");
109  for (int i=0;i<(int)m_alignModuleList.size();i++)
110  delete m_alignModuleList[i];
111  m_alignModuleList.clear();
112 
113  ATH_MSG_DEBUG("deleting fullAlignParList");
114  delete m_fullAlignParList;
115  ATH_MSG_DEBUG("deleting alignParList");
116  delete m_alignParList;
117  }
118 
119  //________________________________________________________________________
121  {
122  ATH_MSG_DEBUG("initialize() of SCTGeometryManagerTool");
123 
124  // retrieve AlignModuleTool
125  if ( m_alignModuleTool.retrieve().isFailure() ) {
126  msg(MSG::FATAL)<<"Could not get " << m_alignModuleTool << endmsg;
127  return StatusCode::FAILURE;
128  }
129  else
130  ATH_MSG_INFO("Retrieved " << m_alignModuleTool);
131 
132  // retrieve SCT helper
133  if ( detStore()->retrieve(m_idHelper).isFailure() ) {
134  msg(MSG::FATAL) << " Cannot retrieve SCT Helper " << endmsg;
135  return StatusCode::FAILURE;
136  }
137  else
138  ATH_MSG_INFO("retrieved Silicon SCT Helper");
139 
140  // retrieve SCT detector manager
141  if ( detStore()->retrieve(m_detManager, "SCT").isFailure() ) {
142  msg(MSG::FATAL) << " Cannot retrieve SCT Detector Manager " << endmsg;
143  return StatusCode::FAILURE;
144  }
145  else
146  ATH_MSG_INFO("retrieved SCT Detector Manager");
147 
148  // dump module selection
149  if(m_doModuleSelection && msgLvl(MSG::INFO)) {
150  msg(MSG::INFO)<<"Creating geometry for selected "<<m_moduleSelection.size()<<" modules:"<<endmsg;
151  for(unsigned int i=0;i<m_moduleSelection.size();i++)
152  msg(MSG::INFO)<<" "<<i<<". "<<m_moduleSelection.at(i)<<endmsg;
153  }
154 
155  // check the allowed geometry levels
156  if(!checkAlignLevel())
157  return StatusCode::FAILURE;
158 
159  return StatusCode::SUCCESS;
160  }
161 
162  //________________________________________________________________________
164  {
165  ATH_MSG_DEBUG("finalize() of SCTGeometryManagerTool");
166 
167  return StatusCode::SUCCESS;
168  }
169 
170  //________________________________________________________________________
172  {
175  }
176 
177  //________________________________________________________________________
179  {
180  if(m_alignLevel == 0) {
181  ATH_MSG_INFO("Alignment level for SCT is "<<m_alignLevel);
182  return true;
183  }
184 
185  if(m_alignLevel == 2 && m_useOldL2) {
186  ATH_MSG_INFO("Setting up OLD L2 alignment level for SCT");
189  return true;
190  }
191 
192  if(m_alignLevelBarrel == -1)
194 
195  if(m_alignLevelEndcaps == -1)
197 
199 
200  // if the alignment level for barrel and EC is set correctly
201  // reset the global alignment level
202  if(ok)
203  m_alignLevel = -1;
204 
205  return ok;
206  }
207 
208  //________________________________________________________________________
210  {
211  if(!m_alignBarrel)
212  return true;
213 
214  // check whether geometry level is allowed
215  switch(m_alignLevelBarrel) {
216  case 1: case 2: case 27: case 3:
217  ATH_MSG_INFO("Alignment level for SCT Barrel is "<<m_alignLevelBarrel);
218  return true;
219  default:
220  msg(MSG::FATAL)<<"Alignment level "<<m_alignLevelBarrel<<" does not exist for SCT Barrel"<<endmsg;
221  return false;
222  }
223  }
224 
225  //________________________________________________________________________
227  {
228  if(!m_alignEndcaps)
229  return true;
230 
231  // check whether geometry level is allowed
232  switch(m_alignLevelEndcaps) {
233  case 1: case 2: case 25: case 3:
234  ATH_MSG_INFO("Alignment level for SCT Endcaps is "<<m_alignLevelBarrel);
235  return true;
236  default:
237  msg(MSG::FATAL)<<"Alignment level "<<m_alignLevelEndcaps<<" does not exist for SCT Endcaps"<<endmsg;
238  return false;
239  }
240  }
241 
242  //________________________________________________________________________
244  {
245  ATH_MSG_DEBUG("in ReadGeometry() solveLevel="<<solveLevel);
246 
247  // set pointers
250 
251  // build alignment geometry
252  buildGeometry();
253 
254  // now set the alignment parameters
255  // first prepare the parameter lists
258  // loop over modules
259  ATH_MSG_DEBUG("Adding module parameters to modules");
260  std::vector<Trk::AlignModule *>::const_iterator imod = m_alignModuleList.begin();
261  std::vector<Trk::AlignModule *>::const_iterator imod_end = m_alignModuleList.end();
262  for( ; imod!=imod_end ; ++imod)
264 
265  // set alignModuleList and hash table in the alignModuleTool
267  ATH_MSG_DEBUG(" geometry set in m_alignModuleTool");
268 
269  // set alignPar lists in the alignModuleTool
270  ATH_MSG_DEBUG(" alignParList = "<<m_alignParList);
271  ATH_MSG_DEBUG(" fullAlignParList = "<<m_fullAlignParList);
273  ATH_MSG_DEBUG(" AlignParLists set in m_alignModuleTool");
274 
275  // dump summary about the geometry setup
276  if (m_dumpGeometry)
277  dumpGeometry();
278 
279  int nDoF= m_alignModuleTool->nAlignParameters();
280  ATH_MSG_INFO("Total number of degrees of freedom: "<<nDoF);
281 
282  return nDoF;
283  }
284 
285  //_______________________________________________________________________
287  {
288  ATH_MSG_INFO("Preparing the SCT geometry");
289 
290  if(m_alignLevel == 0)
291  buildL0();
292  else if (m_alignLevel == 2 && m_useOldL2)
293  buildL2Old();
294  else {
295 
296  if(m_alignBarrel)
297  switch(m_alignLevelBarrel) {
298  case 1:
299  buildL1Barrel();
300  break;
301  case 2:
302  buildL2Barrel();
303  break;
304  case 27:
305  buildL27Barrel();
306  break;
307  case 3:
308  buildL3Barrel();
309  break;
310  default:
311  break;
312  }
313 
314  if(m_alignEndcaps)
315  switch(m_alignLevelEndcaps) {
316  case 1:
317  buildL1Endcaps();
318  break;
319  case 2:
320  buildL2Endcaps();
321  break;
322  case 25:
323  buildL25Endcaps();
324  break;
325  case 3:
326  buildL3Endcaps();
327  break;
328  default:
329  break;
330  }
331 
332  }
333  }
334 
335  //_______________________________________________________________________
337  {
338  ATH_MSG_INFO("Preparing the SCT geometry for L0: the whole SCT");
339  // ===================================================
340  // Level 0 is just one module containing the whole SCT
341 
342  Trk::AlignModule * sct = new Trk::AlignModule(this);
343  sct->setIdHash(getNextIDHash());
344  sct->setName("SCT");
345 
346  // use the identifier of the SCT barrel for the whole SCT at L0
347  sct->setIdentifier(m_idHelper->wafer_id(0,0,0,0,0));
348 
349  ATH_MSG_DEBUG("Created module "<<sct->name()<<" idHash: "<<sct->identifyHash()<<" identifier: "<<sct->identify());
350 
351  // for L0 alignment the alignment frame is equal to the global frame
352  // and since the SCT detector element positions are also stored
353  // in the global frame in DB, transform is identity
354  const Amg::Transform3D transform = Amg::Transform3D::Identity();
355 
356  // get maximum number of elements from the helper
357  unsigned int sctmaxHash = m_idHelper->wafer_hash_max();
358  ATH_MSG_DEBUG("maxHash for the SCT: "<<sctmaxHash);
359 
361  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(sctmaxHash),nullptr);
363 
364  // ================================================================
365  // loop over SCT elements and add them to respective alignModules
366  // ================================================================
367  for (unsigned int index = 0; index < sctmaxHash; index++) {
368  IdentifierHash idHash = index;
369  Identifier id = m_idHelper->wafer_id(idHash);
370 
371  ATH_MSG_DEBUG(" SCT DetectorElement idhash: "<<index);
372  ATH_MSG_DEBUG(" DetectorElement id: "<<id);
373 
374  // get the element via hash
376  if (element2) {
377  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
378 
379  // add element to respective AlignModule
380 
381  // add to the sct barrel structure
382  if(msgLvl(MSG::DEBUG)) {
383  if (m_idHelper->is_barrel(id))
384  msg(MSG::DEBUG)<<"... SCT barrel element"<<endmsg;
385  else
386  msg(MSG::DEBUG)<<"... SCT endcap element"<<endmsg;
387  }
389 
390  // and fill the corresponding map
391  (*sctIdHashMap)[idHash] = sct;
392  }
393  else
394  ATH_MSG_DEBUG("No SCT detector with id: "<<id);
395  }
396 
397  // add created module to the geometry
398  m_alignModuleListPtr->push_back(sct);
399 
400  ATH_MSG_DEBUG("SCT L0 module successfully added to the geometry");
401  }
402 
403  //_______________________________________________________________________
405  {
406  // ===========================
407  // BARREL
408  // ===========================
409  ATH_MSG_INFO("Preparing the SCT Barrel geometry for L1: barrel + 2 endcaps");
410 
411  // ========================================
412  // Level 1 is whole SCT barrel
413 
414  // get maximum number of elements from the helper
415  unsigned int maxHash = m_idHelper->wafer_hash_max();
416  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
417 
419  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
421 
422  // use the 'real' identifier of the Pixel
423  // build barrel module
424  Trk::AlignModule * mod = new Trk::AlignModule(this);
425  mod->setIdHash(getNextIDHash());
426  mod->setName("SCT Barrel");
427  mod->setIdentifier(m_idHelper->wafer_id(0,0,0,0,0));
428 
429  // check if selected
430  if(!m_alignBarrel || !moduleSelected(mod)) {
431  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
432  delete mod;
433  return;
434  }
435 
436  // fill module with detector elements
437  ATH_MSG_DEBUG("Building module "<<mod->name());
438 
439  const Amg::Transform3D transform = Amg::Transform3D::Identity();
440 
441  for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
442  if (!m_detManager->numerology().useLayer(iLayer))
443  ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
444 
445  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
446  ATH_MSG_DEBUG("iPhi "<<iPhi);
447  for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
448  ATH_MSG_DEBUG("iEta "<<iEta);
449 
450  if (!iEta && m_detManager->numerology().skipEtaZeroForLayer(iLayer))
451  // iEta=0 is not defined for the SCT
452  continue;
453 
454  for (int is = 0; is < 2; is++) { // module side
455 
456  const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
457  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
458 
459  if (element) {
460  // get element location for debugging
461  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
462  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
463  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
464 
465  // add element to the AlignModule
466  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
467  // and fill the corresponding map
468  (*sctIdHashMap)[element->identifyHash()] = mod;
469  }
470  }
471  }
472  }
473  }
474 
475  m_alignModuleListPtr->push_back(mod);
476 
477  ATH_MSG_DEBUG("SCT Barrel successfully added to the geometry");
478  }
479 
480  //_______________________________________________________________________
482  {
483  // ===========================
484  // ENDCAPs
485  // ===========================
486  ATH_MSG_INFO("Preparing the SCT Endcap geometry for L1: 2 endcaps");
487 
488  // ========================================
489  // Level 1 is 2 SCT endcaps
490 
491  // get maximum number of elements from the helper
492  unsigned int maxHash = m_idHelper->wafer_hash_max();
493  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
494 
496  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
498 
499  for (int iEndcapIndex = 0; iEndcapIndex < m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
500  int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
501 
502  Trk::AlignModule * mod = new Trk::AlignModule(this);
503  mod->setIdHash(getNextIDHash());
504  mod->setIdentifier(m_idHelper->wafer_id(iSide,0,0,0,0));
505  if(iEndcapIndex == 0)
506  mod->setName("SCT EndCap A");
507  else
508  mod->setName("SCT EndCap C");
509 
510  if(!m_alignEndcaps || !moduleSelected(mod)) {
511  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
512  delete mod;
513  continue;
514  }
515 
516  ATH_MSG_DEBUG("Building module "<<mod->name());
517 
518  const Amg::Transform3D transform = Amg::Transform3D::Identity();
519 
520  for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
521  if (!m_detManager->numerology().useDisk(iWheel))
522  ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
523 
524  for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
525  ATH_MSG_DEBUG("iEta "<<iEta);
526  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
527  ATH_MSG_DEBUG("iPhi "<<iPhi);
528  for(int is=0; is<2; is++) { // module side
529 
530  const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
531  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
532  if (element) {
533  // get element location for debugging
534  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
535  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
536  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
537 
538  // add element to the AlignModule
539  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
540  // and fill the corresponding map
541  (*sctIdHashMap)[element->identifyHash()] = mod;
542  }
543  }
544  }
545  }
546  }
547 
548  // for endcap we move the CoG
549  Amg::Translation3D translation(mod->centerOfGravity());
550  ATH_MSG_DEBUG("Endcap:" << iSide << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
551  Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
552 
553  mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
554 
555  m_alignModuleListPtr->push_back(mod);
556  }
557 
558  ATH_MSG_DEBUG("SCT End-caps successfully added to the geometry");
559  }
560 
561  //_______________________________________________________________________
563  {
564  // ========================================
565  // BARREL
566  ATH_MSG_INFO("Preparing the SCT Barrel geometry for L2: 4 layers");
567 
568  // ========================================
569  // get all modules for Level 2 alignment of the Barrel
570  // Level 2 is 4 SCT barrel layers
571 
572  const Amg::Transform3D transform = Amg::Transform3D::Identity();
573 
574  unsigned int maxHash = m_idHelper->wafer_hash_max();
575  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
576 
578  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
580 
581  for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
582  if (!m_detManager->numerology().useLayer(iLayer))
583  ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
584 
585  // create the AlignModule
586  Trk::AlignModule * mod = new Trk::AlignModule(this);
587  mod->setIdHash(getNextIDHash());
588  mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, 0, 0, 0));
589 
590  std::stringstream name;
591  name <<"SCT/Barrel/Layer_"<<iLayer;
592  mod->setName(name.str());
593 
594  if(!m_alignBarrel || !moduleSelected(mod)) {
595  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
596  delete mod;
597  continue;
598  }
599 
600  ATH_MSG_DEBUG("Building module "<<mod->name());
601 
602  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
603  ATH_MSG_DEBUG("iPhi "<<iPhi);
604  for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
605  ATH_MSG_DEBUG("iEta "<<iEta);
606  if (!iEta && m_detManager->numerology().skipEtaZeroForLayer(iLayer))
607  // iEta=0 is not defined for the SCT
608  continue;
609  for (int is = 0; is < 2; is++) { // module side
610 
611  const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
612  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
613 
614  if (element) {
615  // get element location for debugging
616  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
617  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
618  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
619 
620  // add element to the AlignModule
621  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
622  // and fill the corresponding map
623  (*sctIdHashMap)[element->identifyHash()] = mod;
624  }
625  }
626  }
627  }
628 
629  m_alignModuleListPtr->push_back(mod);
630  }
631  }
632 
633  //_______________________________________________________________________
635  {
636  // ========================================
637  // BARREL
638  ATH_MSG_INFO("Preparing the SCT Barrel geometry for L27: 176 staves (ladders)");
639 
640  if(!m_alignBarrel) {
641  ATH_MSG_DEBUG("Not aligning barrel");
642  return;
643  }
644 
645  // ========================================
646  // get all modules for Level 27 alignment of the Barrel
647  // 176 staves (ladders)
648 
649  const Amg::Transform3D transform = Amg::Transform3D::Identity();
650 
651  unsigned int maxHash = m_idHelper->wafer_hash_max();
652  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
653 
655  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
657 
658  for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
659  if (!m_detManager->numerology().useLayer(iLayer))
660  ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
661  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
662  ATH_MSG_DEBUG("iPhi "<<iPhi);
663 
664  // create the AlignModule
665  Trk::AlignModule * mod = new Trk::AlignModule(this);
666  mod->setIdHash(getNextIDHash());
667 
668  // even though there is no iEta=0 module for SCT barrel, the
669  // Identifier is still valid so we use it for the stave
670  mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, iPhi, 0, 0));
671 
672  std::stringstream name;
673  name <<"SCT/Barrel/Layer_"<<iLayer<<"/PhiStave_"<<iPhi;
674  mod->setName(name.str());
675 
676  if(!moduleSelected(mod)) {
677  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
678  delete mod;
679  continue;
680  }
681 
682  ATH_MSG_DEBUG("Building module "<<mod->name());
683 
684  // rotation of the stave alignment frame
685  Amg::RotationMatrix3D rotation; rotation.setIdentity();
686 
687  for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
688  ATH_MSG_DEBUG("iEta "<<iEta);
689  if (!iEta && m_detManager->numerology().skipEtaZeroForLayer(iLayer))
690  // iEta=0 is not defined for the SCT
691  continue;
692  for (int is = 0; is < 2; is++) { // module side
693 
694  const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
695  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
696 
697  if (element) {
698  // get element location for debugging
699  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
700  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
701  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
702 
703  // add element to the AlignModule
704  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
705  // and fill the corresponding map
706  (*sctIdHashMap)[element->identifyHash()] = mod;
707  }
708 
709  // for the stave alignment frame rotation we use the one of the iEta=1
710  // non-stereo side (which is the module local frame)
711  if(iEta==1 && !element2->isStereo())
712  rotation = element2->moduleTransform().rotation();
713  }
714  }
715 
716  // we set the alignment frame to be the CoG of the stave
717  // with rotation being the one of the iEta=1 module set above
718  Amg::Translation3D translation(mod->centerOfGravity());
719  Amg::Transform3D localToGlobal = translation * rotation;
720 
721 
722  ATH_MSG_DEBUG("Prepared local to global transform :");
723  ATH_MSG_DEBUG(" - translation: "<<localToGlobal.translation().x()<<" "<<localToGlobal.translation().y()<<" "<<localToGlobal.translation().z());
724  ATH_MSG_DEBUG(" - rotation:");
725  ATH_MSG_DEBUG(" "<<localToGlobal.rotation()(0,0)<<" "<<localToGlobal.rotation()(0,1)<<" "<<localToGlobal.rotation()(0,2));
726  ATH_MSG_DEBUG(" "<<localToGlobal.rotation()(1,0)<<" "<<localToGlobal.rotation()(1,1)<<" "<<localToGlobal.rotation()(1,2));
727  ATH_MSG_DEBUG(" "<<localToGlobal.rotation()(2,0)<<" "<<localToGlobal.rotation()(2,1)<<" "<<localToGlobal.rotation()(2,2));
728 
729  mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
730 
731  m_alignModuleListPtr->push_back(mod);
732  }
733  }
734  }
735 
736  //_______________________________________________________________________
738  {
739  // ========================================
740  // END CAPS
741  ATH_MSG_INFO("Preparing the SCT Endcap geometry for L2: 2 x 9 disks");
742 
743  // ========================================
744  // get all modules for Level 2 alignment of the Endcaps
745  // Level 2 is 2 x 9 SCT Endcap disks
746 
747  const Amg::Transform3D transform = Amg::Transform3D::Identity();
748 
749  unsigned int maxHash = m_idHelper->wafer_hash_max();
750  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
751 
753  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
755 
756  for (int iEndcapIndex = 0; iEndcapIndex < m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
757  int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
758  for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
759  if (!m_detManager->numerology().useDisk(iWheel))
760  ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
761 
762  Trk::AlignModule * mod = new Trk::AlignModule(this);
763  mod->setIdHash(getNextIDHash());
764  mod->setIdentifier(m_idHelper->wafer_id(iSide,iWheel,0,0,0));
765 
766  std::stringstream name;
767  if(iEndcapIndex == 0)
768  name <<"SCT/EndcapA/Disk_" << iWheel;
769  else
770  name <<"SCT/EndcapC/Disk_" << iWheel;
771  mod->setName(name.str());
772 
773  if(!m_alignEndcaps || !moduleSelected(mod)) {
774  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
775  delete mod;
776  continue;
777  }
778 
779  ATH_MSG_DEBUG("Building module "<<mod->name());
780 
781  for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
782  ATH_MSG_DEBUG("iEta "<<iEta);
783  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
784  ATH_MSG_DEBUG("iPhi "<<iPhi);
785  for(int is=0; is<2; is++) { // module side
786 
787  const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
788  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
789  if (element) {
790  // get element location for debugging
791  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
792  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
793  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
794 
795  // add element to the AlignModule
796  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
797  // and fill the corresponding map
798  (*sctIdHashMap)[element->identifyHash()] = mod;
799  }
800  }
801  }
802  }
803 
804  // for endcap we move the CoG
805  Amg::Translation3D translation(mod->centerOfGravity());
806  ATH_MSG_DEBUG("Endcap:" << iSide << " , disk: " << iWheel << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
807  Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
808  mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
809 
810  m_alignModuleListPtr->push_back(mod);
811  }
812  }
813  }
814 
815  //_______________________________________________________________________
817  {
818  // ========================================
819  // END CAPS
820  ATH_MSG_INFO("Preparing the SCT Endcap geometry for L25: 2 x 22 rings");
821 
822  if(!m_alignEndcaps) {
823  ATH_MSG_DEBUG("Not aligning endcaps");
824  return;
825  }
826 
827  // ========================================
828  // get all modules for Level 2 alignment of the Endcaps
829  // 2 x 22 SCT Endcap rings
830 
831  const Amg::Transform3D transform = Amg::Transform3D::Identity();
832 
833  unsigned int maxHash = m_idHelper->wafer_hash_max();
834  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
835 
837  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
839 
840  for (int iEndcapIndex = 0; iEndcapIndex < m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
841  int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
842  for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
843  if (!m_detManager->numerology().useDisk(iWheel))
844  ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
845  for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
846  ATH_MSG_DEBUG("iEta "<<iEta);
847 
848  Trk::AlignModule * mod = new Trk::AlignModule(this);
849  mod->setIdHash(getNextIDHash());
850  mod->setIdentifier(m_idHelper->wafer_id(iSide,iWheel,iEta,0,0));
851 
852  std::stringstream name;
853  if(iEndcapIndex == 0)
854  name <<"SCT/EndcapA/Disk_"<<iWheel<<"/Ring_"<<iEta;
855  else
856  name <<"SCT/EndcapC/Disk_"<<iWheel<<"/Ring_"<<iEta;
857  mod->setName(name.str());
858 
859  if(!moduleSelected(mod)) {
860  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
861  delete mod;
862  continue;
863  }
864 
865  ATH_MSG_DEBUG("Building module "<<mod->name());
866 
867  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
868  ATH_MSG_DEBUG("iPhi "<<iPhi);
869  for(int is=0; is<2; is++) { // module side
870 
871  const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
872  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
873  if (element) {
874  // get element location for debugging
875  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
876  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
877  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
878 
879  // add element to the AlignModule
880  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
881  // and fill the corresponding map
882  (*sctIdHashMap)[element->identifyHash()] = mod;
883  }
884  }
885  }
886 
887  // for endcap we move the CoG
888 
889 
890 
891  Amg::Translation3D translation(mod->centerOfGravity());
892  ATH_MSG_DEBUG("Endcap:" << iSide << " , disk: " << iWheel << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
893  Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
894  mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
895 
896  m_alignModuleListPtr->push_back(mod);
897  }
898  }
899  }
900  }
901 
902  //_______________________________________________________________________
904  {
905  ATH_MSG_INFO("Preparing the old SCT Barrel geometry for L2: 4 barrel layers + 2 x 9 endcap disks");
906 
907  const Amg::Transform3D transform = Amg::Transform3D::Identity();
908 
909  unsigned int maxHash = m_idHelper->wafer_hash_max();
910  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
911 
913  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
915 
916  // first endcaap C
917  int iEndcapIndex = 1;
918  int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
919  for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
920  if (!m_detManager->numerology().useDisk(iWheel))
921  ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
922 
923  Trk::AlignModule * mod = new Trk::AlignModule(this);
924  mod->setIdHash(getNextIDHash());
925  mod->setIdentifier(m_idHelper->wafer_id(iSide,iWheel,0,0,0));
926 
927  std::stringstream name;
928  name <<"SCT/EndcapC/Disk_" << iWheel;
929  mod->setName(name.str());
930 
931  if(!m_alignEndcaps || !moduleSelected(mod)) {
932  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
933  delete mod;
934  continue;
935  }
936 
937  ATH_MSG_DEBUG("Building module "<<mod->name());
938 
939  for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
940  ATH_MSG_DEBUG("iEta "<<iEta);
941  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
942  ATH_MSG_DEBUG("iPhi "<<iPhi);
943  for(int is=0; is<2; is++) { // module side
944  const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
945  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
946  if (element) {
947  // get element location for debugging
948  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
949  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
950  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
951 
952  // add element to the AlignModule
953  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
954  // and fill the corresponding map
955  (*sctIdHashMap)[element->identifyHash()] = mod;
956  }
957  }
958  }
959  }
960 
961  // for endcap we move the CoG
962  Amg::Translation3D translation(mod->centerOfGravity());
963  ATH_MSG_DEBUG("Endcap:" << iSide << " , disk: " << iWheel << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
964  Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
965  mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
966 
967  m_alignModuleListPtr->push_back(mod);
968  }
969 
970  // now barrel
971  for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
972  if (!m_detManager->numerology().useLayer(iLayer))
973  ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
974 
975  // create the AlignModule
976  Trk::AlignModule * mod = new Trk::AlignModule(this);
977  mod->setIdHash(getNextIDHash());
978  mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, 0, 0, 0));
979 
980  std::stringstream name;
981  name <<"SCT/Barrel/Layer_"<<iLayer;
982  mod->setName(name.str());
983 
984  if(!m_alignBarrel || !moduleSelected(mod)) {
985  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
986  delete mod;
987  continue;
988  }
989 
990  ATH_MSG_DEBUG("Building module "<<mod->name());
991 
992  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
993  ATH_MSG_DEBUG("iPhi "<<iPhi);
994  for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
995  ATH_MSG_DEBUG("iEta "<<iEta);
996  if (!iEta && m_detManager->numerology().skipEtaZeroForLayer(iLayer))
997  // iEta=0 is not defined for the SCT
998  continue;
999  for (int is = 0; is < 2; is++) { // module side
1000 
1001  const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
1002  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
1003 
1004  if (element) {
1005  // get element location for debugging
1006  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
1007  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
1008  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
1009 
1010  // add element to the AlignModule
1011  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
1012  // and fill the corresponding map
1013  (*sctIdHashMap)[element->identifyHash()] = mod;
1014  }
1015  }
1016  }
1017  }
1018 
1019  m_alignModuleListPtr->push_back(mod);
1020  }
1021 
1022  // and endcaap A
1023  iEndcapIndex = 0;
1024  iSide = m_detManager->numerology().endcapId(iEndcapIndex);
1025  for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
1026  if (!m_detManager->numerology().useDisk(iWheel))
1027  ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
1028 
1029  Trk::AlignModule * mod = new Trk::AlignModule(this);
1030  mod->setIdHash(getNextIDHash());
1031  mod->setIdentifier(m_idHelper->wafer_id(iSide,iWheel,0,0,0));
1032 
1033  std::stringstream name;
1034  name <<"SCT/EndcapA/Disk_" << iWheel;
1035  mod->setName(name.str());
1036 
1037  if(!m_alignEndcaps || !moduleSelected(mod)) {
1038  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1039  delete mod;
1040  continue;
1041  }
1042 
1043  ATH_MSG_DEBUG("Building module "<<mod->name());
1044 
1045  for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1046  ATH_MSG_DEBUG("iEta "<<iEta);
1047  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1048  ATH_MSG_DEBUG("iPhi "<<iPhi);
1049  for(int is=0; is<2; is++) { // module side
1050  const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
1051  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
1052  if (element) {
1053  // get element location for debugging
1054  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
1055  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
1056  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
1057 
1058  // add element to the AlignModule
1059  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
1060  // and fill the corresponding map
1061  (*sctIdHashMap)[element->identifyHash()] = mod;
1062  }
1063  }
1064  }
1065  }
1066 
1067  // for endcap we move the CoG
1068  Amg::Translation3D translation(mod->centerOfGravity());
1069  ATH_MSG_DEBUG("Endcap:" << iSide << " , disk: " << iWheel << " , CoG (" << translation.x() << " , " << translation.y() << " , " << translation.z() << " ) " );
1070 
1071  Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1072 
1073  mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1074 
1075  m_alignModuleListPtr->push_back(mod);
1076  }
1077  }
1078 
1079  //_______________________________________________________________________
1081  {
1082  // ========================================
1083  // BARREL
1084  ATH_MSG_INFO("Preparing the SCT Barrel geometry for L3: module (bi-wafer) level");
1085 
1086  // =========================================
1087  // get all modules for SCT Barrel Level 3 alignment
1088  // 2112 modules
1089 
1090  unsigned int maxHash = m_idHelper->wafer_hash_max();
1091  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
1092 
1094  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
1096 
1097  for (int iLayer = 0; iLayer < m_detManager->numerology().numLayers(); iLayer++) {
1098  if (!m_detManager->numerology().useLayer(iLayer))
1099  ATH_MSG_INFO(" Layer "<<iLayer<<" not present");
1100  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1101  ATH_MSG_DEBUG("iPhi "<<iPhi);
1102  for (int iEta = m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
1103  ATH_MSG_DEBUG("iEta "<<iEta);
1104  if (!iEta && m_detManager->numerology().skipEtaZeroForLayer(iLayer))
1105  // iEta=0 is not defined for the SCT
1106  continue;
1107 
1108  // create the AlignModule
1109  Trk::AlignModule * mod = new Trk::AlignModule(this);
1110  mod->setIdHash(getNextIDHash());
1111  mod->setIdentifier(m_idHelper->wafer_id(0, iLayer, iPhi, iEta, 0));
1112 
1113  std::stringstream name;
1114  name <<"SCT/Barrel/Layer_"<<iLayer<<"/Phi_"<<iPhi<<"/Eta_"<<iEta;
1115  mod->setName(name.str());
1116 
1117  if(!m_alignBarrel || !moduleSelected(mod)) {
1118  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1119  delete mod;
1120  continue;
1121  }
1122 
1123  ATH_MSG_DEBUG("Building module "<<mod->name());
1124 
1125  for(int is=0;is<2;is++) { // module side
1126 
1127  const SiDetectorElement * element2 = m_detManager->getDetectorElement(0, iLayer, iPhi, iEta, is);
1128  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
1129 
1130  if (element) {
1131  // get element location for debugging
1132  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
1133  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
1134  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
1135 
1136  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1137  // should this be identity? if yes, it means that the
1138  // db frame constants are in the global frame. Or not?
1139  const Amg::Transform3D transform = Amg::Transform3D::Identity();
1140  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1141 
1142  // add element to the AlignModule
1143  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
1144  // and fill the corresponding map
1145  (*sctIdHashMap)[element->identifyHash()] = mod;
1146 
1147  // the local frame for the SCT barrel modules is always that
1148  // of the Rphi element, NOT stereo !
1149  // in any case the correct frame can be obtained using moduleTransform() call
1150  // regardless of the side, but we only need it once so we retrieve it
1151  // for the non-stereo side
1152  if(!element2->isStereo())
1153  mod->setGlobalFrameToAlignFrameTransform(element2->moduleTransform().inverse());
1154  }
1155  }
1156 
1157  m_alignModuleListPtr->push_back(mod);
1158  }
1159  }
1160 
1161  }
1162  }
1163 
1164  //_______________________________________________________________________
1166  {
1167  // ========================================
1168  // ENDCAPs
1169  ATH_MSG_INFO("Preparing the SCT Endcap geometry for L3: module (bi-wafer) level");
1170 
1171  // =========================================
1172  // get all modules for SCT Endcap Level 3 alignment
1173  // 2 * 988
1174 
1175  unsigned int maxHash = m_idHelper->wafer_hash_max();
1176  ATH_MSG_DEBUG("maxHash for the SCT "<<maxHash);
1177 
1179  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(maxHash),nullptr);
1181 
1182  for (int iEndcapIndex = 0; iEndcapIndex < m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
1183  int iSide = m_detManager->numerology().endcapId(iEndcapIndex);
1184  for (int iWheel = 0; iWheel < m_detManager->numerology().numDisks(); iWheel++) {
1185  if (!m_detManager->numerology().useDisk(iWheel))
1186  ATH_MSG_INFO(" Disk "<<iWheel<<" not present");
1187  for (int iEta = 0; iEta < m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1188  ATH_MSG_DEBUG("iEta "<<iEta);
1189  for (int iPhi = 0; iPhi < m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1190  ATH_MSG_DEBUG("iPhi "<<iPhi);
1191 
1192  Trk::AlignModule * mod = new Trk::AlignModule(this);
1193  mod->setIdHash(getNextIDHash());
1194  mod->setIdentifier(m_idHelper->wafer_id(iSide,iWheel,iPhi,iEta,0));
1195 
1196  std::stringstream name;
1197  if(iEndcapIndex == 0)
1198  name<<"SCT/EndcapA";
1199  else
1200  name<<"SCT/EndcapC";
1201  name<<"/Disk_"<<iWheel<<"/Phi_"<<iPhi<<"/Eta_"<<iEta;
1202  mod->setName(name.str());
1203 
1204  if(!m_alignEndcaps || !moduleSelected(mod)) {
1205  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1206  delete mod;
1207  continue;
1208  }
1209 
1210  ATH_MSG_DEBUG("Building module "<<mod->name());
1211 
1212  for(int is=0; is<2; is++) { // module side
1213 
1214  const SiDetectorElement * element2 = m_detManager->getDetectorElement(iSide, iWheel, iPhi, iEta, is);
1215  const Trk::TrkDetElementBase * element = (const Trk::TrkDetElementBase*) element2;
1216  if (element) {
1217  // get element location for debugging
1218  // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
1219  // ATH_MSG_DEBUG(" SCTDetectorElement id: " << id << " with center = " << center);
1220  // ATH_MSG_DEBUG(" Is Barrel: "<< m_idHelper->is_barrel(id));
1221 
1222  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1223  // should this be identity? if yes, it means that the
1224  // db frame constants are in the global frame. Or not?
1225  const Amg::Transform3D transform = Amg::Transform3D::Identity();
1226  // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
1227 
1228  // add element to the AlignModule
1229  mod->addDetElement(Trk::AlignModule::SCT,element,transform);
1230  // and fill the corresponding map
1231  (*sctIdHashMap)[element->identifyHash()] = mod;
1232 
1233  // the local frame for the SCT endcap modules is always that
1234  // of the Rphi element, NOT stereo !
1235  // in any case the correct frame can be obtained using moduleTransform() call
1236  // regardless of the side, but we only need it once so we retrieve it
1237  // for the non-stereo side
1238  if(!element2->isStereo())
1239  mod->setGlobalFrameToAlignFrameTransform(element2->moduleTransform().inverse());
1240  }
1241  }
1242 
1243  m_alignModuleListPtr->push_back(mod);
1244  }
1245  }
1246  }
1247  }
1248 
1249  return;
1250  }
1251 
1252  //________________________________________________________________________
1254  {
1255  // prepare all parameters
1263 
1264  // set sigmas
1265  setSigmas(module,fullModPars);
1266 
1267  // select active parameters based on jobOption properties
1269  for(unsigned int ipar=0;ipar<fullModPars->size();++ipar) {
1270 
1271  Identifier AlimodID = module->identify();
1272  Identifier modID = ((module->detElementCollection(Trk::AlignModule::SCT))->at(0))->identify();
1273 
1274  if(m_idHelper->is_barrel(modID)) {
1275  ATH_MSG_DEBUG("SCT barrel module with id "<<AlimodID);
1276  if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignBarrelX)
1277  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignBarrelY)
1278  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignBarrelZ)
1279  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignBarrelRotX)
1280  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignBarrelRotY)
1281  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignBarrelRotZ) ) {
1282  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is now active");
1283  activeModPars->push_back(fullModPars->at(ipar));
1284  }
1285  else
1286  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is NOT active");
1287  }
1288  else {
1289  ATH_MSG_DEBUG("SCT endcap module with id "<<AlimodID);
1290  if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignEndcapX)
1291  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignEndcapY)
1292  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignEndcapZ)
1293  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignEndcapRotX)
1294  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignEndcapRotY)
1295  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignEndcapRotZ) ) {
1296  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is now active");
1297  activeModPars->push_back(fullModPars->at(ipar));
1298  }
1299  else
1300  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is NOT active");
1301  }
1302  }
1303 
1304  // now add parameters to the list
1305  allFullModPars->push_back(fullModPars);
1306  allActiveModPars->push_back(activeModPars);
1307  }
1308 
1309  //________________________________________________________________________
1311  {
1312  for(unsigned int ipar=0;ipar<modPars->size();++ipar) {
1313  // barrel
1314  if(m_idHelper->is_barrel(module->identify()))
1315  switch(modPars->at(ipar)->paramType()) {
1317  modPars->at(ipar)->setSigma(m_sigmaBarrelX);
1318  modPars->at(ipar)->setSoftCut(m_softcutBarrelX);
1319  break;
1321  modPars->at(ipar)->setSigma(m_sigmaBarrelY);
1322  modPars->at(ipar)->setSoftCut(m_softcutBarrelY);
1323  break;
1325  modPars->at(ipar)->setSigma(m_sigmaBarrelZ);
1326  modPars->at(ipar)->setSoftCut(m_softcutBarrelZ);
1327  break;
1329  modPars->at(ipar)->setSigma(m_sigmaBarrelRotX);
1330  modPars->at(ipar)->setSoftCut(m_softcutBarrelRotX);
1331  break;
1333  modPars->at(ipar)->setSigma(m_sigmaBarrelRotY);
1334  modPars->at(ipar)->setSoftCut(m_softcutBarrelRotY);
1335  break;
1337  modPars->at(ipar)->setSigma(m_sigmaBarrelRotZ);
1338  modPars->at(ipar)->setSoftCut(m_softcutBarrelRotZ);
1339  break;
1340  default:
1341  break;
1342  }
1343  // end-caps
1344  else
1345  switch(modPars->at(ipar)->paramType()) {
1347  modPars->at(ipar)->setSigma(m_sigmaEndcapX);
1348  modPars->at(ipar)->setSoftCut(m_softcutEndcapX);
1349  break;
1351  modPars->at(ipar)->setSigma(m_sigmaEndcapY);
1352  modPars->at(ipar)->setSoftCut(m_softcutEndcapY);
1353  break;
1355  modPars->at(ipar)->setSigma(m_sigmaEndcapZ);
1356  modPars->at(ipar)->setSoftCut(m_softcutEndcapZ);
1357  break;
1359  modPars->at(ipar)->setSigma(m_sigmaEndcapRotX);
1360  modPars->at(ipar)->setSoftCut(m_softcutEndcapRotX);
1361  break;
1363  modPars->at(ipar)->setSigma(m_sigmaEndcapRotY);
1364  modPars->at(ipar)->setSoftCut(m_softcutEndcapRotY);
1365  break;
1367  modPars->at(ipar)->setSigma(m_sigmaEndcapRotZ);
1368  modPars->at(ipar)->setSoftCut(m_softcutEndcapRotZ);
1369  break;
1370  default:
1371  break;
1372  }
1373  }
1374  }
1375 
1376  //________________________________________________________________________
1377  bool SCTGeometryManagerTool::moduleSelected(unsigned long long id)
1378  {
1379  if(!m_doModuleSelection)
1380  return true;
1381 
1382  int nsel = m_moduleSelection.size();
1383  for(int i=0;i<nsel;++i)
1384  if(m_moduleSelection.at(i) == id)
1385  return true;
1386 
1387  return false;
1388  }
1389 
1390  //________________________________________________________________________
1392  {
1393  return moduleSelected(mod->identify().get_compact());
1394  }
1395 
1396  //________________________________________________________________________
1398  {
1399  ATH_MSG_INFO("---------------------------------------------------");
1400  ATH_MSG_INFO("Summary of the alignment geometry");
1401  ATH_MSG_INFO("Number of alignable objects: "<< m_alignModuleList.size());
1402  for(unsigned int i=0;i<m_alignModuleList.size();i++) {
1404  ATH_MSG_INFO(i<<". "<< module->name());
1405  ATH_MSG_INFO(" - identifier: "<<module->identify());
1406  ATH_MSG_INFO(" - has "<<module->detElementCollection(Trk::AlignModule::SCT)->size()<<" SCT modules");
1407 
1408  Amg::Transform3D localtoglobal = (module->globalFrameToAlignFrame()).inverse();
1409  ATH_MSG_DEBUG(" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<" "<<localtoglobal.rotation());
1410 
1412  int npars = pars->size();
1413  ATH_MSG_DEBUG(" - number of active transform parameters: "<<npars);
1414  for(int j=0;j<npars;j++)
1415  ATH_MSG_DEBUG(" * par "<<j<<" \'"<<(*pars)[j]->dumpType()<<"\' : sigma = "<<(*pars)[j]->sigma()<<" , softCut = "<<(*pars)[j]->softCut());
1416  }
1417  ATH_MSG_INFO("---------------------------------------------------");
1418  }
1419 
1420 } // end namespace
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
InDet::SCTGeometryManagerTool::buildL2Endcaps
void buildL2Endcaps()
creates L2 AlignModules for SCT endcaps
Definition: SCTGeometryManagerTool.cxx:737
InDet::SCTGeometryManagerTool::m_softcutEndcapY
double m_softcutEndcapY
Definition: SCTGeometryManagerTool.h:181
Trk::IGeometryManagerTool::m_alignLevelBarrel
int m_alignLevelBarrel
alignment level
Definition: IGeometryManagerTool.h:116
InDet::SCTGeometryManagerTool::buildL3Barrel
void buildL3Barrel()
creates L3 AlignModules for SCT barrel
Definition: SCTGeometryManagerTool.cxx:1080
InDet::SCTGeometryManagerTool::m_idHelper
const SCT_ID * m_idHelper
pointer to SCT detector manager
Definition: SCTGeometryManagerTool.h:127
InDet::SCTGeometryManagerTool::moduleSelected
bool moduleSelected(Trk::AlignModule *mod)
check wheather module is selected for module pointer
Definition: SCTGeometryManagerTool.cxx:1391
SCT_ID.h
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
InDet::SCTGeometryManagerTool::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: SCTGeometryManagerTool.cxx:1253
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
InDetDD::SiDetectorManager::numerology
const SiNumerology & numerology() const
Access Numerology.
Definition: SiDetectorManager.h:126
InDet::SCTGeometryManagerTool::m_alignBarrel
bool m_alignBarrel
Definition: SCTGeometryManagerTool.h:142
Trk::AlignModule::TransZ
@ TransZ
Definition: AlignModule.h:54
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
InDet::SCTGeometryManagerTool::buildL25Endcaps
void buildL25Endcaps()
creates L25 AlignModules for SCT endcaps
Definition: SCTGeometryManagerTool.cxx:816
SCTGeometryManagerTool.h
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
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
Trk::IGeometryManagerTool::m_hashCounter
int m_hashCounter
variable for setting the idHash of the AlignModules
Definition: IGeometryManagerTool.h:111
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
InDet::SCTGeometryManagerTool::m_moduleSelection
std::vector< unsigned long long > m_moduleSelection
Definition: SCTGeometryManagerTool.h:140
InDet
DUMMY Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
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
InDet::SCTGeometryManagerTool::m_sigmaEndcapZ
double m_sigmaEndcapZ
Definition: SCTGeometryManagerTool.h:168
InDetDD::SiNumerology::useLayer
bool useLayer(int layer) const
Check if layer exists.
InDet::SCTGeometryManagerTool::m_sigmaEndcapY
double m_sigmaEndcapY
Definition: SCTGeometryManagerTool.h:167
Trk::AlignModule
Definition: AlignModule.h:45
InDet::SCTGeometryManagerTool::buildL27Barrel
void buildL27Barrel()
creates L27 AlignModules for SCT barrel
Definition: SCTGeometryManagerTool.cxx:634
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::IGeometryManagerTool::m_alignLevelEndcaps
int m_alignLevelEndcaps
alignment level
Definition: IGeometryManagerTool.h:117
Trk::TrkDetElementBase
Definition: TrkDetElementBase.h:52
InDet::SCTGeometryManagerTool::m_alignBarrelRotY
bool m_alignBarrelRotY
Definition: SCTGeometryManagerTool.h:149
InDet::SCTGeometryManagerTool::m_sigmaEndcapRotX
double m_sigmaEndcapRotX
Definition: SCTGeometryManagerTool.h:169
InDetDD::SCT_DetectorManager::getDetectorElement
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements via Identifier
Definition: SCT_DetectorManager.cxx:64
InDet::SCTGeometryManagerTool::m_alignEndcaps
bool m_alignEndcaps
Definition: SCTGeometryManagerTool.h:143
Trk::AlignPar::paramType
AlignModule::TransformParameters paramType() const
returns the type of parameter (i.e.
Definition: AlignPar.h:47
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::SCTGeometryManagerTool::m_sigmaBarrelZ
double m_sigmaBarrelZ
Definition: SCTGeometryManagerTool.h:161
InDet::SCTGeometryManagerTool::m_softcutBarrelRotZ
double m_softcutBarrelRotZ
Definition: SCTGeometryManagerTool.h:178
Trk::IGeometryManagerTool::m_alignLevel
int m_alignLevel
alignment level
Definition: IGeometryManagerTool.h:115
Rec::nDoF
double nDoF(const Trk::Track &track)
Definition: OutwardsCombinedMuonTrackBuilder.cxx:31
InDet::SCTGeometryManagerTool::m_alignBarrelZ
bool m_alignBarrelZ
Definition: SCTGeometryManagerTool.h:147
InDet::SCTGeometryManagerTool::m_alignEndcapRotX
bool m_alignEndcapRotX
Definition: SCTGeometryManagerTool.h:155
InDet::SCTGeometryManagerTool::m_sigmaEndcapRotY
double m_sigmaEndcapRotY
Definition: SCTGeometryManagerTool.h:170
AlignModule
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
python.PyAthena.module
module
Definition: PyAthena.py:134
InDet::SCTGeometryManagerTool::m_sigmaEndcapRotZ
double m_sigmaEndcapRotZ
Definition: SCTGeometryManagerTool.h:171
InDet::SCTGeometryManagerTool::buildL1Barrel
void buildL1Barrel()
creates L1 AlignModules for SCT barrel
Definition: SCTGeometryManagerTool.cxx:404
InDet::SCTGeometryManagerTool::buildL0
void buildL0()
creates L0 AlignModules for SCT
Definition: SCTGeometryManagerTool.cxx:336
InDet::SCTGeometryManagerTool::m_softcutBarrelX
double m_softcutBarrelX
Definition: SCTGeometryManagerTool.h:173
InDet::SCTGeometryManagerTool::~SCTGeometryManagerTool
virtual ~SCTGeometryManagerTool()
Definition: SCTGeometryManagerTool.cxx:106
Trk::AlignPar::setSigma
void setSigma(double sigma)
sets sigma
Definition: AlignPar.h:87
Trk::AlignModule::setName
void setName(const std::string &name)
Set and return name of align module (i.e.
Definition: AlignModule.h:88
Trk::IGeometryManagerTool::m_alignModuleListPtr
Trk::AlignModuleList * m_alignModuleListPtr
pointer to module list to which the modules are added
Definition: IGeometryManagerTool.h:106
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::SCTGeometryManagerTool::ReadGeometry
int ReadGeometry(int solveLevel)
read the geometry Method is called from the main AlignAlg to build the geometry based on the requeste...
Definition: SCTGeometryManagerTool.cxx:243
InDet::SCTGeometryManagerTool::buildL2Old
void buildL2Old()
creates L2 AlignModules for the full Pixel in the ordering equal to the old code
Definition: SCTGeometryManagerTool.cxx:903
InDet::SCTGeometryManagerTool::m_sigmaBarrelY
double m_sigmaBarrelY
Definition: SCTGeometryManagerTool.h:160
InDetDD::SiDetectorElement::moduleTransform
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.
Definition: SiDetectorElement.cxx:173
lumiFormat.i
int i
Definition: lumiFormat.py:92
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
Trk::AlignModule::identifyHash
IdentifierHash identifyHash() const
Set and return index of module, used by alignment classes to keep track of order of align module.
Definition: AlignModule.h:92
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
InDet::SCTGeometryManagerTool::m_idHashToAlignModuleMaps
std::vector< Trk::AlignModuleList * > m_idHashToAlignModuleMaps
Definition: SCTGeometryManagerTool.h:134
InDet::SCTGeometryManagerTool::m_softcutEndcapRotX
double m_softcutEndcapRotX
Definition: SCTGeometryManagerTool.h:183
InDet::SCTGeometryManagerTool::checkAlignLevelBarrel
bool checkAlignLevelBarrel()
check whether the Barrel alignment level is correct
Definition: SCTGeometryManagerTool.cxx:209
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::rotation
rotation
Definition: TrackSurface_v1.cxx:15
InDet::SCTGeometryManagerTool::m_sigmaBarrelRotZ
double m_sigmaBarrelRotZ
Definition: SCTGeometryManagerTool.h:164
InDet::SCTGeometryManagerTool::buildL1Endcaps
void buildL1Endcaps()
creates L1 AlignModules for SCT endcaps
Definition: SCTGeometryManagerTool.cxx:481
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDetDD::SiNumerology::endcapId
int endcapId(int index) const
Barrel/endcap identifier for each endcap.
Trk::AlignModule::RotX
@ RotX
Definition: AlignModule.h:54
InDet::SCTGeometryManagerTool::m_alignEndcapRotY
bool m_alignEndcapRotY
Definition: SCTGeometryManagerTool.h:156
InDetDD::SiNumerology::useDisk
bool useDisk(int disk) const
Check if disk exists.
InDetDD::SiNumerology::numDisks
int numDisks() const
Number of disks.
Trk::AlignModule::SCT
@ SCT
Definition: AlignModule.h:57
InDet::SCTGeometryManagerTool::m_softcutEndcapRotY
double m_softcutEndcapRotY
Definition: SCTGeometryManagerTool.h:184
InDet::SCTGeometryManagerTool::m_softcutEndcapRotZ
double m_softcutEndcapRotZ
Definition: SCTGeometryManagerTool.h:185
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
InDet::SCTGeometryManagerTool::m_dumpGeometry
bool m_dumpGeometry
Definition: SCTGeometryManagerTool.h:188
AlignModuleList.h
InDet::SCTGeometryManagerTool::checkAlignLevel
bool checkAlignLevel()
check whether the alignment level is correct
Definition: SCTGeometryManagerTool.cxx:178
Trk::AlignModule::name
const std::string & name() const
Definition: AlignModule.h:89
InDet::SCTGeometryManagerTool::m_alignEndcapX
bool m_alignEndcapX
Definition: SCTGeometryManagerTool.h:152
InDet::SCTGeometryManagerTool::m_alignBarrelX
bool m_alignBarrelX
Definition: SCTGeometryManagerTool.h:145
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::SCTGeometryManagerTool::m_detManager
const InDetDD::SCT_DetectorManager * m_detManager
pointer to SCT detector manager
Definition: SCTGeometryManagerTool.h:125
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SCT_ID::wafer_hash_max
size_type wafer_hash_max(void) const
Definition: SCT_ID.cxx:639
AlignModule.h
InDet::SCTGeometryManagerTool::m_alignEndcapZ
bool m_alignEndcapZ
Definition: SCTGeometryManagerTool.h:154
InDetDD::SiDetectorElement
Definition: SiDetectorElement.h:109
InDet::SCTGeometryManagerTool::m_softcutBarrelRotX
double m_softcutBarrelRotX
Definition: SCTGeometryManagerTool.h:176
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::SCTGeometryManagerTool::m_sigmaBarrelX
double m_sigmaBarrelX
Definition: SCTGeometryManagerTool.h:159
Trk::IGeometryManagerTool::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: IGeometryManagerTool.h:113
InDet::SCTGeometryManagerTool::m_useOldL2
bool m_useOldL2
Definition: SCTGeometryManagerTool.h:187
SiDetectorElement.h
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:53
InDet::SCTGeometryManagerTool::buildGeometry
void buildGeometry()
builds geometry for SCT alignment
Definition: SCTGeometryManagerTool.cxx:286
Trk::AlignModule::setIdHash
void setIdHash(IdentifierHash id)
Definition: AlignModule.h:93
Trk::AlignModule::TransX
@ TransX
Definition: AlignModule.h:54
InDet::SCTGeometryManagerTool::m_alignEndcapRotZ
bool m_alignEndcapRotZ
Definition: SCTGeometryManagerTool.h:157
DataVector.h
An STL vector of pointers that by default owns its pointed-to elements.
DeMoScan.index
string index
Definition: DeMoScan.py:362
InDet::SCTGeometryManagerTool::m_sigmaBarrelRotY
double m_sigmaBarrelRotY
Definition: SCTGeometryManagerTool.h:163
InDet::SCTGeometryManagerTool::m_softcutBarrelRotY
double m_softcutBarrelRotY
Definition: SCTGeometryManagerTool.h:177
InDet::SCTGeometryManagerTool::m_sigmaBarrelRotX
double m_sigmaBarrelRotX
Definition: SCTGeometryManagerTool.h:162
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
InDet::SCTGeometryManagerTool::m_alignModuleList
Trk::AlignModuleList m_alignModuleList
Definition: SCTGeometryManagerTool.h:131
InDet::SCTGeometryManagerTool::m_softcutEndcapZ
double m_softcutEndcapZ
Definition: SCTGeometryManagerTool.h:182
InDetDD
Message Stream Member.
Definition: FakeTrackBuilder.h:8
Amg::RotationMatrix3D
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Definition: GeoPrimitives.h:49
Trk::AlignModule::RotY
@ RotY
Definition: AlignModule.h:54
InDet::SCTGeometryManagerTool::m_alignEndcapY
bool m_alignEndcapY
Definition: SCTGeometryManagerTool.h:153
InDet::SCTGeometryManagerTool::m_fullAlignParList
DataVector< DataVector< Trk::AlignPar > > * m_fullAlignParList
Definition: SCTGeometryManagerTool.h:137
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
InDetDD::SiNumerology::beginEtaModuleForLayer
int beginEtaModuleForLayer(int layer) const
First eta_module number for a layer.
DEBUG
#define DEBUG
Definition: page_access.h:11
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
IAlignModuleTool.h
InDet::SCTGeometryManagerTool::m_alignBarrelRotX
bool m_alignBarrelRotX
Definition: SCTGeometryManagerTool.h:148
AlignPar.h
InDet::SCTGeometryManagerTool::setAlignLevel
void setAlignLevel(int level)
set alignment level
Definition: SCTGeometryManagerTool.cxx:171
InDet::SCTGeometryManagerTool::buildL3Endcaps
void buildL3Endcaps()
creates L3 AlignModules for SCT endcaps
Definition: SCTGeometryManagerTool.cxx:1165
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
InDet::SCTGeometryManagerTool::m_alignBarrelRotZ
bool m_alignBarrelRotZ
Definition: SCTGeometryManagerTool.h:150
InDet::SCTGeometryManagerTool::m_sigmaEndcapX
double m_sigmaEndcapX
Definition: SCTGeometryManagerTool.h:166
InDet::SCTGeometryManagerTool::buildL2Barrel
void buildL2Barrel()
creates L2 AlignModules for SCT barrel
Definition: SCTGeometryManagerTool.cxx:562
InDet::SCTGeometryManagerTool::m_softcutBarrelY
double m_softcutBarrelY
Definition: SCTGeometryManagerTool.h:174
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
InDet::SCTGeometryManagerTool::m_softcutBarrelZ
double m_softcutBarrelZ
Definition: SCTGeometryManagerTool.h:175
InDet::SCTGeometryManagerTool::finalize
StatusCode finalize()
Definition: SCTGeometryManagerTool.cxx:163
InDet::SCTGeometryManagerTool::m_doModuleSelection
bool m_doModuleSelection
Definition: SCTGeometryManagerTool.h:139
InDet::SCTGeometryManagerTool::initialize
StatusCode initialize()
Definition: SCTGeometryManagerTool.cxx:120
AthAlgTool
Definition: AthAlgTool.h:26
SCT_ID::wafer_id
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
Definition: SCT_ID.h:464
SCT_DetectorManager.h
InDetDD::SiDetectorElement::isStereo
bool isStereo() const
Check if it is the stereo side (useful for SCT)
Definition: SiDetectorElement.cxx:300
Trk::AlignModule::RotZ
@ RotZ
Definition: AlignModule.h:54
xAOD::iEta
setScale setgFexType iEta
Definition: gFexJetRoI_v1.cxx:74
InDet::SCTGeometryManagerTool::setSigmas
void setSigmas(Trk::AlignModule *mod, DataVector< Trk::AlignPar > *modPars)
sets sigmas for modules
Definition: SCTGeometryManagerTool.cxx:1310
Trk::AlignModule::TransY
@ TransY
Definition: AlignModule.h:54
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
InDet::SCTGeometryManagerTool::m_softcutEndcapX
double m_softcutEndcapX
Definition: SCTGeometryManagerTool.h:180
Trk::AlignModule::identify
Identifier identify() const
Definition: AlignModule.h:97
InDet::SCTGeometryManagerTool::dumpGeometry
void dumpGeometry()
print basic geometry info to screen
Definition: SCTGeometryManagerTool.cxx:1397
InDet::SCTGeometryManagerTool::m_alignParList
DataVector< DataVector< Trk::AlignPar > > * m_alignParList
Definition: SCTGeometryManagerTool.h:136
InDet::SCTGeometryManagerTool::checkAlignLevelEndcaps
bool checkAlignLevelEndcaps()
check whether the Endcap alignment level is correct
Definition: SCTGeometryManagerTool.cxx:226
InDet::SCTGeometryManagerTool::m_alignBarrelY
bool m_alignBarrelY
Definition: SCTGeometryManagerTool.h:146
SCT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...
Definition: SCT_ID.h:721
InDet::SCTGeometryManagerTool::m_alignModuleTool
ToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
pointer to AlignModuleTool
Definition: SCTGeometryManagerTool.h:129