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++) {
713 ATH_MSG_DEBUG(
" - translation: "<<localToGlobal.translation().x()<<
" "<<localToGlobal.translation().y()<<
" "<<localToGlobal.translation().z());
715 ATH_MSG_DEBUG(
" "<<localToGlobal.rotation()(0,0)<<
" "<<localToGlobal.rotation()(0,1)<<
" "<<localToGlobal.rotation()(0,2));
716 ATH_MSG_DEBUG(
" "<<localToGlobal.rotation()(1,0)<<
" "<<localToGlobal.rotation()(1,1)<<
" "<<localToGlobal.rotation()(1,2));
717 ATH_MSG_DEBUG(
" "<<localToGlobal.rotation()(2,0)<<
" "<<localToGlobal.rotation()(2,1)<<
" "<<localToGlobal.rotation()(2,2));
719 mod->setGlobalFrameToAlignFrameTransform(localToGlobal.inverse());
731 ATH_MSG_INFO(
"Preparing the SCT Endcap geometry for L2: 2 x 9 disks");
739 unsigned int maxHash =
m_idHelper->wafer_hash_max();
746 for (
int iEndcapIndex = 0; iEndcapIndex <
m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
747 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
748 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
754 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,0,0,0));
756 std::stringstream name;
757 if(iEndcapIndex == 0)
758 name <<
"SCT/EndcapA/Disk_" << iWheel;
760 name <<
"SCT/EndcapC/Disk_" << iWheel;
761 mod->setName(name.str());
771 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
773 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
775 for(
int is=0; is<2; is++) {
795 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
796 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
797 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
809 ATH_MSG_INFO(
"Preparing the SCT Endcap geometry for L25: 2 x 22 rings");
822 unsigned int maxHash =
m_idHelper->wafer_hash_max();
829 for (
int iEndcapIndex = 0; iEndcapIndex <
m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
830 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
831 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
834 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
839 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,iEta,0,0));
841 std::stringstream name;
842 if(iEndcapIndex == 0)
843 name <<
"SCT/EndcapA/Disk_"<<iWheel<<
"/Ring_"<<iEta;
845 name <<
"SCT/EndcapC/Disk_"<<iWheel<<
"/Ring_"<<iEta;
846 mod->setName(name.str());
856 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
858 for(
int is=0; is<2; is++) {
880 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
881 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
882 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
893 ATH_MSG_INFO(
"Preparing the old SCT Barrel geometry for L2: 4 barrel layers + 2 x 9 endcap disks");
897 unsigned int maxHash =
m_idHelper->wafer_hash_max();
905 int iEndcapIndex = 1;
906 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
907 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
913 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,0,0,0));
915 std::stringstream name;
916 name <<
"SCT/EndcapC/Disk_" << iWheel;
917 mod->setName(name.str());
927 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
929 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
931 for(
int is=0; is<2; is++) {
950 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
951 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
952 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
958 for (
int iLayer = 0; iLayer <
m_detManager->numerology().numLayers(); iLayer++) {
965 mod->setIdentifier(
m_idHelper->wafer_id(0, iLayer, 0, 0, 0));
967 std::stringstream name;
968 name <<
"SCT/Barrel/Layer_"<<iLayer;
969 mod->setName(name.str());
979 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
981 for (
int iEta =
m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
983 if (!iEta &&
m_detManager->numerology().skipEtaZeroForLayer(iLayer))
986 for (
int is = 0; is < 2; is++) {
1009 iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
1010 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
1016 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,0,0,0));
1018 std::stringstream name;
1019 name <<
"SCT/EndcapA/Disk_" << iWheel;
1020 mod->setName(name.str());
1030 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1032 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1034 for(
int is=0; is<2; is++) {
1053 ATH_MSG_DEBUG(
"Endcap:" << iSide <<
" , disk: " << iWheel <<
" , CoG (" << translation.x() <<
" , " << translation.y() <<
" , " << translation.z() <<
" ) " );
1055 Amg::Transform3D localtoglobal = translation * Amg::RotationMatrix3D::Identity();
1057 mod->setGlobalFrameToAlignFrameTransform(localtoglobal.inverse());
1068 ATH_MSG_INFO(
"Preparing the SCT Barrel geometry for L3: module (bi-wafer) level");
1074 unsigned int maxHash =
m_idHelper->wafer_hash_max();
1081 for (
int iLayer = 0; iLayer <
m_detManager->numerology().numLayers(); iLayer++) {
1084 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForLayer(iLayer); iPhi++) {
1086 for (
int iEta =
m_detManager->numerology().beginEtaModuleForLayer(iLayer); iEta < m_detManager->numerology().endEtaModuleForLayer(iLayer); iEta++) {
1088 if (!iEta &&
m_detManager->numerology().skipEtaZeroForLayer(iLayer))
1095 mod->setIdentifier(
m_idHelper->wafer_id(0, iLayer, iPhi, iEta, 0));
1097 std::stringstream name;
1098 name <<
"SCT/Barrel/Layer_"<<iLayer<<
"/Phi_"<<iPhi<<
"/Eta_"<<iEta;
1099 mod->setName(name.str());
1109 for(
int is=0;is<2;is++) {
1136 mod->setGlobalFrameToAlignFrameTransform(element->
moduleTransform().inverse());
1152 ATH_MSG_INFO(
"Preparing the SCT Endcap geometry for L3: module (bi-wafer) level");
1158 unsigned int maxHash =
m_idHelper->wafer_hash_max();
1165 for (
int iEndcapIndex = 0; iEndcapIndex <
m_detManager->numerology().numEndcaps(); iEndcapIndex++) {
1166 int iSide =
m_detManager->numerology().endcapId(iEndcapIndex);
1167 for (
int iWheel = 0; iWheel <
m_detManager->numerology().numDisks(); iWheel++) {
1170 for (
int iEta = 0; iEta <
m_detManager->numerology().numRingsForDisk(iWheel); iEta++) {
1172 for (
int iPhi = 0; iPhi <
m_detManager->numerology().numPhiModulesForDiskRing(iWheel,iEta); iPhi++) {
1177 mod->setIdentifier(
m_idHelper->wafer_id(iSide,iWheel,iPhi,iEta,0));
1179 std::stringstream name;
1180 if(iEndcapIndex == 0)
1181 name<<
"SCT/EndcapA";
1183 name<<
"SCT/EndcapC";
1184 name<<
"/Disk_"<<iWheel<<
"/Phi_"<<iPhi<<
"/Eta_"<<iEta;
1185 mod->setName(name.str());
1195 for(
int is=0; is<2; is++) {
1221 mod->setGlobalFrameToAlignFrameTransform(element->
moduleTransform().inverse());
1250 for(
unsigned int ipar=0;ipar<fullModPars->
size();++ipar) {
1253 Identifier modID = ((
module->detElementCollection(Trk::AlignModule::SCT))->at(0))->identify();
1256 ATH_MSG_DEBUG(
"SCT barrel module with id "<<AlimodID);
1257 if( (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransX && m_alignBarrelX)
1258 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransY && m_alignBarrelY)
1259 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::TransZ && m_alignBarrelZ)
1260 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotX && m_alignBarrelRotX)
1261 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotY && m_alignBarrelRotY)
1262 || (fullModPars->at(ipar)->paramType() == Trk::AlignModule::RotZ && m_alignBarrelRotZ) ) {
1263 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->at(ipar)->paramType()<<
" is now active");
1264 activeModPars->push_back(fullModPars->at(ipar));
1267 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->
at(ipar)->paramType()<<
" is NOT active");
1277 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->
at(ipar)->paramType()<<
" is now active");
1281 ATH_MSG_DEBUG(
"parameter type "<<fullModPars->
at(ipar)->paramType()<<
" is NOT active");
1286 allFullModPars->push_back(fullModPars);
1287 allActiveModPars->push_back(activeModPars);
1293 for(
unsigned int ipar=0;ipar<modPars->
size();++ipar) {
1295 if(
m_idHelper->is_barrel(module->identify()))
1296 switch(modPars->
at(ipar)->paramType()) {
1326 switch(modPars->
at(ipar)->paramType()) {
1364 for(
int i=0;i<nsel;++i)
1380 ATH_MSG_INFO(
"---------------------------------------------------");
1389 Amg::Transform3D localtoglobal = (
module->globalFrameToAlignFrame()).inverse();
1390 ATH_MSG_DEBUG(
" - local to global : "<<std::setprecision(12)<<localtoglobal.translation()<<
" "<<localtoglobal.rotation());
1393 int npars = pars->size();
1394 ATH_MSG_DEBUG(
" - number of active transform parameters: "<<npars);
1395 for(
int j=0;j<npars;j++)
1396 ATH_MSG_DEBUG(
" * par "<<j<<
" \'"<<(*pars)[j]->dumpType()<<
"\' : sigma = "<<(*pars)[j]->sigma()<<
" , softCut = "<<(*pars)[j]->softCut());
1398 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