ATLAS Offline Software
Loading...
Searching...
No Matches
GeoModelTrfCacheAlg.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
5
8
9namespace MuonG4{
11 ATH_CHECK(detStore()->retrieve(m_detMgr));
12 ATH_CHECK(m_writeKey.initialize());
13 try {
14 m_type = static_cast<ActsTrk::DetectorType>(m_detType.value());
15 } catch (const std::exception& what) {
16 ATH_MSG_FATAL("Invalid detType is configured " << m_detType);
17 return StatusCode::FAILURE;
18 }
20 ATH_MSG_FATAL("Please configure the detType " << m_detType
21 << " to be something not undefined");
22 return StatusCode::FAILURE;
23 }
24 return StatusCode::SUCCESS;
25 }
26 StatusCode GeoModelTrfCacheAlg::execute(const EventContext& ctx) const {
27 SG::WriteCondHandle writeHandle{m_writeKey, ctx};
28 if (writeHandle.isValid()) {
29 ATH_MSG_DEBUG("Nothing needs to be done for " << ctx.eventID().event_number());
30 return StatusCode::SUCCESS;
31 }
32 writeHandle.addDependency(EventIDRange(IOVInfiniteRange::infiniteTime()));
33
34 auto trfCache = std::make_unique<ActsTrk::DetectorAlignStore>(m_type);
35 std::ranges::for_each(m_detMgr->getAllReadoutElements(),
37 if (re->detectorType() == m_type){
38 re->getMaterialGeom()->getAbsoluteTransform(trfCache->geoModelAlignment.get());
39 re->getMaterialGeom()->clearPositionInfo();
40 }
41 });
42 ATH_CHECK(writeHandle.record(std::move(trfCache)));
43 return StatusCode::SUCCESS;
44 }
45}
const boost::regex re(r_e)
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_FATAL(x)
#define ATH_MSG_DEBUG(x)
const ServiceHandle< StoreGateSvc > & detStore() const
static EventIDRange infiniteTime()
Produces an EventIDRange that is inifinite in Time and invalid in RunLumi.
Gaudi::Property< int > m_detType
Flag determining the subdetector. Needs to be static castable to DetectorType.
virtual StatusCode execute(const EventContext &ctx) const override final
const MuonGMR4::MuonDetectorManager * m_detMgr
SG::WriteCondHandleKey< ActsTrk::DetectorAlignStore > m_writeKey
virtual StatusCode initialize() override final
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
void addDependency(const EventIDRange &range)
DetectorType
Simple enum to Identify the Type of the ACTS sub detector.
@ UnDefined
Small Thing Gap chambers (NSW)