ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_MisalignAlg.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 HGTD_ALIGNALGS_HGTD_MISALIGNALG_H
6#define HGTD_ALIGNALGS_HGTD_MISALIGNALG_H
7
9#include "Gaudi/Property.h"
10
11#include <vector>
12#include <string>
13#include <fstream>
14#include "TTree.h"
15
18
19#include "GaudiKernel/IRndmGenSvc.h"
20#include "GaudiKernel/RndmGenerators.h"
21#include "GaudiKernel/ITHistSvc.h"
22
24#include "GeoModelKernel/GeoVAlignmentStore.h"
25
27#include "GaudiKernel/ToolHandle.h"
28
29class GeoAlignableTransform;
30
32
33public:
35
36 virtual StatusCode initialize() override;
37 virtual StatusCode execute(const EventContext& ctx) override;
38 virtual StatusCode finalize() override;
39
40private:
41
42 Gaudi::Property<int> m_mode{this, "MisalignMode", 1};
43 Gaudi::Property<double> m_shiftX{this, "ShiftX", 0.05};
44 Gaudi::Property<double> m_shiftY{this, "ShiftY", 0.0};
45 Gaudi::Property<double> m_shiftZ{this, "ShiftZ", 0.0};
46
47 Gaudi::Property<double> m_sigmaX{this, "SigmaX", 0.01};
48 Gaudi::Property<double> m_sigmaY{this, "SigmaY", 0.01};
49 Gaudi::Property<double> m_sigmaZ{this, "SigmaZ", 0.01};
50
51
52 Gaudi::Property<bool> m_applyTranslation{this, "ApplyTranslation", true};
53 Gaudi::Property<bool> m_doDebugPrint{this, "DoDebugPrint", true};
54
55 Gaudi::Property<bool> m_applyRotation{this, "ApplyRotation", false};
56 Gaudi::Property<int> m_maxModules{this, "MaxModules", -1};
57
59 this, "RndmGenSvc", "RndmGenSvc", "Random number service"
60 };
61
62 Gaudi::Property<std::string> m_randomStream{
63 this,
64 "RandomStream",
65 "HGTDMisalignment",
66 "Random number stream name"
67 };
68
69 std::vector<GeoAlignableTransform*> m_alignables;
70
71 Gaudi::Property<std::string> m_outputFile{
72 this,
73 "OutputFile",
74 "hgtd_misalignment.txt",
75 "Output file name"
76 };
77
79
80 Gaudi::Property<bool> m_applyToGeometry{
81 this,
82 "ApplyToGeometry",
83 false,
84 "Apply misalignment deltas to HGTD alignable transforms"
85 };
86
87 Gaudi::Property<int> m_testHash{
88 this,
89 "TestHash",
90 -1,
91 "If >=0, apply geometry delta only to this hash"
92 };
93
94 Gaudi::Property<bool> m_createFreshDB{
95 this,
96 "CreateFreshDB",
97 true,
98 "Create a new HGTD alignment database"
99 };
100
101 Gaudi::Property<std::string> m_sqliteTag{
102 this,
103 "SQLiteTag",
104 "HGTD_AlignTag",
105 "SQLite alignment tag"
106 };
107
108 Gaudi::Property<bool> m_writeToDB{
109 this,
110 "WriteToDB",
111 false,
112 "Write misalignment to HGTD alignment database"
113 };
114
115 ToolHandle<IHGTD_AlignDBTool> m_alignDBTool{
116 this,
117 "AlignDBTool",
118 "HGTD_AlignDBTool",
119 "HGTD alignment database tool"
120 };
121
122 const HGTD_ID* m_hgtdIdHelper{nullptr};
123
124 //------------------------------------------------------------
125 // Validation ROOT tree
126 // Stores one entry per HGTD detector element containing the
127 // nominal position together with the applied misalignment.
128 //------------------------------------------------------------
129
130 TTree* m_tree{nullptr};
131
132 // Alignment parameters
133 float m_localDx{0.f};
134 float m_localDy{0.f};
135 float m_localDz{0.f};
136
137 // Nominal module center
138 float m_centerX{0.f};
139 float m_centerY{0.f};
140 float m_centerZ{0.f};
141
142 // Misaligned module center
143 float m_shiftedX{0.f};
144 float m_shiftedY{0.f};
145 float m_shiftedZ{0.f};
146
147 // Detector identification
148 unsigned int m_hash{0};
149 int m_endcap{0};
150 int m_layer{0};
153
154 std::ofstream m_outfile;
155 bool m_firstEvent{true};
156 unsigned int m_nEvents{0};
157
158 StatusCode GenerateMisalignment();
159
160
161};
162
163#endif
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
The Detector manager has methods to retrieve the Identifier helper and methods to retrieve the detect...
This is an Identifier helper class for the HGTD subdetector.
Definition HGTD_ID.h:47
Gaudi::Property< double > m_sigmaY
virtual StatusCode initialize() override
Gaudi::Property< bool > m_createFreshDB
Gaudi::Property< bool > m_writeToDB
std::ofstream m_outfile
Gaudi::Property< std::string > m_outputFile
Gaudi::Property< double > m_sigmaX
Gaudi::Property< bool > m_applyRotation
Gaudi::Property< double > m_shiftZ
Gaudi::Property< double > m_shiftX
StatusCode GenerateMisalignment()
virtual StatusCode execute(const EventContext &ctx) override
Execute method.
Gaudi::Property< double > m_shiftY
const HGTD_DetectorManager * m_hgtdManager
Gaudi::Property< double > m_sigmaZ
virtual StatusCode finalize() override
std::vector< GeoAlignableTransform * > m_alignables
Gaudi::Property< int > m_maxModules
Gaudi::Property< std::string > m_randomStream
Gaudi::Property< std::string > m_sqliteTag
Gaudi::Property< int > m_mode
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Gaudi::Property< bool > m_doDebugPrint
Gaudi::Property< bool > m_applyToGeometry
unsigned int m_nEvents
Gaudi::Property< int > m_testHash
ServiceHandle< IRndmGenSvc > m_rndmSvc
const HGTD_ID * m_hgtdIdHelper
Gaudi::Property< bool > m_applyTranslation
ToolHandle< IHGTD_AlignDBTool > m_alignDBTool