ATLAS Offline Software
Loading...
Searching...
No Matches
InDetAlignCog.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INDETALIGNGENALGS_INDETALIGNCOG_H
6#define INDETALIGNGENALGS_INDETALIGNCOG_H
7
14
15
17#include "GaudiKernel/AlgTool.h"
18#include "GaudiKernel/ToolHandle.h"
19#include "GaudiKernel/ServiceHandle.h"
22
25
29
30class PixelID;
31class SCT_ID;
32class TRT_ID;
33class ITRT_AlignDbSvc;
34
35namespace InDetDD {
36 class TRT_BaseElement;
38}
39
41 public:
42 InDetAlignCog(const std::string& name, ISvcLocator* pSvcLocator);
43 StatusCode initialize();
44 StatusCode execute();
45 StatusCode finalize();
46
47 private:
48 class Params_t
49 {
50 public:
52 m_V1.setZero();
53 m_V2.setZero();
54 m_A1.setZero();
55 m_A2.setZero();
56 m_M1.setZero();
57 m_M2.setZero();
58 }
59
60 AmgVector(6) m_V1;
61 AmgVector(6) m_V2;
62 AmgVector(6) m_A1;
63 AmgVector(6) m_A2;
64 AmgSymMatrix(6) m_M1;
65 AmgSymMatrix(6) m_M2;
66 };
67
68
69 StatusCode getSiElements(const InDetDD::SiDetectorElementCollection*,const bool, InDetAlignCog::Params_t &params);
70 StatusCode getTRT_Elements(const InDetDD::TRT_DetElementCollection*,const bool, InDetAlignCog::Params_t &params);
71 StatusCode shiftIDbyCog();
72 void addL1();
73
74 void enableCoG(Amg::Transform3D&, bool, bool, bool, bool, bool, bool);
75 StatusCode normalizeTransform(Amg::Transform3D&, const int);
76 void scaleTransform(Amg::Transform3D&, const float);
77
80
81 void prepareDerivative(const Amg::Transform3D&, const bool=false);
82 void accumulate(const Amg::Transform3D&, double* );
84
86 bool testIdentity(const Amg::Transform3D&,double,double) const;
88
89 private:
90
91
92 // helpers
96
97 // IInDetAlignDBTool
99
100 // TRTAlignDbTool
101 // ToolHandle<ITRTAlignDbTool> m_TRTAlignDbTool;
103
104 SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
105 SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
106 SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetEleContKey{this, "TRTDetEleContKey", "TRT_DetElementContainer", "Key of TRT_DetElementContainer for TRT"};
107
108 // Select which detectors will be considered for cog calculation
109 int m_det;
114
120 bool m_useChi2; // if to use the Chi2 fit
121
122 double m_errTrans;
123 double m_errRot;
124 double m_sigXpixB;
127 double m_sigXpixE;
130 double m_sigXsctB;
136 double m_sigXtrtB;
142
143 bool m_doTX;
144 bool m_doTY;
145 bool m_doTZ;
146 bool m_doRX;
147 bool m_doRY;
148 bool m_doRZ;
149
150 bool m_doCoG;
151 bool m_doL1;
152
153
154 double m_traX;
155 double m_traY;
156 double m_traZ;
157 double m_rotX;
158 double m_rotY;
159 double m_rotZ;
160
161
163
164 std::string m_sitxtfile;
165 std::string m_trt_txtfile;
166 std::string m_SQLiteTag;
167
168 // infinitesimal global transformations used to calculate derivatives
175
176 // Center-of-gravity
177 double m_cog[6]{};
179
180 // residual global transformation
181 double m_resglob[6]{};
183
184 // Chi2 specific stuff:
185
186
187};
188
189#endif // INDETALIGNGENALGS_INDETALIGNCOG_H
Eigen::Affine3d Transform3D
abstract interface to Service to manage TRT alignment conditions
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
int m_det
Pixel=1, SCT=2, Pixel+SCT=12, TRT=3, all (silicon and TRT)=99.
const PixelID * m_pixid
int m_TRT_layer
a particular TRT layer or all (TRT)=99
bool m_SiTxtOutput
output Si constants to txt file ?
StatusCode getTRT_Elements(const InDetDD::TRT_DetElementCollection *, const bool, InDetAlignCog::Params_t &params)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Amg::Transform3D m_glob_x
const TRT_ID * m_trtid
double m_errTrans
acceptable value for residual global translation
double m_resglob[6]
StatusCode finalize()
double m_traZ
translation/rotation values (CLHEP::mm, CLHEP::rad) for the arbitrary transformation
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
const Amg::Transform3D getL1Transform(int bec)
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleContKey
ServiceHandle< ITRT_AlignDbSvc > m_TRTAlignDbTool
Amg::Transform3D m_grot_z
StatusCode execute()
Amg::Transform3D m_glob_z
double m_sigXsctB
assumed error for SCT barrel local X matchnig in the Xi2 method
bool m_TRT_TxtOutput
output TRT constants to txt file ?
void scaleTransform(Amg::Transform3D &, const float)
StatusCode normalizeTransform(Amg::Transform3D &, const int)
Amg::Transform3D m_CoG
Amg::Transform3D m_ResGlob
Amg::Transform3D m_glob_y
std::string printTransform(const Amg::Transform3D &) const
double m_errRot
acceptable value for residual global rotation angles
double m_sigXpixB
assumed error for Pixel barrel local X matchnig in the Xi2 method
void prepareDerivative(const Amg::Transform3D &, const bool=false)
Amg::Transform3D sumTransforms(const Amg::Transform3D &, const Amg::Transform3D &) const
StatusCode getSiElements(const InDetDD::SiDetectorElementCollection *, const bool, InDetAlignCog::Params_t &params)
bool m_doL1
enable/disable introducing the arbitrary L1 correction to the output objects
bool testIdentity(const Amg::Transform3D &, double, double) const
StatusCode shiftIDbyCog()
int m_TRT_bec
Barrel=-1, Endcaps=+-2, all (TRT)=99.
bool m_doCoG
enable/disable introducing the CoG correction to the output objects
void accumulate(const Amg::Transform3D &, double *)
StatusCode initialize()
double m_sigXtrtB
assumed error for TRT barrel local X matchnig in the Xi2 method
std::string m_SQLiteTag
SQLite tag name.
void accumulateChi2(const Amg::Transform3D &, AmgSymMatrix(6)&, AmgVector(6)&, const double *)
double m_cog[6]
ToolHandle< IInDetAlignDBTool > m_IDAlignDBTool
Amg::Transform3D m_grot_x
std::string m_sitxtfile
text file with dump of Si alignment constants after cog shift
bool m_doTZ
enable/disable writing of indivitual DoF's to the db
std::string m_trt_txtfile
text file with dump of TRT alignment constants after cog shift
int m_Si_bec
Barrel=1, Endcaps=+-2, all (silicon)=99.
void enableCoG(Amg::Transform3D &, bool, bool, bool, bool, bool, bool)
InDetAlignCog(const std::string &name, ISvcLocator *pSvcLocator)
int m_counter
normalization factor
Amg::Transform3D m_grot_y
double m_sigXpixE
assumed error for Pixel endcap local X matchnig in the Xi2 method
const SCT_ID * m_sctid
int m_Si_layer
a particular silicon layer or all (silicon)=99
Class to hold geometrical description of a silicon detector element.
Virtual base class of TRT readout elements.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:67
This is an Identifier helper class for the SCT subdetector.
Definition SCT_ID.h:68
This is an Identifier helper class for the TRT subdetector.
Definition TRT_ID.h:82
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Affine3d Transform3D
Message Stream Member.
Forward declaration.
STL namespace.
#define private