ATLAS Offline Software
Loading...
Searching...
No Matches
CreateMisalignAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef INDETALIGNMENT_CREATEMISALIGNALG_H
6#define INDETALIGNMENT_CREATEMISALIGNALG_H
7
8// CreateMisalignAlg.h
9//
10
11// Gaudi includes
13
14#include "GaudiKernel/NTuple.h"
15#include "GaudiKernel/ToolHandle.h"
16#include "GaudiKernel/ServiceHandle.h"
17
18// CLHEP includes
19#include "CLHEP/Matrix/Vector.h"
20#include "CLHEP/Geometry/Transform3D.h"
21
22#include "Identifier/Identifier.h"
28#include <vector>
29
30//Forward declaration
31class IdentifierHash;
32class TTree;
33
34class AtlasDetectorID;
35class PixelID;
36class SCT_ID;
37class TRT_ID;
38
39namespace InDetAlignment {
41
42public:
43
44 //Gaudi style constructor and execution methods
46 CreateMisalignAlg(const std::string& name, ISvcLocator* pSvcLocator);
49
51 StatusCode initialize();
53 StatusCode execute(const EventContext& ctx);
55 StatusCode finalize();
56
57private:
58 // Data Members m_*
63
64 ToolHandle< IInDetAlignDBTool > m_IDAlignDBTool;
66
67 // algorithm parameters, possible to declare at runtime
68 std::string m_asciiFileNameBase;
69 std::string m_SQLiteTag;
70
75 long int m_nEvents;
76 std::vector<double> m_translation;
77 std::vector<double> m_rotation;
78 std::vector<double> m_local_translation;
79 std::vector<double> m_local_rotation;
80 std::string m_index;
81 Gaudi::Property<double> m_Misalign_x {this,"MisalignmentX",0.0,"Fixed X shift (mode 1 and 2)"};
82 Gaudi::Property<double> m_Misalign_y {this,"MisalignmentY",0.0,"Fixed Y shif (model 1 and 2)"};
83 Gaudi::Property<double> m_Misalign_z {this,"MisalignmentZ",0.0,"Fixed Z shift (mode 1 and 2)"};
84 Gaudi::Property<double> m_Misalign_alpha {this,"MisalignmentAlpha",0.0,"Fixed Alpha shift (model 1 and 2)"};
85 Gaudi::Property<double> m_Misalign_beta {this,"MisalignmentBeta",0.0,"Fixed Beta shift (mode 1 and 2)"};
86 Gaudi::Property<double> m_Misalign_gamma {this,"MisalignmentGamma",0.0,"Fixed Gamma shift (model 1 and 2)"};
87 Gaudi::Property<double> m_RndmMisalignWidth_x {this,"RandomMisalignmentWidthX",0.1,"Gaussian width of X random misalignments (mode 2)"};
88 Gaudi::Property<double> m_RndmMisalignWidth_y {this,"RandomMisalignmentWidthY",0.1,"Gaussian width of Y random misalignments (mode 2)"};
89 Gaudi::Property<double> m_RndmMisalignWidth_z {this,"RandomMisalignmentWidthZ",0.1,"Gaussian width of Z random misalignments (mode 2)"};
90 Gaudi::Property<double> m_RndmMisalignWidth_alpha {this,"RandomMisalignmentWidthAplha",0.1,"Gaussian width of Alpha random misalignments (mode 2)"};
91 Gaudi::Property<double> m_RndmMisalignWidth_beta {this,"RandomMisalignmentWidthBeta",0.1,"Gaussian width of Beta random misalignments (mode 2)"};
92 Gaudi::Property<double> m_RndmMisalignWidth_gamma {this,"RandomMisalignmentWidthGamma",0.1,"Gaussian width of Gamma random misalignments (mode 2)"};
110
111
112 std::map<Identifier, HepGeom::Point3D<double> > m_ModuleList;
113
114 // Generated Initial Alignment NTuple
116
119
120 NTuple::Item<double> m_AlignResults_x;
121 NTuple::Item<double> m_AlignResults_y;
122 NTuple::Item<double> m_AlignResults_z;
123 NTuple::Item<double> m_AlignResults_alpha;
124 NTuple::Item<double> m_AlignResults_beta;
125 NTuple::Item<double> m_AlignResults_gamma;
126 NTuple::Item<long> m_AlignResults_Identifier_ID;
130 NTuple::Item<long> m_AlignResults_Identifier_Phi;
131 NTuple::Item<long> m_AlignResults_Identifier_Eta;
132
133 NTuple::Item<double> m_Initial_center_x;
134 NTuple::Item<double> m_Initial_center_y;
135 NTuple::Item<double> m_Initial_center_z;
136
137
138 NTuple::Item<double> m_Global_center_x;
139 NTuple::Item<double> m_Global_center_y;
140 NTuple::Item<double> m_Global_center_z;
141
142 // Member Functions
143
144 void setupSCT_AlignModule(int&);
145 void setupPixel_AlignModule(int&);
146 void setupTRT_AlignModule(int&);
147
149 const HepGeom::Transform3D BuildAlignTransform(const CLHEP::HepVector &);
150
153
154 // IBL bowing functions
155 double getBowingMagParam(double temp_shift);
156 double getBowingTx(double p1, double z);
157
159 StatusCode GenerateMisaligment();
160
164
165 SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
166 SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
167 SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetEleCollKey{this, "TRTDetEleCollKey", "TRT_DetElementContainer", "Key of TRT_DetElementContainer for TRT"};
168
169};
170
171} // end of namespace bracket
172#endif // INDETALIGNMENT_CREATEMISALIGNALG_H
abstract interface to Service to manage TRT alignment conditions
#define z
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
This is a "hash" representation of an Identifier.
std::vector< double > m_rotation
Flag which turns on misalignment with rotation.
int m_targetLayerMax
Upper ITk barrel layer selector for layer-range modes (-999 means unused).
Gaudi::Property< double > m_RndmMisalignWidth_gamma
std::map< Identifier, HepGeom::Point3D< double > > m_ModuleList
map of all SiIdentifiers to be misaligned and their centerpoints in global coordinates
std::string m_index
Generate misalignment according to module indices.
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleCollKey
const HepGeom::Transform3D BuildAlignTransform(const CLHEP::HepVector &)
builds a HepGeom::Transform3D from the 6 Alignment Parameters
double m_IBLBowingTshift
The relative temp shift of set point that intriduces bowing (sign is important).
Gaudi::Property< double > m_RndmMisalignWidth_alpha
NTuple::Item< double > m_AlignResults_z
AP normal to module plane.
std::string m_radialSubdetector
Subdetector selector for mode 43: Pixel, Strip, or Both.
NTuple::Item< double > m_Initial_center_x
Initial global center of module.
double getBowingTx(double p1, double z)
bool m_createFreshDB
Flag to call the createDB method of DBTool (to be switched off when adding misalignments to a given g...
NTuple::Item< long > m_AlignResults_Identifier_PixelSCT
ID information for this module.
Gaudi::Property< double > m_Misalign_x
Gaudi::Property< double > m_RndmMisalignWidth_z
NTuple::Item< double > m_Global_center_x
Misaligned global center of module.
std::string m_SQLiteTag
tag name for the ConditionsDB
const Identifier reduceTRTID(Identifier id)
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
std::string m_radialShiftConvention
Barrel radial shift convention for mode 43.
int m_targetLayer
ITk barrel layer selector for dedicated ITk modes (-1 means all layers).
Gaudi::Property< double > m_Misalign_z
std::string m_endcapShiftConvention
Endcap z-shift convention for mode 41.
Gaudi::Property< double > m_RndmMisalignWidth_beta
StatusCode execute(const EventContext &ctx)
standard Athena-Algorithm method
int m_MisalignmentMode
Flag which Misalignment mode is to be generated.
double getBowingMagParam(double temp_shift)
NTuple::Item< long > m_AlignResults_Identifier_BarrelEC
ID information for this module.
const AtlasDetectorID * m_idHelper
bool m_firstEvent
Flag for Setup of AlignModuleList (1st event).
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
NTuple::Item< double > m_Initial_center_z
Initial global center of module.
NTuple::Item< long > m_AlignResults_Identifier_LayerDisc
ID information for this module.
std::vector< double > m_local_translation
Specify misalignment with translation.
Gaudi::Property< double > m_Misalign_y
NTuple::Item< double > m_AlignResults_x
Alignment parameter sensitive coordinate.
StatusCode finalize()
standard Athena-Algorithm method
NTuple::Item< double > m_Global_center_y
Misaligned global center of module.
StatusCode initialize()
standard Athena-Algorithm method
NTuple::Item< double > m_Initial_center_y
Initial global center of module.
double m_Misalign_maxShift_Inner
Maximum shift of the Pixel B-layer in curl (d0 bias!).
NTuple::Item< long > m_AlignResults_Identifier_Eta
ID information for this module.
NTuple::Item< double > m_AlignResults_alpha
AP rotation around x-axis.
NTuple::Item< long > m_AlignResults_Identifier_Phi
ID information for this module.
Gaudi::Property< double > m_RndmMisalignWidth_y
Gaudi::Property< double > m_RndmMisalignWidth_x
NTuple::Item< long > m_AlignResults_Identifier_ID
ID information for this module.
Gaudi::Property< double > m_Misalign_beta
std::vector< double > m_local_rotation
Specify misalignment with rotation.
std::vector< double > m_translation
Flag which turns on misalignment with translation.
NTuple::Item< double > m_AlignResults_y
AP not-so-sensitive coordinate.
StatusCode GenerateMisaligment()
the main function which calculates and applies a transformation to each detector element
ServiceHandle< ITRT_AlignDbSvc > m_trtaligndbservice
NTuple::Item< double > m_Global_center_z
Misaligned global center of module.
NTuple::Item< double > m_AlignResults_gamma
AP rotation around z-axis.
Gaudi::Property< double > m_Misalign_gamma
std::string m_asciiFileNameBase
filename basis for ASCII files with alignment constants
ToolHandle< IInDetAlignDBTool > m_IDAlignDBTool
CreateMisalignAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
double m_Misalign_maxShift
Maximum shift for global modes.
NTuple::Item< double > m_AlignResults_beta
AP rotation aorund y-axis.
Gaudi::Property< double > m_Misalign_alpha
double m_radialShift
Barrel radial shift for mode 43.
This is an Identifier helper class for the Pixel subdetector.
Definition PixelID.h:69
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:84