ATLAS Offline Software
Loading...
Searching...
No Matches
HGTD_MisalignAlg Class Reference

#include <HGTD_MisalignAlg.h>

Inheritance diagram for HGTD_MisalignAlg:
Collaboration diagram for HGTD_MisalignAlg:

Public Member Functions

virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) override
 Execute method.
virtual StatusCode finalize () override
 AthAlgorithm (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
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 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

Protected Member Functions

virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode GenerateMisalignment ()
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

Gaudi::Property< int > m_mode {this, "MisalignMode", 1}
Gaudi::Property< double > m_shiftX {this, "ShiftX", 0.05}
Gaudi::Property< double > m_shiftY {this, "ShiftY", 0.0}
Gaudi::Property< double > m_shiftZ {this, "ShiftZ", 0.0}
Gaudi::Property< double > m_sigmaX {this, "SigmaX", 0.01}
Gaudi::Property< double > m_sigmaY {this, "SigmaY", 0.01}
Gaudi::Property< double > m_sigmaZ {this, "SigmaZ", 0.01}
Gaudi::Property< bool > m_applyTranslation {this, "ApplyTranslation", true}
Gaudi::Property< bool > m_doDebugPrint {this, "DoDebugPrint", true}
Gaudi::Property< bool > m_applyRotation {this, "ApplyRotation", false}
Gaudi::Property< int > m_maxModules {this, "MaxModules", -1}
ServiceHandle< IRndmGenSvc > m_rndmSvc
Gaudi::Property< std::string > m_randomStream
std::vector< GeoAlignableTransform * > m_alignables
Gaudi::Property< std::string > m_outputFile
const HGTD_DetectorManagerm_hgtdManager {nullptr}
Gaudi::Property< bool > m_applyToGeometry
Gaudi::Property< int > m_testHash
Gaudi::Property< bool > m_createFreshDB
Gaudi::Property< std::string > m_sqliteTag
Gaudi::Property< bool > m_writeToDB
ToolHandle< IHGTD_AlignDBToolm_alignDBTool
const HGTD_IDm_hgtdIdHelper {nullptr}
TTree * m_tree {nullptr}
float m_localDx {0.f}
float m_localDy {0.f}
float m_localDz {0.f}
float m_centerX {0.f}
float m_centerY {0.f}
float m_centerZ {0.f}
float m_shiftedX {0.f}
float m_shiftedY {0.f}
float m_shiftedZ {0.f}
unsigned int m_hash {0}
int m_endcap {0}
int m_layer {0}
int m_phiModule {0}
int m_etaModule {0}
std::ofstream m_outfile
bool m_firstEvent {true}
unsigned int m_nEvents {0}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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 31 of file HGTD_MisalignAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ AthAlgorithm()

AthAlgorithm::AthAlgorithm ( const std::string & name,
ISvcLocator * pSvcLocator )

Constructor.

Definition at line 31 of file AthAlgorithm.cxx.

11 :
12 AthCommonAlgorithm<Gaudi::Algorithm>( name, pSvcLocator )
13{
14 // default cardinality for non-reentrant algorithms
15 setProperty( "Cardinality", 1 ).orThrow("Unable to set property 'Cardinality'", name);
16}
void setProperty(columnar::PythonToolHandle &self, const std::string &key, nb::object value)
AthCommonAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode HGTD_MisalignAlg::execute ( const EventContext & ctx)
overridevirtual

Execute method.

Implements AthAlgorithm.

Definition at line 130 of file HGTD_MisalignAlg.cxx.

131{
132 ATH_MSG_DEBUG("HGTD_MisalignAlg execute()");
133
134 ++m_nEvents;
135
136 //------------------------------------------------------------
137 // Nothing to do if misalignment is disabled
138 //------------------------------------------------------------
139 if (!m_applyTranslation.value()) {
140 ATH_MSG_DEBUG("Translation disabled");
141 return StatusCode::SUCCESS;
142 }
143
144 //------------------------------------------------------------
145 // Generate the alignment only once
146 //------------------------------------------------------------
147 if (!m_firstEvent) {
148 return StatusCode::SUCCESS;
149 }
150
151 ATH_MSG_DEBUG("Generating HGTD misalignment");
152
153 //------------------------------------------------------------
154 // Create a fresh alignment database
155 //------------------------------------------------------------
156 if (m_createFreshDB) {
157
158 ATH_MSG_DEBUG("Creating HGTD alignment database");
159
160 ATH_CHECK(m_alignDBTool->createDB());
161
162 m_createFreshDB = false;
163 }
164
165 //------------------------------------------------------------
166 // Generate all module misalignments
167 //------------------------------------------------------------
169
170 //------------------------------------------------------------
171 // Write AlignableTransforms
172 //------------------------------------------------------------
173 ATH_MSG_DEBUG("Writing HGTD alignment constants");
174
175 if (m_writeToDB) {
176 ATH_MSG_DEBUG("Calling outputObjs()");
177 ATH_CHECK(m_alignDBTool->outputObjs());
178
179 ATH_MSG_DEBUG("Finished outputObjs()");
180 ATH_MSG_DEBUG("Calling fillDB()");
181
182 //------------------------------------------------------------
183 // Write SQLite database
184 //------------------------------------------------------------
185 ATH_CHECK(
186 m_alignDBTool->fillDB(
192
193 ATH_MSG_DEBUG("Finished fillDB()");
194 }
195 else {
196 ATH_MSG_DEBUG("WriteToDB = FALSE, skipping database writing.");
197 }
198
199 //------------------------------------------------------------
200 // Do not regenerate on later events
201 //------------------------------------------------------------
202 m_firstEvent = false;
203
204 return StatusCode::SUCCESS;
205}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
Gaudi::Property< bool > m_createFreshDB
Gaudi::Property< bool > m_writeToDB
StatusCode GenerateMisalignment()
Gaudi::Property< std::string > m_sqliteTag
unsigned int m_nEvents
Gaudi::Property< bool > m_applyTranslation
ToolHandle< IHGTD_AlignDBTool > m_alignDBTool
static constexpr uint32_t MAXRUN
Definition IOVTime.h:48
static constexpr uint32_t MINEVENT
Definition IOVTime.h:50
static constexpr uint32_t MAXEVENT
Definition IOVTime.h:51
static constexpr uint32_t MINRUN
Definition IOVTime.h:44

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode HGTD_MisalignAlg::finalize ( )
overridevirtual

Definition at line 379 of file HGTD_MisalignAlg.cxx.

380{
381 ATH_MSG_INFO("HGTD_MisalignAlg finalize()");
382
383 //------------------------------------------------------------
384 // Close output file
385 //------------------------------------------------------------
386 if (m_outfile.is_open()) {
387 m_outfile.close();
388 }
389
390 ATH_CHECK(m_alignDBTool->outputObjs());
391
392 ATH_CHECK(
393 m_alignDBTool->fillDB(
399 )
400 );
401
402 ATH_MSG_INFO("Processed " << m_nEvents << " event(s)");
403
404 return StatusCode::SUCCESS;
405}
#define ATH_MSG_INFO(x)
std::ofstream m_outfile

◆ GenerateMisalignment()

StatusCode HGTD_MisalignAlg::GenerateMisalignment ( )
private

Definition at line 207 of file HGTD_MisalignAlg.cxx.

208{
209 const auto* elements = m_hgtdManager->getDetectorElementCollection();
210
211 if (!elements) {
212 ATH_MSG_ERROR("HGTD detector element collection is null");
213 return StatusCode::FAILURE;
214 }
215
216 ATH_MSG_DEBUG("Number of HGTD detector elements = "
217 << elements->size());
218
219 ATH_MSG_DEBUG("Misalignment mode = "
220 << m_mode.value());
221
222 //------------------------------------------------------------
223 // Random generators
224 //------------------------------------------------------------
225 Rndm::Numbers gaussX(
226 m_rndmSvc.operator->(),
227 Rndm::Gauss(0., m_sigmaX.value()));
228
229 Rndm::Numbers gaussY(
230 m_rndmSvc.operator->(),
231 Rndm::Gauss(0., m_sigmaY.value()));
232
233 Rndm::Numbers gaussZ(
234 m_rndmSvc.operator->(),
235 Rndm::Gauss(0., m_sigmaZ.value()));
236
237 int count = 0;
238
239 //------------------------------------------------------------
240 // Loop over all HGTD detector elements
241 //------------------------------------------------------------
242 for (const auto* element : *elements) {
243
244 if (!element)
245 continue;
246
247 Identifier id = element->identify();
248 IdentifierHash hash = element->identifyHash();
249
250 //--------------------------------------------------------
251 // Detector identifier information
252 //--------------------------------------------------------
253 m_hash = hash.value();
254 m_endcap = m_hgtdIdHelper->endcap(id);
255 m_layer = m_hgtdIdHelper->layer(id);
256 m_phiModule = m_hgtdIdHelper->phi_module(id);
257 m_etaModule = m_hgtdIdHelper->eta_module(id);
258
259 //--------------------------------------------------------
260 // Misalignment parameters
261 //--------------------------------------------------------
262 double dx = 0.0;
263 double dy = 0.0;
264 double dz = 0.0;
265
266 if (m_mode.value() == 0) {
267 // no misalignment
268 }
269 else if (m_mode.value() == 1) {
270 // Constant translation
271 dx = m_shiftX.value();
272 dy = m_shiftY.value();
273 dz = m_shiftZ.value();
274 }
275 else if (m_mode.value() == 2) {
276 // Random Gaussian translation
277 dx = gaussX();
278 dy = gaussY();
279 dz = gaussZ();
280 }
281 else {
282 ATH_MSG_WARNING("Unknown MisalignMode = "
283 << m_mode.value()
284 << ". No misalignment applied.");
285 continue;
286 }
287 //--------------------------------------------------------
288 // Update alignment constants
289 //--------------------------------------------------------
290 bool ok =
291 m_alignDBTool->tweakTrans(
292 id,
293 1,
294 Amg::Vector3D(dx, dy, dz),
295 0.,
296 0.,
297 0.);
298
299 if (!ok) {
300
302 "Failed to update module "
303 << hash);
304
305 continue;
306 }
307
308 //--------------------------------------------------------
309 // Fill validation tree
310 // For the current implementation only translations are
311 // applied, therefore the shifted position is simply
312 // nominal position + translation.
313 //--------------------------------------------------------
314
315 m_localDx = dx;
316 m_localDy = dy;
317 m_localDz = dz;
318
319 //--------------------------------------------------------
320 // Nominal module position
321 //--------------------------------------------------------
322 const Amg::Vector3D& center = element->center();
323
324 m_centerX = center.x();
325 m_centerY = center.y();
326 m_centerZ = center.z();
327
331
332 //--------------------------------------------------------
333 // Print first few modules
334 //--------------------------------------------------------
335 if (count < 10) {
336
338 "Module "
339 << hash
340 << " -> shift ("
341 << dx << ", "
342 << dy << ", "
343 << dz << ")");
344 }
345
346 //--------------------------------------------------------
347 // Save to text file
348 //--------------------------------------------------------
350 << m_hash << " "
351 << m_endcap << " "
352 << m_layer << " "
353 << m_phiModule << " "
354 << m_etaModule << " "
355 << m_localDx << " "
356 << m_localDy << " "
357 << m_localDz << " "
358 << m_centerX << " "
359 << m_centerY << " "
360 << m_centerZ << " "
361 << m_shiftedX << " "
362 << m_shiftedY << " "
363 << m_shiftedZ
364 << '\n';
365
366 m_tree->Fill();
367
368 ++count;
369 }
370
372 "Processed "
373 << count
374 << " HGTD modules");
375
376 return StatusCode::SUCCESS;
377}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
Gaudi::Property< double > m_sigmaY
Gaudi::Property< double > m_sigmaX
Gaudi::Property< double > m_shiftZ
Gaudi::Property< double > m_shiftX
Gaudi::Property< double > m_shiftY
const HGTD_DetectorManager * m_hgtdManager
Gaudi::Property< double > m_sigmaZ
Gaudi::Property< int > m_mode
ServiceHandle< IRndmGenSvc > m_rndmSvc
const HGTD_ID * m_hgtdIdHelper
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
Eigen::Matrix< double, 3, 1 > Vector3D

◆ initialize()

StatusCode HGTD_MisalignAlg::initialize ( )
overridevirtual

Definition at line 16 of file HGTD_MisalignAlg.cxx.

17{
18 ATH_MSG_INFO("=== HGTD_MisalignAlg initialize ===");
19
20 //------------------------------------------------------------
21 // Retrieve services
22 //------------------------------------------------------------
23 ATH_CHECK(m_rndmSvc.retrieve());
24 ATH_CHECK(m_alignDBTool.retrieve());
25
26 ATH_MSG_DEBUG("Retrieved HGTD_AlignDBTool");
27 ATH_MSG_DEBUG("AlignDBTool = " << m_alignDBTool.typeAndName());
28 ATH_MSG_DEBUG("WriteToDB = " << m_writeToDB);
29 ATH_MSG_DEBUG("SQLiteTag = " << m_sqliteTag);
30 ATH_MSG_DEBUG("RandomStream = " << m_randomStream);
31
32 //------------------------------------------------------------
33 // Retrieve HGTD identifier helper
34 //------------------------------------------------------------
35 ATH_CHECK(detStore()->retrieve(m_hgtdIdHelper,"HGTD_ID"));
36
37 //------------------------------------------------------------
38 // Retrieve HGTD detector manager
39 //------------------------------------------------------------
40 ATH_CHECK(detStore()->retrieve(m_hgtdManager, "HGTD"));
41 ATH_MSG_DEBUG("Retrieved HGTD_DetectorManager");
42
43 //------------------------------------------------------------
44 // Open output file
45 //------------------------------------------------------------
46 m_outfile.open(m_outputFile.value());
47
48 if (!m_outfile.is_open()) {
49
51 "Cannot open output file "
52 << m_outputFile.value());
53
54 return StatusCode::FAILURE;
55 }
56 ATH_MSG_DEBUG("Output file = " << m_outputFile.value());
57
58 //------------------------------------------------------------
59 // ASCII validation output
60 //------------------------------------------------------------
62 << "# hash "
63 << "endcap "
64 << "layer "
65 << "phi_module "
66 << "eta_module "
67 << "local_dx "
68 << "local_dy "
69 << "local_dz "
70 << "center_x "
71 << "center_y "
72 << "center_z "
73 << "misaligned_x "
74 << "misaligned_y "
75 << "misaligned_z\n";
76
77 SmartIF<ITHistSvc> histSvc{
78 Gaudi::svcLocator()->service("THistSvc")};
79 ATH_CHECK(histSvc.isValid());
80
81 m_tree = new TTree("HGTDMisalignment", "HGTD alignment validation");
82
84 histSvc->regTree("/CREATEMISALIGN/HGTDMisalignment", m_tree));
85
86 //------------------------------------------------------------
87 // Validation tree branches
88 // These quantities are used to validate the generated
89 // misalignment and compare the nominal and shifted geometry.
90 //------------------------------------------------------------
91
92 m_tree->Branch("hash", &m_hash, "hash/i");
93
94 // HGTD detector identifier
95 m_tree->Branch("endcap", &m_endcap, "endcap/I");
96 m_tree->Branch("layer", &m_layer, "layer/I");
97 m_tree->Branch("phi_module", &m_phiModule, "phi_module/I");
98 m_tree->Branch("eta_module", &m_etaModule, "eta_module/I");
99
100 // Applied local misalignment
101 m_tree->Branch("local_dx", &m_localDx, "local_dx/F");
102 m_tree->Branch("local_dy", &m_localDy, "local_dy/F");
103 m_tree->Branch("local_dz", &m_localDz, "local_dz/F");
104
105 // Nominal global center
106 m_tree->Branch("center_x", &m_centerX, "center_x/F");
107 m_tree->Branch("center_y", &m_centerY, "center_y/F");
108 m_tree->Branch("center_z", &m_centerZ, "center_z/F");
109
110 // Misaligned global center
111 m_tree->Branch("misaligned_x", &m_shiftedX, "misaligned_x/F");
112 m_tree->Branch("misaligned_y", &m_shiftedY, "misaligned_y/F");
113 m_tree->Branch("misaligned_z", &m_shiftedZ, "misaligned_z/F");
114
115 //------------------------------------------------------------
116 // Print configuration
117 //------------------------------------------------------------
118 ATH_MSG_DEBUG("MisalignMode = " << m_mode.value());
119 ATH_MSG_DEBUG("ShiftX = " << m_shiftX.value());
120 ATH_MSG_DEBUG("ShiftY = " << m_shiftY.value());
121 ATH_MSG_DEBUG("ShiftZ = " << m_shiftZ.value());
122 ATH_MSG_DEBUG("SigmaX = " << m_sigmaX.value());
123 ATH_MSG_DEBUG("SigmaY = " << m_sigmaY.value());
124 ATH_MSG_DEBUG("SigmaZ = " << m_sigmaZ.value());
125 ATH_MSG_DEBUG("ApplyTranslation = " << m_applyTranslation.value());
126
127 return StatusCode::SUCCESS;
128}
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< std::string > m_outputFile
Gaudi::Property< std::string > m_randomStream

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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.

◆ 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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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 }

Member Data Documentation

◆ m_alignables

std::vector<GeoAlignableTransform*> HGTD_MisalignAlg::m_alignables
private

Definition at line 69 of file HGTD_MisalignAlg.h.

◆ m_alignDBTool

ToolHandle<IHGTD_AlignDBTool> HGTD_MisalignAlg::m_alignDBTool
private
Initial value:
{
this,
"AlignDBTool",
"HGTD_AlignDBTool",
"HGTD alignment database tool"
}

Definition at line 115 of file HGTD_MisalignAlg.h.

115 {
116 this,
117 "AlignDBTool",
118 "HGTD_AlignDBTool",
119 "HGTD alignment database tool"
120 };

◆ m_applyRotation

Gaudi::Property<bool> HGTD_MisalignAlg::m_applyRotation {this, "ApplyRotation", false}
private

Definition at line 55 of file HGTD_MisalignAlg.h.

55{this, "ApplyRotation", false};

◆ m_applyToGeometry

Gaudi::Property<bool> HGTD_MisalignAlg::m_applyToGeometry
private
Initial value:
{
this,
"ApplyToGeometry",
false,
"Apply misalignment deltas to HGTD alignable transforms"
}

Definition at line 80 of file HGTD_MisalignAlg.h.

80 {
81 this,
82 "ApplyToGeometry",
83 false,
84 "Apply misalignment deltas to HGTD alignable transforms"
85 };

◆ m_applyTranslation

Gaudi::Property<bool> HGTD_MisalignAlg::m_applyTranslation {this, "ApplyTranslation", true}
private

Definition at line 52 of file HGTD_MisalignAlg.h.

52{this, "ApplyTranslation", true};

◆ m_centerX

float HGTD_MisalignAlg::m_centerX {0.f}
private

Definition at line 138 of file HGTD_MisalignAlg.h.

138{0.f};

◆ m_centerY

float HGTD_MisalignAlg::m_centerY {0.f}
private

Definition at line 139 of file HGTD_MisalignAlg.h.

139{0.f};

◆ m_centerZ

float HGTD_MisalignAlg::m_centerZ {0.f}
private

Definition at line 140 of file HGTD_MisalignAlg.h.

140{0.f};

◆ m_createFreshDB

Gaudi::Property<bool> HGTD_MisalignAlg::m_createFreshDB
private
Initial value:
{
this,
"CreateFreshDB",
true,
"Create a new HGTD alignment database"
}

Definition at line 94 of file HGTD_MisalignAlg.h.

94 {
95 this,
96 "CreateFreshDB",
97 true,
98 "Create a new HGTD alignment database"
99 };

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doDebugPrint

Gaudi::Property<bool> HGTD_MisalignAlg::m_doDebugPrint {this, "DoDebugPrint", true}
private

Definition at line 53 of file HGTD_MisalignAlg.h.

53{this, "DoDebugPrint", true};

◆ m_endcap

int HGTD_MisalignAlg::m_endcap {0}
private

Definition at line 149 of file HGTD_MisalignAlg.h.

149{0};

◆ m_etaModule

int HGTD_MisalignAlg::m_etaModule {0}
private

Definition at line 152 of file HGTD_MisalignAlg.h.

152{0};

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_firstEvent

bool HGTD_MisalignAlg::m_firstEvent {true}
private

Definition at line 155 of file HGTD_MisalignAlg.h.

155{true};

◆ m_hash

unsigned int HGTD_MisalignAlg::m_hash {0}
private

Definition at line 148 of file HGTD_MisalignAlg.h.

148{0};

◆ m_hgtdIdHelper

const HGTD_ID* HGTD_MisalignAlg::m_hgtdIdHelper {nullptr}
private

Definition at line 122 of file HGTD_MisalignAlg.h.

122{nullptr};

◆ m_hgtdManager

const HGTD_DetectorManager* HGTD_MisalignAlg::m_hgtdManager {nullptr}
private

Definition at line 78 of file HGTD_MisalignAlg.h.

78{nullptr};

◆ m_layer

int HGTD_MisalignAlg::m_layer {0}
private

Definition at line 150 of file HGTD_MisalignAlg.h.

150{0};

◆ m_localDx

float HGTD_MisalignAlg::m_localDx {0.f}
private

Definition at line 133 of file HGTD_MisalignAlg.h.

133{0.f};

◆ m_localDy

float HGTD_MisalignAlg::m_localDy {0.f}
private

Definition at line 134 of file HGTD_MisalignAlg.h.

134{0.f};

◆ m_localDz

float HGTD_MisalignAlg::m_localDz {0.f}
private

Definition at line 135 of file HGTD_MisalignAlg.h.

135{0.f};

◆ m_maxModules

Gaudi::Property<int> HGTD_MisalignAlg::m_maxModules {this, "MaxModules", -1}
private

Definition at line 56 of file HGTD_MisalignAlg.h.

56{this, "MaxModules", -1};

◆ m_mode

Gaudi::Property<int> HGTD_MisalignAlg::m_mode {this, "MisalignMode", 1}
private

Definition at line 42 of file HGTD_MisalignAlg.h.

42{this, "MisalignMode", 1};

◆ m_nEvents

unsigned int HGTD_MisalignAlg::m_nEvents {0}
private

Definition at line 156 of file HGTD_MisalignAlg.h.

156{0};

◆ m_outfile

std::ofstream HGTD_MisalignAlg::m_outfile
private

Definition at line 154 of file HGTD_MisalignAlg.h.

◆ m_outputFile

Gaudi::Property<std::string> HGTD_MisalignAlg::m_outputFile
private
Initial value:
{
this,
"OutputFile",
"hgtd_misalignment.txt",
"Output file name"
}

Definition at line 71 of file HGTD_MisalignAlg.h.

71 {
72 this,
73 "OutputFile",
74 "hgtd_misalignment.txt",
75 "Output file name"
76 };

◆ m_phiModule

int HGTD_MisalignAlg::m_phiModule {0}
private

Definition at line 151 of file HGTD_MisalignAlg.h.

151{0};

◆ m_randomStream

Gaudi::Property<std::string> HGTD_MisalignAlg::m_randomStream
private
Initial value:
{
this,
"RandomStream",
"HGTDMisalignment",
"Random number stream name"
}

Definition at line 62 of file HGTD_MisalignAlg.h.

62 {
63 this,
64 "RandomStream",
65 "HGTDMisalignment",
66 "Random number stream name"
67 };

◆ m_rndmSvc

ServiceHandle<IRndmGenSvc> HGTD_MisalignAlg::m_rndmSvc
private
Initial value:
{
this, "RndmGenSvc", "RndmGenSvc", "Random number service"
}

Definition at line 58 of file HGTD_MisalignAlg.h.

58 {
59 this, "RndmGenSvc", "RndmGenSvc", "Random number service"
60 };

◆ m_shiftedX

float HGTD_MisalignAlg::m_shiftedX {0.f}
private

Definition at line 143 of file HGTD_MisalignAlg.h.

143{0.f};

◆ m_shiftedY

float HGTD_MisalignAlg::m_shiftedY {0.f}
private

Definition at line 144 of file HGTD_MisalignAlg.h.

144{0.f};

◆ m_shiftedZ

float HGTD_MisalignAlg::m_shiftedZ {0.f}
private

Definition at line 145 of file HGTD_MisalignAlg.h.

145{0.f};

◆ m_shiftX

Gaudi::Property<double> HGTD_MisalignAlg::m_shiftX {this, "ShiftX", 0.05}
private

Definition at line 43 of file HGTD_MisalignAlg.h.

43{this, "ShiftX", 0.05};

◆ m_shiftY

Gaudi::Property<double> HGTD_MisalignAlg::m_shiftY {this, "ShiftY", 0.0}
private

Definition at line 44 of file HGTD_MisalignAlg.h.

44{this, "ShiftY", 0.0};

◆ m_shiftZ

Gaudi::Property<double> HGTD_MisalignAlg::m_shiftZ {this, "ShiftZ", 0.0}
private

Definition at line 45 of file HGTD_MisalignAlg.h.

45{this, "ShiftZ", 0.0};

◆ m_sigmaX

Gaudi::Property<double> HGTD_MisalignAlg::m_sigmaX {this, "SigmaX", 0.01}
private

Definition at line 47 of file HGTD_MisalignAlg.h.

47{this, "SigmaX", 0.01};

◆ m_sigmaY

Gaudi::Property<double> HGTD_MisalignAlg::m_sigmaY {this, "SigmaY", 0.01}
private

Definition at line 48 of file HGTD_MisalignAlg.h.

48{this, "SigmaY", 0.01};

◆ m_sigmaZ

Gaudi::Property<double> HGTD_MisalignAlg::m_sigmaZ {this, "SigmaZ", 0.01}
private

Definition at line 49 of file HGTD_MisalignAlg.h.

49{this, "SigmaZ", 0.01};

◆ m_sqliteTag

Gaudi::Property<std::string> HGTD_MisalignAlg::m_sqliteTag
private
Initial value:
{
this,
"SQLiteTag",
"HGTD_AlignTag",
"SQLite alignment tag"
}

Definition at line 101 of file HGTD_MisalignAlg.h.

101 {
102 this,
103 "SQLiteTag",
104 "HGTD_AlignTag",
105 "SQLite alignment tag"
106 };

◆ m_testHash

Gaudi::Property<int> HGTD_MisalignAlg::m_testHash
private
Initial value:
{
this,
"TestHash",
-1,
"If >=0, apply geometry delta only to this hash"
}

Definition at line 87 of file HGTD_MisalignAlg.h.

87 {
88 this,
89 "TestHash",
90 -1,
91 "If >=0, apply geometry delta only to this hash"
92 };

◆ m_tree

TTree* HGTD_MisalignAlg::m_tree {nullptr}
private

Definition at line 130 of file HGTD_MisalignAlg.h.

130{nullptr};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_writeToDB

Gaudi::Property<bool> HGTD_MisalignAlg::m_writeToDB
private
Initial value:
{
this,
"WriteToDB",
false,
"Write misalignment to HGTD alignment database"
}

Definition at line 108 of file HGTD_MisalignAlg.h.

108 {
109 this,
110 "WriteToDB",
111 false,
112 "Write misalignment to HGTD alignment database"
113 };

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