ATLAS Offline Software
Loading...
Searching...
No Matches
CreateMisalignAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 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// #include <map>
12#include <vector>
13
14// Gaudi includes
15// #include "GaudiKernel/Algorithm.h"
17
18#include "GaudiKernel/NTuple.h"
19#include "GaudiKernel/ToolHandle.h"
20#include "GaudiKernel/ServiceHandle.h"
21
22// CLHEP includes
23#include "CLHEP/Matrix/Vector.h"
24#include "CLHEP/Geometry/Transform3D.h"
25
26// Write output into ROOT Trees
27#include "TTree.h"
28
29#include "Identifier/Identifier.h"
35
36//Forward declaration
37class IdentifierHash;
38class TTree;
39
40class AtlasDetectorID;
41class PixelID;
42class SCT_ID;
43class TRT_ID;
44
45namespace InDetAlignment {
47
48public:
49
50 //Gaudi style constructor and execution methods
52 CreateMisalignAlg(const std::string& name, ISvcLocator* pSvcLocator);
55
57 StatusCode initialize();
59 StatusCode execute();
61 StatusCode finalize();
62
63private:
64 // Data Members m_*
69
70 ToolHandle< IInDetAlignDBTool > m_IDAlignDBTool;
72
73 // algorithm parameters, possible to declare at runtime
74 std::string m_asciiFileNameBase;
75 std::string m_SQLiteTag;
76
81 long int m_nEvents;
82 std::vector<double> m_translation;
83 std::vector<double> m_rotation;
84 std::vector<double> m_local_translation;
85 std::vector<double> m_local_rotation;
86 std::string m_index;
87 Gaudi::Property<double> m_Misalign_x {this,"MisalignmentX",0.0,"Fixed X shift (mode 1 and 2)"};
88 Gaudi::Property<double> m_Misalign_y {this,"MisalignmentY",0.0,"Fixed Y shif (model 1 and 2)"};
89 Gaudi::Property<double> m_Misalign_z {this,"MisalignmentZ",0.0,"Fixed Z shift (mode 1 and 2)"};
90 Gaudi::Property<double> m_Misalign_alpha {this,"MisalignmentAlpha",0.0,"Fixed Alpha shift (model 1 and 2)"};
91 Gaudi::Property<double> m_Misalign_beta {this,"MisalignmentBeta",0.0,"Fixed Beta shift (mode 1 and 2)"};
92 Gaudi::Property<double> m_Misalign_gamma {this,"MisalignmentGamma",0.0,"Fixed Gamma shift (model 1 and 2)"};
93 Gaudi::Property<double> m_RndmMisalignWidth_x {this,"RandomMisalignmentWidthX",0.1,"Gaussian width of X random misalignments (mode 2)"};
94 Gaudi::Property<double> m_RndmMisalignWidth_y {this,"RandomMisalignmentWidthY",0.1,"Gaussian width of Y random misalignments (mode 2)"};
95 Gaudi::Property<double> m_RndmMisalignWidth_z {this,"RandomMisalignmentWidthZ",0.1,"Gaussian width of Z random misalignments (mode 2)"};
96 Gaudi::Property<double> m_RndmMisalignWidth_alpha {this,"RandomMisalignmentWidthAplha",0.1,"Gaussian width of Alpha random misalignments (mode 2)"};
97 Gaudi::Property<double> m_RndmMisalignWidth_beta {this,"RandomMisalignmentWidthBeta",0.1,"Gaussian width of Beta random misalignments (mode 2)"};
98 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 with parameters:
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.
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.
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
Gaudi::Property< double > m_Misalign_z
Gaudi::Property< double > m_RndmMisalignWidth_beta
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
StatusCode execute()
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
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