|
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "CLHEP/Geometry/Transform3D.h"
38 , m_pixHelper(nullptr)
39 , m_sctHelper(nullptr)
41 , m_writeSQLFile(true)
42 , m_SQLiteTag(
"test_tag")
43 , m_outputAlignFile(
"OutputSiAlignment.txt")
44 , m_outIBLDistFile(
"OutputIBLDist.txt")
45 , m_outGlobalFolderFile(
"OutputSiGlobalFolder.txt")
46 , m_writeTextFile(true)
47 , m_writeOldConstants(false)
48 , m_oldIBLDistFile(
"OldIBLDist.txt")
49 , m_oldAlignFile(
"OldSiAlignment.txt")
50 , m_oldGlobalFolderFile(
"OldSiGlobalFolder.txt")
51 , m_updateConstants(true)
52 , m_IDAlignDBTool(
"InDetAlignDBTool")
53 , m_alignModuleTool(
"Trk::AlignModuleTool/AlignModuleTool")
54 , m_pixelGeoManager(
"")
58 , m_pixelAlignLevel(-1)
59 , m_pixelAlignLevelBarrel(-1)
60 , m_pixelAlignLevelEndcaps(-1)
61 , m_pixelaAlignDBM(
false)
63 , m_sctAlignLevelBarrel(-1)
64 , m_sctAlignLevelEndcaps(-1)
73 declareInterface<ITrkAlignDBTool>(
this);
75 declareProperty(
"WriteSQLFile", m_writeSQLFile);
76 declareProperty(
"SQLiteTag", m_SQLiteTag);
77 declareProperty(
"OutputTextFile", m_outputAlignFile);
78 declareProperty(
"OutputIBLDistFile", m_outIBLDistFile);
79 declareProperty(
"OutputGlobalFolderFile",m_outGlobalFolderFile);
80 declareProperty(
"WriteTextFile", m_writeTextFile);
81 declareProperty(
"WriteOldConstants", m_writeOldConstants);
82 declareProperty(
"OldAlignFile", m_oldAlignFile);
83 declareProperty(
"OldIBLDistFile", m_oldIBLDistFile);
84 declareProperty(
"OldGlobalFolderFile",m_oldGlobalFolderFile);
85 declareProperty(
"UpdateConstants", m_updateConstants);
86 declareProperty(
"WriteAsL3", m_writeAsL3);
88 declareProperty(
"IDAlignDBTool", m_IDAlignDBTool);
89 declareProperty(
"AlignModuleTool", m_alignModuleTool,
"Tool for handling of align module collections");
90 declareProperty(
"AlignmentDBM", m_pixelaAlignDBM);
92 declareProperty(
"PixelGeometryManager", m_pixelGeoManager,
"Tool for handling the Pixel alignment geometry");
93 declareProperty(
"SCTGeometryManager", m_sctGeoManager,
"Tool for handling the SCT alignment geometry");
94 declareProperty(
"SiGeometryManager", m_siGeoManager,
"Tool for handling the Silicon alignment geometry");
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(
"-------------------------------------------------------");
427 ATH_MSG_DEBUG(
"Module with ID: "<<modID<<
" is not a Silicon module. Skipping.");
433 if(alignPars->
size() == 0) {
545 dbtransform = dbFrameToAlignFrame.inverse() *
transform * dbFrameToAlignFrame;
573 ATH_MSG_DEBUG(
"Module \'"<<
module->name()<<
"\': Call to tweak failed. Constants probably don't exist yet. Use set instead.");
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++) {
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(
"-----------------------------------------------------");
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(
"-----------------------------------------------------");
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.");
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());
877 if (abs(barrel_ec)==4)
return m_pixHelper->
wafer_id( barrel_ec, layer_disk, phi_sector, 0 ) ;
def retrieve(aClass, aKey=None)
This is an Identifier helper class for the Pixel subdetector. This class is a factory for creating co...
bool is_pixel(Identifier id) const
This is an Identifier helper class for the SCT subdetector. This class is a factory for creating comp...
std::string find(const std::string &s)
return a remapped string
bool is_sct(Identifier id) const
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module) const
For a single crystal.
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
double par() const
returns final parameter and error
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
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...
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.
::StatusCode StatusCode
StatusCode definition for legacy code.
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.
int layer_disk(const Identifier &id) const
int layer_disk(const Identifier &id) const
Eigen::Matrix< double, 3, 1 > Vector3D
An STL vector of pointers that by default owns its pointed-to elements.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
#define ATH_MSG_WARNING(x)
Eigen::Translation< double, 3 > Translation3D
int side(const Identifier &id) const
Eigen::AngleAxisd AngleAxis3D
defines and typedefs for IOVSvc
const T * at(size_type n) const
Access an element, as an rvalue.
Identifier wafer_id(int barrel_ec, int layer_disk, int phi_module, int eta_module, int side) const
For a single side of module.
int phi_module(const Identifier &id) const
size_type size() const noexcept
Returns the number of elements in the collection.
virtual Identifier identify() const override final
identifier of this detector element (inline)
bool is_barrel(const Identifier &id) const
Test for barrel - WARNING: id MUST be sct id, otherwise answer is not accurate. Use SiliconID for gen...