|
ATLAS Offline Software
|
Go to the documentation of this file.
34 PixelGeometryManagerTool::PixelGeometryManagerTool(
const std::string&
type,
35 const std::string&
name,
39 , m_detManager(
nullptr)
41 , m_alignModuleTool(
"Trk::AlignModuleTool/AlignModuleTool")
43 , m_alignParList(
nullptr)
44 , m_fullAlignParList(
nullptr)
45 , m_rdbAccessSvc(
"RDBAccessSvc",
name)
46 , m_geoModelSvc(
"GeoModelSvc",
name)
48 declareInterface<IGeometryManagerTool>(
this);
49 declareProperty(
"AlignModuleTool", m_alignModuleTool);
51 declareProperty(
"AlignBarrel", m_alignBarrel =
true);
52 declareProperty(
"AlignEndcaps", m_alignEndcaps =
true);
54 declareProperty(
"AlignBarrelX", m_alignBarrelX =
true);
55 declareProperty(
"AlignBarrelY", m_alignBarrelY =
true);
56 declareProperty(
"AlignBarrelZ", m_alignBarrelZ =
true);
57 declareProperty(
"AlignBarrelRotX", m_alignBarrelRotX =
true);
58 declareProperty(
"AlignBarrelRotY", m_alignBarrelRotY =
true);
59 declareProperty(
"AlignBarrelRotZ", m_alignBarrelRotZ =
true);
60 declareProperty(
"AlignBarrelBowX", m_alignBarrelBowX =
false);
63 declareProperty(
"AlignEndcapX", m_alignEndcapX =
true);
64 declareProperty(
"AlignEndcapY", m_alignEndcapY =
true);
65 declareProperty(
"AlignEndcapZ", m_alignEndcapZ =
true);
66 declareProperty(
"AlignEndcapRotX", m_alignEndcapRotX =
true);
67 declareProperty(
"AlignEndcapRotY", m_alignEndcapRotY =
true);
68 declareProperty(
"AlignEndcapRotZ", m_alignEndcapRotZ =
true);
70 declareProperty(
"SetSigmaBarrelX", m_sigmaBarrelX = 1.);
71 declareProperty(
"SetSigmaBarrelY", m_sigmaBarrelY = 1.);
72 declareProperty(
"SetSigmaBarrelZ", m_sigmaBarrelZ = 1.);
73 declareProperty(
"SetSigmaBarrelRotX", m_sigmaBarrelRotX = 0.001);
74 declareProperty(
"SetSigmaBarrelRotY", m_sigmaBarrelRotY = 0.001);
75 declareProperty(
"SetSigmaBarrelRotZ", m_sigmaBarrelRotZ = 0.001);
76 declareProperty(
"SetSigmaBarrelBowX", m_sigmaBarrelBowX = 1);
78 declareProperty(
"SetSigmaEndcapX", m_sigmaEndcapX = 1.);
79 declareProperty(
"SetSigmaEndcapY", m_sigmaEndcapY = 1.);
80 declareProperty(
"SetSigmaEndcapZ", m_sigmaEndcapZ = 1.);
81 declareProperty(
"SetSigmaEndcapRotX", m_sigmaEndcapRotX = 0.001);
82 declareProperty(
"SetSigmaEndcapRotY", m_sigmaEndcapRotY = 0.001);
83 declareProperty(
"SetSigmaEndcapRotZ", m_sigmaEndcapRotZ = 0.001);
85 declareProperty(
"SetSoftCutBarrelX", m_softcutBarrelX = 1.);
86 declareProperty(
"SetSoftCutBarrelY", m_softcutBarrelY = 1.);
87 declareProperty(
"SetSoftCutBarrelZ", m_softcutBarrelZ = 1.);
88 declareProperty(
"SetSoftCutBarrelRotX", m_softcutBarrelRotX = 1.);
89 declareProperty(
"SetSoftCutBarrelRotY", m_softcutBarrelRotY = 1.);
90 declareProperty(
"SetSoftCutBarrelRotZ", m_softcutBarrelRotZ = 1.);
91 declareProperty(
"SetSoftCutBarrelBowX", m_softcutBarrelBowX = 1.);
93 declareProperty(
"SetSoftCutEndcapX", m_softcutEndcapX = 1.);
94 declareProperty(
"SetSoftCutEndcapY", m_softcutEndcapY = 1.);
95 declareProperty(
"SetSoftCutEndcapZ", m_softcutEndcapZ = 1.);
96 declareProperty(
"SetSoftCutEndcapRotX", m_softcutEndcapRotX = 1.);
97 declareProperty(
"SetSoftCutEndcapRotY", m_softcutEndcapRotY = 1.);
98 declareProperty(
"SetSoftCutEndcapRotZ", m_softcutEndcapRotZ = 1.);
101 declareProperty(
"AlignmentLevel", m_alignLevel = 1);
102 declareProperty(
"AlignmentLevelBarrel", m_alignLevelBarrel = -1);
103 declareProperty(
"AlignmentLevelEndcaps", m_alignLevelEndcaps = -1);
104 declareProperty(
"AlignmentDBM", m_alignDBM =
false);
106 declareProperty(
"doModuleSelection", m_doModuleSelection =
false);
107 declareProperty(
"ModuleSelection", m_moduleSelection);
109 declareProperty(
"DumpGeometry", m_dumpGeometry =
true);
112 m_logStream =
nullptr;
160 return StatusCode::FAILURE;
162 return StatusCode::SUCCESS;
170 return StatusCode::SUCCESS;
221 case 12:
case 16:
case 2:
case 26:
case 27:
case 3:
226 ATH_MSG_FATAL(
"This level is not supported with the configured geometry");
236 ATH_MSG_FATAL(
"This level is not supported with the configured geometry");
255 case 12:
case 16:
case 2:
case 3:
302 ATH_MSG_INFO(
"Total number of degrees of freedom: "<<nDoF);
317 ATH_MSG_INFO(
" When checking for IBL-Layer, layer "<<iLayer<<
" not present");
398 ATH_MSG_INFO(
"Preparing the Pixel geometry for L1 : whole Pixel");
415 pixel->setName(
"Pixel");
437 IdentifierHash idHash =
index;
457 (*pixelIdHashMap)[idHash] =
pixel;
462 ATH_MSG_DEBUG(
"-------------------------------------------------------");
467 ATH_MSG_DEBUG(
"Pixel L1 module successfully added to the list");
477 ATH_MSG_INFO(
"Preparing the Pixel geometry for L11 : IBL + rest of pixel detector");
480 ATH_MSG_WARNING(
"No IBL in geometry; Maybe this is not the level you want to use");
500 pixel_old->
setName(
"Pixel/oldPixel");
515 IdentifierHash idHash =
index;
548 ATH_MSG_DEBUG(
"-------------------------------------------------------");
574 ATH_MSG_INFO(
"Preparing the Pixel Barrel geometry for L12 : whole barrel");
596 mod->setName(
"Pixel/Barrel");
651 ATH_MSG_INFO(
"Preparing the Pixel Barrel geometry for L15 : 2 barrel halfs");
673 top->setName(
"Pixel/Barrel/Top-half");
677 bottom->
setName(
"Pixel/Barrel/Bottom-half");
743 ATH_MSG_INFO(
"Preparing the Pixel Endcap geometry for L12 : 2 endcaps");
766 const std::string
name = (iEndcapIndex == 0)?
"Pixel/EndcapA":
"Pixel/EndcapC";
807 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
808 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
809 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
820 ATH_MSG_INFO(
"Preparing the Pixel Barrel geometry for L26 : IBL stave Pixel whole barrel");
845 pixel_old->
setName(
"Pixel/oldPixel");
936 mod->setGlobalFrameToAlignFrameTransform( alignModuleToGlobal.inverse() );
937 mod->resetAlignModuleToDetElementTransforms();
1076 unsigned int phi_top = 10;
1078 unsigned int phi_bottom = iLayer ? 30 : 20;
1081 std::string nametop=
"Pixel/Barrel/Layer_"+
std::to_string(iLayer)+
"_top";
1082 top->setName(nametop);
1084 std::string namebottom=
"Pixel/Barrel/Layer_"+
std::to_string(iLayer)+
"_bottom";
1142 ATH_MSG_INFO(
"Preparing the Pixel Barrel geometry for L26 : IBL stave Pixel L2");
1256 mod->setGlobalFrameToAlignFrameTransform( alignModuleToGlobal.inverse() );
1257 mod->resetAlignModuleToDetElementTransforms();
1275 ATH_MSG_INFO(
"Preparing the Pixel Barrel geometry for L27 : 112(132 incl. IBL) staves (ladders)");
1345 throw std::logic_error(
"No detector element at the 0th eta wafer.");
1347 mod->setGlobalFrameToAlignFrameTransform(element->
transform().inverse());
1362 ATH_MSG_INFO(
"Preparing the Pixel Endcap geometry for L2 : 2 x 3 disks");
1391 std::string
name= (iEndcapIndex == 0) ?
"Pixel/EndcapA/Disk_" + iWheelStr :
"Pixel/EndcapC/Disk_" + iWheelStr;
1427 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
1428 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1429 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1441 ATH_MSG_INFO(
"Preparing the Pixel Barrel geometry for L3 : module (wafer) level");
1509 mod->setGlobalFrameToAlignFrameTransform(element->
transform().inverse());
1528 ATH_MSG_INFO(
"Preparing the Pixel geometry for L3 : module (wafer) level");
1569 std::string
name = (iEndcapIndex == 0)?
"Pixel/EndcapA" :
"Pixel/EndcapC";
1600 mod->setGlobalFrameToAlignFrameTransform(element->
transform().inverse());
1621 ATH_MSG_INFO(
"Preparing the DBM Endcap geometry for L1 : 2 endcaps");
1649 IdentifierHash idHash =
index;
1688 ATH_MSG_DEBUG(
"-------------------------------------------------------");
1699 ATH_MSG_DEBUG(
"Endcap:" << dbm1->
name() <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
1700 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1714 ATH_MSG_DEBUG(
"Endcap:" << dbm2->
name() <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
1715 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1728 ATH_MSG_INFO(
"Preparing the DBM telescope geometry for L2 : 8 telescopes");
1737 std::vector<Trk::AlignModule*> mod_list;
1739 for (
unsigned int i = 0;
i < 8;
i++)
1749 mod_list.push_back(
mod);
1760 IdentifierHash idHash =
index;
1773 unsigned int telescope = -1;
1778 mod = mod_list.at(telescope);
1783 mod = mod_list.at(telescope);
1799 ATH_MSG_DEBUG(
"-------------------------------------------------------");
1803 for(
unsigned int i=0;
i<mod_list.size();
i++) {
1805 ATH_MSG_DEBUG(
"Module "<<mod_list.at(
i)->name()<<
" NOT selected");
1811 ATH_MSG_DEBUG(
"Endcap:" << mod_list.at(
i)->name() <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
1812 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1813 mod_list.at(
i)->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1826 ATH_MSG_INFO(
"Preparing the DBM module geometry for L3 : 24 modules");
1840 IdentifierHash idHash =
index;
1877 mod->setGlobalFrameToAlignFrameTransform(element->
transform().inverse());
1908 for(
unsigned int ipar=0;ipar<fullModPars->
size();++ipar) {
1946 allFullModPars->push_back(fullModPars);
1947 allActiveModPars->push_back(activeModPars);
1953 for(
unsigned int ipar=0;ipar<modPars->
size();++ipar) {
2027 for(
int i=0;
i<nsel;++
i)
2043 ATH_MSG_INFO(
"---------------------------------------------------");
2053 ATH_MSG_DEBUG(
" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<
" "<<localtoglobal.rotation());
2056 int npars =
pars->size();
2057 ATH_MSG_DEBUG(
" - number of active transform parameters: "<<npars);
2058 for(
int j=0;j<npars;j++)
2061 ATH_MSG_INFO(
"---------------------------------------------------");
2076 msg(MSG::ERROR)<<
"Layer 0 has only 22 phi modules: range 0-21, requested "<<phi<<
endmsg;
2079 if (phi>0 && phi<11)
2084 else if (
layer==1) {
2086 msg(MSG::ERROR)<<
"Layer 1 has only 38 phi modules: range 0-37, requested "<<phi<<
endmsg;
2094 else if (
layer==2) {
2096 msg(MSG::ERROR)<<
"Layer 2 has only 52 phi modules: range 0-51, requested "<<phi<<
endmsg;
2099 else if (phi<23 || phi>48)
2106 msg(MSG::ERROR)<<
"Pixel barrel only 3 layers: range 0-2, requested "<<
layer<<
endmsg;
2113 ATH_MSG_DEBUG(
" - translation: "<<tr.translation().x()<<
" "<<tr.translation().y()<<
" "<<tr.translation().z());
2115 ATH_MSG_DEBUG(
" "<<tr.rotation()(0,0)<<
" "<<tr.rotation()(0,1)<<
" "<<tr.rotation()(0,2));
2116 ATH_MSG_DEBUG(
" "<<tr.rotation()(1,0)<<
" "<<tr.rotation()(1,1)<<
" "<<tr.rotation()(1,2));
2117 ATH_MSG_DEBUG(
" "<<tr.rotation()(2,0)<<
" "<<tr.rotation()(2,1)<<
" "<<tr.rotation()(2,2));
2127 const std::string& detectorKey = versionKey.
tag();
2128 const std::string& detectorNode = versionKey.
node();
2130 ATH_MSG_INFO(
"--------------------- decode version key " << detectorKey<<
" "<<detectorNode);
2136 const IRDBRecord *geoTable_layer = (*geoSet_layer)[0];
2138 if (!geoTable_layer->
isFieldNull(
"STAVEINDEX")) staveIndex=geoTable_layer->
getInt(
"STAVEINDEX");
2142 const IRDBRecord *geoTable_stave = (*geoSet_stave)[staveIndex];
2144 if (!geoTable_stave->
isFieldNull(
"NOSKIPZERO")) noSkipZero=geoTable_stave->
getInt(
"NOSKIPZERO");
virtual int getInt(const std::string &fieldName) const =0
Get int field value.
def retrieve(aClass, aKey=None)
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
const Identifier & identify(const UncalibratedMeasurement *meas)
Returns the associated identifier from the muon measurement.
const SiNumerology & numerology() const
Access Numerology.
std::vector< AlignModule * > AlignModuleList
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
virtual const Amg::Transform3D & transform() const =0
Return local to global transform.
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...
bool useLayer(int layer) const
Check if layer exists.
bool msgLvl(const MSG::Level lvl) const
const std::string & node() const
Return the version node.
std::string dumpType() const
returns the string representing the type of parameter (i.e.
AlignModule::TransformParameters paramType() const
returns the type of parameter (i.e.
static Amg::Vector3D centerOfGravity(const std::vector< DetElementCollection * > &)
Calculates center of gravity (average center of associated det-elements)
bool is_blayer(const Identifier &id) const
Test for b-layer - WARNING: id MUST be pixel id, otherwise answer is not accurate....
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
bool skipEtaZeroForLayer(int layer) const
Check if eta_module=0 exists.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for g...
void setSigma(double sigma)
sets sigma
Definition of the abstract IRDBAccessSvc interface.
void setName(const std::string &name)
Set and return name of align module (i.e.
void setGlobalFrameToAlignFrameTransform(const Amg::Transform3D &t)
set global to alignment frame transforms
void setIdentifier(Identifier identifier)
Set and return identifier of module.
@ OWN_ELEMENTS
this data object owns its elements
::StatusCode StatusCode
StatusCode definition for legacy code.
CalibratedSpacePoint::Covariance_t inverse(const CalibratedSpacePoint::Covariance_t &mat)
Inverts the parsed matrix.
This is a helper class to query the version tags from GeoModelSvc and determine the appropriate tag a...
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
This is an Identifier helper class for both the Pixel and SCT subdetectors. This class defines identi...
const std::string & tag() const
Return version tag.
int endcapId(int index) const
Barrel/endcap identifier for each endcap.
bool useDisk(int disk) const
Check if disk exists.
int numLayers() const
Number of layers.
std::shared_ptr< IRDBRecordset > IRDBRecordset_ptr
const std::string & name() const
int layer_disk(const Identifier &id) const
std::string to_string(const DetectorType &type)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type wafer_hash_max(void) const
constexpr unsigned int numLayers()
bool is_dbm(const Identifier &id) const
Test for dbm - WARNING: id MUST be pixel id, otherwise answer is not accurate. Use SiliconID for gene...
void setIdHash(IdentifierHash id)
An STL vector of pointers that by default owns its pointed-to elements.
Definition of the abstract IRDBRecord interface.
#define ATH_MSG_WARNING(x)
virtual bool isFieldNull(const std::string &fieldName) const =0
Check if the field value is NULL.
IRDBRecord is one record in the IRDBRecordset object.
int beginEtaModuleForLayer(int layer) const
First eta_module number for a layer.
Eigen::Translation< double, 3 > Translation3D
virtual IdentifierHash identifyHash() const =0
Identifier hash.
void setSoftCut(double softCut)
sets soft-mode-cut
const T * at(size_type n) const
Access an element, as an rvalue.
Definition of the abstract IRDBRecordset interface.
int phi_module(const Identifier &id) const
setScale setgFexType iEta
size_type size() const noexcept
Returns the number of elements in the collection.
virtual SiDetectorElement * getDetectorElement(const Identifier &id) const override
access to individual elements : via Identifier