6#include "CLHEP/Geometry/Transform3D.h"
72 declareInterface<ITrkAlignDBTool>(
this);
107 return StatusCode::SUCCESS;
196 ATH_MSG_FATAL(
" No geometry manager available or alignment level not given. " );
211 ATH_MSG_INFO(
" Storing IBLDist as level 16 constants in separate DB");
214 ATH_MSG_FATAL(
" No geometry manager available or alignment level not given.");
220 return StatusCode::SUCCESS;
228 return StatusCode::SUCCESS;
265 case 11:
case 12:
case 15:
case 16:
case 2:
case 22:
case 26:
case 27:
case 3:
276 case 11:
case 16:
case 2:
case 3:
case 12:
303 case 1:
case 2:
case 27:
case 3:
314 case 1:
case 2:
case 25:
case 3:
352 ATH_MSG_INFO(
"Update of Silicon constants not requested!");
385 ATH_MSG_INFO(
"-------------------------------------------------");
412 std::vector<Trk::AlignModule *>::const_iterator imod =
m_alignModuleTool->getAlignModuleCollection()->begin();
413 std::vector<Trk::AlignModule *>::const_iterator imod_end =
m_alignModuleTool->getAlignModuleCollection()->end();
414 for( ; imod != imod_end; ++imod ) {
418 ATH_MSG_DEBUG(
"-------------------------------------------------------");
419 ATH_MSG_DEBUG(
"Alignment corrections for module: "<<module->name());
426 ATH_MSG_DEBUG(
"Module with ID: "<<modID<<
" is not a Silicon module. Skipping.");
432 if(alignPars->
size() == 0) {
433 ATH_MSG_INFO(
"Alignment constants for module "<<module->name()<<
" not available.");
437 ATH_MSG_DEBUG(
"Retrieved alignment constants for module "<<module->name());
466 Amg::Transform3D transform = translation * Amg::RotationMatrix3D::Identity();
544 dbtransform = dbFrameToAlignFrame.inverse() * transform * dbFrameToAlignFrame;
554 dbtransform = transform;
569 ATH_MSG_INFO(
"Module \'"<<module->name()<<
"\': Level "<<level<<
" constants updated.");
572 ATH_MSG_DEBUG(
"Module \'"<<module->name()<<
"\': Call to tweak failed. Constants probably don't exist yet. Use set instead.");
574 ATH_MSG_INFO(
"Module \'"<<module->name()<<
"\': Level "<<level<<
" constants updated.");
576 ATH_MSG_ERROR(
"Error setting level "<<level<<
" constants for module "<<module->name());
580 ATH_MSG_INFO(
"-------------------------------------------------");
591 ATH_MSG_ERROR(
"wrong identifier for L0 Silicon in updateSiL0asL1()");
599 ATH_MSG_INFO(
"Splitting Silicon into L1 modules and updating in the DB");
609 ATH_MSG_INFO(
"Call to tweak failed. Constants probably don't exist yet. Use set instead.");
615 ATH_MSG_INFO(
"Splitting SCT into L1 modules and updating in the DB");
618 std::vector<Identifier> ids;
624 for(
unsigned int i=0; i<ids.size(); ++i) {
627 ATH_MSG_INFO(
"Module "<<i<<
". - id "<<ids[i]<<
": Call to tweak OK. Constants updated.");
630 ATH_MSG_INFO(
"Module "<<i<<
". - id "<<ids[i]<<
": Call to tweak failed. Constants probably don't exist yet. Use set instead.");
640 ATH_MSG_INFO(
"Updating constants for module "<<module->name()<<
" as level 3 constants");
649 for (
unsigned int idet=0; idet<2; idet++) {
653 ATH_MSG_DEBUG(
"getting elements of type "<<det<<
" from the module");
655 const std::vector<const Trk::TrkDetElementBase *> * elements =
module->detElementCollection(det);
662 ATH_MSG_DEBUG(
"looping over "<<elements->size()<<
" elements");
664 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
665 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
666 for ( ; ielem != ielem_end; ++ielem) {
669 ATH_MSG_WARNING(
"Should be Silicon detector element but is not. Skipping.");
681 ATH_MSG_DEBUG(
"-----------------------------------------------------");
727 ATH_MSG_ERROR(
"Error setting level "<<level<<
" constants for element "<<elemID<<
" in module "<<module->name());
730 ATH_MSG_DEBUG(
"-----------------------------------------------------");
737 ATH_MSG_INFO(
"Updating constants for module "<<module->name()<<
" as level 2 constants (new)");
743 const std::vector<const Trk::TrkDetElementBase *> * elements =
module->detElementCollection(det);
750 ATH_MSG_DEBUG(
"looping over "<<elements->size()<<
" elements");
751 std::vector<std::string> level_mods;
753 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
754 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
755 for ( ; ielem != ielem_end; ++ielem) {
758 ATH_MSG_WARNING(
"Should be Silicon detector element but is not. Skipping.");
769 std::vector<std::string>::const_iterator ix =
find(level_mods.begin(),level_mods.end(),key);
770 if (ix==level_mods.end()) {
771 level_mods.push_back(key);
773 ATH_MSG_DEBUG(
"-----------------------------------------------------");
780 const Amg::Transform3D& dbFrameToAlignFrame =
module->globalFrameToAlignFrame();
785 Amg::Transform3D dbtransform = dbFrameToAlignFrame.inverse() * transform * dbFrameToAlignFrame;
795 ATH_MSG_ERROR(
"Error setting level "<<level<<
" constants for element "<<level_mod<<
" in module "<<module->name());
808 ATH_MSG_INFO(
"Updating constants for module "<<module->name()<<
" as level 16 IBLDist constants (new)");
811 const std::vector<const Trk::TrkDetElementBase *> * elements =
module->detElementCollection(det);
818 ATH_MSG_DEBUG(
"looping over "<<elements->size()<<
" elements");
819 std::vector<int> stave_phis;
820 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
821 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
822 for ( ; ielem != ielem_end; ++ielem) {
825 ATH_MSG_WARNING(
"Should be Silicon detector element but is not. Skipping.");
830 const int this_stave_phi =
m_pixHelper->phi_module( elemID );
835 std::vector<int>::const_iterator ix =
find(stave_phis.begin(),stave_phis.end(),this_stave_phi);
836 if (ix==stave_phis.end()) {
837 stave_phis.push_back(this_stave_phi);
841 ATH_MSG_ERROR(
"Error tweaking IBLDist DB for stave "<<this_stave_phi);
855 ATH_MSG_DEBUG(
" - translation: "<<tr.translation().x()<<
" "<<tr.translation().y()<<
" "<<tr.translation().z());
866 if( level == 3 )
return ident ;
874 int layer_disk =
m_pixHelper->layer_disk( ident ) ;
875 int phi_sector =
m_pixHelper->phi_module( ident ) ;
876 if (abs(barrel_ec)==4)
return m_pixHelper->wafer_id( barrel_ec, layer_disk, phi_sector, 0 ) ;
877 else return m_pixHelper->wafer_id( barrel_ec, layer_disk, 0, 0 ) ;
884 return m_sctHelper->wafer_id( barrel_ec, 0, 0, 0, 0 ) ;
888 int layer_disk =
m_sctHelper->layer_disk( ident ) ;
889 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