6#include "CLHEP/Geometry/Transform3D.h"
72 declareInterface<ITrkAlignDBTool>(
this);
108 return StatusCode::SUCCESS;
197 ATH_MSG_FATAL(
" No geometry manager available or alignment level not given. " );
212 ATH_MSG_INFO(
" Storing IBLDist as level 16 constants in separate DB");
215 ATH_MSG_FATAL(
" No geometry manager available or alignment level not given.");
221 return StatusCode::SUCCESS;
229 return StatusCode::SUCCESS;
266 case 11:
case 12:
case 15:
case 16:
case 2:
case 22:
case 26:
case 27:
case 3:
277 case 11:
case 16:
case 2:
case 3:
case 12:
304 case 1:
case 2:
case 27:
case 3:
315 case 1:
case 2:
case 25:
case 3:
353 ATH_MSG_INFO(
"Update of Silicon constants not requested!");
386 ATH_MSG_INFO(
"-------------------------------------------------");
413 std::vector<Trk::AlignModule *>::const_iterator imod =
m_alignModuleTool->getAlignModuleCollection()->begin();
414 std::vector<Trk::AlignModule *>::const_iterator imod_end =
m_alignModuleTool->getAlignModuleCollection()->end();
415 for( ; imod != imod_end; ++imod ) {
419 ATH_MSG_DEBUG(
"-------------------------------------------------------");
420 ATH_MSG_DEBUG(
"Alignment corrections for module: "<<module->name());
427 ATH_MSG_DEBUG(
"Module with ID: "<<modID<<
" is not a Silicon module. Skipping.");
433 if(alignPars->
size() == 0) {
434 ATH_MSG_INFO(
"Alignment constants for module "<<module->name()<<
" not available.");
438 ATH_MSG_DEBUG(
"Retrieved alignment constants for module "<<module->name());
467 Amg::Transform3D transform = translation * Amg::RotationMatrix3D::Identity();
545 dbtransform = dbFrameToAlignFrame.inverse() * transform * dbFrameToAlignFrame;
555 dbtransform = transform;
570 ATH_MSG_INFO(
"Module \'"<<module->name()<<
"\': Level "<<level<<
" constants updated.");
573 ATH_MSG_DEBUG(
"Module \'"<<module->name()<<
"\': Call to tweak failed. Constants probably don't exist yet. Use set instead.");
575 ATH_MSG_INFO(
"Module \'"<<module->name()<<
"\': Level "<<level<<
" constants updated.");
577 ATH_MSG_ERROR(
"Error setting level "<<level<<
" constants for module "<<module->name());
581 ATH_MSG_INFO(
"-------------------------------------------------");
592 ATH_MSG_ERROR(
"wrong identifier for L0 Silicon in updateSiL0asL1()");
600 ATH_MSG_INFO(
"Splitting Silicon into L1 modules and updating in the DB");
610 ATH_MSG_INFO(
"Call to tweak failed. Constants probably don't exist yet. Use set instead.");
616 ATH_MSG_INFO(
"Splitting SCT into L1 modules and updating in the DB");
619 std::vector<Identifier> ids;
625 for(
unsigned int i=0; i<ids.size(); ++i) {
628 ATH_MSG_INFO(
"Module "<<i<<
". - id "<<ids[i]<<
": Call to tweak OK. Constants updated.");
631 ATH_MSG_INFO(
"Module "<<i<<
". - id "<<ids[i]<<
": Call to tweak failed. Constants probably don't exist yet. Use set instead.");
641 ATH_MSG_INFO(
"Updating constants for module "<<module->name()<<
" as level 3 constants");
650 for (
unsigned int idet=0; idet<2; idet++) {
654 ATH_MSG_DEBUG(
"getting elements of type "<<det<<
" from the module");
656 const std::vector<const Trk::TrkDetElementBase *> * elements =
module->detElementCollection(det);
663 ATH_MSG_DEBUG(
"looping over "<<elements->size()<<
" elements");
665 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
666 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
667 for ( ; ielem != ielem_end; ++ielem) {
670 ATH_MSG_WARNING(
"Should be Silicon detector element but is not. Skipping.");
682 ATH_MSG_DEBUG(
"-----------------------------------------------------");
728 ATH_MSG_ERROR(
"Error setting level "<<level<<
" constants for element "<<elemID<<
" in module "<<module->name());
731 ATH_MSG_DEBUG(
"-----------------------------------------------------");
738 ATH_MSG_INFO(
"Updating constants for module "<<module->name()<<
" as level 2 constants (new)");
744 const std::vector<const Trk::TrkDetElementBase *> * elements =
module->detElementCollection(det);
751 ATH_MSG_DEBUG(
"looping over "<<elements->size()<<
" elements");
752 std::vector<std::string> level_mods;
754 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
755 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
756 for ( ; ielem != ielem_end; ++ielem) {
759 ATH_MSG_WARNING(
"Should be Silicon detector element but is not. Skipping.");
770 std::vector<std::string>::const_iterator ix =
find(level_mods.begin(),level_mods.end(),key);
771 if (ix==level_mods.end()) {
772 level_mods.push_back(key);
774 ATH_MSG_DEBUG(
"-----------------------------------------------------");
781 const Amg::Transform3D& dbFrameToAlignFrame =
module->globalFrameToAlignFrame();
786 Amg::Transform3D dbtransform = dbFrameToAlignFrame.inverse() * transform * dbFrameToAlignFrame;
796 ATH_MSG_ERROR(
"Error setting level "<<level<<
" constants for element "<<level_mod<<
" in module "<<module->name());
809 ATH_MSG_INFO(
"Updating constants for module "<<module->name()<<
" as level 16 IBLDist constants (new)");
812 const std::vector<const Trk::TrkDetElementBase *> * elements =
module->detElementCollection(det);
819 ATH_MSG_DEBUG(
"looping over "<<elements->size()<<
" elements");
820 std::vector<int> stave_phis;
821 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
822 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
823 for ( ; ielem != ielem_end; ++ielem) {
826 ATH_MSG_WARNING(
"Should be Silicon detector element but is not. Skipping.");
831 const int this_stave_phi =
m_pixHelper->phi_module( elemID );
836 std::vector<int>::const_iterator ix =
find(stave_phis.begin(),stave_phis.end(),this_stave_phi);
837 if (ix==stave_phis.end()) {
838 stave_phis.push_back(this_stave_phi);
842 ATH_MSG_ERROR(
"Error tweaking IBLDist DB for stave "<<this_stave_phi);
856 ATH_MSG_DEBUG(
" - translation: "<<tr.translation().x()<<
" "<<tr.translation().y()<<
" "<<tr.translation().z());
867 if( level == 3 )
return ident ;
875 int layer_disk =
m_pixHelper->layer_disk( ident ) ;
876 int phi_sector =
m_pixHelper->phi_module( ident ) ;
877 if (abs(barrel_ec)==4)
return m_pixHelper->wafer_id( barrel_ec, layer_disk, phi_sector, 0 ) ;
878 else return m_pixHelper->wafer_id( barrel_ec, layer_disk, 0, 0 ) ;
885 return m_sctHelper->wafer_id( barrel_ec, 0, 0, 0, 0 ) ;
889 int layer_disk =
m_sctHelper->layer_disk( ident ) ;
890 return m_sctHelper->wafer_id( barrel_ec, layer_disk, 0, 0, 0 ) ;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
An STL vector of pointers that by default owns its pointed-to elements.
Basic time unit for IOVSvc.
This is an Identifier helper class for the Pixel subdetector.
This is an Identifier helper class for the SCT subdetector.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const ServiceHandle< StoreGateSvc > & detStore() const
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
Class to hold geometrical description of a silicon detector element.
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.
virtual Identifier identify() const override final
identifier of this detector element (inline)
std::string find(const std::string &s)
return a remapped string
Eigen::AngleAxisd AngleAxis3D
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D