ATLAS Offline Software
Loading...
Searching...
No Matches
InDet::SiTrkAlignDBTool Class Reference

#include <SiTrkAlignDBTool.h>

Inheritance diagram for InDet::SiTrkAlignDBTool:
Collaboration diagram for InDet::SiTrkAlignDBTool:

Public Member Functions

 SiTrkAlignDBTool (const std::string &type, const std::string &name, const IInterface *parent)
 constructor
virtual ~SiTrkAlignDBTool ()
 destructor
virtual StatusCode initialize ()
 initialize method
virtual StatusCode finalize ()
 finalize method
void writeAlignPar ()
 Writes alignment parameters.
void setNtuple (TFile *file)
 sets ntuple to be used to write output
virtual void setLogStream (std::ostream *os)
 sets the output stream for the logfile
virtual StatusCode preSolve ()
 sets up initial alignment constants before solving
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

std::ostream * m_logStream = nullptr
 logfile output stream

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

void updateDB ()
 updates alignment constants in the DB
bool checkPixelLevel ()
bool checkSCTLevel ()
bool checkSiLevel ()
void updateSiL0asL1 (Identifier idL0, const Amg::Transform3D &transform)
void updateAsL3 (const Trk::AlignModule *module, const Amg::Transform3D &transform, double)
void printTransform (const Amg::Transform3D &tr) const
void updateAsL2 (const Trk::AlignModule *module, const Amg::Transform3D &transform, const int)
void updateAsL16 (const Trk::AlignModule *module, double)
virtual Identifier GetL1L2fromL3Identifier (const Identifier &ident, const int &level) const
 convert L3 module identifier to L1 or L2
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

const PixelIDm_pixHelper
 pointer to PIX detector manager
const SCT_IDm_sctHelper
 pointer to SCT detector manager
const AtlasDetectorIDm_idHelper
bool m_writeSQLFile
 flag wether to write out .db file or not (file is not needed in parallel jobs)
std::string m_SQLiteTag
 tag name for the ConditionsDB
std::string m_outputAlignFile
 filename for the textfile with final alignment constants
std::string m_outIBLDistFile
 filename for the textfile with final IBLDist params
std::string m_outGlobalFolderFile
 filename for the textfile with final GlobalFolder constants
bool m_writeTextFile
 flag whether to write out the final constants into text file
bool m_writeOldConstants
 flag whether to write out the initial constants into text file
std::string m_oldIBLDistFile
 filename for the textfile with initial IBLDist params
std::string m_oldAlignFile
 filename for the textfile with initial alignment constants
std::string m_oldGlobalFolderFile
 filename for the textfile with initial GlobalFolder constants
bool m_updateConstants
 flag whether to update the constants
ToolHandle< IInDetAlignDBToolm_IDAlignDBTool
ToolHandle< Trk::IAlignModuleToolm_alignModuleTool
ToolHandle< Trk::IGeometryManagerToolm_pixelGeoManager
ToolHandle< Trk::IGeometryManagerToolm_sctGeoManager
ToolHandle< Trk::IGeometryManagerToolm_siGeoManager
TFile * m_ntuple
int m_pixelAlignLevel
int m_pixelAlignLevelBarrel
int m_pixelAlignLevelEndcaps
bool m_pixelaAlignDBM
int m_sctAlignLevel
int m_sctAlignLevelBarrel
int m_sctAlignLevelEndcaps
int m_siAlignLevel
bool m_doSi
bool m_doPixel
bool m_doSCT
bool m_writeAsL3
bool m_writeAsL2
bool m_writeAsL16
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 44 of file SiTrkAlignDBTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SiTrkAlignDBTool()

InDet::SiTrkAlignDBTool::SiTrkAlignDBTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

constructor

Definition at line 35 of file SiTrkAlignDBTool.cxx.

36 : AthAlgTool(type,name,parent)
37 , m_pixHelper(nullptr)
38 , m_sctHelper(nullptr)
39 , m_idHelper(nullptr)
40 , m_writeSQLFile(true)
41 , m_SQLiteTag("test_tag")
42 , m_outputAlignFile("OutputSiAlignment.txt")
43 , m_outIBLDistFile("OutputIBLDist.txt")
44 , m_outGlobalFolderFile("OutputSiGlobalFolder.txt")
45 , m_writeTextFile(true)
46 , m_writeOldConstants(false)
47 , m_oldIBLDistFile("OldIBLDist.txt")
48 , m_oldAlignFile("OldSiAlignment.txt")
49 , m_oldGlobalFolderFile("OldSiGlobalFolder.txt")
50 , m_updateConstants(true)
51 , m_IDAlignDBTool("InDetAlignDBTool")
52 , m_alignModuleTool("Trk::AlignModuleTool/AlignModuleTool")
54 , m_sctGeoManager("")
55 , m_siGeoManager("")
56 , m_ntuple{}
60 , m_pixelaAlignDBM(false)
61 , m_sctAlignLevel(-1)
64 , m_siAlignLevel(-1)
65 , m_doSi(false)
66 , m_doPixel(false)
67 , m_doSCT(false)
68 , m_writeAsL3(false)
69 , m_writeAsL2(false)
70 , m_writeAsL16(false)
71{
72 declareInterface<ITrkAlignDBTool>(this);
73
74 declareProperty("WriteSQLFile", m_writeSQLFile);
75 declareProperty("SQLiteTag", m_SQLiteTag);
76 declareProperty("OutputTextFile", m_outputAlignFile);
77 declareProperty("OutputIBLDistFile", m_outIBLDistFile, "File to write out IBL distortions - set empy to suppress writing this folder");
78 declareProperty("OutputGlobalFolderFile",m_outGlobalFolderFile);
79 declareProperty("WriteTextFile", m_writeTextFile);
80 declareProperty("WriteOldConstants", m_writeOldConstants);
81 declareProperty("OldAlignFile", m_oldAlignFile);
82 declareProperty("OldIBLDistFile", m_oldIBLDistFile,"File to write out (old-style) IBL distortions - set empy to suppress writing this folder");
83 declareProperty("OldGlobalFolderFile",m_oldGlobalFolderFile);
84 declareProperty("UpdateConstants", m_updateConstants);
85 declareProperty("WriteAsL3", m_writeAsL3);
86
87 declareProperty("IDAlignDBTool", m_IDAlignDBTool);
88 declareProperty("AlignModuleTool", m_alignModuleTool, "Tool for handling of align module collections");
89 declareProperty("AlignmentDBM", m_pixelaAlignDBM);
90
91 declareProperty("PixelGeometryManager", m_pixelGeoManager, "Tool for handling the Pixel alignment geometry");
92 declareProperty("SCTGeometryManager", m_sctGeoManager, "Tool for handling the SCT alignment geometry");
93 declareProperty("SiGeometryManager", m_siGeoManager, "Tool for handling the Silicon alignment geometry");
94}
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
const PixelID * m_pixHelper
pointer to PIX detector manager
std::string m_oldGlobalFolderFile
filename for the textfile with initial GlobalFolder constants
ToolHandle< Trk::IGeometryManagerTool > m_pixelGeoManager
ToolHandle< Trk::IAlignModuleTool > m_alignModuleTool
ToolHandle< Trk::IGeometryManagerTool > m_sctGeoManager
std::string m_outGlobalFolderFile
filename for the textfile with final GlobalFolder constants
std::string m_outIBLDistFile
filename for the textfile with final IBLDist params
std::string m_SQLiteTag
tag name for the ConditionsDB
const AtlasDetectorID * m_idHelper
bool m_writeTextFile
flag whether to write out the final constants into text file
bool m_writeSQLFile
flag wether to write out .db file or not (file is not needed in parallel jobs)
const SCT_ID * m_sctHelper
pointer to SCT detector manager
bool m_updateConstants
flag whether to update the constants
ToolHandle< IInDetAlignDBTool > m_IDAlignDBTool
ToolHandle< Trk::IGeometryManagerTool > m_siGeoManager
bool m_writeOldConstants
flag whether to write out the initial constants into text file
std::string m_oldIBLDistFile
filename for the textfile with initial IBLDist params
std::string m_outputAlignFile
filename for the textfile with final alignment constants
std::string m_oldAlignFile
filename for the textfile with initial alignment constants

◆ ~SiTrkAlignDBTool()

InDet::SiTrkAlignDBTool::~SiTrkAlignDBTool ( )
virtual

destructor

Definition at line 97 of file SiTrkAlignDBTool.cxx.

98{}

Member Function Documentation

◆ checkPixelLevel()

bool InDet::SiTrkAlignDBTool::checkPixelLevel ( )
private

Definition at line 232 of file SiTrkAlignDBTool.cxx.

233{
235 return true;
236
237 if(!m_pixelaAlignDBM && m_pixelAlignLevel==11){// the new one with IBL (seems simplest solution)
238 m_writeAsL2 = true;
239 return true;
240 }
241
242 if(m_pixelaAlignDBM && (m_pixelAlignLevel==1 || m_pixelAlignLevel==2 )){// the new one with DBM (seems simplest solution)
243 m_writeAsL2 = true;
244 return true;
245 }
246
247 if(m_pixelaAlignDBM && m_pixelAlignLevel==3 ){// the new one with DBM (seems simplest solution)
248 return true;
249 }
250
251 if(!m_pixelaAlignDBM && m_pixelAlignLevel==16){// the new IBL bowing level
252 m_writeAsL16 = true;
253 // We need some fix here with respect to current CL implementation! There bowing is updated at L3!! (this would currently do both..)
254 return true;
255 }
256
257 if (m_writeAsL3)
258 return true;
259
261
262 bool ok = false;
263
265 case 11: case 12: case 15: case 16: case 2: case 22: case 26: case 27: case 3:
266 ok = true;
267 break;
268 default:
269 ATH_MSG_ERROR(" Storing of alignment constants for level "<<m_pixelAlignLevelBarrel<<" for Pixel Barrel is not implemented.");
271 ok = false;
272 break;
273 }
274
276 case 11: case 16: case 2: case 3: case 12:
277 ok = ok && true;
278 break;
279 default:
280 ATH_MSG_ERROR(" Storing of alignment constants for level "<<m_pixelAlignLevelEndcaps<<" for Pixel Endcaps is not implemented.");
282 ok = false;
283 break;
284 }
285
286 return ok;
287}
#define ATH_MSG_ERROR(x)

◆ checkSCTLevel()

bool InDet::SiTrkAlignDBTool::checkSCTLevel ( )
private

Definition at line 290 of file SiTrkAlignDBTool.cxx.

291{
292 if(m_sctAlignLevel==0)
293 return true;
294
295 if (m_writeAsL3)
296 return true;
297
298 m_sctAlignLevel = -1;
299
300 bool ok = false;
301
302 switch(m_sctAlignLevelBarrel) {
303 case 1: case 2: case 27: case 3:
304 ok = true;
305 break;
306 default:
307 ATH_MSG_ERROR(" Storing of alignment constants for level "<<m_sctAlignLevelBarrel<<" for SCT Barrel is not implemented.");
309 ok = false;
310 break;
311 }
312
313 switch(m_sctAlignLevelEndcaps) {
314 case 1: case 2: case 25: case 3:
315 ok = ok && true;
316 break;
317 default:
318 ATH_MSG_ERROR(" Storing of alignment constants for level "<<m_sctAlignLevelEndcaps<<" for SCT Endcaps is not implemented.");
320 ok = false;
321 break;
322 }
323
324 return ok;
325}

◆ checkSiLevel()

bool InDet::SiTrkAlignDBTool::checkSiLevel ( )
private

Definition at line 328 of file SiTrkAlignDBTool.cxx.

329{
330 if (m_writeAsL3)
331 return true;
332
333 switch(m_siAlignLevel) {
334 case 0:
335 case 1:
336 case 2:
337 case 3:
338 return true;
339
340 default:
341 return false;
342 }
343}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode InDet::SiTrkAlignDBTool::finalize ( )
virtual

finalize method

Implements Trk::ITrkAlignDBTool.

Definition at line 224 of file SiTrkAlignDBTool.cxx.

225{
226 ATH_MSG_DEBUG("finalize() of SiTrkAlignDBTool");
227
228 return StatusCode::SUCCESS;
229}
#define ATH_MSG_DEBUG(x)

◆ GetL1L2fromL3Identifier()

Identifier InDet::SiTrkAlignDBTool::GetL1L2fromL3Identifier ( const Identifier & ident,
const int & level ) const
privatevirtual

convert L3 module identifier to L1 or L2

< no translation needed

check whether PIX

< Whole pixel det. at L1

check whether SCT

< barrel + 2 x EC at L1

< take care of the case where level != 1,2,3 or ident neither pix nor sct

Definition at line 865 of file SiTrkAlignDBTool.cxx.

865 {
866 if( level == 3 ) return ident ;
868 if( m_pixHelper->is_pixel(ident) ) {
869 if( level == 1 ) {
870 return m_pixHelper->wafer_id( 0, 0, 0, 0 ) ;
871 }
872 if( level == 2 ) {
873 int barrel_ec = m_pixHelper->barrel_ec( ident ) ;
874 int layer_disk = m_pixHelper->layer_disk( ident ) ;
875 int phi_sector = m_pixHelper->phi_module( ident ) ;
876 if (abs(barrel_ec)==4) return m_pixHelper->wafer_id( barrel_ec, layer_disk, phi_sector, 0 ) ;
877 else return m_pixHelper->wafer_id( barrel_ec, layer_disk, 0, 0 ) ;
878 }
879 }
881 if( m_sctHelper->is_sct(ident) ) {
882 if( level == 1 ) {
883 int barrel_ec = m_sctHelper->barrel_ec( ident ) ;
884 return m_sctHelper->wafer_id( barrel_ec, 0, 0, 0, 0 ) ;
885 }
886 if( level == 2 ) {
887 int barrel_ec = m_sctHelper->barrel_ec( ident ) ;
888 int layer_disk = m_sctHelper->layer_disk( ident ) ;
889 return m_sctHelper->wafer_id( barrel_ec, layer_disk, 0, 0, 0 ) ;
890 }
891 }
892 return ident ;
893}
@ ident
Definition HitInfo.h:77

◆ initialize()

StatusCode InDet::SiTrkAlignDBTool::initialize ( )
virtual

initialize method

Implements Trk::ITrkAlignDBTool.

Definition at line 101 of file SiTrkAlignDBTool.cxx.

101 {
102
103 ATH_MSG_DEBUG("initialize() of SiTrkAlignDBTool");
104
105 if(!m_updateConstants) {
106 ATH_MSG_WARNING("Not updating Silicon constants!");
107 return StatusCode::SUCCESS;
108 }
109
110 // Si alignment database tool
111 ATH_CHECK( m_IDAlignDBTool.retrieve() );
112 // get AlignModuleTool
113 ATH_CHECK( m_alignModuleTool.retrieve() );
114 // retrieve Pixel helper
115 ATH_CHECK( detStore()->retrieve(m_pixHelper) );
116 // retrieve SCT helper
117 ATH_CHECK( detStore()->retrieve(m_sctHelper) );
118 ATH_CHECK(detStore()->retrieve(m_idHelper, "AtlasID"));
119
120 // check which geometry managers are loaded and which are to be used
121
122 // get SiGeometryManagerTool
123 if( !m_siGeoManager.empty() ) {
124 ATH_CHECK( m_siGeoManager.retrieve());
125
126 ATH_MSG_DEBUG("retrieved " << m_siGeoManager);
127 m_siAlignLevel = m_siGeoManager->alignLevel();
128 ATH_MSG_INFO(" Requested update of Level "<<m_siAlignLevel<<" alignment constants for Silicon");
129
130 // check alignment level but don't stop on error
131 // if unknown level given, set to -1
132 if(!checkSiLevel()) {
133 ATH_MSG_WARNING(" Storing of alignment constants for level "<<m_siAlignLevel<<" for Silicon is not implemented.");
135 }
136 }
137
138 // for anything else then level 0 we need the other two geometry managers
139 if(m_siAlignLevel!=0) {
140
141 // get PixelGeometryManagerTool
142 if( !m_pixelGeoManager.empty() ) {
143 ATH_CHECK( m_pixelGeoManager.retrieve());
144 ATH_MSG_DEBUG("retrieved " << m_pixelGeoManager);
145 m_pixelAlignLevel = m_pixelGeoManager->alignLevel();
146 m_pixelAlignLevelBarrel = m_pixelGeoManager->alignLevelBarrel();
147 m_pixelAlignLevelEndcaps = m_pixelGeoManager->alignLevelEndcaps();
148// m_pixelaAlignDBM = m_pixelGeoManager->alignDBM();
149 ATH_MSG_DEBUG("Retrieved Pixel Global alignment level: "<<m_pixelAlignLevel);
150 ATH_MSG_DEBUG("Retrieved Pixel Barrel alignment level: "<<m_pixelAlignLevelBarrel);
151 ATH_MSG_DEBUG("Retrieved Pixel Endcap alignment level: "<<m_pixelAlignLevelEndcaps);
152 ATH_MSG_DEBUG("Retrieved DBM alignment configuration: "<<m_pixelaAlignDBM);
153
154 if(m_pixelAlignLevel == 1)
155 ATH_MSG_INFO(" Requested update of Level "<<m_pixelAlignLevel<<" alignment constants for Pixel");
156 else {
157 ATH_MSG_INFO(" Requested update of Level "<<m_pixelAlignLevelBarrel<<" alignment constants for Pixel Barrel");
158 ATH_MSG_INFO(" Requested update of Level "<<m_pixelAlignLevelEndcaps<<" alignment constants for Pixel Endcaps");
159 }
160
161 // check alignment level but don't stop on error
162 if(!checkPixelLevel()) {
163 ATH_MSG_FATAL(" Pixel alignment level not given.");
164// return StatusCode::FAILURE;
165 }
166 }
167
168 // get SCTGeometryManagerTool
169 if( !m_sctGeoManager.empty() ) {
170 ATH_CHECK( m_sctGeoManager.retrieve());
171 ATH_MSG_DEBUG("retrieved " << m_sctGeoManager);
172 m_sctAlignLevel = m_sctGeoManager->alignLevel();
173 m_sctAlignLevelBarrel = m_sctGeoManager->alignLevelBarrel();
174 m_sctAlignLevelEndcaps = m_sctGeoManager->alignLevelEndcaps();
175 ATH_MSG_DEBUG("Retrieved SCT Global alignment level: "<<m_sctAlignLevel);
176 ATH_MSG_DEBUG("Retrieved SCT Barrel alignment level: "<<m_sctAlignLevelBarrel);
177 ATH_MSG_DEBUG("Retrieved SCT Endcap alignment level: "<<m_sctAlignLevelEndcaps);
178
179 if(m_sctAlignLevel == 0)
180 ATH_MSG_INFO(" Requested update of Level "<<m_sctAlignLevel<<" alignment constants for SCT");
181 else {
182 ATH_MSG_INFO(" Requested update of Level "<<m_sctAlignLevelBarrel<<" alignment constants for SCT Barrel");
183 ATH_MSG_INFO(" Requested update of Level "<<m_sctAlignLevelEndcaps<<" alignment constants for SCT Endcaps");
184 }
185
186 // check alignment level but don't stop on error
187 if(!checkSCTLevel()) {
188 ATH_MSG_FATAL(" SCT alignment level not given.");
189// return StatusCode::FAILURE;
190 }
191 }
192
193 // if we're here it means that we need at least one the two managers
196 ATH_MSG_FATAL( " No geometry manager available or alignment level not given. " );
197 // we don't want to stop if there's errors
198 // so we comment out the return statement
199// return StatusCode::FAILURE;
200 }
201 }
202
203 m_doSi = (m_siAlignLevel==0);
205 m_doSCT = (checkSCTLevel() && !m_doSi);
206
207 if (m_writeAsL3)
208 ATH_MSG_INFO(" Storing as level 3 constants.");
209
210 if (m_writeAsL16)
211 ATH_MSG_INFO(" Storing IBLDist as level 16 constants in separate DB");
212
213 if(!m_doPixel && !m_doSCT && !m_doSi) {
214 ATH_MSG_FATAL(" No geometry manager available or alignment level not given.");
215 ATH_MSG_FATAL(" DB not updated.");
216// return;
217 }
218 ATH_MSG_DEBUG("Made it till here..... "<<m_doSi<<" "<<m_doPixel<<" "<<m_doSCT);
219 ATH_MSG_DEBUG("update constants..... "<<m_updateConstants);
220 return StatusCode::SUCCESS;
221}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_WARNING(x)
const ServiceHandle< StoreGateSvc > & detStore() const

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & ITrkAlignDBTool::interfaceID ( )
inlinestaticinherited

Definition at line 58 of file ITrkAlignDBTool.h.

static const InterfaceID IID_TRKALIGNINTERFACES_ITrkAlignDBTool("ITrkAlignDBTool", 1, 0)

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ preSolve()

virtual StatusCode Trk::ITrkAlignDBTool::preSolve ( )
inlinevirtualinherited

sets up initial alignment constants before solving

Definition at line 52 of file ITrkAlignDBTool.h.

52{ return StatusCode::SUCCESS; }

◆ printTransform()

void InDet::SiTrkAlignDBTool::printTransform ( const Amg::Transform3D & tr) const
private

Definition at line 853 of file SiTrkAlignDBTool.cxx.

854 {
855 ATH_MSG_DEBUG(" - translation: "<<tr.translation().x()<<" "<<tr.translation().y()<<" "<<tr.translation().z());
856 ATH_MSG_DEBUG(" - rotation:");
857 ATH_MSG_DEBUG(" "<<tr(0,0)<<" "<<tr(0,1)<<" "<<tr(0,2));
858 ATH_MSG_DEBUG(" "<<tr(1,0)<<" "<<tr(1,1)<<" "<<tr(1,2));
859 ATH_MSG_DEBUG(" "<<tr(2,0)<<" "<<tr(2,1)<<" "<<tr(2,2));
860 return;
861 }

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setLogStream()

virtual void Trk::ITrkAlignDBTool::setLogStream ( std::ostream * os)
inlinevirtualinherited

sets the output stream for the logfile

Definition at line 49 of file ITrkAlignDBTool.h.

49{ m_logStream = os; }
std::ostream * m_logStream
logfile output stream

◆ setNtuple()

void InDet::SiTrkAlignDBTool::setNtuple ( TFile * file)
inlinevirtual

sets ntuple to be used to write output

Reimplemented from Trk::ITrkAlignDBTool.

Definition at line 64 of file SiTrkAlignDBTool.h.

65 { m_ntuple=file; }
TFile * file

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateAsL16()

void InDet::SiTrkAlignDBTool::updateAsL16 ( const Trk::AlignModule * module,
double bowx )
private

Definition at line 806 of file SiTrkAlignDBTool.cxx.

807{
808 ATH_MSG_INFO("Updating constants for module "<<module->name()<<" as level 16 IBLDist constants (new)");
809
811 const std::vector<const Trk::TrkDetElementBase *> * elements = module->detElementCollection(det);
812
813 if( !elements ) {
814 ATH_MSG_FATAL("no elements of type "<<det);
815 return;
816 }
817
818 ATH_MSG_DEBUG("looping over "<<elements->size()<<" elements");
819 std::vector<int> stave_phis; // where we store the unique identifiers we want to update
820 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
821 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
822 for ( ; ielem != ielem_end; ++ielem) {
823 const InDetDD::SiDetectorElement * sielem = dynamic_cast<const InDetDD::SiDetectorElement *>(*ielem);
824 if (!sielem) {
825 ATH_MSG_WARNING("Should be Silicon detector element but is not. Skipping.");
826 continue;
827 }
828
829 Identifier elemID = sielem->identify();
830 const int this_stave_phi = m_pixHelper->phi_module( elemID );
831
832 ATH_MSG_DEBUG("module ID: "<<m_idHelper->show_to_string(elemID,nullptr,'/'));
833 ATH_MSG_DEBUG("phi identifier: "<<m_pixHelper->phi_module( elemID )) ;
834
835 std::vector<int>::const_iterator ix = find(stave_phis.begin(),stave_phis.end(),this_stave_phi); // check whether it is unique
836 if (ix==stave_phis.end()) {
837 stave_phis.push_back(this_stave_phi);
838
839 // tweak applies the transform onto already existing transform in the DB
840 if( !(m_IDAlignDBTool->tweakIBLDist(this_stave_phi,bowx)) ) {
841 ATH_MSG_ERROR("Error tweaking IBLDist DB for stave "<<this_stave_phi);
842 }
843 }
844 else {
845 ATH_MSG_DEBUG("Skipping ModuleID: "<<m_idHelper->show_to_string(elemID,nullptr,'/')<<" --> not unique");
846 }
847
848 } // end loop over detElements
849}
virtual Identifier identify() const override final
identifier of this detector element (inline)
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:138

◆ updateAsL2()

void InDet::SiTrkAlignDBTool::updateAsL2 ( const Trk::AlignModule * module,
const Amg::Transform3D & transform,
const int level )
private

Definition at line 735 of file SiTrkAlignDBTool.cxx.

736{
737 ATH_MSG_INFO("Updating constants for module "<<module->name()<<" as level 2 constants (new)");
738
739 // check the level we store in
740 ATH_MSG_INFO("DB aligning at level: "<<level);
741
743 const std::vector<const Trk::TrkDetElementBase *> * elements = module->detElementCollection(det);
744
745 if( !elements ) {
746 ATH_MSG_FATAL("no elements of type "<<det);
747 return;
748 }
749
750 ATH_MSG_DEBUG("looping over "<<elements->size()<<" elements");
751 std::vector<std::string> level_mods; // where we store the unique identifiers we want to update
752
753 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
754 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
755 for ( ; ielem != ielem_end; ++ielem) {
756 const InDetDD::SiDetectorElement * sielem = dynamic_cast<const InDetDD::SiDetectorElement *>(*ielem);
757 if (!sielem) {
758 ATH_MSG_WARNING("Should be Silicon detector element but is not. Skipping.");
759 continue;
760 }
761
762 Identifier elemID = sielem->identify();
763 Identifier level_mod = GetL1L2fromL3Identifier(elemID,level);
764 std::string key = m_IDAlignDBTool->dirkey(level_mod,level+1);
765
766 ATH_MSG_DEBUG("TESTING value: "<<level_mod);
767 ATH_MSG_DEBUG("TESTING ID: "<<m_idHelper->show_to_string(level_mod,nullptr,'/'));
768 ATH_MSG_DEBUG("TESTING retrieved key: "<<key);
769 std::vector<std::string>::const_iterator ix = find(level_mods.begin(),level_mods.end(),key); // check whether it is unique
770 if (ix==level_mods.end()) {
771 level_mods.push_back(key);
772
773 ATH_MSG_DEBUG("-----------------------------------------------------");
774
775 ATH_MSG_DEBUG("ModuleID value: "<<level_mod);
776 ATH_MSG_DEBUG("ModuleID: "<<m_idHelper->show_to_string(level_mod,nullptr,'/'));
777
778 // for levels 1 and 2 the DB frame equals to the global frame but the align
779 // frame doesnot, so we have to apply an additional transform
780 const Amg::Transform3D& dbFrameToAlignFrame = module->globalFrameToAlignFrame();
781
782 ATH_MSG_DEBUG("DB to align");
783 printTransform(dbFrameToAlignFrame);
784
785 Amg::Transform3D dbtransform = dbFrameToAlignFrame.inverse() * transform * dbFrameToAlignFrame;
786
787 ATH_MSG_DEBUG("DB transform");
788 printTransform(dbtransform);
789
790
791 // tweak applies the transform onto already existing transform in the DB
792 if( !(m_IDAlignDBTool->tweakTrans(level_mod, level, dbtransform)) ) {
793 // set replaces the transform in the DB
794 if( !(m_IDAlignDBTool->setTrans(level_mod, level, dbtransform)) )
795 ATH_MSG_ERROR("Error setting level "<<level<<" constants for element "<<level_mod<<" in module "<<module->name());
796 }
797 }
798 else {
799 ATH_MSG_DEBUG("Skipping ModuleID: "<<m_idHelper->show_to_string(elemID,nullptr,'/')<<" --> not unique");
800 }
801 } // end loop over detElements
802}
void printTransform(const Amg::Transform3D &tr) const
virtual Identifier GetL1L2fromL3Identifier(const Identifier &ident, const int &level) const
convert L3 module identifier to L1 or L2
Eigen::Affine3d Transform3D
Amg::Vector3D transform(Amg::Vector3D &v, Amg::Transform3D &tr)
Transform a point from a Trasformation3D.

◆ updateAsL3()

void InDet::SiTrkAlignDBTool::updateAsL3 ( const Trk::AlignModule * module,
const Amg::Transform3D & transform,
double  )
private
  if (apBowX!=0){
double z = sielem->center()[2];        
const double  y0y0  = 366.5*366.5;

ATH_MSG_DEBUG("Z position : "<< z); double bowx = apBowX * ( z*z - y0y0 ) / y0y0; This is in the module frame, as bowing corrections are directly L3 Amg::Translation3D translation_bow(bowx , 0, 0 ); dbtransform *= translation_bow; }

Definition at line 638 of file SiTrkAlignDBTool.cxx.

639{
640 ATH_MSG_INFO("Updating constants for module "<<module->name()<<" as level 3 constants");
641
642 // store as level 3 constants
643 const int level = 3;
644
645 // transform from global frame to align frame
646 const Amg::Transform3D& globaltoalign = module->globalFrameToAlignFrame();
647
648 // same code pplies to both Pixel and SCT
649 for (unsigned int idet=0; idet<2; idet++) {
650
652
653 ATH_MSG_DEBUG("getting elements of type "<<det<<" from the module");
654
655 const std::vector<const Trk::TrkDetElementBase *> * elements = module->detElementCollection(det);
656
657 if( !elements ) {
658 ATH_MSG_DEBUG("no elements of type "<<det);
659 continue;
660 }
661
662 ATH_MSG_DEBUG("looping over "<<elements->size()<<" elements");
663
664 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem = elements->begin();
665 std::vector<const Trk::TrkDetElementBase*>::const_iterator ielem_end = elements->end();
666 for ( ; ielem != ielem_end; ++ielem) {
667 const InDetDD::SiDetectorElement * sielem = dynamic_cast<const InDetDD::SiDetectorElement *>(*ielem);
668 if (!sielem) {
669 ATH_MSG_WARNING("Should be Silicon detector element but is not. Skipping.");
670 continue;
671 }
672
673 Identifier elemID = sielem->identify();
674
675 // for the SCT the 0 side Identifier is used in the DB
676 if (m_idHelper->is_sct(elemID)) {
677 if (m_sctHelper->side(elemID) > 0)
678 continue;
679 }
680
681 ATH_MSG_DEBUG("-----------------------------------------------------");
682
683 ATH_MSG_DEBUG("ModuleID value: "<<elemID);
684 ATH_MSG_DEBUG("ModuleID: "<<m_idHelper->show_to_string(elemID,nullptr,'/'));
685
686 // this should work for both Pixel and SCT
687 // module transform is the transform between the db frame and global frame
688 Amg::Transform3D dbtoglobal = sielem->moduleTransform();
689 // ATH_MSG_DEBUG("DB to Global");
690 // printTransform(dbtoglobal);
691
692 // ATH_MSG_DEBUG("Global to Align");
693 // printTransform(globaltoalign);
694
695 // from DB frame to alignment frame transform
696 Amg::Transform3D dbtoalign = globaltoalign * dbtoglobal;
697 // ATH_MSG_DEBUG("DB to Align");
698 // printTransform(dbtoalign);
699
700 ATH_MSG_DEBUG("Alignment transform");
701 printTransform(transform);
702
703 // alignment transform in DB frame
704 Amg::Transform3D dbtransform = dbtoalign.inverse() * transform * dbtoalign;
705
706 // This should work as Bowing is in DB frame, i.e. local module frame
707 // This implementation is need in the CL as of Oct2015;
708 // For now, just comment for offline
720 ATH_MSG_DEBUG("DB transform");
721 printTransform(dbtransform);
722
723 // tweak applies the transform onto already existing transform in the DB
724 if( !(m_IDAlignDBTool->tweakTrans(elemID, level, dbtransform)) ) {
725 // set replaces the transform in the DB
726 if( !(m_IDAlignDBTool->setTrans(elemID, level, dbtransform)) )
727 ATH_MSG_ERROR("Error setting level "<<level<<" constants for element "<<elemID<<" in module "<<module->name());
728 }
729 } // end loop over detElements
730 ATH_MSG_DEBUG("-----------------------------------------------------");
731 } // end loop over Pixel and SCT
732}
const Amg::Transform3D & moduleTransform() const
Module to global frame transform.

◆ updateDB()

void InDet::SiTrkAlignDBTool::updateDB ( )
private

updates alignment constants in the DB

Definition at line 379 of file SiTrkAlignDBTool.cxx.

380{
381 ATH_MSG_DEBUG(" in SiTrkAlignDBTool::updateDB()");
382
383 Amg::Transform3D dbtransform;
384
385 ATH_MSG_INFO("-------------------------------------------------");
386 // updating level 1, level 2 or level 3 constants in the DB
387 if(m_doSi)
388 ATH_MSG_INFO("Updating Level "<<m_siAlignLevel<<" alignment constants for Silicon");
389
390 if(m_doPixel) {
391 if(m_pixelAlignLevel==1)
392 ATH_MSG_INFO("Updating Level "<<m_pixelAlignLevel<<" alignment constants for Pixel");
393 else {
394 ATH_MSG_INFO("Updating Level "<<m_pixelAlignLevelBarrel<<" alignment constants for Pixel Barrel");
395 ATH_MSG_INFO("Updating Level "<<m_pixelAlignLevelEndcaps<<" alignment constants for Pixel Endcaps");
396 }
397 }
398
399 if(m_doSCT) {
400 if(m_sctAlignLevel==0)
401 ATH_MSG_INFO("Updating Level "<<m_sctAlignLevel<<" alignment constants for SCT");
402 else {
403 ATH_MSG_INFO("Updating Level "<<m_sctAlignLevelBarrel<<" alignment constants for SCT Barrel");
404 ATH_MSG_INFO("Updating Level "<<m_sctAlignLevelEndcaps<<" alignment constants for SCT Endcaps");
405 }
406 }
407
408 if (m_writeAsL3)
409 ATH_MSG_INFO("Updating Level 3 constants.");
410
411 // loop over all AlignModules
412 std::vector<Trk::AlignModule *>::const_iterator imod = m_alignModuleTool->getAlignModuleCollection()->begin();
413 std::vector<Trk::AlignModule *>::const_iterator imod_end = m_alignModuleTool->getAlignModuleCollection()->end();
414 for( ; imod != imod_end; ++imod ) {
415
416 Trk::AlignModule * module = *imod;
417
418 ATH_MSG_DEBUG("-------------------------------------------------------");
419 ATH_MSG_DEBUG("Alignment corrections for module: "<<module->name());
420
421 // the the identifier of the module for the DB
422 Identifier modID = module->identify();
423
424 // The Si AlignModules of levels 0, 1, 2 and 3 use the Silicon Identifier.
425 if(!m_idHelper->is_pixel(modID) && !m_idHelper->is_sct(modID)) {
426 ATH_MSG_DEBUG("Module with ID: "<<modID<<" is not a Silicon module. Skipping.");
427 continue;
428 }
429
430 // get active alignment parameters for the module
431 DataVector<Trk::AlignPar> * alignPars = m_alignModuleTool->getAlignPars(module);
432 if(alignPars->size() == 0) {
433 ATH_MSG_INFO("Alignment constants for module "<<module->name()<<" not available.");
434 continue;
435 }
436
437 ATH_MSG_DEBUG("Retrieved alignment constants for module "<<module->name());
438 ATH_MSG_DEBUG("Module ID : "<<modID);
439 ATH_MSG_DEBUG("Expanded module ID : "<<m_idHelper->show_to_string(modID,nullptr,'/'));
440
441 // get final alignment parameters
442 DataVector<Trk::AlignPar> * fullAlignPars = m_alignModuleTool->getFullAlignPars(module);
443 double apTraX = fullAlignPars->at(Trk::AlignModule::TransX)->par();
444 double apTraY = fullAlignPars->at(Trk::AlignModule::TransY)->par();
445 double apTraZ = fullAlignPars->at(Trk::AlignModule::TransZ)->par();
446 double apRotX = fullAlignPars->at(Trk::AlignModule::RotX)->par();
447 double apRotY = fullAlignPars->at(Trk::AlignModule::RotY)->par();
448 double apRotZ = fullAlignPars->at(Trk::AlignModule::RotZ)->par();
449
450 // Need to make sure not to call SCT modules - only defined for PIX
451 double apBowX = 0;
452 // This should be sufficient as bowing-DoF is only enabled for IBL
453 if(m_idHelper->is_pixel(modID) && m_pixHelper->is_barrel(modID) ){
454 apBowX = fullAlignPars->at(Trk::AlignModule::BowX)->par();
455
456 // The last check ensures that it also updates for L11 in case bowing DoF is enables.
457 if(m_pixelAlignLevelBarrel==16 || m_writeAsL16 || apBowX!=0){
458 updateAsL16(module,apBowX);
459 // Can we get a baseline as well? include here in case it is possible!
460 // Allow other DoF to be updated as well!
461 // Initial CL (Oct. 2016) update at L3 --> commented for now
462 }
463 }
464
465 Amg::Translation3D translation( apTraX, apTraY, apTraZ );
466 Amg::Transform3D transform = translation * Amg::RotationMatrix3D::Identity();
467 transform *= Amg::AngleAxis3D(apRotZ, Amg::Vector3D(0.,0.,1.));
468 transform *= Amg::AngleAxis3D(apRotY, Amg::Vector3D(0.,1.,0.));
469 transform *= Amg::AngleAxis3D(apRotX, Amg::Vector3D(1.,0.,0.));
470
471
472 ATH_MSG_DEBUG(" - translation X = "<<apTraX);
473 ATH_MSG_DEBUG(" - translation Y = "<<apTraY);
474 ATH_MSG_DEBUG(" - translation Z = "<<apTraZ);
475 ATH_MSG_DEBUG(" - rotation X = "<<apRotX);
476 ATH_MSG_DEBUG(" - rotation Y = "<<apRotY);
477 ATH_MSG_DEBUG(" - rotation Z = "<<apRotZ);
478
479 int level=-1;
480
481 // this is really ugly and quite confusing !!!
482 // but will do for now...
483 if(m_idHelper->is_pixel(modID)) {
484 if(!m_doPixel && !m_doSi) {
485 ATH_MSG_INFO("--> Pixel module - NOT storing");
486 continue;
487 }
488 if(m_doPixel) {
491 else if(m_pixHelper->is_barrel(modID))
493 else
495 }
496 else // this makes sure that Si L0 is handled since pixel identifier is used for it
498 }
499 else if(m_idHelper->is_sct(modID)) {
500 if(!m_doSCT) {
501 ATH_MSG_INFO("--> SCT module - NOT storing");
502 continue;
503 }
504 if(m_sctAlignLevel==0)
506 else if(m_sctHelper->is_barrel(modID))
508 else
510 }
511 // to better understand what is going on
512 ATH_MSG_DEBUG("We are having level: "<<level);
513
514 if (m_writeAsL3) {
515 updateAsL3(module,transform,apBowX);
516 continue;
517 }
518
519 if (m_idHelper->is_pixel(modID) && m_writeAsL2) {
520 level=2;
521 updateAsL2(module,transform,level);
522 continue;
523 }
524
525 // calculate the DB transform
526 switch(level) {
527
528 case -1:
529 // level not recognized, do nothing
530 continue;
531
532 case 0:
533 updateSiL0asL1(modID,transform);
534 continue;
535
536 case 1: case 2: {
537 // for levels 1 and 2 the DB frame equals to the global frame but the align
538 // frame doesnot, so we have to apply an additional transform
539 Amg::Transform3D dbFrameToAlignFrame = module->globalFrameToAlignFrame();
540
541 ATH_MSG_DEBUG("DB to align");
542 printTransform(dbFrameToAlignFrame);
543
544 dbtransform = dbFrameToAlignFrame.inverse() * transform * dbFrameToAlignFrame;
545
546 ATH_MSG_DEBUG("DB transform");
547 printTransform(dbtransform);
548 break;
549 }
550
551 case 3:
552 // for level 3 alignment the DB frame and the align frame equals to the local frame
553 // so we don't apply any additional transform
554 dbtransform = transform;
555
556 ATH_MSG_DEBUG("DB transform");
557 printTransform(dbtransform);
558 break;
559
560 default:
561 // otherwise we split the AlignModule into level 3 modules
562 ATH_MSG_DEBUG("We are doing this one");
563 updateAsL3(module,transform,apBowX);
564 continue;
565 }
566
567 // tweak applies the transform onto already existing transform in the DB
568 if( m_IDAlignDBTool->tweakTrans(modID, level, dbtransform) )
569 ATH_MSG_INFO("Module \'"<<module->name()<<"\': Level "<<level<<" constants updated.");
570 else {
571 // set replaces the transform in the DB
572 ATH_MSG_DEBUG("Module \'"<<module->name()<<"\': Call to tweak failed. Constants probably don't exist yet. Use set instead.");
573 if( m_IDAlignDBTool->setTrans(modID, level, dbtransform) )
574 ATH_MSG_INFO("Module \'"<<module->name()<<"\': Level "<<level<<" constants updated.");
575 else
576 ATH_MSG_ERROR("Error setting level "<<level<<" constants for module "<<module->name());
577 }
578
579 }
580 ATH_MSG_INFO("-------------------------------------------------");
581
582}
const T * at(size_type n) const
Access an element, as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
void updateAsL16(const Trk::AlignModule *module, double)
void updateAsL3(const Trk::AlignModule *module, const Amg::Transform3D &transform, double)
void updateAsL2(const Trk::AlignModule *module, const Amg::Transform3D &transform, const int)
void updateSiL0asL1(Identifier idL0, const Amg::Transform3D &transform)
Eigen::AngleAxisd AngleAxis3D
Eigen::Matrix< double, 3, 1 > Vector3D
Eigen::Translation< double, 3 > Translation3D

◆ updateSiL0asL1()

void InDet::SiTrkAlignDBTool::updateSiL0asL1 ( Identifier idL0,
const Amg::Transform3D & transform )
private

Definition at line 585 of file SiTrkAlignDBTool.cxx.

586{
587 // splitting the whole Silicon into Pixel, SCT barrel and 2 SCT endcaps
588 // the id has to be equal to L1 Pixel ID for Silicon level 0 update
589 // or to SCT barrel L1 ID for SCT level 0 update
590 if( idL0 != m_pixHelper->wafer_id(0,0,0,0) && idL0 != m_sctHelper->wafer_id(0,0,0,0,0) ) {
591 ATH_MSG_ERROR("wrong identifier for L0 Silicon in updateSiL0asL1()");
592 return;
593 }
594
595 // for both L0 and L1 the global frame is equal to the DB frame
596 // for L0 it is also equal to align frame so no additional transform is needed
597
598 if(idL0 == m_pixHelper->wafer_id(0,0,0,0)) {
599 ATH_MSG_INFO("Splitting Silicon into L1 modules and updating in the DB");
600
601 // Pixel
602 Identifier idPixel = m_pixHelper->wafer_id(0,0,0,0);
603 ATH_MSG_INFO("Updating L1 constants for Pixel");
604 // tweak applies the transform onto already existing transform in the DB
605 if( m_IDAlignDBTool->tweakTrans(idPixel, 1, transform) )
606 ATH_MSG_INFO("Call to tweak OK. Constants updated.");
607 else {
608 // set replaces the transform in the DB
609 ATH_MSG_INFO("Call to tweak failed. Constants probably don't exist yet. Use set instead.");
610 if( !m_IDAlignDBTool->setTrans(idPixel, 1, transform) )
611 ATH_MSG_ERROR("Error setting constants.");
612 }
613 }
614 else
615 ATH_MSG_INFO("Splitting SCT into L1 modules and updating in the DB");
616
617 // SCT
618 std::vector<Identifier> ids;
619 ids.push_back(m_sctHelper->wafer_id(0,0,0,0,0)); // SCT barrel
620 ids.push_back(m_sctHelper->wafer_id(-2,0,0,0,0)); // SCT endcap A
621 ids.push_back(m_sctHelper->wafer_id(2,0,0,0,0)); // SCT endcap C
622
623 ATH_MSG_INFO("Updating L1 constants for SCT");
624 for(unsigned int i=0; i<ids.size(); ++i) {
625 // tweak applies the transform onto already existing transform in the DB
626 if( m_IDAlignDBTool->tweakTrans(ids[i], 1, transform) )
627 ATH_MSG_INFO("Module "<<i<<". - id "<<ids[i]<<": Call to tweak OK. Constants updated.");
628 else {
629 // set replaces the transform in the DB
630 ATH_MSG_INFO("Module "<<i<<". - id "<<ids[i]<<": Call to tweak failed. Constants probably don't exist yet. Use set instead.");
631 if( !m_IDAlignDBTool->setTrans(ids[i], 1, transform) )
632 ATH_MSG_ERROR("Error setting constants.");
633 }
634 }
635}

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ writeAlignPar()

void InDet::SiTrkAlignDBTool::writeAlignPar ( )
virtual

Writes alignment parameters.

Reimplemented from Trk::ITrkAlignDBTool.

Definition at line 346 of file SiTrkAlignDBTool.cxx.

347{
348 ATH_MSG_DEBUG("in SiTrkAlignDBTool::writeAlignPar()");
349
350 // do we want to update the DB?
351 if(!m_updateConstants) {
352 ATH_MSG_INFO("Update of Silicon constants not requested!");
353 return;
354 }
355
356 // write initial alignment constants
358 ATH_MSG_INFO("Writing old Silicon alignment constants to file "<<m_oldAlignFile);
359 m_IDAlignDBTool->writeFile(false, m_oldAlignFile);
360 if(m_oldIBLDistFile!="") m_IDAlignDBTool->writeIBLDistFile(m_oldIBLDistFile);
361 m_IDAlignDBTool->writeGlobalFolderFile(m_oldGlobalFolderFile);
362 }
363
364 // now update the DB
365 updateDB();
366
367 // and write the final alignment constants
368 if(m_writeTextFile) {
369 ATH_MSG_INFO("Writing Silicon alignment constants to file "<<m_outputAlignFile);
370 m_IDAlignDBTool->writeFile(false, m_outputAlignFile);
371 if(m_outIBLDistFile!="") m_IDAlignDBTool->writeIBLDistFile(m_outIBLDistFile);
372 m_IDAlignDBTool->writeGlobalFolderFile(m_outGlobalFolderFile);
373 }
374
375 return;
376}
void updateDB()
updates alignment constants in the DB

Member Data Documentation

◆ m_alignModuleTool

ToolHandle<Trk::IAlignModuleTool> InDet::SiTrkAlignDBTool::m_alignModuleTool
private

Definition at line 106 of file SiTrkAlignDBTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doPixel

bool InDet::SiTrkAlignDBTool::m_doPixel
private

Definition at line 126 of file SiTrkAlignDBTool.h.

◆ m_doSCT

bool InDet::SiTrkAlignDBTool::m_doSCT
private

Definition at line 127 of file SiTrkAlignDBTool.h.

◆ m_doSi

bool InDet::SiTrkAlignDBTool::m_doSi
private

Definition at line 125 of file SiTrkAlignDBTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_IDAlignDBTool

ToolHandle<IInDetAlignDBTool> InDet::SiTrkAlignDBTool::m_IDAlignDBTool
private

Definition at line 105 of file SiTrkAlignDBTool.h.

◆ m_idHelper

const AtlasDetectorID* InDet::SiTrkAlignDBTool::m_idHelper
private

Definition at line 91 of file SiTrkAlignDBTool.h.

◆ m_logStream

std::ostream* Trk::ITrkAlignDBTool::m_logStream = nullptr
protectedinherited

logfile output stream

Definition at line 55 of file ITrkAlignDBTool.h.

◆ m_ntuple

TFile* InDet::SiTrkAlignDBTool::m_ntuple
private

Definition at line 112 of file SiTrkAlignDBTool.h.

◆ m_oldAlignFile

std::string InDet::SiTrkAlignDBTool::m_oldAlignFile
private

filename for the textfile with initial alignment constants

Definition at line 101 of file SiTrkAlignDBTool.h.

◆ m_oldGlobalFolderFile

std::string InDet::SiTrkAlignDBTool::m_oldGlobalFolderFile
private

filename for the textfile with initial GlobalFolder constants

Definition at line 102 of file SiTrkAlignDBTool.h.

◆ m_oldIBLDistFile

std::string InDet::SiTrkAlignDBTool::m_oldIBLDistFile
private

filename for the textfile with initial IBLDist params

Definition at line 100 of file SiTrkAlignDBTool.h.

◆ m_outGlobalFolderFile

std::string InDet::SiTrkAlignDBTool::m_outGlobalFolderFile
private

filename for the textfile with final GlobalFolder constants

Definition at line 97 of file SiTrkAlignDBTool.h.

◆ m_outIBLDistFile

std::string InDet::SiTrkAlignDBTool::m_outIBLDistFile
private

filename for the textfile with final IBLDist params

Definition at line 96 of file SiTrkAlignDBTool.h.

◆ m_outputAlignFile

std::string InDet::SiTrkAlignDBTool::m_outputAlignFile
private

filename for the textfile with final alignment constants

Definition at line 95 of file SiTrkAlignDBTool.h.

◆ m_pixelaAlignDBM

bool InDet::SiTrkAlignDBTool::m_pixelaAlignDBM
private

Definition at line 117 of file SiTrkAlignDBTool.h.

◆ m_pixelAlignLevel

int InDet::SiTrkAlignDBTool::m_pixelAlignLevel
private

Definition at line 114 of file SiTrkAlignDBTool.h.

◆ m_pixelAlignLevelBarrel

int InDet::SiTrkAlignDBTool::m_pixelAlignLevelBarrel
private

Definition at line 115 of file SiTrkAlignDBTool.h.

◆ m_pixelAlignLevelEndcaps

int InDet::SiTrkAlignDBTool::m_pixelAlignLevelEndcaps
private

Definition at line 116 of file SiTrkAlignDBTool.h.

◆ m_pixelGeoManager

ToolHandle<Trk::IGeometryManagerTool> InDet::SiTrkAlignDBTool::m_pixelGeoManager
private

Definition at line 108 of file SiTrkAlignDBTool.h.

◆ m_pixHelper

const PixelID* InDet::SiTrkAlignDBTool::m_pixHelper
private

pointer to PIX detector manager

Definition at line 89 of file SiTrkAlignDBTool.h.

◆ m_sctAlignLevel

int InDet::SiTrkAlignDBTool::m_sctAlignLevel
private

Definition at line 119 of file SiTrkAlignDBTool.h.

◆ m_sctAlignLevelBarrel

int InDet::SiTrkAlignDBTool::m_sctAlignLevelBarrel
private

Definition at line 120 of file SiTrkAlignDBTool.h.

◆ m_sctAlignLevelEndcaps

int InDet::SiTrkAlignDBTool::m_sctAlignLevelEndcaps
private

Definition at line 121 of file SiTrkAlignDBTool.h.

◆ m_sctGeoManager

ToolHandle<Trk::IGeometryManagerTool> InDet::SiTrkAlignDBTool::m_sctGeoManager
private

Definition at line 109 of file SiTrkAlignDBTool.h.

◆ m_sctHelper

const SCT_ID* InDet::SiTrkAlignDBTool::m_sctHelper
private

pointer to SCT detector manager

Definition at line 90 of file SiTrkAlignDBTool.h.

◆ m_siAlignLevel

int InDet::SiTrkAlignDBTool::m_siAlignLevel
private

Definition at line 123 of file SiTrkAlignDBTool.h.

◆ m_siGeoManager

ToolHandle<Trk::IGeometryManagerTool> InDet::SiTrkAlignDBTool::m_siGeoManager
private

Definition at line 110 of file SiTrkAlignDBTool.h.

◆ m_SQLiteTag

std::string InDet::SiTrkAlignDBTool::m_SQLiteTag
private

tag name for the ConditionsDB

Definition at line 94 of file SiTrkAlignDBTool.h.

◆ m_updateConstants

bool InDet::SiTrkAlignDBTool::m_updateConstants
private

flag whether to update the constants

Definition at line 103 of file SiTrkAlignDBTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeAsL16

bool InDet::SiTrkAlignDBTool::m_writeAsL16
private

Definition at line 131 of file SiTrkAlignDBTool.h.

◆ m_writeAsL2

bool InDet::SiTrkAlignDBTool::m_writeAsL2
private

Definition at line 130 of file SiTrkAlignDBTool.h.

◆ m_writeAsL3

bool InDet::SiTrkAlignDBTool::m_writeAsL3
private

Definition at line 129 of file SiTrkAlignDBTool.h.

◆ m_writeOldConstants

bool InDet::SiTrkAlignDBTool::m_writeOldConstants
private

flag whether to write out the initial constants into text file

Definition at line 99 of file SiTrkAlignDBTool.h.

◆ m_writeSQLFile

bool InDet::SiTrkAlignDBTool::m_writeSQLFile
private

flag wether to write out .db file or not (file is not needed in parallel jobs)

Definition at line 93 of file SiTrkAlignDBTool.h.

◆ m_writeTextFile

bool InDet::SiTrkAlignDBTool::m_writeTextFile
private

flag whether to write out the final constants into text file

Definition at line 98 of file SiTrkAlignDBTool.h.


The documentation for this class was generated from the following files: