ATLAS Offline Software
TRTGeometryManagerTool.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 
11 #include "InDetIdentifier/TRT_ID.h"
12 
14 
17 #include "TrkAlignEvent/AlignPar.h"
18 
19 
21 
22 
23 #include <iostream>
24 
25 using namespace InDetDD;
26 
27 namespace InDet {
28 
29 //________________________________________________________________________
30 TRTGeometryManagerTool::TRTGeometryManagerTool(const std::string& type,
31  const std::string& name,
32  const IInterface * parent)
34  , m_trtDetManager(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  declareProperty("AlignBarrel", m_alignBarrel = true);
45  declareProperty("AlignBarrelX", m_alignBarrelX = true);
46  declareProperty("AlignBarrelY", m_alignBarrelY = true);
47  declareProperty("AlignBarrelZ", m_alignBarrelZ = false);
48  declareProperty("AlignBarrelRotX", m_alignBarrelRotX = true);
49  declareProperty("AlignBarrelRotY", m_alignBarrelRotY = true);
50  declareProperty("AlignBarrelRotZ", m_alignBarrelRotZ = true);
51 
52  declareProperty("AlignEndcaps", m_alignEndcaps = true);
53  declareProperty("AlignEndcapX", m_alignEndcapX = true);
54  declareProperty("AlignEndcapY", m_alignEndcapY = true);
55  declareProperty("AlignEndcapZ", m_alignEndcapZ = true);
56  declareProperty("AlignEndcapRotX", m_alignEndcapRotX = true);
57  declareProperty("AlignEndcapRotY", m_alignEndcapRotY = true);
58  declareProperty("AlignEndcapRotZ", m_alignEndcapRotZ = true);
59 
60  declareProperty("SetSigmaBarrelX", m_sigmaBarrelX = 1.);
61  declareProperty("SetSigmaBarrelY", m_sigmaBarrelY = 1.);
62  declareProperty("SetSigmaBarrelZ", m_sigmaBarrelZ = 1.);
63  declareProperty("SetSigmaBarrelRotX", m_sigmaBarrelRotX = 0.001);
64  declareProperty("SetSigmaBarrelRotY", m_sigmaBarrelRotY = 0.001);
65  declareProperty("SetSigmaBarrelRotZ", m_sigmaBarrelRotZ = 0.001);
66 
67  declareProperty("SetSigmaEndcapX", m_sigmaEndcapX = 1.);
68  declareProperty("SetSigmaEndcapY", m_sigmaEndcapY = 1.);
69  declareProperty("SetSigmaEndcapZ", m_sigmaEndcapZ = 1.);
70  declareProperty("SetSigmaEndcapRotX", m_sigmaEndcapRotX = 0.001);
71  declareProperty("SetSigmaEndcapRotY", m_sigmaEndcapRotY = 0.001);
72  declareProperty("SetSigmaEndcapRotZ", m_sigmaEndcapRotZ = 0.001);
73 
74  declareProperty("SetSoftCutBarrelX", m_softcutBarrelX = 1.);
75  declareProperty("SetSoftCutBarrelY", m_softcutBarrelY = 1.);
76  declareProperty("SetSoftCutBarrelZ", m_softcutBarrelZ = 1.);
77  declareProperty("SetSoftCutBarrelRotX", m_softcutBarrelRotX = 1.);
78  declareProperty("SetSoftCutBarrelRotY", m_softcutBarrelRotY = 1.);
79  declareProperty("SetSoftCutBarrelRotZ", m_softcutBarrelRotZ = 1.);
80 
81  declareProperty("SetSoftCutEndcapX", m_softcutEndcapX = 1.);
82  declareProperty("SetSoftCutEndcapY", m_softcutEndcapY = 1.);
83  declareProperty("SetSoftCutEndcapZ", m_softcutEndcapZ = 1.);
84  declareProperty("SetSoftCutEndcapRotX", m_softcutEndcapRotX = 1.);
85  declareProperty("SetSoftCutEndcapRotY", m_softcutEndcapRotY = 1.);
86  declareProperty("SetSoftCutEndcapRotZ", m_softcutEndcapRotZ = 1.);
87 
88  declareProperty("AlignmentLevel", m_alignLevel = 1);
89  declareProperty("AlignmentLevelBarrel", m_alignLevelBarrel = -1);
90  declareProperty("AlignmentLevelEndcaps", m_alignLevelEndcaps = -1);
91 
92  declareProperty("AlignBarrelPhiSectors", m_barrelPhiSectors);
93  declareProperty("AlignBarrelLayers", m_barrelLayers);
94 
95  declareProperty("AlignSingleEndcap", m_endcap = 0);
96  declareProperty("AlignEndcapWheels", m_endcapWheels);
97  declareProperty("AlignEndcapPhiSectors", m_endcapPhiSectors);
98 
99  declareProperty("doModuleSelection", m_doModuleSelection = false);
100  declareProperty("ModuleSelection", m_moduleSelection);
101 
102  declareProperty("DumpGeometry", m_dumpGeometry = true);
103 
104  m_hashCounter = 0;
105  m_logStream = nullptr;
106 }
107 
108 //________________________________________________________________________
110 {
111  ATH_MSG_DEBUG("deleting alignModuleList");
112  for (int i=0;i<(int)m_alignModuleList.size();i++)
113  delete m_alignModuleList[i];
114  m_alignModuleList.clear();
115 
116  ATH_MSG_DEBUG("deleting fullAlignParList");
117  delete m_fullAlignParList;
118  ATH_MSG_DEBUG("deleting alignParList");
119  delete m_alignParList;
120 }
121 
122 //________________________________________________________________________
124 {
125  ATH_MSG_DEBUG("initialize() of TRTGeometryManagerTool");
126 
127  // retrieve AlignModuleTool
128  if ( m_alignModuleTool.retrieve().isFailure() ) {
129  msg(MSG::FATAL)<<"Could not get " << m_alignModuleTool << endmsg;
130  return StatusCode::FAILURE;
131  }
132  else
133  ATH_MSG_INFO("Retrieved " << m_alignModuleTool);
134 
135  // retrieve TRT ID helper
136  if ( detStore()->retrieve(m_idHelper, "TRT_ID").isFailure() ) {
137  msg(MSG::FATAL) << " Cannot retrieve TRT ID Helper " << endmsg;
138  return StatusCode::FAILURE;
139  }
140  else
141  ATH_MSG_INFO("retrieved TRT ID Helper");
142 
143  // retrieve TRT detector manager
144  if ( detStore()->retrieve(m_trtDetManager).isFailure() ) {
145  msg(MSG::FATAL) << " Cannot retrieve TRT Detector Manager " << endmsg;
146  return StatusCode::FAILURE;
147  }
148  else
149  ATH_MSG_INFO("retrieved TRT Detector Manager");
150 
151  // dump module selection
153  msg(MSG::INFO)<<"Creating geometry for selected "<<m_moduleSelection.size()<<" modules:"<<endmsg;
154  for(unsigned int i=0;i<m_moduleSelection.size();i++)
155  msg(MSG::INFO)<<" "<<i<<". "<<m_moduleSelection.at(i)<<endmsg;
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 TRTGeometryManagerTool");
169 
170  return StatusCode::SUCCESS;
171 }
172 
173 //________________________________________________________________________
175 {
178 }
179 
180 //________________________________________________________________________
182 {
183  if(m_alignLevel == 0) {
184  ATH_MSG_INFO("Alignment level for TRT is "<<m_alignLevel);
185  return true;
186  }
187 
188  if(m_alignLevelBarrel == -1) {
189  if(m_alignLevel == 200)
190  m_alignLevelBarrel = 2;
191  else
193  }
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 3:
217  ATH_MSG_INFO("Alignment level for TRT Barrel is "<<m_alignLevelBarrel);
218  return true;
219  default:
220  msg(MSG::FATAL)<<"Alignment level "<<m_alignLevelBarrel<<" does not exist for TRT 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 200: case 3:
234  ATH_MSG_INFO("Alignment level for TRT Endcaps is "<<m_alignLevelEndcaps);
235  return true;
236  default:
237  msg(MSG::FATAL)<<"Alignment level "<<m_alignLevelEndcaps<<" does not exist for TRT 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  std::vector<Trk::AlignModule *>::const_iterator imod = m_alignModuleList.begin();
260  std::vector<Trk::AlignModule *>::const_iterator imod_end = m_alignModuleList.end();
261  for( ; imod!=imod_end; ++imod)
263 
264  // set alignModuleList and hash table in the alignModuleTool
266  ATH_MSG_DEBUG(" geometry set in m_alignModuleTool");
267 
268  // set alignPar lists in the alignModuleTool
269  ATH_MSG_DEBUG(" alignParList = "<<m_alignParList);
270  ATH_MSG_DEBUG(" fullAlignParList = "<<m_fullAlignParList);
272  ATH_MSG_DEBUG(" AlignParLists set in m_alignModuleTool");
273 
274  // dump summary about the geometry setup
275  if (m_dumpGeometry)
276  dumpGeometry();
277 
278  int nDoF= m_alignModuleTool->nAlignParameters();
279  ATH_MSG_INFO("Total number of degrees of freedom: "<<nDoF);
280 
281  return nDoF;
282 }
283 
284 //_______________________________________________________________________
286 {
287  ATH_MSG_INFO("Preparing the TRT geometry");
288 
289  if(m_alignLevel == 0)
290  buildL0();
291  else {
292 
293  if(m_alignBarrel)
294  switch(m_alignLevelBarrel) {
295  case 1:
296  buildL1Barrel();
297  break;
298  case 2:
299  buildL2Barrel();
300  break;
301  case 3:
302  buildL3Barrel();
303  m_alignModuleTool->setSubDetElement(Trk::AlignModule::TRT,true);
304  break;
305  default:
306  break;
307  }
308 
309  if(m_alignEndcaps)
310  switch(m_alignLevelEndcaps) {
311  case 1:
312  buildL1Endcaps();
313  break;
314  case 2:
315  buildL2Endcaps();
316  break;
317  case 200:
319  break;
320  case 3:
321  buildL3Endcap();
322  m_alignModuleTool->setSubDetElement(Trk::AlignModule::TRT,true);
323  break;
324  default:
325  break;
326  }
327  }
328 }
329 
330 //_______________________________________________________________________
332 {
333  ATH_MSG_INFO("Preparing the TRT geometry for L0: whole TRT");
334 
335  // ========================================
336  // get all modules for Level 0 alignment
337  // Level 0 is the whole TRT, i.e., 1 AlignModule in total
338 
339  // define modules
340  // we'll stick with the base AlignModule here since we don't want to
341  // do shifting for the moment but we might need to extend AlignModule
342  // in the future
343 
344  // for L1 alignment the alignment frame is equal to the global frame
345  // and since the TRT detector element positions are also stored in
346  // the global frame in DB, transform is identity
347  Amg::Transform3D transform = Amg::Transform3D::Identity();
348 
349  // use the 'real' identifier of the TRT barrel for TRT L0 module
350  Trk::AlignModule * trt = new Trk::AlignModule(this);
351  trt->setIdHash(getNextIDHash());
352  trt->setName("TRT");
354 
355  if(!moduleSelected(trt)) {
356  ATH_MSG_DEBUG("Module "<<trt->name()<<" NOT selected");
357  delete trt;
358  return;
359  }
360 
361  // get maximum number of elements from the helper
362  unsigned int trtmaxHash = m_idHelper->straw_layer_hash_max();
363  ATH_MSG_DEBUG("maxHash for the TRT "<<trtmaxHash);
364 
366  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)(trtmaxHash),nullptr);
368 
369  // ================================================================
370  // loop over TRT elements and add them to respective alignModules
371  // ================================================================
372  for (unsigned int index = 0; index < trtmaxHash; index++) {
373  IdentifierHash idHash = index;
374  Identifier id = m_idHelper->layer_id(idHash);
375 
376  // get the element via hash
377  const TRT_BaseElement * element = m_trtDetManager->getElement(idHash);
378  if (element) {
379  // get element location for debugging
380 // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
381 // ATH_MSG_DEBUG(" TRTDetectorElement id: " << id << " with center = " << center);
382 
383  // add element to respective AlignModule
384 
385  // add to the Inner Detector structure
386  if(msgLvl(MSG::DEBUG)) {
387  if (m_idHelper->is_barrel(id))
388  msg(MSG::DEBUG)<<"... TRT barrel element"<<endmsg;
389  else
390  msg(MSG::DEBUG)<<"... TRT endcap element"<<endmsg;
391  }
393 
394  // and fill the corresponding map
395  (*trtIdHashMap)[idHash] = trt;
396  }
397  else
398  ATH_MSG_DEBUG("No TRTDetectorElement with id: "<<id);
399  }
400 
401  // add created module to the geometry
402  m_alignModuleListPtr->push_back(trt);
403 
404  ATH_MSG_DEBUG("TRT L0 module successfully added to the list");
405 }
406 
407 //_______________________________________________________________________
409 {
410  // ===========================
411  // BARREL
412  // ===========================
413  ATH_MSG_INFO("Preparing the TRT Barrelgeometry for L1: whole barrel");
414 
415  // ========================================
416  // get all modules for barrel Level 1 alignment
417  // Level 1 is barrel as a single AlignModule
418 
419  // define modules
420  // we'll stick with the base AlignModule here since we don't want to
421  // do shifting for the moment but we might need to extend AlignModule
422  // in the future
423 
424  // get maximum number of elements from the helper
425  unsigned int maxHash = 0;
426  if(m_alignLevelEndcaps==3)
427  maxHash = m_idHelper->straw_hash_max();
428  else
429  maxHash = m_idHelper->straw_layer_hash_max();
430  ATH_MSG_DEBUG("maxHash for the TRT "<<maxHash);
431 
433  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)maxHash,nullptr);
435 
436  // for L1 alignment the alignment frame is equal to the global frame
437  // and since the TRT detector element positions are also stored in
438  // the global frame in DB, transform is identity
439  Amg::Transform3D transform = Amg::Transform3D::Identity();
440 
441  // BARREL
442  // use the 'real' identifier of the TRT barrel that can be
443  // used by idHelper->barrel_ec()
444  // TRT barrel has two sides so both -1 and +1 are ok
445  // but -1 is used in the DB so we use it here as well
447  trtBarrel->setIdHash(getNextIDHash());
448  trtBarrel->setName("TRT Barrel");
449  trtBarrel->setIdentifier(m_idHelper->barrel_ec_id(-1));
450 
451  if(!moduleSelected(trtBarrel)) {
452  ATH_MSG_DEBUG("Module "<<trtBarrel->name()<<" NOT selected");
453  delete trtBarrel;
454  }
455  else {
456  // loop over detector elements in the barrel and add them to respective alignModules
457  for (unsigned int iLayer = 0; iLayer < m_trtDetManager->getNumerology()->getNBarrelRings(); iLayer++) // barrel layers
458  for (unsigned int iPhiModule = 0; iPhiModule < m_trtDetManager->getNumerology()->getNBarrelPhi(); iPhiModule++) // modules in phi
459  for (unsigned int iStrawLayer = 0; iStrawLayer < m_trtDetManager->getNumerology()->getNBarrelLayers(iLayer); iStrawLayer++) // straw layers inside one phi module
460  for (int iSide = 0; iSide < 2; iSide++) { // side of the straw
461  const TRT_BarrelElement * element = m_trtDetManager->getBarrelElement(iSide, iLayer, iPhiModule, iStrawLayer);
462  if (element) {
463  // get element location for debugging
464 // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
465 // ATH_MSG_DEBUG(" TRTDetectorElement id: " << element->identify() << " with center = " << center);
466 
467  // add to the barrel
468  trtBarrel->addDetElement(Trk::AlignModule::TRT,element,transform);
469  // and fill the corresponding map
470  (*trtIdHashMap)[element->identifyHash()] = trtBarrel;
471  }
472  else
473  ATH_MSG_DEBUG("No TRT_BarrelElement with side-layer-phi-strawLayer:" <<iSide<<"-"<<iLayer<<"-"<<iPhiModule<<"-"<<iStrawLayer);
474  }
475 
476  // add
477  m_alignModuleListPtr->push_back(trtBarrel);
478  }
479 }
480 
481 
482 //_______________________________________________________________________
484 {
485  // ===========================
486  // ENDCAPs
487  // ===========================
488  ATH_MSG_INFO("Preparing the TRT Endcap geometry for L1: 2 endcaps");
489 
490  // ========================================
491  // get all modules for Endcap Level 1 alignment
492  // Level 1 is endcap AlignModules
493 
494  // define modules
495  // we'll stick with the base AlignModule here since we don't want to
496  // do shifting for the moment but we might need to extend AlignModule
497  // in the future
498 
499  // get maximum number of elements from the helper
500  unsigned int maxHash = 0;
501  if(m_alignLevelBarrel==3)
502  maxHash = m_idHelper->straw_hash_max();
503  else
504  maxHash = m_idHelper->straw_layer_hash_max();
505  ATH_MSG_DEBUG("maxHash for the TRT "<<maxHash);
506 
508  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)maxHash,nullptr);
510 
511  // for L1 alignment the alignment frame is equal to the global frame
512  // and since the TRT detector element positions are also stored in
513  // the global frame in DB, transform is identity
514  Amg::Transform3D transform = Amg::Transform3D::Identity();
515 
516  // ENDCAPs
517  // identifiers for endcaps are set in analogy to barrel
518  // above to -2 and +2 so they can be used by
519  // idHelper->barrel_ec()
521  for (int iSide=0;iSide<2;iSide++) {
522  trtEndCap[iSide] = new Trk::AlignModule(this);
523  trtEndCap[iSide] -> setIdHash(getNextIDHash());
524 
525  if(iSide)
526  trtEndCap[iSide]->setName("TRT EndCap C");
527  else
528  trtEndCap[iSide]->setName("TRT EndCap A");
529 
530  int idSide = iSide ? 2 : -2;
531  trtEndCap[iSide]->setIdentifier(m_idHelper->barrel_ec_id(idSide));
532 
533  if( !moduleSelected(trtEndCap[iSide]) || (m_endcap!=idSide && m_endcap!=0 ) ) {
534  ATH_MSG_DEBUG("Module "<<trtEndCap[iSide]->name()<<" NOT selected");
535  delete trtEndCap[iSide];
536  }
537  else {
538  for (unsigned int iWheel = 0; iWheel < m_trtDetManager->getNumerology()->getNEndcapWheels(); iWheel++)
539  for (unsigned int iStrawLayer = 0; iStrawLayer < m_trtDetManager->getNumerology()->getNEndcapLayers(iWheel); iStrawLayer++)
540  for(unsigned int iPhi = 0; iPhi < m_trtDetManager->getNumerology()->getNEndcapPhi(); iPhi++) {
541  const TRT_EndcapElement * element = m_trtDetManager->getEndcapElement(iSide, iWheel, iStrawLayer, iPhi);
542  if (element) {
543  // get element location for debugging
544 // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
545 // ATH_MSG_DEBUG(" TRTDetectorElement id: " << id << " with center = " << center);
546 
547  // add element to respective AlignModule
548  trtEndCap[iSide]->addDetElement(Trk::AlignModule::TRT,element,transform);
549  // and fill the corresponding map
550  (*trtIdHashMap)[element->identifyHash()] = trtEndCap[iSide];
551  }
552  else
553  ATH_MSG_DEBUG("No TRT_EndcapElement with side-wheel-strawLayer-phi:" <<iSide<<"-"<<iWheel<<"-"<<iStrawLayer<<"-"<<iPhi);
554  }
555 
556  // for endcap we move the CoG
557  Amg::Translation3D translation(trtEndCap[iSide]->centerOfGravity());
558  Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
559  trtEndCap[iSide]->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
560 
561  // add
562  m_alignModuleListPtr->push_back(trtEndCap[iSide]);
563  }
564  }
565 }
566 
567 
568 //_______________________________________________________________________
570 {
571  // ===========================
572  // BARREL
573  // ===========================
574  ATH_MSG_INFO("Preparing the TRT Barrel geometry for L2: 3 layers with 32 modules each (96 modules)");
575 
576  // ========================================
577  // get all modules for TRT Barrel Level 2 alignment
578  // Level 2 in the barrel is 3 layers with 32 phi modules each
579  // i.e. 96 AlignModules in total
580 
581  // define modules
582  // we'll stick with the base AlignModule here since we don't want to
583  // do shifting for the moment but we might need to extend AlignModule
584  // in the future
585 
586  // TRT detector element positions are stored in the DB in global frame
587  // so the DB frame to global frame transform is identity
588  Amg::Transform3D transform = Amg::Transform3D::Identity();
589 
590  // get maximum number of elements from the helper
591  unsigned int maxHash = 0;
592  if(m_alignLevelEndcaps==3)
593  maxHash = m_idHelper->straw_hash_max();
594  else
595  maxHash = m_idHelper->straw_layer_hash_max();
596  ATH_MSG_DEBUG("maxHash for the TRT "<<maxHash);
597 
599  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)maxHash,nullptr);
601 
602  // for the alignment frame we would like to use something like
603  // the 'center-of-gravity' (cog) of the module and the rotation
604  // of the strawlayer planes. the main problem here is that the
605  // planes are not entirely parallel. for the definition of the
606  // alignment of the module this is all irrelevant, but we would
607  // like to give the twist some meaning, like 'the rotation
608  // around the most central straw': since strawlayer planes are
609  // even and straws as well, there is no such thing as a really
610  // central straw. we'll do something that brings us as close as
611  // possible: for the central plane take strawlayer that is at
612  // (N+1)/2, where N is the maximum strawlayer. (strawlayers
613  // start counting at 0). The reason to pick the outer of the two
614  // central strawlayers is that there are more straws per layer
615  // in the outer layers and that the outer layers are also
616  // further apart, so this is closer to the 'real' cog.
617 
618  for (unsigned int iPhiModule = 0; iPhiModule < m_trtDetManager->getNumerology()->getNBarrelPhi(); iPhiModule++) { // modules in phi
619  for (unsigned int iLayer = 0; iLayer < m_trtDetManager->getNumerology()->getNBarrelRings(); iLayer++) {// barrel layers
620  // create the AlignModule
621  Trk::AlignModule * mod = new Trk::AlignModule(this);
622  mod->setIdHash(getNextIDHash());
623  mod->setIdentifier(m_idHelper->module_id(-1, iPhiModule, iLayer));
624 
625  std::stringstream name;
626  name<<"TRT/Barrel/Module_-1_"<<iPhiModule<<"_"<<iLayer;
627  mod->setName(name.str());
628 
629  if(!moduleSelected(mod) || !moduleSelectedBarrel(iLayer,iPhiModule)) {
630  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
631  delete mod;
632  continue;
633  }
634 
635  ATH_MSG_DEBUG("Building module "<<mod->name());
636 
637  // create the collection of central layers for cog and transform calculation
638  std::vector<const Trk::TrkDetElementBase *> centralLayers;
639 
640  int maxstrawlayer = m_trtDetManager->getNumerology()->getNBarrelLayers(iLayer);
641  ATH_MSG_DEBUG("maxstrawlayer "<<maxstrawlayer);
642  for (int iStrawLayer = 0; iStrawLayer < maxstrawlayer; iStrawLayer++) { // straw layers inside one phi module
643  ATH_MSG_DEBUG("iStrawLayer "<<iStrawLayer);
644  for (int iSide = 0; iSide < 2; iSide++) { // side of the straw
645  ATH_MSG_DEBUG("iSide "<<iSide);
646  const TRT_BarrelElement * element = m_trtDetManager->getBarrelElement(iSide, iLayer, iPhiModule, iStrawLayer);
647  if (element) {
648  // get element location for debugging
649 // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
650 // ATH_MSG_DEBUG(" TRTDetectorElement id: " << element->identify() << " with center = " << center);
651 
652  // update maximum straw layer
653  maxstrawlayer = std::max(maxstrawlayer,m_idHelper->straw_layer(element->identify()));
654 
655  // add element to respective AlignModule
656  mod->addDetElement(Trk::AlignModule::TRT,element,transform);
657 
658  // and fill the corresponding map
659  (*trtIdHashMap)[element->identifyHash()] = mod;
660 
661  // add central layers to centralLayers collection
662  // maxstrawlayer is probably odd (if there is an even number
663  // of strawlayers), but I could be wrong, so let's make this always work:
664  // if maxstrawlayer==23, we want to pick strawlayer 12
665  // if maxstrawlayer==24, we still want to pick strawlayer 12
666  if( iStrawLayer == maxstrawlayer/2 ) {
667  //Amg::Vector3D center = element->transform() * Amg::Vector3D(0,0,0);
668  centralLayers.push_back(element);
669  }
670  }
671  else
672  ATH_MSG_DEBUG("No TRT_BarrelElement with side-layer-phi-strawLayer:" <<iSide<<"-"<<iLayer<<"-"<<iPhiModule<<"-"<<iStrawLayer);
673  }
674  }
675 
676  // This is how the frames line up for a bec=-1 module at global
677  // position (0,R,-360):
678  //
679  // global straw det-element
680  // x +x -x
681  // y +y +z
682  // z +z +y
683  //
684  // For other bec=-1 modules you just need to rotate around
685  // global y. For bec=+1 modules it looks like this:
686  //
687  // global straw det-element
688  // x -x -x
689  // y +y +z
690  // z -z +y
691  // So that just involves one rotation around local-y for the strawreference frame.
692  //
693  std::vector<std::vector<const Trk::TrkDetElementBase *> *> centralLayersVec;
694  centralLayersVec.push_back(&centralLayers);
695 
696  Amg::Translation3D translation(Trk::AlignModule::centerOfGravity(centralLayersVec));
697  // for the rotation, we choose the element on the '-1' side.
698  Amg::RotationMatrix3D rotation = ( m_idHelper->barrel_ec(centralLayers.front()->identify()) == -1 ) ?
699  centralLayers.front()->transform().rotation() : centralLayers.back()->transform().rotation();
700  Amg::Transform3D localToGlobal = translation * rotation;
701 
702 
703 
704  ATH_MSG_DEBUG("centerOfGravity "<< mod->centerOfGravity(centralLayersVec));
705  ATH_MSG_DEBUG("Prepared local to global transform : "<<std::setprecision(12)<<localToGlobal.translation()<<" "<<localToGlobal.rotation());
706 
707  mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
708 
709  // add AlignModule to the geometry
710  m_alignModuleListPtr->push_back(mod);
711  }
712  }
713 
714  }
715 
716 
717 //_______________________________________________________________________
719 {
720  // ===========================
721  // ENDCAPs
722  // ===========================
723  ATH_MSG_INFO("Preparing the TRT Endcap geometry for L2: 2 x 40 rings");
724 
725  // ========================================
726  // get all modules for TRT Endcap Level 2 alignment
727  // Level 2 in the endcaps is 40 rings per endcap
728  // i.e. 40 AlignModules in total
729 
730  // define modules
731  // we'll stick with the base AlignModule here since we don't want to
732  // do shifting for the moment but we might need to extend AlignModule
733  // in the future
734 
735  // TRT detector element positions are stored in the DB in global frame
736  // so the DB frame to global frame transform is identity
737  Amg::Transform3D transform = Amg::Transform3D::Identity();
738 
739  // get maximum number of elements from the helper
740  unsigned int maxHash = 0;
741  if(m_alignLevelBarrel==3)
742  maxHash = m_idHelper->straw_hash_max();
743  else
744  maxHash = m_idHelper->straw_layer_hash_max();
745  ATH_MSG_DEBUG("maxHash for the TRT "<<maxHash);
746 
748  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)maxHash,nullptr);
750 
751  for (int iSide = 0; iSide < 2; iSide++) {
752  int idSide = iSide ? 2 : -2;
753  ATH_MSG_DEBUG("Side : "<<iSide<<" , idSide : "<<idSide);
754  if( m_endcap!=idSide && m_endcap!=0 ) {
755  ATH_MSG_DEBUG("Endcap "<<idSide<<" NOT aligned");
756  continue;
757  }
758 
759  int iRing(-1);
760  Trk::AlignModule * mod = nullptr;
761  for (unsigned int iWheel = 0; iWheel < m_trtDetManager->getNumerology()->getNEndcapWheels(); iWheel++) {
762  ATH_MSG_DEBUG("Wheel : "<<iWheel);
763  for (unsigned int iStrawLayer = 0; iStrawLayer < m_trtDetManager->getNumerology()->getNEndcapLayers(iWheel); iStrawLayer++) {
764  ATH_MSG_DEBUG("StrawLayer : "<<iStrawLayer);
765 
766  if(iStrawLayer%4==0) {
767 
768  if(iRing >= 0) {
769  // before creating module for new ring we set the alignment
770  // frame for the previous one and add it to the list of modules
771  ATH_MSG_DEBUG("Setting frame for ring : "<<iRing);
772 
773  // for endcap we move the CoG with no additional rotation
774  Amg::Translation3D translation(mod->centerOfGravity());
775 
776  Amg::Transform3D localToGlobal = translation * Amg::RotationMatrix3D::Identity();
777 
778  mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
779 
780  // add AlignModule to the geometry
781  m_alignModuleListPtr->push_back(mod);
782  }
783 
784  // new ring
785  iRing++;
786 
787  ATH_MSG_DEBUG("Ring : "<<iRing);
788  // create the AlignModule
789  mod = new Trk::AlignModule(this);
790  mod->setIdHash(getNextIDHash());
791  // Identifier for a ring is the Identifier for the first Straw layer in that ring
792  // one ring has 4 straw layers
793  int strawLayerForRing = (iStrawLayer/4) * 4;
794  mod->setIdentifier(m_idHelper->layer_id((iSide ? 2:-2),0,iWheel,strawLayerForRing));
795 
796  std::stringstream name;
797  name<<"TRT/Endcap/Module_"<<(iSide ? 2:-2)<<"_"<<iRing;
798  mod->setName(name.str());
799 
800  if(!moduleSelected(mod)) {
801  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
802  delete mod;
803  mod=nullptr;
804  continue;
805  }
806 
807  ATH_MSG_DEBUG("Building module "<<mod->name());
808  }
809 
810  for(unsigned int iPhi = 0; iPhi < m_trtDetManager->getNumerology()->getNEndcapPhi(); iPhi++) {
811  const TRT_EndcapElement * element = m_trtDetManager->getEndcapElement(iSide, iWheel, iStrawLayer, iPhi);
812  if (element) {
813  // get element location for debugging
814 // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
815 // ATH_MSG_DEBUG(" TRTDetectorElement id: " << id << " with center = " << center);
816 
817  // add element to respective AlignModule
818  mod->addDetElement(Trk::AlignModule::TRT,element,transform);
819 
820  // and fill the corresponding map
821  (*trtIdHashMap)[element->identifyHash()] = mod;
822  }
823  else
824  ATH_MSG_DEBUG("No TRT_EndcapElement with side-wheel-strawLayer-phi:" <<iSide<<"-"<<iWheel<<"-"<<iStrawLayer<<"-"<<iPhi);
825  }
826  }
827  }
828 
829  if (!mod) throw std::logic_error("No AlignmentModule");
830 
831  // for the last ring we have to explicitly set the alignment
832  // frame add it to the list of modules here, at the end of
833  // loop over wheels
834  ATH_MSG_DEBUG("Setting frame for ring : "<<iRing);
835 
836  // for endcap we move the CoG with no additional rotation
837  Amg::Translation3D translation(mod->centerOfGravity());
838  Amg::Transform3D localToGlobal = translation * Amg::RotationMatrix3D::Identity();
839 
840  mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
841 
842  // add AlignModule to the geometry
843  m_alignModuleListPtr->push_back(mod);
844  }
845 }
846 
847 
848 //_______________________________________________________________________
850 {
851  // !!!! WARNING !!!!
852  // !!!! This method sets up the TRT Endcap level 2 geometry which
853  // !!!! is now obsolete. The method buildL2Endcap() should be used
854  // !!!! instead !!!
855 
856  // ===========================
857  // ENDCAPs
858  // ===========================
859  ATH_MSG_INFO("Preparing the _OLD_ TRT Endcap geometry for L2: 2 x 14 wheels");
860 
861  // ========================================
862  // get all modules for TRT Endcap Level 2 alignment
863  // Level 2 in the endcaps is 14 wheels per endcap
864  // i.e. 28 AlignModules in total
865 
866  // define modules
867  // we'll stick with the base AlignModule here since we don't want to
868  // do shifting for the moment but we might need to extend AlignModule
869  // in the future
870 
871  // TRT detector element positions are stored in the DB in global frame
872  // so the DB frame to global frame transform is identity
873  Amg::Transform3D transform = Amg::Transform3D::Identity();
874 
875  // get maximum number of elements from the helper
876  unsigned int maxHash = 0;
877  if(m_alignLevelBarrel==3)
878  maxHash = m_idHelper->straw_hash_max();
879  else
880  maxHash = m_idHelper->straw_layer_hash_max();
881  ATH_MSG_DEBUG("maxHash for the TRT "<<maxHash);
882 
884  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)maxHash,nullptr);
886 
887  for (int iSide = 0; iSide < 2; iSide++) {
888  int idSide = iSide ? 2 : -2;
889  ATH_MSG_DEBUG("Side : "<<iSide<<" , idSide : "<<idSide);
890  if( m_endcap!=idSide && m_endcap!=0 ) {
891  ATH_MSG_DEBUG("Endcap "<<idSide<<" NOT aligned");
892  continue;
893  }
894 
895  for (unsigned int iWheel = 0; iWheel < m_trtDetManager->getNumerology()->getNEndcapWheels(); iWheel++) {
896  // create the AlignModule
897  Trk::AlignModule * mod = new Trk::AlignModule(this);
898  mod->setIdHash(getNextIDHash());
899  mod->setIdentifier(m_idHelper->module_id(idSide,0,iWheel));
900 
901  std::stringstream name;
902  name<<"TRT/Endcap/Module_"<<idSide<<"_"<<iWheel;
903  mod->setName(name.str());
904 
905  if(!moduleSelected(mod)) {
906  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
907  delete mod;
908  continue;
909  }
910 
911  ATH_MSG_DEBUG("Building module "<<mod->name());
912 
913  for (unsigned int iStrawLayer = 0; iStrawLayer < m_trtDetManager->getNumerology()->getNEndcapLayers(iWheel); iStrawLayer++) {
914  for(unsigned int iPhi = 0; iPhi < m_trtDetManager->getNumerology()->getNEndcapPhi(); iPhi++) {
915  const TRT_EndcapElement * element = m_trtDetManager->getEndcapElement(iSide, iWheel, iStrawLayer, iPhi);
916  if (element) {
917  // get element location for debugging
918 // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
919 // ATH_MSG_DEBUG(" TRTDetectorElement id: " << id << " with center = " << center);
920 
921  // add element to respective AlignModule
922  mod->addDetElement(Trk::AlignModule::TRT,element,transform);
923 
924  // and fill the corresponding map
925  (*trtIdHashMap)[element->identifyHash()] = mod;
926  }
927  else
928  ATH_MSG_DEBUG("No TRT_EndcapElement with side-wheel-strawLayer-phi:" <<iSide<<"-"<<iWheel<<"-"<<iStrawLayer<<"-"<<iPhi);
929  }
930  }
931 
932  // for endcap we move the CoG with no additional rotation
933  Amg::Translation3D translation(mod->centerOfGravity());
934  Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
935 
936  mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
937 
938  // add AlignModule to the geometry
939  m_alignModuleListPtr->push_back(mod);
940  }
941  }
942 
943  }
944 
945 
946 //_______________________________________________________________________
948 {
949  // ===========================
950  // BARREL Level 3
951  // ===========================
952  ATH_MSG_INFO("Preparing the TRT Barrel geometry for L3");
953 
954  // ========================================
955  // get all modules for TRT Barrel Level 3 alignment
956  // Level 3 is one AlignModule per straw
957 
958  // define modules
959  // we'll stick with the base AlignModule here since we don't want to
960  // do shifting for the moment but we might need to extend AlignModule
961  // in the future
962 
963  // TRT detector element positions are stored in the DB in global frame
964  // so the DB frame to global frame transform is identity
965  Amg::Transform3D transform = Amg::Transform3D::Identity();
966 
967  // get maximum number of elements from the helper
968  unsigned int maxHash = m_idHelper->straw_hash_max();
969  ATH_MSG_DEBUG("maxHash for the TRT "<<maxHash);
970 
972  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)maxHash,nullptr);
974 
975  for (unsigned int iPhiModule = 0; iPhiModule < m_trtDetManager->getNumerology()->getNBarrelPhi(); iPhiModule++) { // modules in phi
976  ATH_MSG_DEBUG("iPhiModule "<<iPhiModule);
977  for (unsigned int iLayer = 0; iLayer < m_trtDetManager->getNumerology()->getNBarrelRings(); iLayer++) {// barrel layers
978  ATH_MSG_DEBUG("iLayer "<<iLayer);
979 
980  if(!moduleSelectedBarrel(iLayer,iPhiModule)) {
981  ATH_MSG_INFO("Skipping barrel layer "<<iLayer<<" phi sector "<<iPhiModule);
982  continue;
983  }
984 
985  for (unsigned int iStrawLayer = 0; iStrawLayer < m_trtDetManager->getNumerology()->getNBarrelLayers(iLayer); iStrawLayer++) { // straw layers inside one phi module
986  ATH_MSG_DEBUG("iStrawLayer "<<iStrawLayer);
987  for (int iSide = 0; iSide < 2; iSide++) { // side of the straw
988  ATH_MSG_DEBUG("iSide "<<iSide);
989  int idSide = iSide ? 1 : -1;
990 
991  const TRT_BarrelElement * element = m_trtDetManager->getBarrelElement(iSide, iLayer, iPhiModule, iStrawLayer);
992  if(element) {
993  for (unsigned int iStraw = 0; iStraw< element->nStraws(); iStraw++)
994  {
995  ATH_MSG_DEBUG("iStraw "<<iStraw);
996 
997  // create the AlignModule
998  Trk::AlignModule * mod = new Trk::AlignModule(this);
999  mod->setIdHash(getNextIDHash());
1000  Identifier moduleId = m_idHelper->straw_id(idSide,iPhiModule,iLayer,iStrawLayer,iStraw);
1001  mod->setIdentifier(moduleId);
1002 
1003  std::stringstream name;
1004  name<<"TRT/Barrel/Straw_"<<idSide<<"_"<<iPhiModule<<"_"<<iLayer<<"_"<<iStrawLayer<<"_"<<iStraw;
1005  mod->setName(name.str());
1006 
1007  if(!moduleSelected(mod)) {
1008  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1009  delete mod;
1010  mod=nullptr;
1011  continue;
1012  }
1013 
1014  ATH_MSG_DEBUG("Building module "<<mod->name());
1015 
1016  // add element to respective AlignModule
1017  mod->addDetElement(Trk::AlignModule::TRT, element, transform, moduleId);
1018 
1019  // and fill the corresponding map
1020  (*trtIdHashMap)[m_idHelper->straw_hash(moduleId)] = mod;
1021 
1022  // set the align frame transform
1023  Amg::Transform3D localToGlobal = element->strawTransform(iStraw);
1024  Amg::RotationMatrix3D lgrot = localToGlobal.rotation();
1025  ATH_MSG_DEBUG("Prepared local to global transform : "<<std::setprecision(12)
1026  <<localToGlobal.translation()<<" "<<localToGlobal.rotation());
1027  ATH_MSG_DEBUG(" rotation = (" << lgrot(2,1) << "," << lgrot(0,2) << "," << lgrot(1,0) << ")");
1028 
1029  mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
1030 
1031  Amg::Transform3D aatr = element->transform();
1032  Amg::RotationMatrix3D aarot = aatr.rotation();
1033 
1034  ATH_MSG_DEBUG("Straw layer transform : "<<std::setprecision(12)
1035  <<aatr.translation()<<" "<<aatr.rotation());
1036  ATH_MSG_DEBUG(" rotation = (" << aarot(2,1) << "," << aarot(0,2) << "," << aarot(1,0) << ")");
1037 
1038  // add AlignModule to the geometry
1039  m_alignModuleListPtr->push_back(mod);
1040  }
1041  }
1042  else
1043  ATH_MSG_DEBUG("No TRT_BarrelElement with side-layer-phi-strawLayer:" <<iSide<<"-"<<iLayer<<"-"<<iPhiModule<<"-"<<iStrawLayer);
1044  }
1045  }
1046  }
1047  }
1048 
1049  }
1050 
1051 //_______________________________________________________________________
1053 {
1054  // ===========================
1055  // ENDCAP Level 3
1056  // ===========================
1057  ATH_MSG_INFO("Preparing the TRT Endcap geometry for L3");
1058 
1059  // ========================================
1060  // get all modules for TRT Endcap Level 3 alignment
1061  // Level 3 is one AlignModule per straw
1062 
1063  // define modules
1064  // we'll stick with the base AlignModule here since we don't want to
1065  // do shifting for the moment but we might need to extend AlignModule
1066  // in the future
1067 
1068  // TRT detector element positions are stored in the DB in the local frame
1069  // so the DB frame to local frame transform is identity
1070  Amg::Transform3D transform = Amg::Transform3D::Identity();
1071 
1072  // get maximum number of elements from the helper
1073  unsigned int maxHash = m_idHelper->straw_hash_max();
1074  ATH_MSG_DEBUG("maxHash for the TRT "<<maxHash);
1075 
1077  m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)maxHash,nullptr);
1079 
1080 
1081  for (int iSide = 0; iSide < 2; iSide++) { // endcap
1082  int idSide = iSide ? 2 : -2;
1083  ATH_MSG_DEBUG("Side : "<<iSide<<" , idSide : "<<idSide);
1084  if( m_endcap!=idSide && m_endcap!=0 ) {
1085  ATH_MSG_DEBUG("Endcap "<<idSide<<" NOT aligned");
1086  continue;
1087  }
1088 
1089  // wheels in Z
1090  for (unsigned int iWheel = 0; iWheel < m_trtDetManager->getNumerology()->getNEndcapWheels(); iWheel++) {
1091  ATH_MSG_DEBUG("iWheel "<<iWheel);
1092 
1093  // sectors in Phi
1094  for (unsigned int iPhiModule = 0; iPhiModule < m_trtDetManager->getNumerology()->getNEndcapPhi(); iPhiModule++) {
1095 
1096  ATH_MSG_DEBUG("iPhiModule "<<iPhiModule);
1097 
1098  if(!moduleSelectedEndcap(iWheel,iPhiModule)) {
1099  ATH_MSG_INFO("Skipping endcap wheel "<<iWheel<<" phi sector "<<iPhiModule);
1100  continue;
1101  }
1102 
1103  // endcap straw layers in z (with in a wheel)
1104  for (unsigned int iStrawLayer = 0; iStrawLayer < m_trtDetManager->getNumerology()->getNEndcapLayers(iWheel); iStrawLayer++) {
1105 
1106  const TRT_EndcapElement * element = m_trtDetManager->getEndcapElement(iSide, iWheel, iStrawLayer, iPhiModule);
1107 
1108  if(element) {
1109  for (unsigned int iStraw = 0; iStraw< element->nStraws(); iStraw++) {
1110  ATH_MSG_DEBUG("iStraw "<<iStraw);
1111 
1112  // create the AlignModule
1113  Trk::AlignModule * mod = new Trk::AlignModule(this);
1114  mod->setIdHash(getNextIDHash());
1115  Identifier moduleId = m_idHelper->straw_id(idSide,iPhiModule,iWheel,iStrawLayer,iStraw);
1116  mod->setIdentifier(moduleId);
1117 
1118  std::stringstream name;
1119  name<<"TRT/Endcap/Straw_"<<idSide<<"_"<<iPhiModule<<"_"<<iWheel<<"_"<<iStrawLayer<<"_"<<iStraw;
1120  mod->setName(name.str());
1121 
1122  if(!moduleSelected(mod)) {
1123  ATH_MSG_DEBUG("Module "<<mod->name()<<" NOT selected");
1124  delete mod;
1125  mod=nullptr;
1126  continue;
1127  }
1128 
1129  ATH_MSG_DEBUG("Building module "<<mod->name());
1130 
1131  // add element to respective AlignModule
1132  mod->addDetElement(Trk::AlignModule::TRT, element, transform, moduleId);
1133 
1134  // and fill the corresponding map
1135  (*trtIdHashMap)[m_idHelper->straw_hash(moduleId)] = mod;
1136 
1137  // set the align frame transform
1138  Amg::Transform3D localToGlobal = element->strawTransform(iStraw);
1139  Amg::RotationMatrix3D lgrot = localToGlobal.rotation();
1140 
1141  ATH_MSG_DEBUG("Prepared local to global transform : "<<std::setprecision(12)
1142  <<localToGlobal.translation()<<" "<<localToGlobal.rotation());
1143 
1144  ATH_MSG_DEBUG(" rotation = (" << lgrot(2,1) << "," << lgrot(0,2) << "," << lgrot(1,0) << ")");
1145 
1146  mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
1147 
1148  Amg::Transform3D aatr = element->transform();
1149  Amg::RotationMatrix3D aarot = aatr.rotation();
1150 
1151  ATH_MSG_DEBUG("Straw layer transform : "<<std::setprecision(12)
1152  <<aatr.translation()<<" "<<aatr.rotation());
1153  ATH_MSG_DEBUG(" rotation = (" << aarot(2,1) << "," << aarot(0,2) << "," << aarot(1,0) << ")");
1154 
1155  // add AlignModule to the geometry
1156  m_alignModuleListPtr->push_back(mod);
1157  }// Straws
1158  }// if the EndcapElement Exists
1159  else
1160  ATH_MSG_DEBUG("No TRT_EndcapElement with endcap-wheel-strawLayer-phi:" <<iSide<<"-"<<iWheel<<"-"<<iStrawLayer<<"-"<<iPhiModule);
1161  }// StrawLayer
1162  }// PhiModule
1163  }// Wheel
1164  }// Endcap
1165 
1166  }
1167 
1168 //________________________________________________________________________
1170 {
1171  // prepare all parameters
1179 
1180  // set sigmas
1181  setSigmas(module,fullModPars);
1182 
1183  // select active parameters based on jobOption properties
1185  for(unsigned int ipar=0;ipar<fullModPars->size();++ipar) {
1186 
1187  Identifier modID = module->identify();
1188 
1189  if(m_idHelper->is_barrel(modID)) {
1190  ATH_MSG_DEBUG("Barrel module with id "<<modID);
1191  if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignBarrelX)
1192  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignBarrelY)
1193  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignBarrelZ)
1194  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignBarrelRotX)
1195  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignBarrelRotY)
1196  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignBarrelRotZ) ) {
1197  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is now active");
1198  activeModPars->push_back(fullModPars->at(ipar));
1199  }
1200  else
1201  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is NOT active");
1202  }
1203  else {
1204  ATH_MSG_DEBUG("Endcap module with id "<<modID);
1205  if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignEndcapX)
1206  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignEndcapY)
1207  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignEndcapZ)
1208  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignEndcapRotX)
1209  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignEndcapRotY)
1210  || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignEndcapRotZ) ) {
1211  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is now active");
1212  activeModPars->push_back(fullModPars->at(ipar));
1213  }
1214  else
1215  ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is NOT active");
1216  }
1217  }
1218 
1219  // add to parameter lists
1220  allFullModPars->push_back(fullModPars);
1221  allActiveModPars->push_back(activeModPars);
1222 }
1223 
1224 
1225 //________________________________________________________________________
1227 {
1228  for(unsigned int ipar=0;ipar<modPars->size();++ipar) {
1229  // barrel
1230  if(m_idHelper->is_barrel(module->identify()))
1231  switch(modPars->at(ipar)->paramType()) {
1233  modPars->at(ipar)->setSigma(m_sigmaBarrelX);
1234  modPars->at(ipar)->setSoftCut(m_softcutBarrelX);
1235  break;
1237  modPars->at(ipar)->setSigma(m_sigmaBarrelY);
1238  modPars->at(ipar)->setSoftCut(m_softcutBarrelY);
1239  break;
1241  modPars->at(ipar)->setSigma(m_sigmaBarrelZ);
1242  modPars->at(ipar)->setSoftCut(m_softcutBarrelZ);
1243  break;
1245  modPars->at(ipar)->setSigma(m_sigmaBarrelRotX);
1246  modPars->at(ipar)->setSoftCut(m_softcutBarrelRotX);
1247  break;
1249  modPars->at(ipar)->setSigma(m_sigmaBarrelRotY);
1250  modPars->at(ipar)->setSoftCut(m_softcutBarrelRotY);
1251  break;
1253  modPars->at(ipar)->setSigma(m_sigmaBarrelRotZ);
1254  modPars->at(ipar)->setSoftCut(m_softcutBarrelRotZ);
1255  break;
1256  default:
1257  break;
1258  }
1259  // end-caps
1260  else
1261  switch(modPars->at(ipar)->paramType()) {
1263  modPars->at(ipar)->setSigma(m_sigmaEndcapX);
1264  modPars->at(ipar)->setSoftCut(m_softcutEndcapX);
1265  break;
1267  modPars->at(ipar)->setSigma(m_sigmaEndcapY);
1268  modPars->at(ipar)->setSoftCut(m_softcutEndcapY);
1269  break;
1271  modPars->at(ipar)->setSigma(m_sigmaEndcapZ);
1272  modPars->at(ipar)->setSoftCut(m_softcutEndcapZ);
1273  break;
1275  modPars->at(ipar)->setSigma(m_sigmaEndcapRotX);
1276  modPars->at(ipar)->setSoftCut(m_softcutEndcapRotX);
1277  break;
1279  modPars->at(ipar)->setSigma(m_sigmaEndcapRotY);
1280  modPars->at(ipar)->setSoftCut(m_softcutEndcapRotY);
1281  break;
1283  modPars->at(ipar)->setSigma(m_sigmaEndcapRotZ);
1284  modPars->at(ipar)->setSoftCut(m_softcutEndcapRotZ);
1285  break;
1286  default:
1287  break;
1288  }
1289  }
1290 }
1291 
1292 
1293 //________________________________________________________________________
1294 bool TRTGeometryManagerTool::moduleSelected(unsigned long long id)
1295 {
1296  if(!m_doModuleSelection)
1297  return true;
1298 
1299  int nsel = m_moduleSelection.size();
1300  for(int i=0;i<nsel;++i)
1301  if(m_moduleSelection.at(i) == id)
1302  return true;
1303 
1304  return false;
1305 }
1306 
1307 
1308 //________________________________________________________________________
1310 {
1311  return moduleSelected(mod->identify().get_compact());
1312 }
1313 
1314 
1315 //________________________________________________________________________
1316 bool TRTGeometryManagerTool::moduleSelectedBarrel(unsigned int ilayer, unsigned int iphi)
1317 {
1318  bool select = true;
1319  if(!m_barrelLayers.empty()) {
1320  select = false;
1321  for(unsigned int i=0;i<m_barrelLayers.size();i++) {
1322  if(m_barrelLayers[i] == (int)ilayer) {
1323  select = true;
1324  break;
1325  }
1326  }
1327  }
1328 
1329  if(!select)
1330  return false;
1331 
1332  if(!m_barrelPhiSectors.empty()) {
1333  select = false;
1334  for(unsigned int i=0;i<m_barrelPhiSectors.size();i++) {
1335  if(m_barrelPhiSectors[i] == (int)iphi) {
1336  select = true;
1337  break;
1338  }
1339  }
1340  }
1341 
1342  return select;
1343 }
1344 
1345 //________________________________________________________________________
1346 bool TRTGeometryManagerTool::moduleSelectedEndcap(unsigned int iwheel, unsigned int iphi)
1347 {
1348  bool select = true;
1349  if(!m_endcapWheels.empty()) {
1350  select = false;
1351  for(unsigned int i=0;i<m_endcapWheels.size();++i) {
1352  if(m_endcapWheels[i] == (int)iwheel) {
1353  select = true;
1354  break;
1355  }
1356  }
1357  }
1358 
1359  if(!select)
1360  return false;
1361 
1362  if(!m_endcapPhiSectors.empty()) {
1363  select = false;
1364  for(unsigned int i=0;i<m_endcapPhiSectors.size();i++) {
1365  if(m_endcapPhiSectors[i] == (int)iphi) {
1366  select = true;
1367  break;
1368  }
1369  }
1370  }
1371 
1372  return select;
1373 }
1374 
1375 
1376 //________________________________________________________________________
1378 {
1379  ATH_MSG_INFO("---------------------------------------------------");
1380  ATH_MSG_INFO("Summary of the alignment geometry");
1381  ATH_MSG_INFO("Number of alignable objects: "<<m_alignModuleList.size());
1382  ATH_MSG_INFO("Total number of aligment DoFs: "<<m_alignModuleTool->nAlignParameters());
1383 
1384  for(unsigned int i=0;i<m_alignModuleList.size();i++) {
1386  //ATH_MSG_DEBUG(i<<". "<< module->name());
1387  //ATH_MSG_DEBUG(" - identifier: "<<module->identify());
1388  //ATH_MSG_DEBUG(" - has "<<module->detElementCollection(Trk::AlignModule::TRT)->size()<<" TRT modules");
1389 
1390  Amg::Transform3D localtoglobal = (module->globalFrameToAlignFrame()).inverse();
1391  ATH_MSG_DEBUG(" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<" "<<localtoglobal.rotation());
1392 
1394  int npars = pars->size();
1395  ATH_MSG_DEBUG(" - number of active transform parameters: "<<npars);
1396  for(int j=0;j<npars;j++)
1397  ATH_MSG_DEBUG(" * par "<<j<<" \'"<<(*pars)[j]->dumpType()<<"\' : sigma = "<<(*pars)[j]->sigma()<<" , softCut = "<<(*pars)[j]->softCut());
1398  }
1399  ATH_MSG_INFO("---------------------------------------------------");
1400 }
1401 
1402 } // end namespace
1403 
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
make_hlt_rep.pars
pars
Definition: make_hlt_rep.py:90
Trk::IGeometryManagerTool::m_alignLevelBarrel
int m_alignLevelBarrel
alignment level
Definition: IGeometryManagerTool.h:116
InDet::TRTGeometryManagerTool::m_softcutEndcapRotY
double m_softcutEndcapRotY
Definition: TRTGeometryManagerTool.h:187
TRT_ID::layer_id
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
Definition: TRT_ID.h:494
InDet::TRTGeometryManagerTool::m_sigmaBarrelX
double m_sigmaBarrelX
Definition: TRTGeometryManagerTool.h:162
InDet::TRTGeometryManagerTool::m_softcutBarrelRotY
double m_softcutBarrelRotY
Definition: TRTGeometryManagerTool.h:180
InDetDD::TRT_BarrelElement
Definition: TRT_BarrelElement.h:43
InDet::TRTGeometryManagerTool::m_sigmaBarrelZ
double m_sigmaBarrelZ
Definition: TRTGeometryManagerTool.h:164
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
Trk::AlignModule::TRT
@ TRT
Definition: AlignModule.h:57
Trk::AlignModule::TransZ
@ TransZ
Definition: AlignModule.h:54
InDet::TRTGeometryManagerTool::m_fullAlignParList
DataVector< DataVector< Trk::AlignPar > > * m_fullAlignParList
Definition: TRTGeometryManagerTool.h:143
InDet::TRTGeometryManagerTool::buildL3Endcap
void buildL3Endcap()
builds geometry for L3 TRT Endcap alignment Creates many modules - one module per straw
Definition: TRTGeometryManagerTool.cxx:1052
InDet::TRTGeometryManagerTool::checkAlignLevelBarrel
bool checkAlignLevelBarrel()
check whether the Barrel alignment level is correct
Definition: TRTGeometryManagerTool.cxx:209
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:18
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
TRT_ID::straw_hash
IdentifierHash straw_hash(Identifier straw_id) const
straw hash from id - optimized
Definition: TRT_ID.h:762
TRT_DetectorManager.h
Trk::AlignModuleList
std::vector< AlignModule * > AlignModuleList
Definition: AlignModuleList.h:37
InDet::TRTGeometryManagerTool::checkAlignLevelEndcaps
bool checkAlignLevelEndcaps()
check whether the Endcap alignment level is correct
Definition: TRTGeometryManagerTool.cxx:226
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
InDetDD::TRT_DetectorManager::getBarrelElement
const TRT_BarrelElement * getBarrelElement(unsigned int positive, unsigned int moduleIndex, unsigned int phiIndex, unsigned int strawLayerIndex) const
Access Barrel Elements:---------------—(Fast)-------------------------—.
Definition: TRT_DetectorManager.cxx:100
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
InDet
Primary Vertex Finder.
Definition: VP1ErrorUtils.h:36
InDet::TRTGeometryManagerTool::dumpGeometry
void dumpGeometry()
print basic geometry info to screen
Definition: TRTGeometryManagerTool.cxx:1377
InDet::TRTGeometryManagerTool::m_alignEndcapZ
bool m_alignEndcapZ
Definition: TRTGeometryManagerTool.h:157
InDet::TRTGeometryManagerTool::m_alignBarrelX
bool m_alignBarrelX
Definition: TRTGeometryManagerTool.h:148
InDetDD::TRT_BaseElement::nStraws
unsigned int nStraws() const
Number of straws in the element.
InDet::TRTGeometryManagerTool::m_sigmaEndcapY
double m_sigmaEndcapY
Definition: TRTGeometryManagerTool.h:170
InDet::TRTGeometryManagerTool::m_barrelLayers
std::vector< int > m_barrelLayers
list of barrel layers to align (if empty, align everything)
Definition: TRTGeometryManagerTool.h:191
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::TRTGeometryManagerTool::moduleSelectedBarrel
bool moduleSelectedBarrel(unsigned int iLayer, unsigned int iPhi)
check wheather barrel module is selected by layer and phi
Definition: TRTGeometryManagerTool.cxx:1316
InDet::TRTGeometryManagerTool::buildGeometry
void buildGeometry()
builds geometry for TRT alignment
Definition: TRTGeometryManagerTool.cxx:285
InDet::TRTGeometryManagerTool::m_alignEndcaps
bool m_alignEndcaps
Definition: TRTGeometryManagerTool.h:146
TRT_ID.h
This is an Identifier helper class for the TRT subdetector. This class is a factory for creating comp...
InDet::TRTGeometryManagerTool::m_alignBarrelY
bool m_alignBarrelY
Definition: TRTGeometryManagerTool.h:149
InDetDD::TRT_EndcapElement
Definition: TRT_EndcapElement.h:43
InDet::TRTGeometryManagerTool::buildL2Endcaps
void buildL2Endcaps()
builds geometry for L2 TRT Endcapalignment Creates 80 modules - 40 rings per endcap
Definition: TRTGeometryManagerTool.cxx:718
InDet::TRTGeometryManagerTool::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: TRTGeometryManagerTool.cxx:1169
Trk::AlignModule
Definition: AlignModule.h:45
AthCommonMsg< AlgTool >::msgLvl
bool msgLvl(const MSG::Level lvl) const
Definition: AthCommonMsg.h:30
Trk::AlignModule::centerOfGravity
Amg::Vector3D centerOfGravity() const
Definition: AlignModule.cxx:119
Trk::IGeometryManagerTool::m_alignLevelEndcaps
int m_alignLevelEndcaps
alignment level
Definition: IGeometryManagerTool.h:117
InDet::TRTGeometryManagerTool::setAlignLevel
void setAlignLevel(int level)
set alignment level
Definition: TRTGeometryManagerTool.cxx:174
InDet::TRTGeometryManagerTool::buildL1Barrel
void buildL1Barrel()
builds geometry for L1 TRT Barrel alignment Creates single module for barrel
Definition: TRTGeometryManagerTool.cxx:408
InDet::TRTGeometryManagerTool::buildL1Endcaps
void buildL1Endcaps()
builds geometry for L1 TRT Endcap alignment Creates 2 modules, one for each endcap
Definition: TRTGeometryManagerTool.cxx:483
TRT_ID::barrel_ec_id
Identifier barrel_ec_id(int barrel_ec) const
For +/-barrel or +/-endcap id.
Definition: TRT_ID.h:411
InDet::TRTGeometryManagerTool::m_barrelPhiSectors
std::vector< int > m_barrelPhiSectors
list of barrel phi sectors to align (if empty, align everything)
Definition: TRTGeometryManagerTool.h:190
InDet::TRTGeometryManagerTool::ReadGeometry
int ReadGeometry(int solveLevel)
read the geometry Method is called from the main AlignAlg to build the geometry based on the requeste...
Definition: TRTGeometryManagerTool.cxx:243
InDet::TRTGeometryManagerTool::m_endcap
int m_endcap
endcap_id of the endcap to align (-2 or 2 for endcap A or C, 0 for both)
Definition: TRTGeometryManagerTool.h:193
Trk::AlignPar::paramType
AlignModule::TransformParameters paramType() const
returns the type of parameter (i.e.
Definition: AlignPar.h:47
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
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
Trk::IGeometryManagerTool::m_alignLevel
int m_alignLevel
alignment level
Definition: IGeometryManagerTool.h:115
InDet::TRTGeometryManagerTool::m_softcutBarrelRotX
double m_softcutBarrelRotX
Definition: TRTGeometryManagerTool.h:179
AlignModule
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
InDet::TRTGeometryManagerTool::initialize
StatusCode initialize()
Definition: TRTGeometryManagerTool.cxx:123
python.PyAthena.module
module
Definition: PyAthena.py:131
InDet::TRTGeometryManagerTool::m_sigmaEndcapRotZ
double m_sigmaEndcapRotZ
Definition: TRTGeometryManagerTool.h:174
InDet::TRTGeometryManagerTool::m_alignBarrelRotY
bool m_alignBarrelRotY
Definition: TRTGeometryManagerTool.h:152
InDet::TRTGeometryManagerTool::m_alignEndcapRotZ
bool m_alignEndcapRotZ
Definition: TRTGeometryManagerTool.h:160
InDet::TRTGeometryManagerTool::m_idHelper
const TRT_ID * m_idHelper
Definition: TRTGeometryManagerTool.h:133
TRT_EndcapElement.h
InDetDD::TRT_DetectorManager::getNumerology
TRT_Numerology * getNumerology()
Access Numerological information:---------------------------------------—.
Definition: TRT_DetectorManager.cxx:43
InDet::TRTGeometryManagerTool::m_alignModuleTool
ToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
pointer to AlignModuleTool
Definition: TRTGeometryManagerTool.h:135
InDet::TRTGeometryManagerTool::m_alignEndcapRotX
bool m_alignEndcapRotX
Definition: TRTGeometryManagerTool.h:158
InDet::TRTGeometryManagerTool::m_alignEndcapY
bool m_alignEndcapY
Definition: TRTGeometryManagerTool.h:156
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::TRTGeometryManagerTool::m_alignEndcapRotY
bool m_alignEndcapRotY
Definition: TRTGeometryManagerTool.h:159
InDet::TRTGeometryManagerTool::m_sigmaEndcapZ
double m_sigmaEndcapZ
Definition: TRTGeometryManagerTool.h:171
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::TRTGeometryManagerTool::m_softcutEndcapX
double m_softcutEndcapX
Definition: TRTGeometryManagerTool.h:183
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
MuonR4::inverse
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
Definition: MuonSpectrometer/MuonPhaseII/Event/MuonSpacePoint/src/UtilFunctions.cxx:65
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Definition: AthCommonDataStore.h:145
InDet::TRTGeometryManagerTool::m_alignBarrelRotZ
bool m_alignBarrelRotZ
Definition: TRTGeometryManagerTool.h:153
xAOD::rotation
rotation
Definition: TrackSurface_v1.cxx:15
InDet::TRTGeometryManagerTool::m_softcutEndcapZ
double m_softcutEndcapZ
Definition: TRTGeometryManagerTool.h:185
Trk::trtEndCap
@ trtEndCap
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:257
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDet::TRTGeometryManagerTool::m_moduleSelection
std::vector< unsigned long long > m_moduleSelection
Definition: TRTGeometryManagerTool.h:198
Amg::transform
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
Definition: GeoPrimitivesHelpers.h:156
InDet::TRTGeometryManagerTool::m_softcutBarrelRotZ
double m_softcutBarrelRotZ
Definition: TRTGeometryManagerTool.h:181
Trk::AlignPar
Definition: AlignPar.h:25
test_pyathena.parent
parent
Definition: test_pyathena.py:15
InDet::TRTGeometryManagerTool::~TRTGeometryManagerTool
virtual ~TRTGeometryManagerTool()
Definition: TRTGeometryManagerTool.cxx:109
Trk::AlignModule::RotX
@ RotX
Definition: AlignModule.h:54
InDet::TRTGeometryManagerTool::m_softcutBarrelZ
double m_softcutBarrelZ
Definition: TRTGeometryManagerTool.h:178
InDet::TRTGeometryManagerTool::m_alignModuleList
Trk::AlignModuleList m_alignModuleList
Definition: TRTGeometryManagerTool.h:137
InDetDD::TRT_BaseElement::identify
virtual Identifier identify() const override final
identifier of this detector element:
InDetDD::TRT_Numerology::getNBarrelLayers
unsigned int getNBarrelLayers(unsigned int iMod) const
InDet::TRTGeometryManagerTool::moduleSelectedEndcap
bool moduleSelectedEndcap(unsigned int iwheel, unsigned int iphi)
check wheather we are aligning the different endcaps and sectors
Definition: TRTGeometryManagerTool.cxx:1346
TRT_ID::barrel_ec
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Definition: TRT_ID.h:860
TRT_ID::straw_layer
int straw_layer(const Identifier &id) const
Definition: TRT_ID.h:887
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
AlignModuleList.h
InDetDD::TRT_BaseElement::identifyHash
virtual IdentifierHash identifyHash() const override final
identifier hash
TRT_BarrelElement.h
InDet::TRTGeometryManagerTool::m_trtDetManager
const InDetDD::TRT_DetectorManager * m_trtDetManager
pointer to TRT detector manager
Definition: TRTGeometryManagerTool.h:131
InDet::TRTGeometryManagerTool::m_sigmaEndcapRotY
double m_sigmaEndcapRotY
Definition: TRTGeometryManagerTool.h:173
Trk::AlignModule::name
const std::string & name() const
Definition: AlignModule.h:89
InDetDD::TRT_DetectorManager::getEndcapElement
const TRT_EndcapElement * getEndcapElement(unsigned int positive, unsigned int wheelIndex, unsigned int strawLayerIndex, unsigned int phiIndex) const
Access Endcap Elements:---------------—(Fast)--------------------------—.
Definition: TRT_DetectorManager.cxx:116
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
InDet::TRTGeometryManagerTool::buildL2Barrel
void buildL2Barrel()
builds geometry for L2 TRT Barrel alignment Creates 96 modules - 3 layers with 32 modules per layer
Definition: TRTGeometryManagerTool.cxx:569
InDet::TRTGeometryManagerTool::m_softcutEndcapRotZ
double m_softcutEndcapRotZ
Definition: TRTGeometryManagerTool.h:188
InDet::TRTGeometryManagerTool::m_sigmaBarrelRotX
double m_sigmaBarrelRotX
Definition: TRTGeometryManagerTool.h:165
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
InDet::TRTGeometryManagerTool::m_dumpGeometry
bool m_dumpGeometry
Definition: TRTGeometryManagerTool.h:200
InDet::TRTGeometryManagerTool::m_sigmaBarrelRotY
double m_sigmaBarrelRotY
Definition: TRTGeometryManagerTool.h:166
InDetDD::TRT_DetectorManager::getElement
const TRT_BaseElement * getElement(Identifier id) const
Access Elements Generically---------------------------------------------—.
Definition: TRT_DetectorManager.cxx:145
AlignModule.h
InDet::TRTGeometryManagerTool::moduleSelected
bool moduleSelected(Trk::AlignModule *mod)
check wheather module is selected for module pointer
Definition: TRTGeometryManagerTool.cxx:1309
InDet::TRTGeometryManagerTool::m_endcapWheels
std::vector< int > m_endcapWheels
list of endcap wheels to align (if empty, align everything)
Definition: TRTGeometryManagerTool.h:195
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
InDet::TRTGeometryManagerTool::m_softcutEndcapRotX
double m_softcutEndcapRotX
Definition: TRTGeometryManagerTool.h:186
Trk::IGeometryManagerTool::m_logStream
std::ostream * m_logStream
logfile output stream
Definition: IGeometryManagerTool.h:113
Trk::trtBarrel
@ trtBarrel
Definition: Tracking/TrkEvent/TrkTrackSummary/TrkTrackSummary/TrackSummary.h:256
InDet::TRTGeometryManagerTool::m_sigmaBarrelRotZ
double m_sigmaBarrelRotZ
Definition: TRTGeometryManagerTool.h:167
InDet::TRTGeometryManagerTool::m_softcutEndcapY
double m_softcutEndcapY
Definition: TRTGeometryManagerTool.h:184
TRT_ID::straw_hash_max
size_type straw_hash_max() const
Definition: TRT_ID.h:923
Trk::iPhi
@ iPhi
Definition: ParamDefs.h:47
Trk::AlignModule::setIdHash
void setIdHash(IdentifierHash id)
Definition: AlignModule.h:93
InDet::TRTGeometryManagerTool::finalize
StatusCode finalize()
Definition: TRTGeometryManagerTool.cxx:166
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
InDetDD::TRT_BaseElement::strawTransform
const Amg::Transform3D & strawTransform(unsigned int straw) const
Straw transform - fast access in array, in Tracking frame: Amg.
Definition: TRT_BaseElement.cxx:89
TRT_ID::is_barrel
bool is_barrel(const Identifier &id) const
Test for barrel.
Definition: TRT_ID.h:851
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
InDet::TRTGeometryManagerTool::m_alignParList
DataVector< DataVector< Trk::AlignPar > > * m_alignParList
Definition: TRTGeometryManagerTool.h:142
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
python.Constants.INFO
int INFO
Definition: Control/AthenaCommon/python/Constants.py:15
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::TRTGeometryManagerTool::m_softcutBarrelY
double m_softcutBarrelY
Definition: TRTGeometryManagerTool.h:177
DEBUG
#define DEBUG
Definition: page_access.h:11
InDet::TRTGeometryManagerTool::m_alignBarrelRotX
bool m_alignBarrelRotX
Definition: TRTGeometryManagerTool.h:151
Amg::Translation3D
Eigen::Translation< double, 3 > Translation3D
Definition: GeoPrimitives.h:44
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
IAlignModuleTool.h
AlignPar.h
TRT_Numerology.h
InDet::TRTGeometryManagerTool::m_alignEndcapX
bool m_alignEndcapX
Definition: TRTGeometryManagerTool.h:155
TRTGeometryManagerTool.h
Trk::AlignPar::setSoftCut
void setSoftCut(double softCut)
sets soft-mode-cut
Definition: AlignPar.h:90
InDet::TRTGeometryManagerTool::buildL0
void buildL0()
builds geometry for L1 TRT alignment Creates 1 module - the whole TRT
Definition: TRTGeometryManagerTool.cxx:331
DataVector::at
const T * at(size_type n) const
Access an element, as an rvalue.
InDet::TRTGeometryManagerTool::buildL3Barrel
void buildL3Barrel()
builds geometry for L3 TRT Barrel alignment Creates many modules - one module per straw
Definition: TRTGeometryManagerTool.cxx:947
AthAlgTool
Definition: AthAlgTool.h:26
TRT_ID::straw_layer_hash_max
size_type straw_layer_hash_max() const
Definition: TRT_ID.h:914
InDet::TRTGeometryManagerTool::m_alignBarrelZ
bool m_alignBarrelZ
Definition: TRTGeometryManagerTool.h:150
Trk::AlignModule::RotZ
@ RotZ
Definition: AlignModule.h:54
InDet::TRTGeometryManagerTool::m_endcapPhiSectors
std::vector< int > m_endcapPhiSectors
list of endcap phi sectors to align (if empty, align everything)
Definition: TRTGeometryManagerTool.h:194
DerivationFramework::ClustersInCone::select
void select(const xAOD::IParticle *particle, const float coneSize, const xAOD::CaloClusterContainer *clusters, std::vector< bool > &mask)
Definition: ClustersInCone.cxx:14
InDet::TRTGeometryManagerTool::m_sigmaBarrelY
double m_sigmaBarrelY
Definition: TRTGeometryManagerTool.h:163
InDet::TRTGeometryManagerTool::m_sigmaEndcapRotX
double m_sigmaEndcapRotX
Definition: TRTGeometryManagerTool.h:172
Trk::AlignModule::TransY
@ TransY
Definition: AlignModule.h:54
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
InDet::TRTGeometryManagerTool::m_idHashToAlignModuleMaps
std::vector< Trk::AlignModuleList * > m_idHashToAlignModuleMaps
Definition: TRTGeometryManagerTool.h:140
InDet::TRTGeometryManagerTool::m_alignBarrel
bool m_alignBarrel
Definition: TRTGeometryManagerTool.h:145
InDet::TRTGeometryManagerTool::m_sigmaEndcapX
double m_sigmaEndcapX
Definition: TRTGeometryManagerTool.h:169
InDetDD::TRT_BaseElement
Definition: TRT_BaseElement.h:52
TRT_ID::module_id
Identifier module_id(int barrel_ec, int phi_module, int layer_or_wheel) const
For an individual module phi sector.
Definition: TRT_ID.h:442
TRT_ID::straw_id
Identifier straw_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer, int straw) const
Three ways of getting id for a single straw:
Definition: TRT_ID.h:575
InDet::TRTGeometryManagerTool::buildL2EndcapsOLD
void buildL2EndcapsOLD()
builds geometry for L2 TRT Endcapalignment Creates 28 modules - 14 wheels per endcap
Definition: TRTGeometryManagerTool.cxx:849
InDet::TRTGeometryManagerTool::checkAlignLevel
bool checkAlignLevel()
check whether the alignment level is correct
Definition: TRTGeometryManagerTool.cxx:181
InDetDD::TRT_BaseElement::transform
virtual const Amg::Transform3D & transform() const override final
Element Surface: Get Transform of element in Tracking frame: Amg.
InDet::TRTGeometryManagerTool::m_softcutBarrelX
double m_softcutBarrelX
Definition: TRTGeometryManagerTool.h:176
Identifier
Definition: IdentifierFieldParser.cxx:14
InDet::TRTGeometryManagerTool::setSigmas
void setSigmas(Trk::AlignModule *mod, DataVector< Trk::AlignPar > *modPars)
sets sigmas for modules
Definition: TRTGeometryManagerTool.cxx:1226
InDet::TRTGeometryManagerTool::m_doModuleSelection
bool m_doModuleSelection
Definition: TRTGeometryManagerTool.h:197