ATLAS Offline Software
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
37 class IdentifierHash;
38 class TTree;
39 
40 class AtlasDetectorID;
41 class PixelID;
42 class SCT_ID;
43 class TRT_ID;
44 
45 namespace InDetAlignment {
47 
48 public:
49 
50  //Gaudi style constructor and execution methods
52  CreateMisalignAlg(const std::string& name, ISvcLocator* pSvcLocator);
55 
62 
63 private:
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 
77  bool m_firstEvent;
79  int m_MisalignmentMode;
81  long int m_nEvents;
82  Gaudi::Property<double> m_Misalign_x {this,"MisalignmentX",0.0,"Fixed X shift (mode 1 and 2)"};
83  Gaudi::Property<double> m_Misalign_y {this,"MisalignmentY",0.0,"Fixed Y shif (model 1 and 2)"};
84  Gaudi::Property<double> m_Misalign_z {this,"MisalignmentZ",0.0,"Fixed Z shift (mode 1 and 2)"};
85  Gaudi::Property<double> m_Misalign_alpha {this,"MisalignmentAlpha",0.0,"Fixed Alpha shift (model 1 and 2)"};
86  Gaudi::Property<double> m_Misalign_beta {this,"MisalignmentBeta",0.0,"Fixed Beta shift (mode 1 and 2)"};
87  Gaudi::Property<double> m_Misalign_gamma {this,"MisalignmentGamma",0.0,"Fixed Gamma shift (model 1 and 2)"};
88  Gaudi::Property<double> m_RndmMisalignWidth_x {this,"RandomMisalignmentWidthX",0.1,"Gaussian width of X random misalignments (mode 2)"};
89  Gaudi::Property<double> m_RndmMisalignWidth_y {this,"RandomMisalignmentWidthY",0.1,"Gaussian width of Y random misalignments (mode 2)"};
90  Gaudi::Property<double> m_RndmMisalignWidth_z {this,"RandomMisalignmentWidthZ",0.1,"Gaussian width of Z random misalignments (mode 2)"};
91  Gaudi::Property<double> m_RndmMisalignWidth_alpha {this,"RandomMisalignmentWidthAplha",0.1,"Gaussian width of Alpha random misalignments (mode 2)"};
92  Gaudi::Property<double> m_RndmMisalignWidth_beta {this,"RandomMisalignmentWidthBeta",0.1,"Gaussian width of Beta random misalignments (mode 2)"};
93  Gaudi::Property<double> m_RndmMisalignWidth_gamma {this,"RandomMisalignmentWidthGamma",0.1,"Gaussian width of Gamma random misalignments (mode 2)"};
105 
106 
107  std::map<Identifier, HepGeom::Point3D<double> > m_ModuleList;
108 
109  // Generated Initial Alignment NTuple
111 
114 
115  NTuple::Item<double> m_AlignResults_x;
116  NTuple::Item<double> m_AlignResults_y;
117  NTuple::Item<double> m_AlignResults_z;
118  NTuple::Item<double> m_AlignResults_alpha;
119  NTuple::Item<double> m_AlignResults_beta;
120  NTuple::Item<double> m_AlignResults_gamma;
121  NTuple::Item<long> m_AlignResults_Identifier_ID;
125  NTuple::Item<long> m_AlignResults_Identifier_Phi;
126  NTuple::Item<long> m_AlignResults_Identifier_Eta;
127 
128  NTuple::Item<double> m_Initial_center_x;
129  NTuple::Item<double> m_Initial_center_y;
130  NTuple::Item<double> m_Initial_center_z;
131 
132 
133  NTuple::Item<double> m_Global_center_x;
134  NTuple::Item<double> m_Global_center_y;
135  NTuple::Item<double> m_Global_center_z;
136 
137  // Member Functions
138 
139  void setupSCT_AlignModule(int&);
140  void setupPixel_AlignModule(int&);
141  void setupTRT_AlignModule(int&);
142 
144  const HepGeom::Transform3D BuildAlignTransform(const CLHEP::HepVector &);
145 
148 
149  // IBL bowing functions
150  double getBowingMagParam(double temp_shift);
151  double getBowingTx(double p1, double z);
152 
155 
156  bool m_doPix;
157  bool m_doStrip;
158  bool m_doTRT;
159 
160  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_pixelDetEleCollKey{this, "PixelDetEleCollKey", "PixelDetectorElementCollection", "Key of SiDetectorElementCollection for Pixel"};
161  SG::ReadCondHandleKey<InDetDD::SiDetectorElementCollection> m_SCTDetEleCollKey{this, "SCTDetEleCollKey", "SCT_DetectorElementCollection", "Key of SiDetectorElementCollection for SCT"};
162  SG::ReadCondHandleKey<InDetDD::TRT_DetElementContainer> m_trtDetEleCollKey{this, "TRTDetEleCollKey", "TRT_DetElementContainer", "Key of TRT_DetElementContainer for TRT"};
163 
164 };
165 
166 } // end of namespace bracket
167 #endif // INDETALIGNMENT_CREATEMISALIGNALG_H
InDetAlignment::CreateMisalignAlg::m_RndmMisalignWidth_y
Gaudi::Property< double > m_RndmMisalignWidth_y
Definition: CreateMisalignAlg.h:89
InDetAlignment::CreateMisalignAlg::m_Misalign_z
Gaudi::Property< double > m_Misalign_z
Definition: CreateMisalignAlg.h:84
InDetAlignment::CreateMisalignAlg::m_ScalePixelDBM
double m_ScalePixelDBM
Definition: CreateMisalignAlg.h:97
InDetAlignment::CreateMisalignAlg::m_AlignResults_alpha
NTuple::Item< double > m_AlignResults_alpha
AP rotation around x-axis.
Definition: CreateMisalignAlg.h:118
InDetAlignment::CreateMisalignAlg::m_HumanReadableID
int m_HumanReadableID
Definition: CreateMisalignAlg.h:113
InDetAlignment::CreateMisalignAlg::m_ScalePixelEndcap
double m_ScalePixelEndcap
Definition: CreateMisalignAlg.h:100
InDetAlignment::CreateMisalignAlg::m_AlignResults_Identifier_ID
NTuple::Item< long > m_AlignResults_Identifier_ID
ID information for this module.
Definition: CreateMisalignAlg.h:121
InDetAlignment::CreateMisalignAlg::m_Global_center_x
NTuple::Item< double > m_Global_center_x
Misaligned global center of module.
Definition: CreateMisalignAlg.h:133
InDetAlignment::CreateMisalignAlg::m_Initial_center_z
NTuple::Item< double > m_Initial_center_z
Initial global center of module.
Definition: CreateMisalignAlg.h:130
InDetAlignment::CreateMisalignAlg::m_Misalign_gamma
Gaudi::Property< double > m_Misalign_gamma
Definition: CreateMisalignAlg.h:87
InDetAlignment::CreateMisalignAlg::BuildAlignTransform
const HepGeom::Transform3D BuildAlignTransform(const CLHEP::HepVector &)
builds a HepGeom::Transform3D from the 6 Alignment Parameters
Definition: CreateMisalignAlg.cxx:1020
TRT_DetElementContainer.h
InDetAlignment::CreateMisalignAlg::m_pixelDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_pixelDetEleCollKey
Definition: CreateMisalignAlg.h:160
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
InDetAlignment
Definition: CreateMisalignAlg.cxx:68
InDetAlignment::CreateMisalignAlg::m_Misalign_beta
Gaudi::Property< double > m_Misalign_beta
Definition: CreateMisalignAlg.h:86
InDetAlignment::CreateMisalignAlg::m_ScaleTRTBarrel
double m_ScaleTRTBarrel
Definition: CreateMisalignAlg.h:103
InDetAlignment::CreateMisalignAlg
Definition: CreateMisalignAlg.h:46
InDetAlignment::CreateMisalignAlg::m_AlignResults_gamma
NTuple::Item< double > m_AlignResults_gamma
AP rotation around z-axis.
Definition: CreateMisalignAlg.h:120
InDetAlignment::CreateMisalignAlg::m_ScaleSCTBarrel
double m_ScaleSCTBarrel
Definition: CreateMisalignAlg.h:101
InDetAlignment::CreateMisalignAlg::m_SQLiteTag
std::string m_SQLiteTag
tag name for the ConditionsDB
Definition: CreateMisalignAlg.h:75
InDetAlignment::CreateMisalignAlg::m_AlignResults_Identifier_LayerDisc
NTuple::Item< long > m_AlignResults_Identifier_LayerDisc
ID information for this module.
Definition: CreateMisalignAlg.h:124
InDetAlignment::CreateMisalignAlg::finalize
StatusCode finalize()
standard Athena-Algorithm method
Definition: CreateMisalignAlg.cxx:256
InDetAlignment::CreateMisalignAlg::m_AlignResults_Identifier_Eta
NTuple::Item< long > m_AlignResults_Identifier_Eta
ID information for this module.
Definition: CreateMisalignAlg.h:126
InDetAlignment::CreateMisalignAlg::m_ModuleList
std::map< Identifier, HepGeom::Point3D< double > > m_ModuleList
map of all SiIdentifiers to be misaligned and their centerpoints in global coordinates
Definition: CreateMisalignAlg.h:107
AthAlgorithm.h
InDetAlignment::CreateMisalignAlg::m_doTRT
bool m_doTRT
Definition: CreateMisalignAlg.h:158
InDetAlignment::CreateMisalignAlg::m_AlignResults_Identifier_BarrelEC
NTuple::Item< long > m_AlignResults_Identifier_BarrelEC
ID information for this module.
Definition: CreateMisalignAlg.h:123
InDetAlignment::CreateMisalignAlg::m_AlignResults_beta
NTuple::Item< double > m_AlignResults_beta
AP rotation aorund y-axis.
Definition: CreateMisalignAlg.h:119
InDetAlignment::CreateMisalignAlg::m_RndmMisalignWidth_beta
Gaudi::Property< double > m_RndmMisalignWidth_beta
Definition: CreateMisalignAlg.h:92
InDetAlignment::CreateMisalignAlg::m_createFreshDB
bool m_createFreshDB
Flag to call the createDB method of DBTool (to be switched off when adding misalignments to a given g...
Definition: CreateMisalignAlg.h:78
InDetAlignment::CreateMisalignAlg::m_trtDetEleCollKey
SG::ReadCondHandleKey< InDetDD::TRT_DetElementContainer > m_trtDetEleCollKey
Definition: CreateMisalignAlg.h:162
InDetAlignment::CreateMisalignAlg::m_RndmMisalignWidth_gamma
Gaudi::Property< double > m_RndmMisalignWidth_gamma
Definition: CreateMisalignAlg.h:93
InDetAlignment::CreateMisalignAlg::getBowingTx
double getBowingTx(double p1, double z)
Definition: CreateMisalignAlg.cxx:1079
InDetAlignment::CreateMisalignAlg::m_asciiFileNameBase
std::string m_asciiFileNameBase
filename basis for ASCII files with alignment constants
Definition: CreateMisalignAlg.h:74
InDetAlignment::CreateMisalignAlg::m_VisualizationLookupTree
TTree * m_VisualizationLookupTree
Definition: CreateMisalignAlg.h:110
z
#define z
InDetAlignment::CreateMisalignAlg::m_trtIdHelper
const TRT_ID * m_trtIdHelper
Definition: CreateMisalignAlg.h:68
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
InDetAlignment::CreateMisalignAlg::m_AlignResults_Identifier_Phi
NTuple::Item< long > m_AlignResults_Identifier_Phi
ID information for this module.
Definition: CreateMisalignAlg.h:125
InDetAlignment::CreateMisalignAlg::m_trtaligndbservice
ServiceHandle< ITRT_AlignDbSvc > m_trtaligndbservice
Definition: CreateMisalignAlg.h:71
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
InDetAlignment::CreateMisalignAlg::m_sctIdHelper
const SCT_ID * m_sctIdHelper
Definition: CreateMisalignAlg.h:67
InDetAlignment::CreateMisalignAlg::setupPixel_AlignModule
void setupPixel_AlignModule(int &)
Definition: CreateMisalignAlg.cxx:316
InDetAlignment::CreateMisalignAlg::m_AlignResults_x
NTuple::Item< double > m_AlignResults_x
Alignment parameter sensitive coordinate.
Definition: CreateMisalignAlg.h:115
InDetAlignment::CreateMisalignAlg::m_Misalign_x
Gaudi::Property< double > m_Misalign_x
Definition: CreateMisalignAlg.h:82
InDetAlignment::CreateMisalignAlg::m_RndmMisalignWidth_z
Gaudi::Property< double > m_RndmMisalignWidth_z
Definition: CreateMisalignAlg.h:90
InDetAlignment::CreateMisalignAlg::m_idHelper
const AtlasDetectorID * m_idHelper
Definition: CreateMisalignAlg.h:65
InDetAlignment::CreateMisalignAlg::initialize
StatusCode initialize()
standard Athena-Algorithm method
Definition: CreateMisalignAlg.cxx:130
InDetAlignment::CreateMisalignAlg::m_ScaleTRTEndcap
double m_ScaleTRTEndcap
Definition: CreateMisalignAlg.h:104
InDetAlignment::CreateMisalignAlg::m_ScaleSCTEndcap
double m_ScaleSCTEndcap
Definition: CreateMisalignAlg.h:102
InDetAlignment::CreateMisalignAlg::m_doPix
bool m_doPix
Definition: CreateMisalignAlg.h:156
IInDetAlignDBTool.h
AthAlgorithm
Definition: AthAlgorithm.h:47
ReadCondHandleKey.h
InDetAlignment::CreateMisalignAlg::m_pixelIdHelper
const PixelID * m_pixelIdHelper
Definition: CreateMisalignAlg.h:66
InDetAlignment::CreateMisalignAlg::m_doStrip
bool m_doStrip
Definition: CreateMisalignAlg.h:157
InDetAlignment::CreateMisalignAlg::m_IBLBowingTshift
double m_IBLBowingTshift
The relative temp shift of set point that intriduces bowing (sign is important)
Definition: CreateMisalignAlg.h:98
InDetAlignment::CreateMisalignAlg::m_ScalePixelBarrel
double m_ScalePixelBarrel
Definition: CreateMisalignAlg.h:99
InDetAlignment::CreateMisalignAlg::setupTRT_AlignModule
void setupTRT_AlignModule(int &)
Definition: CreateMisalignAlg.cxx:368
InDetAlignment::CreateMisalignAlg::m_Initial_center_x
NTuple::Item< double > m_Initial_center_x
Initial global center of module.
Definition: CreateMisalignAlg.h:128
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
InDetAlignment::CreateMisalignAlg::m_firstEvent
bool m_firstEvent
Flag for Setup of AlignModuleList (1st event)
Definition: CreateMisalignAlg.h:77
InDetAlignment::CreateMisalignAlg::m_AlignResults_y
NTuple::Item< double > m_AlignResults_y
AP not-so-sensitive coordinate.
Definition: CreateMisalignAlg.h:116
InDetAlignment::CreateMisalignAlg::m_IDAlignDBTool
ToolHandle< IInDetAlignDBTool > m_IDAlignDBTool
Definition: CreateMisalignAlg.h:70
InDetAlignment::CreateMisalignAlg::m_ScalePixelIBL
double m_ScalePixelIBL
Definition: CreateMisalignAlg.h:96
SiDetectorElementCollection.h
InDetAlignment::CreateMisalignAlg::getBowingMagParam
double getBowingMagParam(double temp_shift)
Definition: CreateMisalignAlg.cxx:1070
InDetAlignment::CreateMisalignAlg::m_AlignResults_z
NTuple::Item< double > m_AlignResults_z
AP normal to module plane.
Definition: CreateMisalignAlg.h:117
InDetAlignment::CreateMisalignAlg::reduceTRTID
const Identifier reduceTRTID(Identifier id)
Definition: CreateMisalignAlg.cxx:1032
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection >
InDetAlignment::CreateMisalignAlg::m_Global_center_y
NTuple::Item< double > m_Global_center_y
Misaligned global center of module.
Definition: CreateMisalignAlg.h:134
InDetAlignment::CreateMisalignAlg::m_Misalign_maxShift
double m_Misalign_maxShift
Maximum shift for global modes.
Definition: CreateMisalignAlg.h:94
InDetAlignment::CreateMisalignAlg::m_Initial_center_y
NTuple::Item< double > m_Initial_center_y
Initial global center of module.
Definition: CreateMisalignAlg.h:129
TRT_ID
Definition: TRT_ID.h:84
InDetAlignment::CreateMisalignAlg::m_SCTDetEleCollKey
SG::ReadCondHandleKey< InDetDD::SiDetectorElementCollection > m_SCTDetEleCollKey
Definition: CreateMisalignAlg.h:161
InDetAlignment::CreateMisalignAlg::m_RndmMisalignWidth_alpha
Gaudi::Property< double > m_RndmMisalignWidth_alpha
Definition: CreateMisalignAlg.h:91
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
SCT_ID
Definition: SCT_ID.h:68
InDetAlignment::CreateMisalignAlg::m_nEvents
long int m_nEvents
Definition: CreateMisalignAlg.h:81
InDetAlignment::CreateMisalignAlg::m_Misalign_alpha
Gaudi::Property< double > m_Misalign_alpha
Definition: CreateMisalignAlg.h:85
InDetAlignment::CreateMisalignAlg::m_Misalign_y
Gaudi::Property< double > m_Misalign_y
Definition: CreateMisalignAlg.h:83
InDetAlignment::CreateMisalignAlg::m_AlignResults_Identifier_PixelSCT
NTuple::Item< long > m_AlignResults_Identifier_PixelSCT
ID information for this module.
Definition: CreateMisalignAlg.h:122
InDetAlignment::CreateMisalignAlg::CreateMisalignAlg
CreateMisalignAlg(const std::string &name, ISvcLocator *pSvcLocator)
Standard Athena-Algorithm Constructor.
Definition: CreateMisalignAlg.cxx:71
InDetAlignment::CreateMisalignAlg::execute
StatusCode execute()
standard Athena-Algorithm method
Definition: CreateMisalignAlg.cxx:218
InDetAlignment::CreateMisalignAlg::m_Global_center_z
NTuple::Item< double > m_Global_center_z
Misaligned global center of module.
Definition: CreateMisalignAlg.h:135
InDetAlignment::CreateMisalignAlg::setupSCT_AlignModule
void setupSCT_AlignModule(int &)
Definition: CreateMisalignAlg.cxx:266
ITRT_AlignDbSvc.h
abstract interface to Service to manage TRT alignment conditions
InDetAlignment::CreateMisalignAlg::m_Misalign_maxShift_Inner
double m_Misalign_maxShift_Inner
Maximum shift of the Pixel B-layer in curl (d0 bias!)
Definition: CreateMisalignAlg.h:95
IdentifierHash
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
Definition: IdentifierHash.h:25
InDetAlignment::CreateMisalignAlg::GenerateMisaligment
StatusCode GenerateMisaligment()
the main function which calculates and applies a transformation to each detector element
Definition: CreateMisalignAlg.cxx:437
PixelID
Definition: PixelID.h:67
InDetAlignment::CreateMisalignAlg::~CreateMisalignAlg
~CreateMisalignAlg()
Default Destructor.
Definition: CreateMisalignAlg.cxx:124
AtlasDetectorID
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition: AtlasDetectorID.h:57
InDetAlignment::CreateMisalignAlg::m_RndmMisalignWidth_x
Gaudi::Property< double > m_RndmMisalignWidth_x
Definition: CreateMisalignAlg.h:88
InDetAlignment::CreateMisalignAlg::m_AthenaHashedID
int m_AthenaHashedID
Definition: CreateMisalignAlg.h:112
ServiceHandle< ITRT_AlignDbSvc >
InDetAlignment::CreateMisalignAlg::m_MisalignmentMode
int m_MisalignmentMode
Flag which Misalignment mode is to be generated.
Definition: CreateMisalignAlg.h:80
Identifier
Definition: IdentifierFieldParser.cxx:14