ATLAS Offline Software
Loading...
Searching...
No Matches
MuonR4::GeomAlignCondAlg Class Reference

#include <GeomAlignCondAlg.h>

Inheritance diagram for MuonR4::GeomAlignCondAlg:

Public Member Functions

virtual ~GeomAlignCondAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual bool isReEntrant () const override
 Avoid scheduling algorithm multiple times.
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

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

using deltaMap = std::unordered_map<const GeoAlignableTransform*, std::shared_ptr<const Amg::Transform3D>>
 Association map of the GeoAlignableTransforms with the rigid alignment transformations.
using alignTechMap = std::map<ActsTrk::DetectorType, std::set<const GeoAlignableTransform*>>
 Association map of the GeoAlignable transforms with the detector technologies.
typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Identifier alignmentId (const MuonGMR4::MuonReadoutElement *reElement) const
 Returns the Identifier serving as key to find the alignment parameters connected with the readout element.
StatusCode loadDeltas (const EventContext &ctx, deltaMap &alignDeltas, alignTechMap &techTransforms) const
 Loads the ALineContainer from the conditions store and fills the deltaMap with the A-Line delta transformations and the technology map to connect mutually moving detectors.
StatusCode loadMdtDeformPars (const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
 Loads the BLine container and the Mdt-as built parameters from the Conditions store and stores them into the tracking alignment object of the RawGeomAlignmentStore.
StatusCode loadMmDeformPars (const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
StatusCode loadStgcDeformPars (const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
StatusCode declareDependencies (const EventContext &ctx, ActsTrk::DetectorType detType, SG::WriteCondHandle< ActsTrk::DetectorAlignStore > &writeHandle) const
 Loads the corresponding ReadCondHandles from the Conditions store and adds their IOVs to the dependency of the writeHandle.
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

std::vector< ActsTrk::DetectorTypem_techs {}
SG::ReadCondHandleKey< ALineContainerm_readKeyALines
SG::ReadCondHandleKey< BLineContainerm_readKeyBLines
SG::ReadCondHandleKey< MdtAsBuiltContainerm_readMdtAsBuiltKey
SG::ReadCondHandleKey< NswAsBuiltDbDatam_readNswAsBuiltKey
SG::ReadCondHandleKey< sTGCAsBuiltDatam_readsTgcAsBuiltKey
SG::ReadCondHandleKey< NswPassivationDbDatam_readNswPassivKey
SG::WriteCondHandleKeyArray< ActsTrk::DetectorAlignStorem_writeKeys
Gaudi::Property< std::string > m_keyToken
ServiceHandle< Muon::IMuonIdHelperSvcm_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
const MuonGMR4::MuonDetectorManagerm_detMgr {nullptr}
Gaudi::Property< bool > m_applyMmPassivation {this, "applyMmPassivation", false}
Gaudi::Property< bool > m_applyNswAsBuilt
Gaudi::Property< bool > m_applyMdtAsBuilt
Gaudi::Property< bool > m_applyALines {this, "applyALines", false}
 Apply translations and rotations to align the Muon stations.
Gaudi::Property< bool > m_applyBLines {this, "applyBLines", false}
 Apply the chamber deformation model (Mdts + Nsw).
Gaudi::Property< bool > m_fillAlignStoreCache {this, "FillAlignCache", false}
 Flag toggling whether the alignment store shall be filled with the transforms or not.
Gaudi::Property< bool > m_fillGeoAlignStore {this, "FillGeoAlignStore", true}
 Flag toggling whether the GeoAlignmentStore shall be filled.
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 30 of file GeomAlignCondAlg.h.

Member Typedef Documentation

◆ alignTechMap

using MuonR4::GeomAlignCondAlg::alignTechMap = std::map<ActsTrk::DetectorType, std::set<const GeoAlignableTransform*>>
private

Association map of the GeoAlignable transforms with the detector technologies.

Definition at line 45 of file GeomAlignCondAlg.h.

◆ deltaMap

using MuonR4::GeomAlignCondAlg::deltaMap = std::unordered_map<const GeoAlignableTransform*, std::shared_ptr<const Amg::Transform3D>>
private

Association map of the GeoAlignableTransforms with the rigid alignment transformations.

Definition at line 43 of file GeomAlignCondAlg.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ~GeomAlignCondAlg()

virtual MuonR4::GeomAlignCondAlg::~GeomAlignCondAlg ( )
virtualdefault

Member Function Documentation

◆ alignmentId()

Identifier MuonR4::GeomAlignCondAlg::alignmentId ( const MuonGMR4::MuonReadoutElement * reElement) const
private

Returns the Identifier serving as key to find the alignment parameters connected with the readout element.

The BML eta 7 stations have their own alignment.

The rest shares the same alignmnet constants with the Mdts

For the NSW, the alignment parameters are stored under the same key as the RE

Definition at line 57 of file GeomAlignCondAlg.cxx.

57 {
58 if (re->detectorType() == ActsTrk::DetectorType::Mdt ||
59 re->detectorType() == ActsTrk::DetectorType::Tgc) {
60 return m_idHelperSvc->chamberId(re->identify());
61 } else if (re->detectorType() == ActsTrk::DetectorType::Rpc) {
63 if (!m_idHelperSvc->hasMDT() ||
64 (std::abs(re->stationEta()) == 7 && m_idHelperSvc->stationNameString(re->identify()) == "BML")) {
65 return m_idHelperSvc->rpcIdHelper().elementID(re->stationName(), re->stationEta(), re->stationPhi(), 1);
67 } else {
68 return m_idHelperSvc->mdtIdHelper().elementID(re->stationName(), re->stationEta(), re->stationPhi());
69 }
70 }
72 return re->identify();
73}
const std::regex re(r_e)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
@ Tgc
Resitive Plate Chambers.
@ Rpc
Monitored Drift Tubes.
@ Mdt
MuonSpectrometer.

◆ declareDependencies()

StatusCode MuonR4::GeomAlignCondAlg::declareDependencies ( const EventContext & ctx,
ActsTrk::DetectorType detType,
SG::WriteCondHandle< ActsTrk::DetectorAlignStore > & writeHandle ) const
private

Loads the corresponding ReadCondHandles from the Conditions store and adds their IOVs to the dependency of the writeHandle.

Definition at line 195 of file GeomAlignCondAlg.cxx.

197 {
199 if (m_applyALines) {
200 SG::ReadCondHandle depHandle{m_readKeyALines, ctx};
201 ATH_CHECK(depHandle.isValid());
202 writeHandle.addDependency(depHandle);
203 }
204 const bool issTGC = detType == ActsTrk::DetectorType::sTgc;
205 const bool isMm = detType == ActsTrk::DetectorType::Mm;
206 const bool isMdt = detType == ActsTrk::DetectorType::Mdt;
207
208 if (m_applyBLines&& (issTGC || isMm || isMdt)) {
209 SG::ReadCondHandle depHandle{m_readKeyBLines, ctx};
210 ATH_CHECK(depHandle.isValid());
211 writeHandle.addDependency(depHandle);
212 }
213 if (m_applyMdtAsBuilt && isMdt) {
214 SG::ReadCondHandle depHandle{m_readMdtAsBuiltKey, ctx};
215 ATH_CHECK(depHandle.isValid());
216 writeHandle.addDependency(depHandle);
217 }
219 SG::ReadCondHandle depHandle{m_readNswPassivKey, ctx};
220 ATH_CHECK(depHandle.isValid());
221 writeHandle.addDependency(depHandle);
222 }
223 if (m_applyNswAsBuilt && isMm) {
224 SG::ReadCondHandle depHandle{m_readNswAsBuiltKey, ctx};
225 ATH_CHECK(depHandle.isValid());
226 writeHandle.addDependency(depHandle);
227 }
228 if(m_applyNswAsBuilt && issTGC && !m_readsTgcAsBuiltKey.empty()){
229 SG::ReadCondHandle depHandle{m_readsTgcAsBuiltKey, ctx};
230 ATH_CHECK(depHandle.isValid());
231 writeHandle.addDependency(depHandle);
232 }
233 return StatusCode::SUCCESS;
234}
#define ATH_CHECK
Evaluate an expression and check for errors.
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
Gaudi::Property< bool > m_applyALines
Apply translations and rotations to align the Muon stations.
SG::ReadCondHandleKey< MdtAsBuiltContainer > m_readMdtAsBuiltKey
SG::ReadCondHandleKey< sTGCAsBuiltData > m_readsTgcAsBuiltKey
SG::ReadCondHandleKey< BLineContainer > m_readKeyBLines
Gaudi::Property< bool > m_applyMmPassivation
Gaudi::Property< bool > m_applyMdtAsBuilt
Gaudi::Property< bool > m_applyBLines
Apply the chamber deformation model (Mdts + Nsw).
SG::ReadCondHandleKey< NswPassivationDbData > m_readNswPassivKey
SG::ReadCondHandleKey< NswAsBuiltDbData > m_readNswAsBuiltKey
Gaudi::Property< bool > m_applyNswAsBuilt
SG::ReadCondHandleKey< ALineContainer > m_readKeyALines
void addDependency(const EventIDRange &range)
@ Mm
Maybe not needed in the migration.
@ sTgc
Micromegas (NSW).

◆ 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 MuonR4::GeomAlignCondAlg::execute ( const EventContext & ctx) const
overridevirtual

Create the condition handles

Append the alignable transformations to the conditions object

Propagate the cache throughout the geometry

Cache all transforms at the creation of this conditions object

The geoModel constants are no longer needed.

Ensure that the rigid transformations of the detector elements are applied

There's no need to cache the delta parameters longer

Whipe the GeoModelCache

Definition at line 236 of file GeomAlignCondAlg.cxx.

236 {
237 deltaMap alignDeltas{};
238 alignTechMap techTransforms{};
239 const unsigned memBeforeAlign = GeoPerfUtils::getMem();
240 ATH_CHECK(loadDeltas(ctx, alignDeltas, techTransforms));
241
243 for (std::size_t det =0 ; det < m_techs.size(); ++det) {
244 const SG::WriteCondHandleKey<ActsTrk::DetectorAlignStore>& key = m_writeKeys[det];
245 const ActsTrk::DetectorType subDet = m_techs[det];
246
248 ActsTrk::DetectorAlignStore::Mode::Block :
249 ActsTrk::DetectorAlignStore::Mode::LazyFill};
250 SG::WriteCondHandle writeHandle{key, ctx};
251 if (writeHandle.isValid()) {
252 ATH_MSG_DEBUG("The alignment constants for "<<subDet <<" are still valid.");
253 continue;
254 }
255 auto writeCdo = std::make_unique<ActsTrk::DetectorAlignStore>(subDet, mode);
256
257 const std::set<const GeoAlignableTransform*>& toStore = techTransforms[subDet];
259 for (const GeoAlignableTransform* alignable : toStore) {
260 const std::shared_ptr<const Amg::Transform3D>& cached = alignDeltas[alignable];
261 if (!cached) continue;
262 writeCdo->geoModelAlignment->setDelta(alignable, alignDeltas[alignable]);
263 }
264 writeCdo->geoModelAlignment->lockDelta();
265 if (subDet == ActsTrk::DetectorType::Mdt) {
266 ATH_CHECK(loadMdtDeformPars(ctx,*writeCdo));
267 } else if (subDet == ActsTrk::DetectorType::Mm) {
268 ATH_CHECK(loadMmDeformPars(ctx, *writeCdo));
269 } else if (subDet == ActsTrk::DetectorType::sTgc) {
270 ATH_CHECK(loadStgcDeformPars(ctx, *writeCdo));
271 }
273 ATH_CHECK(declareDependencies(ctx, subDet, writeHandle));
276 unsigned numAligned{0};
277 std::ranges::for_each(m_detMgr->getAllReadoutElements(subDet),
278 [&](const MuonGMR4::MuonReadoutElement* re) {
279 numAligned += re->storeAlignedTransforms(*writeCdo);
280 });
281 std::ranges::for_each(m_detMgr->getAllChambers(),
282 [&](const MuonGMR4::Chamber* chamber){
283 const auto& placement = chamber->parameters().placement;
284 if (placement) {
285 numAligned+= placement->storeAlignedTransforms(*writeCdo);
286 }
287 });
289 writeCdo->geoModelAlignment.reset();
290 ATH_MSG_DEBUG("Populated the alignment store "<<subDet<<" with "<<numAligned<<" transforms");
291 if (writeCdo->trackingAlignment->filled() != writeCdo->trackingAlignment->size()) {
292 ATH_MSG_ERROR("The number of aligned transforms "<<(*writeCdo->trackingAlignment)
293 <<" does not match what's reported from the readout geometry "
294 <<writeCdo->trackingAlignment->filled());
295 return StatusCode::FAILURE;
296 }
297 } else if (m_fillGeoAlignStore) {
299 std::ranges::for_each(m_detMgr->getAllReadoutElements(subDet),
300 [&](const MuonReadoutElement* re){
301 const Amg::Transform3D& detTrf{re->getMaterialGeom()->getAbsoluteTransform(writeCdo->geoModelAlignment.get())};
302 ATH_MSG_VERBOSE("Detector element "<<m_idHelperSvc->toStringDetEl(re->identify())<<" is located at "
303 <<Amg::toString(detTrf));
304 });
306 writeCdo->geoModelAlignment->getDeltas()->clear();
307 writeCdo->geoModelAlignment->lockPosCache();
308 }
309 ATH_CHECK(writeHandle.record(std::move(writeCdo)));
310 }
311
312 alignDeltas.clear();
313 techTransforms.clear();
315 GeoClearAbsPosAction whipeTreeTop{};
316 for (unsigned treeTop = 0 ; treeTop < m_detMgr->getNumTreeTops(); ++treeTop) {
317 m_detMgr->getTreeTop(treeTop)->exec(&whipeTreeTop);
318 }
319
320 const unsigned memAfterAlign = GeoPerfUtils::getMem();
321 ATH_MSG_INFO("Caching of the alignment parameters required "<<(memAfterAlign - memBeforeAlign) / 1024<<" MB of memory");
322 return StatusCode::SUCCESS;
323}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
detail::TransformStore::Mode Mode
std::unordered_map< const GeoAlignableTransform *, std::shared_ptr< const Amg::Transform3D > > deltaMap
Association map of the GeoAlignableTransforms with the rigid alignment transformations.
StatusCode loadMmDeformPars(const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
const MuonGMR4::MuonDetectorManager * m_detMgr
StatusCode loadMdtDeformPars(const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
Loads the BLine container and the Mdt-as built parameters from the Conditions store and stores them i...
std::vector< ActsTrk::DetectorType > m_techs
std::map< ActsTrk::DetectorType, std::set< const GeoAlignableTransform * > > alignTechMap
Association map of the GeoAlignable transforms with the detector technologies.
SG::WriteCondHandleKeyArray< ActsTrk::DetectorAlignStore > m_writeKeys
StatusCode loadDeltas(const EventContext &ctx, deltaMap &alignDeltas, alignTechMap &techTransforms) const
Loads the ALineContainer from the conditions store and fills the deltaMap with the A-Line delta trans...
Gaudi::Property< bool > m_fillAlignStoreCache
Flag toggling whether the alignment store shall be filled with the transforms or not.
StatusCode declareDependencies(const EventContext &ctx, ActsTrk::DetectorType detType, SG::WriteCondHandle< ActsTrk::DetectorAlignStore > &writeHandle) const
Loads the corresponding ReadCondHandles from the Conditions store and adds their IOVs to the dependen...
StatusCode loadStgcDeformPars(const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
Gaudi::Property< bool > m_fillGeoAlignStore
Flag toggling whether the GeoAlignmentStore shall be filled.
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
cached(func)
Decorator to cache function return value.
Definition cached.py:6

◆ 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:

◆ initialize()

StatusCode MuonR4::GeomAlignCondAlg::initialize ( )
overridevirtual

Definition at line 19 of file GeomAlignCondAlg.cxx.

19 {
20
26 ATH_CHECK(m_idHelperSvc.retrieve());
27 ATH_CHECK(detStore()->retrieve(m_detMgr));
28 m_techs = m_detMgr->getDetectorTypes();
29 if (m_techs.empty()) {
30 ATH_MSG_FATAL("The detector manager does not contain any elements");
31 return StatusCode::FAILURE;
32 }
33 auto hasDetector = [this](const ActsTrk::DetectorType d) -> bool {
34 return Acts::rangeContainsValue(m_techs, d);
35 };
37 hasDetector(ActsTrk::DetectorType::Mm) ||
38 hasDetector(ActsTrk::DetectorType::sTgc));
41 hasDetector(ActsTrk::DetectorType::sTgc));
43
44
45
46 for (const ActsTrk::DetectorType det : m_techs) {
47 m_writeKeys.emplace_back(std::format("{:}{:}", det, m_keyToken.value()));
48 ATH_MSG_INFO("Register new alignment container "<<m_writeKeys.back().fullKey());
49 }
50 ATH_MSG_INFO("Switched options "<<m_fillAlignStoreCache<<", "<<", "<<m_applyALines<<", "
51 <<m_applyBLines<<", "<<m_applyMdtAsBuilt<<", "
53 ATH_CHECK(m_writeKeys.initialize());
54 return StatusCode::SUCCESS;
55}
#define ATH_MSG_FATAL(x)
const ServiceHandle< StoreGateSvc > & detStore() const
Gaudi::Property< std::string > m_keyToken

◆ 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 AthCondAlgorithm::isReEntrant ( ) const
inlineoverridevirtualinherited

Avoid scheduling algorithm multiple times.

With multiple concurrent events, conditions objects often expire simultaneously for all slots. To avoid that the scheduler runs the CondAlg in each slot, we declare it as "non-reentrant". This ensures that the conditions objects are only created once.

In case a particular CondAlg should behave differently, it can override this method again and return true.

See also
ATEAM-836

Definition at line 39 of file AthCondAlgorithm.h.

39{ return false; }

◆ loadDeltas()

StatusCode MuonR4::GeomAlignCondAlg::loadDeltas ( const EventContext & ctx,
deltaMap & alignDeltas,
alignTechMap & techTransforms ) const
private

Loads the ALineContainer from the conditions store and fills the deltaMap with the A-Line delta transformations and the technology map to connect mutually moving detectors.

Construct the identifier to search for the proper Aline transformation

Store the alignable transformation

Definition at line 74 of file GeomAlignCondAlg.cxx.

76 {
77 if (m_readKeyALines.empty()) {
78 ATH_MSG_DEBUG("Loading of the A line parameters deactivated");
79 return StatusCode::SUCCESS;
80 }
81 const ALineContainer* aLineContainer{};
82 ATH_CHECK(SG::get(aLineContainer, m_readKeyALines, ctx));
83 std::vector<const MuonReadoutElement*> readoutEles = m_detMgr->getAllReadoutElements();
84 ATH_MSG_INFO("Load the alignment of "<<readoutEles.size()<<" detector elements");
85 for (const MuonReadoutElement* re : readoutEles) {
86 const GeoAlignableTransform* alignTrans = re->alignableTransform();
87 if (!alignTrans) {
88 ATH_MSG_WARNING("The readout element "<<m_idHelperSvc->toStringDetEl(re->identify())
89 <<" has no alignable transform.");
90 continue;
91 }
92 std::shared_ptr<const Amg::Transform3D>& cached = alignDeltas[alignTrans];
93 if (cached) {
94 ATH_MSG_DEBUG("The alignable transformation for "<<m_idHelperSvc->toStringChamber(re->identify())
95 <<" has been cached before. ");
96 techTransforms[re->detectorType()].insert(alignTrans);
97 continue;
98 }
100 const Identifier stationId = alignmentId(re);
101 ALineContainer::const_iterator aLineItr = aLineContainer->find(stationId);
102 if (aLineItr == aLineContainer->end()) {
103 ATH_MSG_VERBOSE("No Alines were stored for "<<m_idHelperSvc->toString(re->identify())
104 <<". Used "<<m_idHelperSvc->toString(stationId)<<" as station Identifier");
105 continue;
106 }
108 cached = std::make_shared<Amg::Transform3D>(aLineItr->delta());
109 techTransforms[re->detectorType()].insert(alignTrans);
110 }
111 return StatusCode::SUCCESS;
112}
#define ATH_MSG_WARNING(x)
std::set< ALinePar, std::less<> > ALineContainer
Identifier alignmentId(const MuonGMR4::MuonReadoutElement *reElement) const
Returns the Identifier serving as key to find the alignment parameters connected with the readout ele...
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.

◆ loadMdtDeformPars()

StatusCode MuonR4::GeomAlignCondAlg::loadMdtDeformPars ( const EventContext & ctx,
ActsTrk::DetectorAlignStore & store ) const
private

Loads the BLine container and the Mdt-as built parameters from the Conditions store and stores them into the tracking alignment object of the RawGeomAlignmentStore.

Definition at line 113 of file GeomAlignCondAlg.cxx.

114 {
115
117 return StatusCode::SUCCESS;
118 }
119 auto internAlign = std::make_unique<MdtAlignmentStore>(m_idHelperSvc.get());
120 const MdtAsBuiltContainer* asBuiltCont{nullptr};
121 const BLineContainer* bLines{nullptr};
122
123 ATH_CHECK(SG::get(asBuiltCont, m_readMdtAsBuiltKey, ctx));
124 ATH_CHECK(SG::get(bLines, m_readKeyBLines, ctx));
125
126 const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
127 for (auto itr = idHelper.module_begin(); itr != idHelper.module_end(); ++itr) {
128 const Identifier& stationId{*itr};
129 const BLinePar* bline{nullptr};
130 if (bLines) {
131 BLineContainer::const_iterator itr = bLines->find(stationId);
132 if (itr != bLines->end()) bline = &(*itr);
133 }
134 const MdtAsBuiltPar* asBuilt{nullptr};
135 if (asBuiltCont) {
136 MdtAsBuiltContainer::const_iterator itr = asBuiltCont->find(stationId);
137 if (itr != asBuiltCont->end()) asBuilt = &(*itr);
138 }
139 if (asBuilt || bline) {
140 internAlign->storeDistortion(stationId, bline, asBuilt);
141 }
142 }
143 // Down cast the alignment pointer
144 store.internalAlignment = std::move(internAlign);
145 return StatusCode::SUCCESS;
146}
std::set< MdtAsBuiltPar, std::less<> > MdtAsBuiltContainer
std::set< BLinePar, std::less<> > BLineContainer
const_id_iterator module_end() const
const_id_iterator module_begin() const
Iterators over full set of ids.
TestStore store
Definition TestStore.cxx:23

◆ loadMmDeformPars()

StatusCode MuonR4::GeomAlignCondAlg::loadMmDeformPars ( const EventContext & ctx,
ActsTrk::DetectorAlignStore & store ) const
private

Definition at line 147 of file GeomAlignCondAlg.cxx.

148 {
150 return StatusCode::SUCCESS;
151 }
152 auto internAlign = std::make_unique<MmAlignmentStore>();
153 const NswAsBuiltDbData* asBuiltPars{};
154 ATH_CHECK(SG::get(internAlign->passivation, m_readNswPassivKey, ctx));
155 ATH_CHECK(SG::get(asBuiltPars, m_readNswAsBuiltKey, ctx));
156 if (asBuiltPars) {
157 internAlign->asBuiltPars = asBuiltPars->microMegaData;
158 }
159 const BLineContainer* bLines{};
160 ATH_CHECK(SG::get(bLines, m_readKeyBLines, ctx));
161 if (bLines) {
162 for (const MmReadoutElement* re : m_detMgr->getAllMmReadoutElements()){
163 const Identifier stationId = alignmentId(re);
164 BLineContainer::const_iterator itr = bLines->find(stationId);
165 if (itr != bLines->end()) {
166 internAlign->cacheBLine(re->identify(), *itr);
167 }
168 }
169 }
170 store.internalAlignment = std::move(internAlign);
171 return StatusCode::SUCCESS;
172}
MmAsBuiltPtr microMegaData

◆ loadStgcDeformPars()

StatusCode MuonR4::GeomAlignCondAlg::loadStgcDeformPars ( const EventContext & ctx,
ActsTrk::DetectorAlignStore & store ) const
private

Definition at line 173 of file GeomAlignCondAlg.cxx.

174 {
176 return StatusCode::SUCCESS;
177 }
178 auto internAlign = std::make_unique<sTgcAlignmentStore>();
179 ATH_CHECK(SG::get(internAlign->asBuiltPars, m_readsTgcAsBuiltKey, ctx));
180 const BLineContainer* bLines{};
181 ATH_CHECK(SG::get(bLines, m_readKeyBLines, ctx));
182 if (bLines) {
183 for (const sTgcReadoutElement* re : m_detMgr->getAllsTgcReadoutElements()) {
184 const Identifier stationId = alignmentId(re);
185 BLineContainer::const_iterator itr = bLines->find(stationId);
186 if (itr != bLines->end()) {
187 internAlign->cacheBLine(re->identify(), *itr);
188 }
189 }
190 }
191 store.internalAlignment = std::move(internAlign);
192 return StatusCode::SUCCESS;
193}

◆ 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_applyALines

Gaudi::Property<bool> MuonR4::GeomAlignCondAlg::m_applyALines {this, "applyALines", false}
private

Apply translations and rotations to align the Muon stations.

Definition at line 102 of file GeomAlignCondAlg.h.

102{this, "applyALines", false};

◆ m_applyBLines

Gaudi::Property<bool> MuonR4::GeomAlignCondAlg::m_applyBLines {this, "applyBLines", false}
private

Apply the chamber deformation model (Mdts + Nsw).

Definition at line 104 of file GeomAlignCondAlg.h.

104{this, "applyBLines", false};

◆ m_applyMdtAsBuilt

Gaudi::Property<bool> MuonR4::GeomAlignCondAlg::m_applyMdtAsBuilt
private
Initial value:
{this, "applyMdtAsBuilt", false,
"Toggles the application of the Mdt as-built parameters"}

Definition at line 99 of file GeomAlignCondAlg.h.

99 {this, "applyMdtAsBuilt", false,
100 "Toggles the application of the Mdt as-built parameters"};

◆ m_applyMmPassivation

Gaudi::Property<bool> MuonR4::GeomAlignCondAlg::m_applyMmPassivation {this, "applyMmPassivation", false}
private

Definition at line 94 of file GeomAlignCondAlg.h.

94{this, "applyMmPassivation", false};

◆ m_applyNswAsBuilt

Gaudi::Property<bool> MuonR4::GeomAlignCondAlg::m_applyNswAsBuilt
private
Initial value:
{this, "applyNswAsBuilt", false,
"Toggles the application of the Nsw as-built parameters"}

Definition at line 96 of file GeomAlignCondAlg.h.

96 {this, "applyNswAsBuilt", false,
97 "Toggles the application of the Nsw as-built parameters"};

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* MuonR4::GeomAlignCondAlg::m_detMgr {nullptr}
private

Definition at line 92 of file GeomAlignCondAlg.h.

92{nullptr};

◆ 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_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_fillAlignStoreCache

Gaudi::Property<bool> MuonR4::GeomAlignCondAlg::m_fillAlignStoreCache {this, "FillAlignCache", false}
private

Flag toggling whether the alignment store shall be filled with the transforms or not.

Definition at line 106 of file GeomAlignCondAlg.h.

106{this, "FillAlignCache", false};

◆ m_fillGeoAlignStore

Gaudi::Property<bool> MuonR4::GeomAlignCondAlg::m_fillGeoAlignStore {this, "FillGeoAlignStore", true}
private

Flag toggling whether the GeoAlignmentStore shall be filled.

Definition at line 108 of file GeomAlignCondAlg.h.

108{this, "FillGeoAlignStore", true};

◆ m_idHelperSvc

ServiceHandle<Muon::IMuonIdHelperSvc> MuonR4::GeomAlignCondAlg::m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}
private

Definition at line 90 of file GeomAlignCondAlg.h.

90{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};

◆ m_keyToken

Gaudi::Property<std::string> MuonR4::GeomAlignCondAlg::m_keyToken
private
Initial value:
{this, "CondKeyToken","ActsAlignContainer",
"Common name token of all written alignment objects (e.g.) MdtActsAlignContainer"}

Definition at line 87 of file GeomAlignCondAlg.h.

87 {this, "CondKeyToken","ActsAlignContainer",
88 "Common name token of all written alignment objects (e.g.) MdtActsAlignContainer"};

◆ m_readKeyALines

SG::ReadCondHandleKey<ALineContainer> MuonR4::GeomAlignCondAlg::m_readKeyALines
private
Initial value:
{this, "ReadKeyALines", "ALineContainer",
"Key of the ALine container created from the DB"}

Definition at line 70 of file GeomAlignCondAlg.h.

70 {this, "ReadKeyALines", "ALineContainer",
71 "Key of the ALine container created from the DB"};

◆ m_readKeyBLines

SG::ReadCondHandleKey<BLineContainer> MuonR4::GeomAlignCondAlg::m_readKeyBLines
private
Initial value:
{this, "ReadKeyBLines", "BLineContainer",
"Key of the BLine container created from the DB"}

Definition at line 73 of file GeomAlignCondAlg.h.

73 {this, "ReadKeyBLines", "BLineContainer",
74 "Key of the BLine container created from the DB"};

◆ m_readMdtAsBuiltKey

SG::ReadCondHandleKey<MdtAsBuiltContainer> MuonR4::GeomAlignCondAlg::m_readMdtAsBuiltKey
private
Initial value:
{this, "ReadMdtAsBuiltKey", "MdtAsBuiltContainer",
"Key of output muon alignment MDT/AsBuilt condition data"}

Definition at line 76 of file GeomAlignCondAlg.h.

76 {this, "ReadMdtAsBuiltKey", "MdtAsBuiltContainer",
77 "Key of output muon alignment MDT/AsBuilt condition data"};

◆ m_readNswAsBuiltKey

SG::ReadCondHandleKey<NswAsBuiltDbData> MuonR4::GeomAlignCondAlg::m_readNswAsBuiltKey
private
Initial value:
{this, "ReadNswAsBuiltKey", "NswAsBuiltDbData",
"Key of NswAsBuiltDbData object containing conditions data for NSW as-built params!"}

Definition at line 78 of file GeomAlignCondAlg.h.

78 {this, "ReadNswAsBuiltKey", "NswAsBuiltDbData",
79 "Key of NswAsBuiltDbData object containing conditions data for NSW as-built params!"};

◆ m_readNswPassivKey

SG::ReadCondHandleKey<NswPassivationDbData> MuonR4::GeomAlignCondAlg::m_readNswPassivKey
private
Initial value:
{this, "dMmPassivationKey", "NswPassivationDbData",
"Key of NswPassivationDbData object containing passivation data for MMs"}

Definition at line 82 of file GeomAlignCondAlg.h.

82 {this, "dMmPassivationKey", "NswPassivationDbData",
83 "Key of NswPassivationDbData object containing passivation data for MMs"};

◆ m_readsTgcAsBuiltKey

SG::ReadCondHandleKey<sTGCAsBuiltData> MuonR4::GeomAlignCondAlg::m_readsTgcAsBuiltKey
private
Initial value:
{this, "ReadsTgcAsBuiltKey", "",
"Key of sTGCAsBuiltDbData object containing conditions data for sTgc as-built params!"}

Definition at line 80 of file GeomAlignCondAlg.h.

80 {this, "ReadsTgcAsBuiltKey", "",
81 "Key of sTGCAsBuiltDbData object containing conditions data for sTgc as-built params!"};

◆ m_techs

std::vector<ActsTrk::DetectorType> MuonR4::GeomAlignCondAlg::m_techs {}
private

Definition at line 68 of file GeomAlignCondAlg.h.

68{};

◆ 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_writeKeys

SG::WriteCondHandleKeyArray<ActsTrk::DetectorAlignStore> MuonR4::GeomAlignCondAlg::m_writeKeys
private
Initial value:
{this, "WriteKeys", {},
"Keys of the alignment technologies"}

Definition at line 85 of file GeomAlignCondAlg.h.

85 {this, "WriteKeys", {},
86 "Keys of the alignment technologies"};

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