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

#include <ActsMuonAlignCondAlg.h>

Inheritance diagram for ActsMuonAlignCondAlg:

Public Member Functions

 ActsMuonAlignCondAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~ActsMuonAlignCondAlg ()=default
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual bool isReEntrant () const override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
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
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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 29 of file ActsMuonAlignCondAlg.h.

Member Typedef Documentation

◆ alignTechMap

using ActsMuonAlignCondAlg::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 ActsMuonAlignCondAlg.h.

◆ deltaMap

using ActsMuonAlignCondAlg::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 ActsMuonAlignCondAlg.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ActsMuonAlignCondAlg()

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

Definition at line 23 of file ActsMuonAlignCondAlg.cxx.

23 :
24 AthReentrantAlgorithm{name, pSvcLocator}{}

◆ ~ActsMuonAlignCondAlg()

virtual ActsMuonAlignCondAlg::~ActsMuonAlignCondAlg ( )
virtualdefault

Member Function Documentation

◆ alignmentId()

Identifier ActsMuonAlignCondAlg::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 65 of file ActsMuonAlignCondAlg.cxx.

65 {
66 if (re->detectorType() == ActsTrk::DetectorType::Mdt ||
67 re->detectorType() == ActsTrk::DetectorType::Tgc) {
68 return m_idHelperSvc->chamberId(re->identify());
69 } else if (re->detectorType() == ActsTrk::DetectorType::Rpc) {
71 if (!m_idHelperSvc->hasMDT() ||
72 (std::abs(re->stationEta()) == 7 && m_idHelperSvc->stationNameString(re->identify()) == "BML")) {
73 return m_idHelperSvc->rpcIdHelper().elementID(re->stationName(), re->stationEta(), re->stationPhi(), 1);
75 } else {
76 return m_idHelperSvc->mdtIdHelper().elementID(re->stationName(), re->stationEta(), re->stationPhi());
77 }
78 }
80 return re->identify();
81}
const boost::regex re(r_e)
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
@ Tgc
Resitive Plate Chambers.
@ Rpc
Monitored Drift Tubes.
@ Mdt
MuonSpectrometer.

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ declareDependencies()

StatusCode ActsMuonAlignCondAlg::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 211 of file ActsMuonAlignCondAlg.cxx.

213 {
215 if (m_applyALines) {
217 writeHandle.addDependency(readHandle);
218 }
219 const bool issTGC = detType == ActsTrk::DetectorType::sTgc;
220 const bool isMm = detType == ActsTrk::DetectorType::Mm;
221 const bool isMdt = detType == ActsTrk::DetectorType::Mdt;
222
223 if (m_applyBLines&& (issTGC || isMm || isMdt)) {
225 writeHandle.addDependency(readHandle);
226 }
227 if (m_applyMdtAsBuilt && isMdt) {
229 writeHandle.addDependency(readHandle);
230 }
232 CREATE_READHANDLE(NswPassivationDbData, m_readNswPassivKey);
233 writeHandle.addDependency(readHandle);
234 }
235 if (m_applyNswAsBuilt && isMm) {
236 CREATE_READHANDLE(NswAsBuiltDbData, m_readNswAsBuiltKey);
237 writeHandle.addDependency(readHandle);
238 }
239 if(m_applyNswAsBuilt && issTGC && !m_readsTgcAsBuiltKey.empty()){
240 CREATE_READHANDLE(sTGCAsBuiltData, m_readsTgcAsBuiltKey);
241 writeHandle.addDependency(readHandle);
242 }
243 return StatusCode::SUCCESS;
244}
#define CREATE_READHANDLE(CONT_TYPE, KEY)
std::set< ALinePar, std::less<> > ALineContainer
std::set< MdtAsBuiltPar, std::less<> > MdtAsBuiltContainer
std::set< BLinePar, std::less<> > BLineContainer
Gaudi::Property< bool > m_applyMdtAsBuilt
SG::ReadCondHandleKey< NswAsBuiltDbData > m_readNswAsBuiltKey
Gaudi::Property< bool > m_applyMmPassivation
SG::ReadCondHandleKey< BLineContainer > m_readKeyBLines
Gaudi::Property< bool > m_applyNswAsBuilt
SG::ReadCondHandleKey< ALineContainer > m_readKeyALines
Gaudi::Property< bool > m_applyALines
Apply translations and rotations to align the Muon stations.
Gaudi::Property< bool > m_applyBLines
Apply the chamber deformation model (Mdts + Nsw)
SG::ReadCondHandleKey< NswPassivationDbData > m_readNswPassivKey
SG::ReadCondHandleKey< sTGCAsBuiltData > m_readsTgcAsBuiltKey
SG::ReadCondHandleKey< MdtAsBuiltContainer > m_readMdtAsBuiltKey
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
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 ActsMuonAlignCondAlg::execute ( const EventContext & ctx) const
overridevirtual

Create the condition handles

Append the alignable transformations to the conditions object

Propagate the cache throughout the geometry

Ensure that the rigid transformations of the detector elements are applied

There's no need to cache the delta parameters longer

The geoModel constants are no longer needed.

Whipe the GeoModelCache

Definition at line 246 of file ActsMuonAlignCondAlg.cxx.

246 {
247 deltaMap alignDeltas{};
248 alignTechMap techTransforms{};
249 unsigned int memBeforeAlign = GeoPerfUtils::getMem();
250 ATH_CHECK(loadDeltas(ctx, alignDeltas, techTransforms));
251
252 std::vector<const MuonReadoutElement*> readoutEles = m_detMgr->getAllReadoutElements();
254 unsigned int numAligned{0};
255 for (size_t det =0 ; det < m_techs.size(); ++det) {
256 const SG::WriteCondHandleKey<ActsTrk::DetectorAlignStore>& key = m_writeKeys[det];
257 const ActsTrk::DetectorType subDet = m_techs[det];
258
259 SG::WriteCondHandle<ActsTrk::DetectorAlignStore> writeHandle{key, ctx};
260 if (writeHandle.isValid()) {
261 ATH_MSG_VERBOSE("The alignment constants for "<<ActsTrk::to_string(subDet)
262 <<" are still valid.");
263 continue;
264 }
265 std::unique_ptr<ActsTrk::DetectorAlignStore> writeCdo = std::make_unique<ActsTrk::DetectorAlignStore>(subDet);
266
267 const std::set<const GeoAlignableTransform*>& toStore = techTransforms[subDet];
269 for (const GeoAlignableTransform* alignable : toStore) {
270 const std::shared_ptr<const Amg::Transform3D>& cached = alignDeltas[alignable];
271 if (!cached) continue;
272 writeCdo->geoModelAlignment->setDelta(alignable, alignDeltas[alignable]);
273 }
274 writeCdo->geoModelAlignment->lockDelta();
275 if (subDet == ActsTrk::DetectorType::Mdt) {
276 ATH_CHECK(loadMdtDeformPars(ctx,*writeCdo));
277 } else if (subDet == ActsTrk::DetectorType::Mm) {
278 ATH_CHECK(loadMmDeformPars(ctx, *writeCdo));
279 } else if (subDet == ActsTrk::DetectorType::sTgc) {
280 ATH_CHECK(loadStgcDeformPars(ctx, *writeCdo));
281 }
283 ATH_CHECK(declareDependencies(ctx, subDet, writeHandle));
286 for (const MuonReadoutElement* re : readoutEles) {
287 if (re->detectorType() == subDet) {
288 const Amg::Transform3D& detTrf{re->getMaterialGeom()->getAbsoluteTransform(writeCdo->geoModelAlignment.get())};
289 ATH_MSG_VERBOSE("Detector element "<<m_idHelperSvc->toStringDetEl(re->identify())<<" is located at "
290 <<Amg::toString(detTrf));
291 }
292 }
294 writeCdo->geoModelAlignment->getDeltas()->clear();
295 writeCdo->geoModelAlignment->lockPosCache();
296 } else if (m_fillAlignStoreCache) {
297 for (const MuonReadoutElement* re : readoutEles){
298 numAligned+= re->storeAlignedTransforms(*writeCdo);
299 }
301 writeCdo->geoModelAlignment.reset();
302 }
303 ATH_CHECK(writeHandle.record(std::move(writeCdo)));
304 }
305
306 ATH_MSG_VERBOSE("Only "<<numAligned<<" out of "<<readoutEles.size()<<" were picked up by the alignment cutalg");
307 alignDeltas.clear();
308 techTransforms.clear();
310 GeoClearAbsPosAction whipeTreeTop{};
311 for (unsigned int treeTop = 0 ; treeTop < m_detMgr->getNumTreeTops(); ++treeTop) {
312 m_detMgr->getTreeTop(treeTop)->exec(&whipeTreeTop);
313 }
314
315 unsigned int memAfterAlign = GeoPerfUtils::getMem();
316 ATH_MSG_INFO("Caching of the alignment parameters required "<<(memAfterAlign - memBeforeAlign) / 1024<<" MB of memory");
317 return StatusCode::SUCCESS;
318}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
StatusCode loadMmDeformPars(const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
StatusCode loadStgcDeformPars(const EventContext &ctx, ActsTrk::DetectorAlignStore &store) const
const MuonGMR4::MuonDetectorManager * m_detMgr
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 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...
std::unordered_map< const GeoAlignableTransform *, std::shared_ptr< const Amg::Transform3D > > deltaMap
Association map of the GeoAlignableTransforms with the rigid alignment transformations.
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...
Gaudi::Property< bool > m_fillGeoAlignStore
Flag toggling whether the GeoAlignmentStore shall be filled.
std::map< ActsTrk::DetectorType, std::set< const GeoAlignableTransform * > > alignTechMap
Association map of the GeoAlignable transforms with the detector technologies.
Gaudi::Property< bool > m_fillAlignStoreCache
Flag toggling whether the alignment store shall be filled with the transforms or not.
SG::WriteCondHandleKeyArray< ActsTrk::DetectorAlignStore > m_writeKeys
std::vector< ActsTrk::DetectorType > m_techs
StatusCode record(const EventIDRange &range, T *t)
record handle, with explicit range DEPRECATED
std::string to_string(const DetectorType &type)
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Eigen::Affine3d Transform3D
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 & AthCommonReentrantAlgorithm< 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 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

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

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode ActsMuonAlignCondAlg::initialize ( )
overridevirtual

Definition at line 26 of file ActsMuonAlignCondAlg.cxx.

26 {
27
33 ATH_CHECK(m_idHelperSvc.retrieve());
35 m_techs = m_detMgr->getDetectorTypes();
36 if (m_techs.empty()) {
37 ATH_MSG_FATAL("The detector manager does not contain any elements");
38 return StatusCode::FAILURE;
39 }
40 auto hasDetector = [this](const ActsTrk::DetectorType d) -> bool {
41 return std::find(m_techs.begin(),m_techs.end(), d) != m_techs.end();
42 };
43
45 hasDetector(ActsTrk::DetectorType::Mm) ||
46 hasDetector(ActsTrk::DetectorType::sTgc));
49 hasDetector(ActsTrk::DetectorType::sTgc));
51
52
53
54 for (const ActsTrk::DetectorType det : m_techs) {
55 m_writeKeys.emplace_back(ActsTrk::to_string(det) + m_keyToken);
56 ATH_MSG_INFO("Register new alignment container "<<m_writeKeys.back().fullKey());
57 }
58 ATH_MSG_INFO("Switched options "<<m_fillAlignStoreCache<<", "<<", "<<m_applyALines<<", "
59 <<m_applyBLines<<", "<<m_applyMdtAsBuilt<<", "
61 ATH_CHECK(m_writeKeys.initialize());
62 return StatusCode::SUCCESS;
63}
#define ATH_MSG_FATAL(x)
Gaudi::Property< std::string > m_keyToken
const ServiceHandle< StoreGateSvc > & detStore() const
retrieve(aClass, aKey=None)
Definition PyKernel.py:110

◆ 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()

◆ isReEntrant()

virtual bool ActsMuonAlignCondAlg::isReEntrant ( ) const
inlineoverridevirtual

Definition at line 35 of file ActsMuonAlignCondAlg.h.

35{ return false; }

◆ loadDeltas()

StatusCode ActsMuonAlignCondAlg::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 82 of file ActsMuonAlignCondAlg.cxx.

84 {
85 if (m_readKeyALines.empty()) {
86 ATH_MSG_DEBUG("Loading of the A line parameters deactivated");
87 return StatusCode::SUCCESS;
88 }
89
91 const ALineContainer* aLineContainer{*readHandle};
92 std::vector<const MuonReadoutElement*> readoutEles = m_detMgr->getAllReadoutElements();
93 ATH_MSG_INFO("Load the alignment of "<<readoutEles.size()<<" detector elements");
94 for (const MuonReadoutElement* re : readoutEles) {
95 const GeoAlignableTransform* alignTrans = re->alignableTransform();
96 if (!alignTrans) {
97 ATH_MSG_WARNING("The readout element "<<m_idHelperSvc->toStringDetEl(re->identify())
98 <<" has no alignable transform.");
99 continue;
100 }
101 std::shared_ptr<const Amg::Transform3D>& cached = alignDeltas[alignTrans];
102 if (cached) {
103 ATH_MSG_DEBUG("The alignable transformation for "<<m_idHelperSvc->toStringChamber(re->identify())
104 <<" has been cached before. ");
105 techTransforms[re->detectorType()].insert(alignTrans);
106 continue;
107 }
109 const Identifier stationId = alignmentId(re);
110 ALineContainer::const_iterator aLineItr = aLineContainer->find(stationId);
111 if (aLineItr == aLineContainer->end()) {
112 ATH_MSG_VERBOSE("No Alines were stored for "<<m_idHelperSvc->toString(re->identify())
113 <<". Used "<<m_idHelperSvc->toString(stationId)<<" as station Identifier");
114 continue;
115 }
117 cached = std::make_shared<Amg::Transform3D>(aLineItr->delta());
118 techTransforms[re->detectorType()].insert(alignTrans);
119 }
120 return StatusCode::SUCCESS;
121}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Identifier alignmentId(const MuonGMR4::MuonReadoutElement *reElement) const
Returns the Identifier serving as key to find the alignment parameters connected with the readout ele...

◆ loadMdtDeformPars()

StatusCode ActsMuonAlignCondAlg::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 122 of file ActsMuonAlignCondAlg.cxx.

123 {
124
126 return StatusCode::SUCCESS;
127 }
128 std::unique_ptr<MdtAlignmentStore> internAlign = std::make_unique<MdtAlignmentStore>(m_idHelperSvc.get());
129 const MdtAsBuiltContainer* asBuiltCont{nullptr};
130 const BLineContainer* bLines{nullptr};
131 if (m_applyMdtAsBuilt) {
133 asBuiltCont = readHandle.cptr();
134 }
135 if (m_applyBLines) {
137 bLines = readHandle.cptr();
138 }
139 const MdtIdHelper& idHelper{m_idHelperSvc->mdtIdHelper()};
140 for (auto itr = idHelper.module_begin(); itr != idHelper.module_end(); ++itr) {
141 const Identifier& stationId{*itr};
142 const BLinePar* bline{nullptr};
143 if (bLines) {
144 BLineContainer::const_iterator itr = bLines->find(stationId);
145 if (itr != bLines->end()) bline = &(*itr);
146 }
147 const MdtAsBuiltPar* asBuilt{nullptr};
148 if (asBuiltCont) {
149 MdtAsBuiltContainer::const_iterator itr = asBuiltCont->find(stationId);
150 if (itr != asBuiltCont->end()) asBuilt = &(*itr);
151 }
152 if (asBuilt || bline) internAlign->storeDistortion(stationId, bline, asBuilt);
153 }
154 // Down cast the alignment pointer
155 store.internalAlignment = std::move(internAlign);
156 return StatusCode::SUCCESS;
157}
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 ActsMuonAlignCondAlg::loadMmDeformPars ( const EventContext & ctx,
ActsTrk::DetectorAlignStore & store ) const
private

Replace it by the vector of MmReadout elements once these are implemented

Definition at line 158 of file ActsMuonAlignCondAlg.cxx.

159 {
161 return StatusCode::SUCCESS;
162 }
163 std::unique_ptr<MmAlignmentStore> internAlign = std::make_unique<MmAlignmentStore>();
165 CREATE_READHANDLE(NswPassivationDbData, m_readNswPassivKey);
166 internAlign->passivation = readHandle.cptr();
167 }
168 if (m_applyNswAsBuilt) {
169 CREATE_READHANDLE(NswAsBuiltDbData, m_readNswAsBuiltKey);
170 internAlign->asBuiltPars = readHandle->microMegaData;
171 }
172 if (m_applyBLines) {
175 std::vector<const MuonReadoutElement*> reEles = m_detMgr->getAllReadoutElements();
176 for (const MuonReadoutElement* re : reEles){
177 if (re->detectorType() != ActsTrk::DetectorType::Mm) continue;
178 const Identifier stationId = alignmentId(re);
179 BLineContainer::const_iterator itr = readHandle->find(stationId);
180 if (itr != readHandle->end()) internAlign->cacheBLine(re->identify(), *itr);
181 }
182 }
183 store.internalAlignment = std::move(internAlign);
184 return StatusCode::SUCCESS;
185}

◆ loadStgcDeformPars()

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

Replace it by the vector of MmReadout elements once these are implemented

Definition at line 186 of file ActsMuonAlignCondAlg.cxx.

187 {
189 return StatusCode::SUCCESS;
190 }
191 std::unique_ptr<sTgcAlignmentStore> internalAlign = std::make_unique<sTgcAlignmentStore>();
192 if (m_applyNswAsBuilt && !m_readsTgcAsBuiltKey.empty()) {
193 CREATE_READHANDLE(sTGCAsBuiltData, m_readsTgcAsBuiltKey);
194 internalAlign->asBuiltPars = *readHandle;
195 }
196 if (m_applyBLines) {
199 std::vector<const MuonReadoutElement*> reEles = m_detMgr->getAllReadoutElements();
200 for (const MuonReadoutElement* re : reEles){
201 if (re->detectorType() != ActsTrk::DetectorType::sTgc) continue;
202 const Identifier stationId = alignmentId(re);
203 BLineContainer::const_iterator itr = readHandle->find(stationId);
204 if (itr != readHandle->end()) internalAlign->cacheBLine(re->identify(), *itr);
205 }
206 }
207 store.internalAlignment = std::move(internalAlign);
208 return StatusCode::SUCCESS;
209}

◆ 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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< 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.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< 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 HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_ERROR(x)
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> ActsMuonAlignCondAlg::m_applyALines {this, "applyALines", false}
private

Apply translations and rotations to align the Muon stations.

Definition at line 101 of file ActsMuonAlignCondAlg.h.

101{this, "applyALines", false};

◆ m_applyBLines

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

Apply the chamber deformation model (Mdts + Nsw)

Definition at line 103 of file ActsMuonAlignCondAlg.h.

103{this, "applyBLines", false};

◆ m_applyMdtAsBuilt

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

Definition at line 98 of file ActsMuonAlignCondAlg.h.

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

◆ m_applyMmPassivation

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

Definition at line 93 of file ActsMuonAlignCondAlg.h.

93{this, "applyMmPassivation", false};

◆ m_applyNswAsBuilt

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

Definition at line 95 of file ActsMuonAlignCondAlg.h.

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

◆ m_detMgr

const MuonGMR4::MuonDetectorManager* ActsMuonAlignCondAlg::m_detMgr {nullptr}
private

Definition at line 91 of file ActsMuonAlignCondAlg.h.

91{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 AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

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

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_fillAlignStoreCache

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

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

Definition at line 105 of file ActsMuonAlignCondAlg.h.

105{this, "FillAlignCache", false};

◆ m_fillGeoAlignStore

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

Flag toggling whether the GeoAlignmentStore shall be filled.

Definition at line 107 of file ActsMuonAlignCondAlg.h.

107{this, "FillGeoAlignStore", true};

◆ m_idHelperSvc

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

Definition at line 89 of file ActsMuonAlignCondAlg.h.

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

◆ m_keyToken

Gaudi::Property<std::string> ActsMuonAlignCondAlg::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 ActsMuonAlignCondAlg.h.

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

◆ m_readKeyALines

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

Definition at line 70 of file ActsMuonAlignCondAlg.h.

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

◆ m_readKeyBLines

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

Definition at line 73 of file ActsMuonAlignCondAlg.h.

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

◆ m_readMdtAsBuiltKey

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

Definition at line 76 of file ActsMuonAlignCondAlg.h.

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

◆ m_readNswAsBuiltKey

SG::ReadCondHandleKey<NswAsBuiltDbData> ActsMuonAlignCondAlg::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 ActsMuonAlignCondAlg.h.

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

◆ m_readNswPassivKey

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

Definition at line 82 of file ActsMuonAlignCondAlg.h.

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

◆ m_readsTgcAsBuiltKey

SG::ReadCondHandleKey<sTGCAsBuiltData> ActsMuonAlignCondAlg::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 ActsMuonAlignCondAlg.h.

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

◆ m_techs

std::vector<ActsTrk::DetectorType> ActsMuonAlignCondAlg::m_techs {}
private

Definition at line 68 of file ActsMuonAlignCondAlg.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> ActsMuonAlignCondAlg::m_writeKeys
private
Initial value:
{this, "WriteKeys", {},
"Keys of the alignment technologies"}

Definition at line 85 of file ActsMuonAlignCondAlg.h.

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

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