ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::InDetGeometryManagerTool Class Reference

#include <InDetGeometryManagerTool.h>

Inheritance diagram for InDet::InDetGeometryManagerTool:

Public Member Functions

virtual ~InDetGeometryManagerTool ()
StatusCode initialize ()
StatusCode finalize ()
int ReadGeometry (int solveLevel)
 read the geometry Method is called from the main AlignAlg to build the geometry based on the requested level of alignment.
void PrintModPositions ()
void StoreModPositions (std::string)
void buildGeometry ()
 builds geometry for Silicon alignment
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()
bool checkAlignLevel ()
 check whether the alignment level is correct
void setLogStream (std::ostream *os)
 sets the output stream for the logfile

Private Member Functions

void buildL0 ()
 creates L0 AlignModules for Silicon
void setSigmas (Trk::AlignModule *mod, DataVector< Trk::AlignPar > *modPars)
 sets sigmas for modules
bool moduleSelected (Trk::AlignModule *mod)
 check wheather module is selected for module pointer
bool moduleSelected (unsigned long long modId)
 check wheather module is selected for module id
void dumpGeometry ()
 print basic geometry info to screen
bool isOneDetOnly (const Trk::AlignModule *mod, Trk::AlignModule::DetectorType dettype) const
 check whether the module is of a single detector type
bool isSiOnly (const Trk::AlignModule *mod) const
 check whether the module is Silicon only

Private Attributes

const InDetDD::PixelDetectorManager * m_pixelDetManager {nullptr}
 pointer to PIX detector manager
const InDetDD::SCT_DetectorManager * m_sctDetManager {nullptr}
 pointer to SCT detector manager
const InDetDD::TRT_DetectorManager * m_trtDetManager {nullptr}
 pointer to TRT detector manager
const PixelID * m_pixHelper {nullptr}
 pointer to PIX detector manager
const SCT_ID * m_sctHelper {nullptr}
 pointer to SCT detector manager
const SiliconID * m_siHelper {nullptr}
 pointer to Silicon detector manager
const TRT_ID * m_trtHelper {nullptr}
 pointer to TRT detector manager
PublicToolHandle< Trk::IGeometryManagerTool > m_siGeoManager {this, "SiGeometryManager", ""}
 pointer to Silicon geometry manager
PublicToolHandle< Trk::IGeometryManagerTool > m_trtGeoManager {this, "TRTGeometryManager", ""}
 pointer to TRT geometry manager
PublicToolHandle< Trk::IAlignModuleTool > m_alignModuleTool {this, "AlignModuleTool", "Trk::AlignModuleTool/AlignModuleTool"}
 pointer to AlignModuleTool
Trk::AlignModuleList m_alignModuleList
Trk::AlignModuleList m_idHashToAlignModuleMap
std::vector< Trk::AlignModuleList * > m_idHashToAlignModuleMaps {std::vector<Trk::AlignModuleList *>(Trk::AlignModule::NDetectorTypes, nullptr)}
DataVector< DataVector< Trk::AlignPar > > * m_alignParList {nullptr}
DataVector< DataVector< Trk::AlignPar > > * m_fullAlignParList {nullptr}
Gaudi::Property< bool > m_alignX {this, "AlignX", true}
Gaudi::Property< bool > m_alignY {this, "AlignY", true}
Gaudi::Property< bool > m_alignZ {this, "AlignZ", true}
Gaudi::Property< bool > m_alignRotX {this, "AlignRotX", true}
Gaudi::Property< bool > m_alignRotY {this, "AlignRotY", true}
Gaudi::Property< bool > m_alignRotZ {this, "AlignRotZ", true}
Gaudi::Property< double > m_sigmaX {this, "SetSigmaX", 1.}
Gaudi::Property< double > m_sigmaY {this, "SetSigmaY", 1.}
Gaudi::Property< double > m_sigmaZ {this, "SetSigmaZ", 1.}
Gaudi::Property< double > m_sigmaRotX {this, "SetSigmaRotX", 0.001}
Gaudi::Property< double > m_sigmaRotY {this, "SetSigmaRotY", 0.001}
Gaudi::Property< double > m_sigmaRotZ {this, "SetSigmaRotZ", 0.001}
Gaudi::Property< bool > m_alignSi {this, "AlignSilicon", true}
Gaudi::Property< bool > m_alignTRT {this, "AlignTRT", true}
Gaudi::Property< int > m_alignLevelProp {this, "AlignmentLevel", -1}
 property, copied to m_alignLevel in initialize()
Gaudi::Property< bool > m_doModuleSelection {this, "doModuleSelection", false}
Gaudi::Property< std::vector< unsigned long long > > m_moduleSelection {this, "ModuleSelection", {}}
Gaudi::Property< bool > m_dumpGeometry {this, "DumpGeometry", true}

Detailed Description

Definition at line 48 of file InDetGeometryManagerTool.h.

Constructor & Destructor Documentation

◆ ~InDetGeometryManagerTool()

InDet::InDetGeometryManagerTool::~InDetGeometryManagerTool ( )
virtual

Definition at line 34 of file InDetGeometryManagerTool.cxx.

35 {
36 ATH_MSG_DEBUG("deleting alignModuleList");
37 for (const auto & i:m_alignModuleList){
38 delete i;
39 }
40 m_alignModuleList.clear();
41
42 ATH_MSG_DEBUG("deleting fullAlignParList");
43 delete m_fullAlignParList;
44 ATH_MSG_DEBUG("deleting alignParList");
45 delete m_alignParList;
46 }
#define ATH_MSG_DEBUG(x,...)
DataVector< DataVector< Trk::AlignPar > > * m_alignParList
DataVector< DataVector< Trk::AlignPar > > * m_fullAlignParList

Member Function Documentation

◆ addModuleParameters()

void InDet::InDetGeometryManagerTool::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 at line 424 of file InDetGeometryManagerTool.cxx.

425 {
426 // for standalone Silicon and TRT modules call the respective methods
427 if(isSiOnly(module)) {
428 m_siGeoManager->addModuleParameters(module,allFullModPars,allActiveModPars);
429 return;
430 }
431 else if(isOneDetOnly(module,Trk::AlignModule::TRT)) {
432 m_trtGeoManager->addModuleParameters(module,allFullModPars,allActiveModPars);
433 return;
434 }
435
436 // for combined modules we do the work here
437
438 // prepare all parameters
439 DataVector<Trk::AlignPar> * fullModPars = new DataVector<Trk::AlignPar>(SG::OWN_ELEMENTS);
440 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::TransX));
441 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::TransY));
442 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::TransZ));
443 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::RotX));
444 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::RotY));
445 fullModPars->push_back(new Trk::AlignPar(module,Trk::AlignModule::RotZ));
446
447 // set sigmas
448 setSigmas(module,fullModPars);
449
450 // select active parameters based on jobOption properties
451 DataVector<Trk::AlignPar> * activeModPars = new DataVector<Trk::AlignPar>(SG::VIEW_ELEMENTS);
452 for(unsigned int ipar=0;ipar<fullModPars->size();++ipar) {
453
454 Identifier AlimodID = module->identify();
455
456 ATH_MSG_DEBUG("Inner Detector module with id "<<AlimodID);
457 if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignX)
458 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignY)
459 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignZ)
460 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignRotX)
461 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignRotY)
462 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignRotZ) ) {
463 ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is now active");
464 activeModPars->push_back(fullModPars->at(ipar));
465 }
466 else
467 ATH_MSG_DEBUG("parameter type "<<fullModPars->at(ipar)->paramType()<<" is NOT active");
468 }
469
470 // now add parameters to the list
471 allFullModPars->push_back(fullModPars);
472 allActiveModPars->push_back(activeModPars);
473 }
const T * at(size_type n) const
Access an element, as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
bool isSiOnly(const Trk::AlignModule *mod) const
check whether the module is Silicon only
PublicToolHandle< Trk::IGeometryManagerTool > m_trtGeoManager
pointer to TRT geometry manager
PublicToolHandle< Trk::IGeometryManagerTool > m_siGeoManager
pointer to Silicon geometry manager
bool isOneDetOnly(const Trk::AlignModule *mod, Trk::AlignModule::DetectorType dettype) const
check whether the module is of a single detector type
void setSigmas(Trk::AlignModule *mod, DataVector< Trk::AlignPar > *modPars)
sets sigmas for modules
@ OWN_ELEMENTS
this data object owns its elements
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts

◆ buildGeometry()

void InDet::InDetGeometryManagerTool::buildGeometry ( )

builds geometry for Silicon alignment

Definition at line 221 of file InDetGeometryManagerTool.cxx.

222 {
223 ATH_MSG_INFO("Preparing the Inner Detector geometry");
224
225 int idHash = 0;
226
227 if(m_alignLevel==0)
228 buildL0();
229
230 else {
231
232 // Silicon
233 if(m_alignSi) {
234 m_siGeoManager->setFirstIDHash(idHash);
235 m_siGeoManager->setModuleList(m_alignModuleListPtr);
236 m_siGeoManager->setHashMaps(m_idHashToAlignModuleMapsPtr);
237
238 m_siGeoManager->buildGeometry();
239
240 idHash=m_siGeoManager->getNextIDHash();
241 }
242
243 // TRT
244 if(m_alignTRT) {
245 m_trtGeoManager->setFirstIDHash(idHash);
246 m_trtGeoManager->setModuleList(m_alignModuleListPtr);
247 m_trtGeoManager->setHashMaps(m_idHashToAlignModuleMapsPtr);
248
249 m_trtGeoManager->buildGeometry();
250 }
251 }
252
253 }
#define ATH_MSG_INFO(x,...)
void buildL0()
creates L0 AlignModules for Silicon

◆ buildL0()

void InDet::InDetGeometryManagerTool::buildL0 ( )
private

creates L0 AlignModules for Silicon

Definition at line 256 of file InDetGeometryManagerTool.cxx.

257 {
258 ATH_MSG_INFO("Preparing the Silicon geometry for L0");
259 // ========================================
260 // Level 0 is just one module containing
261 // the whole Inner Detector (Pixel+SCT+TRT)
262
263 Trk::AlignModule * indet = new Trk::AlignModule(this);
264 indet->setIdHash(getNextIDHash());
265 indet->setName("Inner Detector");
266
267 // use the identifier of the Pixel for the whole Inner Detector at L0
268 indet->setIdentifier(m_pixHelper->wafer_id(0,0,0,0));
269
270 // check if we're aligning Silicon
271 if(!moduleSelected(indet)) {
272 ATH_MSG_DEBUG("Module "<<indet->name()<<" NOT selected");
273 delete indet;
274 return;
275 }
276
277 ATH_MSG_DEBUG("Created module "<<indet->name()<<" idHash: "<<indet->identifyHash()<<" identifier: "<<indet->identify());
278
279 // for L0 alignment the alignment frame is equal to the global frame
280 // and since the PIXEL and SCT detector element positions are also stored
281 // in the global frame in DB, transform is identity
282 const Amg::Transform3D transform = Amg::Transform3D::Identity();
283
284
285 // PIXEL
286 // get maximum number of elements from the helper
287 unsigned int pixelmaxHash = m_pixHelper->wafer_hash_max();
288 ATH_MSG_DEBUG("maxHash for the Pixel: "<<pixelmaxHash);
289
290 if(!m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::Pixel))
291 m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::Pixel) = new Trk::AlignModuleList((size_t)(pixelmaxHash),nullptr);
292 Trk::AlignModuleList * pixelIdHashMap = m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::Pixel);
293
294 // ==================================================================
295 // loop over Pixel elements and add them to respective alignModules
296 // ==================================================================
297 for (unsigned int index = 0; index < pixelmaxHash; index++) {
298 IdentifierHash idHash = index;
299 Identifier id = m_pixHelper->wafer_id(idHash);
300
301 ATH_MSG_DEBUG(" Pixel DetectorElement idhash: "<<index);
302 ATH_MSG_DEBUG(" DetectorElement id: "<<id);
303
304 // get the element via hash
305 const SiDetectorElement * element2 = m_pixelDetManager->getDetectorElement(id);
306 if (element2) {
307 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*>( element2);
308
309 // get element location for debugging
310 // HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
311 // ATH_MSG_DEBUG(" DetectorElement idhash: " << index);
312 // ATH_MSG_DEBUG(" DetectorElement id: " << id << " with center = " << center);
313 // ATH_MSG_DEBUG(" Is Barrel: "<< m_pixHelper->is_barrel(id));
314
315 // add element to respective AlignModule
316
317 // add to the pixel structure
318 if(msgLvl(MSG::DEBUG)) {
319 if (m_pixHelper->is_barrel(id))
320 msg(MSG::DEBUG)<<"... Pixel barrel element"<<endmsg;
321 else
322 msg(MSG::DEBUG)<<"... Pixel endcap element"<<endmsg;
323 }
324 indet->addDetElement(Trk::AlignModule::Pixel,element,transform);
325
326 // and fill the corresponding map
327 (*pixelIdHashMap)[idHash] = indet;
328 }
329 else
330 ATH_MSG_DEBUG("No Pixel detector with id: "<<id);
331 }
332
333 // SCT
334 // get maximum number of elements from the helper
335 unsigned int sctmaxHash = m_sctHelper->wafer_hash_max();
336 ATH_MSG_DEBUG("maxHash for the SCT: "<<sctmaxHash);
337
338 if(!m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT))
339 m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT) = new Trk::AlignModuleList((size_t)(sctmaxHash),nullptr);
340 Trk::AlignModuleList * sctIdHashMap = m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::SCT);
341
342 // ================================================================
343 // loop over SCT elements and add them to respective alignModules
344 // ================================================================
345 for (unsigned int index = 0; index < sctmaxHash; index++) {
346 IdentifierHash idHash = index;
347 Identifier id = m_sctHelper->wafer_id(idHash);
348
349 ATH_MSG_DEBUG(" SCT DetectorElement idhash: "<<index);
350 ATH_MSG_DEBUG(" DetectorElement id: "<<id);
351
352 // get the element via hash
353 const SiDetectorElement * element2 = m_sctDetManager->getDetectorElement(id);
354 if (element2) {
355 const Trk::TrkDetElementBase * element = static_cast<const Trk::TrkDetElementBase*> (element2);
356
357 // add element to respective AlignModule
358
359 // add to the sct barrel structure
360 if(msgLvl(MSG::DEBUG)) {
361 if (m_sctHelper->is_barrel(id))
362 msg(MSG::DEBUG)<<"... SCT barrel element"<<endmsg;
363 else
364 msg(MSG::DEBUG)<<"... SCT endcap element"<<endmsg;
365 }
366 indet->addDetElement(Trk::AlignModule::SCT,element,transform);
367
368 // and fill the corresponding map
369 (*sctIdHashMap)[idHash] = indet;
370 }
371 else
372 ATH_MSG_DEBUG("No SCT detector with id: "<<id);
373 }
374
375
376 // TRT
377 // get maximum number of elements from the helper
378 unsigned int trtmaxHash = m_trtHelper->straw_layer_hash_max();
379 ATH_MSG_DEBUG("maxHash for the TRT "<<trtmaxHash);
380
381 if(!m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT))
382 m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT) = new Trk::AlignModuleList((size_t)(trtmaxHash),nullptr);
383 Trk::AlignModuleList * trtIdHashMap = m_idHashToAlignModuleMapsPtr->at(Trk::AlignModule::TRT);
384
385 // ================================================================
386 // loop over TRT elements and add them to respective alignModules
387 // ================================================================
388 for (unsigned int index = 0; index < trtmaxHash; index++) {
389 IdentifierHash idHash = index;
390 Identifier id = m_trtHelper->layer_id(idHash);
391
392 // get the element via hash
393 const TRT_BaseElement * element = m_trtDetManager->getElement(idHash);
394 if (element) {
395 // get element location for debugging
396// HepGeom::Point3D<double> center = element->transform() * HepGeom::Point3D<double>();
397// ATH_MSG_DEBUG(" TRTDetectorElement id: " << id << " with center = " << center);
398
399 // add element to respective AlignModule
400
401 // add to the Inner Detector structure
402 if(msgLvl(MSG::DEBUG)) {
403 if (m_trtHelper->is_barrel(id))
404 msg(MSG::DEBUG)<<"... TRT barrel element"<<endmsg;
405 else
406 msg(MSG::DEBUG)<<"... TRT endcap element"<<endmsg;
407 }
408 indet->addDetElement(Trk::AlignModule::TRT,element,transform);
409
410 // and fill the corresponding map
411 (*trtIdHashMap)[idHash] = indet;
412 }
413 else
414 ATH_MSG_DEBUG("No TRTDetectorElement with id: "<<id);
415 }
416
417 // add created module to the geometry
418 m_alignModuleListPtr->push_back(indet);
419
420 ATH_MSG_DEBUG("Inner Detector L0 module successfully added to the list");
421 }
#define endmsg
const TRT_ID * m_trtHelper
pointer to TRT detector manager
const InDetDD::SCT_DetectorManager * m_sctDetManager
pointer to SCT detector manager
const SCT_ID * m_sctHelper
pointer to SCT detector manager
const InDetDD::PixelDetectorManager * m_pixelDetManager
pointer to PIX detector manager
bool moduleSelected(Trk::AlignModule *mod)
check wheather module is selected for module pointer
const InDetDD::TRT_DetectorManager * m_trtDetManager
pointer to TRT detector manager
const PixelID * m_pixHelper
pointer to PIX detector manager
void setIdHash(IdentifierHash id)
Definition AlignModule.h:94
Identifier identify() const
Definition AlignModule.h:98
void setIdentifier(Identifier identifier)
Set and return identifier of module.
Definition AlignModule.h:97
const std::string & name() const
Definition AlignModule.h:90
void setName(const std::string &name)
Set and return name of align module (i.e.
Definition AlignModule.h:89
void addDetElement(AlignModule::DetectorType detType, const TrkDetElementBase *det, const Amg::Transform3D &transform, Identifier id=Identifier())
used to add a detector element to the align module with a align frame to detector element local frame...
IdentifierHash identifyHash() const
Set and return index of module, used by alignment classes to keep track of order of align module.
Definition AlignModule.h:93
Eigen::Affine3d Transform3D
str index
Definition DeMoScan.py:362
std::vector< AlignModule * > AlignModuleList
MsgStream & msg
Definition testRead.cxx:32

◆ checkAlignLevel()

bool InDet::InDetGeometryManagerTool::checkAlignLevel ( )

check whether the alignment level is correct

Definition at line 121 of file InDetGeometryManagerTool.cxx.

122 {
123 switch(m_alignLevel) {
124
125 case 0:
126 // for L0 we don't need the other two managers so everything is ok
127 ATH_MSG_INFO("Setting up level 0 alignment of the InnerDetector");
128 break;
129
130 case 1: case 2: case 3:
131 // for levels 1,2,3 we need the managers and we have to
132 // set the levels in them
133 if( (m_siGeoManager.empty() && m_alignSi) || (m_trtGeoManager.empty() && m_alignTRT) ) {
134 ATH_MSG_ERROR("SiliconGeometryManagerTool and/or TRTGeometryManagerTool not available");
135 ATH_MSG_ERROR("Can't set alignment geometry. ");
136 return false;
137 }
138
139 ATH_MSG_INFO("Setting up level "<<m_alignLevel<<" alignment of the Inner Detector");
140 m_siGeoManager->setAlignLevel(m_alignLevel);
141 m_trtGeoManager->setAlignLevel(m_alignLevel);
142
143 // we also check that the managers support the levels
144 if( (m_alignSi && !m_siGeoManager->checkAlignLevel()) || (m_alignTRT && !m_trtGeoManager->checkAlignLevel()) )
145 return false;
146 break;
147
148 case -1:
149 // if level is not set here (=-1) we need the Silicon and TRT
150 // managers but we trust their setup, we don't need to check it
151 if( (m_siGeoManager.empty() && m_alignSi) || (m_trtGeoManager.empty() && m_alignTRT) ) {
152 ATH_MSG_ERROR("SiGeometryManagerTool and/or TRTGeometryManagerTool not available");
153 ATH_MSG_ERROR("Can't set alignment geometry. ");
154 return false;
155 }
156 break;
157
158 default:
159 ATH_MSG_ERROR("Unknown alignment level "<<m_alignLevel<<". Can't set alignment geometry.");
160 return false;
161
162 }
163
164 return true;
165 }
#define ATH_MSG_ERROR(x,...)

◆ dumpGeometry()

void InDet::InDetGeometryManagerTool::dumpGeometry ( )
private

print basic geometry info to screen

Definition at line 519 of file InDetGeometryManagerTool.cxx.

520 {
521 ATH_MSG_INFO("---------------------------------------------------");
522 ATH_MSG_INFO("Summary of the alignment geometry");
523 ATH_MSG_INFO("Number of alignable objects: "<< m_alignModuleList.size());
524 for(unsigned int i=0;i<m_alignModuleList.size();i++) {
525 const Trk::AlignModule* module = m_alignModuleList.at(i);
526 ATH_MSG_INFO(i<<". "<< module->name());
527 ATH_MSG_INFO(" - identifier: "<<module->identify());
528 ATH_MSG_INFO(" - identifierHash: "<<module->identifyHash());
529 int npix(0);
530 int nsct(0);
531 int ntrt(0);
532 if(module->detElementCollection(Trk::AlignModule::Pixel)) {
533 npix = module->detElementCollection(Trk::AlignModule::Pixel)->size();
534 ATH_MSG_INFO(" - has "<<npix<<" Pixel modules");
535 }
536 if(module->detElementCollection(Trk::AlignModule::SCT)) {
537 nsct = module->detElementCollection(Trk::AlignModule::SCT)->size();
538 ATH_MSG_INFO(" - has "<<nsct<<" SCT modules");
539 }
540 if(module->detElementCollection(Trk::AlignModule::TRT)) {
541 ntrt = module->detElementCollection(Trk::AlignModule::TRT)->size();
542 ATH_MSG_INFO(" - has "<<ntrt<<" TRT modules");
543 }
544 if(npix && nsct)
545 ATH_MSG_INFO(" - has "<<npix+nsct<<" Silicon modules in total");
546 if((npix || nsct) && ntrt)
547 ATH_MSG_INFO(" - has "<<npix+nsct+ntrt<<" Inner Detector modules in total");
548
549 Amg::Transform3D localtoglobal = (module->globalFrameToAlignFrame()).inverse();
550 ATH_MSG_DEBUG(" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<" "<<localtoglobal.rotation());
551
552 DataVector<Trk::AlignPar> * pars = m_alignModuleTool->getAlignPars(module);
553 int npars = pars->size();
554 ATH_MSG_DEBUG(" - number of active transform parameters: "<<npars);
555 for(int j=0;j<npars;j++)
556 ATH_MSG_DEBUG(" * par "<<j<<": sigma = "<<(*pars)[j]->sigma());
557 }
558 ATH_MSG_INFO("---------------------------------------------------");
559 }
PublicToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
pointer to AlignModuleTool
float j(const xAOD::IParticle &, const xAOD::TrackMeasurementValidation &hit, const Eigen::Matrix3d &jab_inv)

◆ finalize()

StatusCode InDet::InDetGeometryManagerTool::finalize ( )

Definition at line 113 of file InDetGeometryManagerTool.cxx.

114 {
115 ATH_MSG_DEBUG("finalize() of InDetGeometryManagerTool");
116
117 return StatusCode::SUCCESS;
118 }

◆ initialize()

StatusCode InDet::InDetGeometryManagerTool::initialize ( )

Definition at line 49 of file InDetGeometryManagerTool.cxx.

50 {
51 ATH_MSG_DEBUG("initialize() of InDetGeometryManagerTool");
52
53 // alignment levels are members of the IGeometryManagerTool base class
54 m_alignLevel = m_alignLevelProp;
55
56 // retrieve AlignModuleTool
57 ATH_CHECK( m_alignModuleTool.retrieve() );
58
59 // retrieve Pixel helper
60 ATH_CHECK( detStore()->retrieve(m_pixHelper) );
61
62 // retrieve SCT helper
63 ATH_CHECK( detStore()->retrieve(m_sctHelper) );
64
65 // retrieve silicon helper
66 ATH_CHECK( detStore()->retrieve(m_siHelper) );
67
68 // retrieve TRT helper
69 ATH_CHECK( detStore()->retrieve(m_trtHelper) );
70
71 // retrieve PIX detector manager
72 ATH_CHECK ( detStore()->retrieve(m_pixelDetManager, "Pixel"));
73
74 // retrieve SCT detector manager
75 ATH_CHECK( detStore()->retrieve(m_sctDetManager, "SCT"));
76
77 // retrieve SCT detector manager
78 ATH_CHECK ( detStore()->retrieve(m_trtDetManager, "TRT") );
79
80 // dump module selection
81 if(m_doModuleSelection && msgLvl(MSG::INFO)) {
82 unsigned int idx{0};
83 ATH_MSG_INFO("Creating geometry for selected "<<m_moduleSelection.value().size()<<" modules:");
84 for(const auto & i:m_moduleSelection.value())
85 ATH_MSG_INFO(" "<<idx++<<". "<<i);
86 }
87
88 // retrieve SiGeometryManagerTool
89 if ( !m_siGeoManager.empty() ) {
90 ATH_CHECK ( m_siGeoManager.retrieve() );
91 }
92
93 // retrieve TRTGeometryManagerTool
94 if ( !m_trtGeoManager.empty() ) {
95 ATH_CHECK ( m_trtGeoManager.retrieve() );
96 }
97
98 if(!m_alignSi && !m_alignTRT && m_alignLevel!=0) {
99 ATH_MSG_FATAL("Alignment of both Silicon and TRT turned off. Aborting.");
100 return StatusCode::FAILURE;
101 }
102
103 // check allowed alignment level
104 if(!checkAlignLevel()) {
105 ATH_MSG_FATAL("Wrong alignment level.");
106 return StatusCode::FAILURE;
107 }
108
109 return StatusCode::SUCCESS;
110 }
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x,...)
Gaudi::Property< std::vector< unsigned long long > > m_moduleSelection
const SiliconID * m_siHelper
pointer to Silicon detector manager
Gaudi::Property< int > m_alignLevelProp
property, copied to m_alignLevel in initialize()
bool checkAlignLevel()
check whether the alignment level is correct

◆ isOneDetOnly()

bool InDet::InDetGeometryManagerTool::isOneDetOnly ( const Trk::AlignModule * mod,
Trk::AlignModule::DetectorType dettype ) const
private

check whether the module is of a single detector type

Definition at line 562 of file InDetGeometryManagerTool.cxx.

563 {
564 ATH_MSG_DEBUG("in isOneDetOnly for detector type "<<dettype);
565 const Trk::AlignModule::DetElementCollection * coll = mod->detElementCollection(dettype);
566 if(!coll || coll->empty())
567 return false;
568
569 int nelem(0);
570 for(int i=1;i<Trk::AlignModule::NDetectorTypes;i++) {
571 if(i==dettype)
572 continue;
573 coll = mod->detElementCollection((Trk::AlignModule::DetectorType)i);
574 if(coll)
575 nelem += coll->size();
576 }
577
578 if(nelem)
579 return false;
580
581 ATH_MSG_DEBUG("module IS of type "<<dettype);
582 return true;
583 }
std::vector< const TrkDetElementBase * > DetElementCollection
typedefs to contain detector element pointers and transforms
Definition AlignModule.h:61

◆ isSiOnly()

bool InDet::InDetGeometryManagerTool::isSiOnly ( const Trk::AlignModule * mod) const
private

check whether the module is Silicon only

Definition at line 586 of file InDetGeometryManagerTool.cxx.

587 {
588 ATH_MSG_DEBUG("in isSiOnly");
589 const Trk::AlignModule::DetElementCollection * collPix = mod->detElementCollection(Trk::AlignModule::Pixel);
590 const Trk::AlignModule::DetElementCollection * collSCT = mod->detElementCollection(Trk::AlignModule::SCT);
591 if((!collPix || collPix->empty()) && (!collSCT || collSCT->empty()))
592 return false;
593
594 int nelem(0);
595 for(int i=1;i<Trk::AlignModule::NDetectorTypes;i++) {
597 continue;
598 const Trk::AlignModule::DetElementCollection * coll = mod->detElementCollection((Trk::AlignModule::DetectorType)i);
599 if(coll)
600 nelem += coll->size();
601 }
602
603 if(nelem)
604 return false;
605
606 ATH_MSG_DEBUG("module IS of type Silicon");
607 return true;
608 }

◆ moduleSelected() [1/2]

bool InDet::InDetGeometryManagerTool::moduleSelected ( Trk::AlignModule * mod)
private

check wheather module is selected for module pointer

Definition at line 513 of file InDetGeometryManagerTool.cxx.

514 {
515 return moduleSelected(mod->identify().get_compact());
516 }

◆ moduleSelected() [2/2]

bool InDet::InDetGeometryManagerTool::moduleSelected ( unsigned long long modId)
private

check wheather module is selected for module id

Definition at line 505 of file InDetGeometryManagerTool.cxx.

506 {
507 if(!m_doModuleSelection) return true;
508 const bool found = (std::find(m_moduleSelection.value().begin(), m_moduleSelection.value().end(),id) != m_moduleSelection.value().end());
509 return found;
510 }

◆ PrintModPositions()

void InDet::InDetGeometryManagerTool::PrintModPositions ( )
inline

Definition at line 64 of file InDetGeometryManagerTool.h.

64{};

◆ ReadGeometry()

int InDet::InDetGeometryManagerTool::ReadGeometry ( int solveLevel)

read the geometry Method is called from the main AlignAlg to build the geometry based on the requested level of alignment.

It calls the other build() methods based on that.

Definition at line 178 of file InDetGeometryManagerTool.cxx.

179 {
180 ATH_MSG_DEBUG("in ReadGeometry() solveLevel="<<solveLevel);
181
182 // set pointers
183 m_idHashToAlignModuleMapsPtr = &m_idHashToAlignModuleMaps;
184 m_alignModuleListPtr = &m_alignModuleList;
185
186 // build alignment geometry
188
189 // now set the alignment parameters
190 // first prepare the parameter lists
191 m_alignParList = new DataVector< DataVector<Trk::AlignPar> >(SG::OWN_ELEMENTS);
192 m_fullAlignParList = new DataVector< DataVector<Trk::AlignPar> >(SG::OWN_ELEMENTS);
193 // loop over modules
194 ATH_MSG_DEBUG("Adding module parameters to modules");
195 for( const auto & imod:m_alignModuleList) {
196 ATH_MSG_DEBUG("Module "<<imod->name());
198 }
199
200 // set alignModuleList and hash table in the alignModuleTool
202 ATH_MSG_DEBUG(" geometry set in m_alignModuleTool");
203
204 // set alignPar lists in the alignModuleTool
205 ATH_MSG_DEBUG(" alignParList = "<<m_alignParList);
206 ATH_MSG_DEBUG(" fullAlignParList = "<<m_fullAlignParList);
208 ATH_MSG_DEBUG(" AlignParLists set in m_alignModuleTool");
209
210 // dump summary about the geometry setup
211 if (m_dumpGeometry)
212 dumpGeometry();
213
214 int nDoF= m_alignModuleTool->nAlignParameters();
215 ATH_MSG_INFO("Total number of degrees of freedom: "<<nDoF);
216
217 return nDoF;
218 }
void dumpGeometry()
print basic geometry info to screen
void buildGeometry()
builds geometry for Silicon alignment
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()
std::vector< Trk::AlignModuleList * > m_idHashToAlignModuleMaps

◆ setLogStream()

void InDet::InDetGeometryManagerTool::setLogStream ( std::ostream * os)

sets the output stream for the logfile

Definition at line 168 of file InDetGeometryManagerTool.cxx.

169 {
170 m_logStream = os;
171 if (!m_siGeoManager.empty())
172 m_siGeoManager->setLogStream(m_logStream);
173 if (!m_trtGeoManager.empty())
174 m_trtGeoManager->setLogStream(m_logStream);
175 }

◆ setSigmas()

void InDet::InDetGeometryManagerTool::setSigmas ( Trk::AlignModule * mod,
DataVector< Trk::AlignPar > * modPars )
private

sets sigmas for modules

Definition at line 476 of file InDetGeometryManagerTool.cxx.

477 {
478 ATH_MSG_DEBUG("Setting sigmas for module: "<<module->name());
479 for(unsigned int ipar=0;ipar<modPars->size();++ipar)
480 switch(modPars->at(ipar)->paramType()) {
482 modPars->at(ipar)->setSigma(m_sigmaX);
483 break;
485 modPars->at(ipar)->setSigma(m_sigmaY);
486 break;
488 modPars->at(ipar)->setSigma(m_sigmaZ);
489 break;
491 modPars->at(ipar)->setSigma(m_sigmaRotX);
492 break;
494 modPars->at(ipar)->setSigma(m_sigmaRotY);
495 break;
497 modPars->at(ipar)->setSigma(m_sigmaRotZ);
498 break;
499 default:
500 break;
501 }
502 }

◆ StoreModPositions()

void InDet::InDetGeometryManagerTool::StoreModPositions ( std::string )
inline

Definition at line 65 of file InDetGeometryManagerTool.h.

65{};

Member Data Documentation

◆ m_alignLevelProp

Gaudi::Property<int> InDet::InDetGeometryManagerTool::m_alignLevelProp {this, "AlignmentLevel", -1}
private

property, copied to m_alignLevel in initialize()

Definition at line 144 of file InDetGeometryManagerTool.h.

144{this, "AlignmentLevel", -1};

◆ m_alignModuleList

Trk::AlignModuleList InDet::InDetGeometryManagerTool::m_alignModuleList
private

Definition at line 117 of file InDetGeometryManagerTool.h.

◆ m_alignModuleTool

PublicToolHandle<Trk::IAlignModuleTool> InDet::InDetGeometryManagerTool::m_alignModuleTool {this, "AlignModuleTool", "Trk::AlignModuleTool/AlignModuleTool"}
private

pointer to AlignModuleTool

Definition at line 115 of file InDetGeometryManagerTool.h.

115{this, "AlignModuleTool", "Trk::AlignModuleTool/AlignModuleTool"};

◆ m_alignParList

DataVector< DataVector<Trk::AlignPar> >* InDet::InDetGeometryManagerTool::m_alignParList {nullptr}
private

Definition at line 122 of file InDetGeometryManagerTool.h.

122{nullptr};

◆ m_alignRotX

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignRotX {this, "AlignRotX", true}
private

Definition at line 129 of file InDetGeometryManagerTool.h.

129{this, "AlignRotX", true};

◆ m_alignRotY

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignRotY {this, "AlignRotY", true}
private

Definition at line 130 of file InDetGeometryManagerTool.h.

130{this, "AlignRotY", true};

◆ m_alignRotZ

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignRotZ {this, "AlignRotZ", true}
private

Definition at line 131 of file InDetGeometryManagerTool.h.

131{this, "AlignRotZ", true};

◆ m_alignSi

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignSi {this, "AlignSilicon", true}
private

Definition at line 141 of file InDetGeometryManagerTool.h.

141{this, "AlignSilicon", true};

◆ m_alignTRT

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignTRT {this, "AlignTRT", true}
private

Definition at line 142 of file InDetGeometryManagerTool.h.

142{this, "AlignTRT", true};

◆ m_alignX

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignX {this, "AlignX", true}
private

Definition at line 126 of file InDetGeometryManagerTool.h.

126{this, "AlignX", true};

◆ m_alignY

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignY {this, "AlignY", true}
private

Definition at line 127 of file InDetGeometryManagerTool.h.

127{this, "AlignY", true};

◆ m_alignZ

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_alignZ {this, "AlignZ", true}
private

Definition at line 128 of file InDetGeometryManagerTool.h.

128{this, "AlignZ", true};

◆ m_doModuleSelection

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_doModuleSelection {this, "doModuleSelection", false}
private

Definition at line 145 of file InDetGeometryManagerTool.h.

145{this, "doModuleSelection", false};

◆ m_dumpGeometry

Gaudi::Property<bool> InDet::InDetGeometryManagerTool::m_dumpGeometry {this, "DumpGeometry", true}
private

Definition at line 148 of file InDetGeometryManagerTool.h.

148{this, "DumpGeometry", true};

◆ m_fullAlignParList

DataVector< DataVector<Trk::AlignPar> >* InDet::InDetGeometryManagerTool::m_fullAlignParList {nullptr}
private

Definition at line 123 of file InDetGeometryManagerTool.h.

123{nullptr};

◆ m_idHashToAlignModuleMap

Trk::AlignModuleList InDet::InDetGeometryManagerTool::m_idHashToAlignModuleMap
private

Definition at line 118 of file InDetGeometryManagerTool.h.

◆ m_idHashToAlignModuleMaps

std::vector<Trk::AlignModuleList *> InDet::InDetGeometryManagerTool::m_idHashToAlignModuleMaps {std::vector<Trk::AlignModuleList *>(Trk::AlignModule::NDetectorTypes, nullptr)}
private

Definition at line 120 of file InDetGeometryManagerTool.h.

120{std::vector<Trk::AlignModuleList *>(Trk::AlignModule::NDetectorTypes, nullptr)};

◆ m_moduleSelection

Gaudi::Property<std::vector<unsigned long long> > InDet::InDetGeometryManagerTool::m_moduleSelection {this, "ModuleSelection", {}}
private

Definition at line 146 of file InDetGeometryManagerTool.h.

146{this, "ModuleSelection", {}};

◆ m_pixelDetManager

const InDetDD::PixelDetectorManager* InDet::InDetGeometryManagerTool::m_pixelDetManager {nullptr}
private

pointer to PIX detector manager

Definition at line 103 of file InDetGeometryManagerTool.h.

103{nullptr};

◆ m_pixHelper

const PixelID* InDet::InDetGeometryManagerTool::m_pixHelper {nullptr}
private

pointer to PIX detector manager

Definition at line 107 of file InDetGeometryManagerTool.h.

107{nullptr};

◆ m_sctDetManager

const InDetDD::SCT_DetectorManager* InDet::InDetGeometryManagerTool::m_sctDetManager {nullptr}
private

pointer to SCT detector manager

Definition at line 104 of file InDetGeometryManagerTool.h.

104{nullptr};

◆ m_sctHelper

const SCT_ID* InDet::InDetGeometryManagerTool::m_sctHelper {nullptr}
private

pointer to SCT detector manager

Definition at line 108 of file InDetGeometryManagerTool.h.

108{nullptr};

◆ m_siGeoManager

PublicToolHandle<Trk::IGeometryManagerTool> InDet::InDetGeometryManagerTool::m_siGeoManager {this, "SiGeometryManager", ""}
private

pointer to Silicon geometry manager

Definition at line 112 of file InDetGeometryManagerTool.h.

112{this, "SiGeometryManager", ""};

◆ m_sigmaRotX

Gaudi::Property<double> InDet::InDetGeometryManagerTool::m_sigmaRotX {this, "SetSigmaRotX", 0.001}
private

Definition at line 136 of file InDetGeometryManagerTool.h.

136{this, "SetSigmaRotX", 0.001};

◆ m_sigmaRotY

Gaudi::Property<double> InDet::InDetGeometryManagerTool::m_sigmaRotY {this, "SetSigmaRotY", 0.001}
private

Definition at line 137 of file InDetGeometryManagerTool.h.

137{this, "SetSigmaRotY", 0.001};

◆ m_sigmaRotZ

Gaudi::Property<double> InDet::InDetGeometryManagerTool::m_sigmaRotZ {this, "SetSigmaRotZ", 0.001}
private

Definition at line 138 of file InDetGeometryManagerTool.h.

138{this, "SetSigmaRotZ", 0.001};

◆ m_sigmaX

Gaudi::Property<double> InDet::InDetGeometryManagerTool::m_sigmaX {this, "SetSigmaX", 1.}
private

Definition at line 133 of file InDetGeometryManagerTool.h.

133{this, "SetSigmaX", 1.};

◆ m_sigmaY

Gaudi::Property<double> InDet::InDetGeometryManagerTool::m_sigmaY {this, "SetSigmaY", 1.}
private

Definition at line 134 of file InDetGeometryManagerTool.h.

134{this, "SetSigmaY", 1.};

◆ m_sigmaZ

Gaudi::Property<double> InDet::InDetGeometryManagerTool::m_sigmaZ {this, "SetSigmaZ", 1.}
private

Definition at line 135 of file InDetGeometryManagerTool.h.

135{this, "SetSigmaZ", 1.};

◆ m_siHelper

const SiliconID* InDet::InDetGeometryManagerTool::m_siHelper {nullptr}
private

pointer to Silicon detector manager

Definition at line 109 of file InDetGeometryManagerTool.h.

109{nullptr};

◆ m_trtDetManager

const InDetDD::TRT_DetectorManager* InDet::InDetGeometryManagerTool::m_trtDetManager {nullptr}
private

pointer to TRT detector manager

Definition at line 105 of file InDetGeometryManagerTool.h.

105{nullptr};

◆ m_trtGeoManager

PublicToolHandle<Trk::IGeometryManagerTool> InDet::InDetGeometryManagerTool::m_trtGeoManager {this, "TRTGeometryManager", ""}
private

pointer to TRT geometry manager

Definition at line 113 of file InDetGeometryManagerTool.h.

113{this, "TRTGeometryManager", ""};

◆ m_trtHelper

const TRT_ID* InDet::InDetGeometryManagerTool::m_trtHelper {nullptr}
private

pointer to TRT detector manager

Definition at line 110 of file InDetGeometryManagerTool.h.

110{nullptr};

The documentation for this class was generated from the following files: