31 const std::string& name,
32 const IInterface * parent)
41 declareInterface<IGeometryManagerTool>(
this);
127 return StatusCode::FAILURE;
134 msg(MSG::FATAL) <<
" Cannot retrieve SCT Helper " <<
endmsg;
135 return StatusCode::FAILURE;
142 msg(MSG::FATAL) <<
" Cannot retrieve SCT Detector Manager " <<
endmsg;
143 return StatusCode::FAILURE;
157 return StatusCode::FAILURE;
159 return StatusCode::SUCCESS;
167 return StatusCode::SUCCESS;
186 ATH_MSG_INFO(
"Setting up OLD L2 alignment level for SCT");
216 case 1:
case 2:
case 27:
case 3:
233 case 1:
case 2:
case 25:
case 3:
260 std::vector<Trk::AlignModule *>::const_iterator imod =
m_alignModuleList.begin();
261 std::vector<Trk::AlignModule *>::const_iterator imod_end =
m_alignModuleList.end();
262 for( ; imod!=imod_end ; ++imod)
280 ATH_MSG_INFO(
"Total number of degrees of freedom: "<<nDoF);
338 ATH_MSG_INFO(
"Preparing the SCT geometry for L0: the whole SCT");
357 unsigned int sctmaxHash =
m_idHelper->wafer_hash_max();
381 msg(MSG::DEBUG)<<
"... SCT barrel element"<<
endmsg;
383 msg(MSG::DEBUG)<<
"... SCT endcap element"<<
endmsg;
388 (*sctIdHashMap)[idHash] = sct;
397 ATH_MSG_DEBUG(
"SCT L0 module successfully added to the geometry");
406 ATH_MSG_INFO(
"Preparing the SCT Barrel geometry for L1: barrel + 2 endcaps");
412 unsigned int maxHash =
m_idHelper->wafer_hash_max();
423 mod->setName(
"SCT Barrel");
424 mod->setIdentifier(
m_idHelper->wafer_id(0,0,0,0,0));
438 for (
int iLayer = 0; iLayer <
m_detManager->numerology().numLayers(); iLayer++) {
442 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
444 for (
int iEta =
m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
447 if (!iEta &&
m_detManager->numerology().skipEtaZeroForLayer(iLayer))
451 for (
int is = 0; is < 2; is++) {
472 ATH_MSG_DEBUG(
"SCT Barrel successfully added to the geometry");
481 ATH_MSG_INFO(
"Preparing the SCT Endcap geometry for L1: 2 endcaps");
487 unsigned int maxHash =
m_idHelper->wafer_hash_max();
494 for (
int iEndcapIndex = 0; iEndcapIndex <
m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
495 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
499 mod->setIdentifier(
m_idHelper->wafer_id(iSide,0,0,0,0));
500 if(iEndcapIndex == 0)
501 mod->setName(
"SCT EndCap A");
503 mod->setName(
"SCT EndCap C");
515 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
519 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
521 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
523 for(
int is=0; is<2; is++) {
544 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
545 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
547 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
552 ATH_MSG_DEBUG(
"SCT End-caps successfully added to the geometry");
560 ATH_MSG_INFO(
"Preparing the SCT Barrel geometry for L2: 4 layers");
568 unsigned int maxHash =
m_idHelper->wafer_hash_max();
575 for (
int iLayer = 0; iLayer <
m_detManager->numerology().numLayers(); iLayer++) {
582 mod->setIdentifier(
m_idHelper->wafer_id(0, iLayer, 0, 0, 0));
584 std::stringstream name;
585 name <<
"SCT/Barrel/Layer_"<<iLayer;
586 mod->setName(name.str());
596 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
598 for (
int iEta =
m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
600 if (!iEta &&
m_detManager->numerology().skipEtaZeroForLayer(iLayer))
603 for (
int is = 0; is < 2; is++) {
630 ATH_MSG_INFO(
"Preparing the SCT Barrel geometry for L27: 176 staves (ladders)");
643 unsigned int maxHash =
m_idHelper->wafer_hash_max();
650 for (
int iLayer = 0; iLayer <
m_detManager->numerology().numLayers(); iLayer++) {
653 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
662 mod->setIdentifier(
m_idHelper->wafer_id(0, iLayer, iPhi, 0, 0));
664 std::stringstream name;
665 name <<
"SCT/Barrel/Layer_"<<iLayer<<
"/PhiStave_"<<iPhi;
666 mod->setName(name.str());
679 for (
int iEta =
m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
681 if (!iEta &&
m_detManager->numerology().skipEtaZeroForLayer(iLayer))
684 for (
int is = 0; is < 2; is++) {
712 ATH_MSG_DEBUG(
" - translation: "<<localToGlobal.translation().x()<<
" "<<localToGlobal.translation().y()<<
" "<<localToGlobal.translation().z());
714 ATH_MSG_DEBUG(
" "<<localToGlobal.rotation()(0,0)<<
" "<<localToGlobal.rotation()(0,1)<<
" "<<localToGlobal.rotation()(0,2));
715 ATH_MSG_DEBUG(
" "<<localToGlobal.rotation()(1,0)<<
" "<<localToGlobal.rotation()(1,1)<<
" "<<localToGlobal.rotation()(1,2));
716 ATH_MSG_DEBUG(
" "<<localToGlobal.rotation()(2,0)<<
" "<<localToGlobal.rotation()(2,1)<<
" "<<localToGlobal.rotation()(2,2));
718 mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
730 ATH_MSG_INFO(
"Preparing the SCT Endcap geometry for L2: 2 x 9 disks");
738 unsigned int maxHash =
m_idHelper->wafer_hash_max();
745 for (
int iEndcapIndex = 0; iEndcapIndex <
m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
746 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
747 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
753 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,0,0,0));
755 std::stringstream name;
756 if(iEndcapIndex == 0)
757 name <<
"SCT/EndcapA/Disk_" << iWheel;
759 name <<
"SCT/EndcapC/Disk_" << iWheel;
760 mod->setName(name.str());
770 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
772 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
774 for(
int is=0; is<2; is++) {
794 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
795 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
796 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
808 ATH_MSG_INFO(
"Preparing the SCT Endcap geometry for L25: 2 x 22 rings");
821 unsigned int maxHash =
m_idHelper->wafer_hash_max();
828 for (
int iEndcapIndex = 0; iEndcapIndex <
m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
829 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
830 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
833 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
838 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,iEta,0,0));
840 std::stringstream name;
841 if(iEndcapIndex == 0)
842 name <<
"SCT/EndcapA/Disk_"<<iWheel<<
"/Ring_"<<iEta;
844 name <<
"SCT/EndcapC/Disk_"<<iWheel<<
"/Ring_"<<iEta;
845 mod->setName(name.str());
855 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
857 for(
int is=0; is<2; is++) {
879 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
880 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
881 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
892 ATH_MSG_INFO(
"Preparing the old SCT Barrel geometry for L2: 4 barrel layers + 2 x 9 endcap disks");
896 unsigned int maxHash =
m_idHelper->wafer_hash_max();
904 int iEndcapIndex = 1;
905 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
906 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
912 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,0,0,0));
914 std::stringstream name;
915 name <<
"SCT/EndcapC/Disk_" << iWheel;
916 mod->setName(name.str());
926 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
928 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
930 for(
int is=0; is<2; is++) {
949 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
950 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
951 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
957 for (
int iLayer = 0; iLayer <
m_detManager->numerology().numLayers(); iLayer++) {
964 mod->setIdentifier(
m_idHelper->wafer_id(0, iLayer, 0, 0, 0));
966 std::stringstream name;
967 name <<
"SCT/Barrel/Layer_"<<iLayer;
968 mod->setName(name.str());
978 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
980 for (
int iEta =
m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
982 if (!iEta &&
m_detManager->numerology().skipEtaZeroForLayer(iLayer))
985 for (
int is = 0; is < 2; is++) {
1008 iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
1009 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
1015 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,0,0,0));
1017 std::stringstream name;
1018 name <<
"SCT/EndcapA/Disk_" << iWheel;
1019 mod->setName(name.str());
1029 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1031 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1033 for(
int is=0; is<2; is++) {
1052 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
1054 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1056 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1067 ATH_MSG_INFO(
"Preparing the SCT Barrel geometry for L3: module (bi-wafer) level");
1073 unsigned int maxHash =
m_idHelper->wafer_hash_max();
1080 for (
int iLayer = 0; iLayer <
m_detManager->numerology().numLayers(); iLayer++) {
1083 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1085 for (
int iEta =
m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
1087 if (!iEta &&
m_detManager->numerology().skipEtaZeroForLayer(iLayer))
1094 mod->setIdentifier(
m_idHelper->wafer_id(0, iLayer, iPhi, iEta, 0));
1096 std::stringstream name;
1097 name <<
"SCT/Barrel/Layer_"<<iLayer<<
"/Phi_"<<iPhi<<
"/Eta_"<<iEta;
1098 mod->setName(name.str());
1108 for(
int is=0;is<2;is++) {
1135 mod->setGlobalFrameToAlignFrameTransform(element->
moduleTransform().inverse());
1151 ATH_MSG_INFO(
"Preparing the SCT Endcap geometry for L3: module (bi-wafer) level");
1157 unsigned int maxHash =
m_idHelper->wafer_hash_max();
1164 for (
int iEndcapIndex = 0; iEndcapIndex <
m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
1165 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
1166 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
1169 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1171 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1176 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,iPhi,iEta,0));
1178 std::stringstream name;
1179 if(iEndcapIndex == 0)
1180 name<<
"SCT/EndcapA";
1182 name<<
"SCT/EndcapC";
1183 name<<
"/Disk_"<<iWheel<<
"/Phi_"<<iPhi<<
"/Eta_"<<iEta;
1184 mod->setName(name.str());
1194 for(
int is=0; is<2; is++) {
1220 mod->setGlobalFrameToAlignFrameTransform(element->
moduleTransform().inverse());
1249 for(
unsigned int ipar=0;ipar<fullModPars->
size();++ipar) {
1252 Identifier modID = ((
module->detElementCollection(Trk::AlignModule::SCT))->at(0))->identify();
1255 ATH_MSG_DEBUG(
"SCT barrel module with id "<<AlimodID);
1256 if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignBarrelX)
1257 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignBarrelY)
1258 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignBarrelZ)
1259 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignBarrelRotX)
1260 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignBarrelRotY)
1261 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignBarrelRotZ) ) {
1262 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->at(ipar)->paramType()<<
" is now active");
1263 activeModPars->push_back(fullModPars->at(ipar));
1266 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->
at(ipar)->paramType()<<
" is NOT active");
1276 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->
at(ipar)->paramType()<<
" is now active");
1280 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->
at(ipar)->paramType()<<
" is NOT active");
1285 allFullModPars->push_back(fullModPars);
1286 allActiveModPars->push_back(activeModPars);
1292 for(
unsigned int ipar=0;ipar<modPars->
size();++ipar) {
1294 if(
m_idHelper->is_barrel(module->identify()))
1295 switch(modPars->
at(ipar)->paramType()) {
1325 switch(modPars->
at(ipar)->paramType()) {
1363 for(
int i=0;i<nsel;++i)
1379 ATH_MSG_INFO(
"---------------------------------------------------");
1388 Amg::Transform3D localtoglobal = (
module->globalFrameToAlignFrame()).inverse();
1389 ATH_MSG_DEBUG(
" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<
" "<<localtoglobal.rotation());
1392 int npars = pars->size();
1393 ATH_MSG_DEBUG(
" - number of active transform parameters: "<<npars);
1394 for(
int j=0;j<npars;j++)
1395 ATH_MSG_DEBUG(
" * par "<<j<<
" \'"<<(*pars)[j]->dumpType()<<
"\' : sigma = "<<(*pars)[j]->sigma()<<
" , softCut = "<<(*pars)[j]->softCut());
1397 ATH_MSG_INFO(
"---------------------------------------------------");
An STL vector of pointers that by default owns its pointed-to elements.
This is an Identifier helper class for the SCT subdetector.
AlignModule is a grouping of TrkDetElementBase objects, grouped according to the type of alignment,...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
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.
This is a "hash" representation of an Identifier.
Class to hold geometrical description of a silicon detector element.
bool isStereo() const
Check if it is the stereo side (useful for SCT).
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.
virtual IdentifierHash identifyHash() const override final
identifier hash (inline)
void setIdHash(IdentifierHash id)
Identifier identify() const
void setIdentifier(Identifier identifier)
Set and return identifier of module.
const std::string & name() const
void setName(const std::string &name)
Set and return name of align module (i.e.
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.
Eigen::Matrix< double, 3, 3 > RotationMatrix3D
Eigen::Affine3d Transform3D
Eigen::Translation< double, 3 > Translation3D
@ OWN_ELEMENTS
this data object owns its elements
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
Ensure that the ATLAS eigen extensions are properly loaded.
std::vector< AlignModule * > AlignModuleList