ATLAS Offline Software
ReadoutGeomCnvAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONGEOMETRYCNV_ReadoutGeomCnvAlg_H
5 #define MUONGEOMETRYCNV_ReadoutGeomCnvAlg_H
6 
7 #include "TrkSurfaces/Surface.h" // Work around cppcheck false positive
12 
16 
17 #include "GeoModelKernel/GeoTransform.h"
18 #include "GeoModelHelpers/GeoDeDuplicator.h"
19 #include "GeoModelKernel/GeoVFullPhysVol.h"
20 #include "GeoModelKernel/GeoIdentifierTag.h"
21 
24 
31 namespace MuonGMR4{
33  public:
34  ReadoutGeomCnvAlg(const std::string& name, ISvcLocator* pSvcLocator);
35  ~ReadoutGeomCnvAlg() = default;
36 
37  StatusCode execute(const EventContext& ctx) const override;
38  StatusCode initialize() override;
39  bool isReEntrant() const override { return false; }
40 
41  private:
42  struct ConstructionCache: public GeoDeDuplicator {
43  public:
44  ConstructionCache() = default;
46  std::unique_ptr<MuonGM::MuonDetectorManager> detMgr{};
48  PVLink world{};
50  std::set<PVConstLink> translatedStations{};
52  GeoIntrusivePtr<GeoIdentifierTag> newIdTag() {
53  return make_intrusive<GeoIdentifierTag>(++m_id);
54  }
55  private:
56  unsigned int m_id{0};
57 
58  };
59 
66  const Identifier& stationId,
67  ConstructionCache& cacheObj) const;
73  const Identifier& stationId,
74  ConstructionCache& cacheObj,
75  GeoIntrusivePtr<GeoVFullPhysVol>& clonedPhysVol,
76  MuonGM::MuonStation* & station) const;
78  GeoIntrusivePtr<GeoVFullPhysVol> cloneNswWedge(const ActsGeometryContext& gctx,
79  const MuonGMR4::MuonReadoutElement* nswRE,
80  ConstructionCache& cacheObj) const;
81 
83  ConstructionCache& cacheObj) const;
84 
86  ConstructionCache& cacheObj) const;
87 
89  ConstructionCache& cacheObj) const;
90 
92  ConstructionCache& cacheObj) const;
93 
95  ConstructionCache& cacheObj) const;
96 
97 
99  const MuonGMR4::RpcReadoutElement& refEle,
100  const MuonGM::RpcReadoutElement& testEle) const;
101 
103  const MuonGMR4::MdtReadoutElement& refEle,
104  const MuonGM::MdtReadoutElement& testEle) const;
105 
107  const MuonGMR4::MmReadoutElement& refEle,
108  const MuonGM::MMReadoutElement& testEle) const;
109 
111  const MuonGMR4::TgcReadoutElement& refEle,
112  const MuonGM::TgcReadoutElement& testEle) const;
113 
115  const MuonGMR4::sTgcReadoutElement& refEle,
116  const MuonGM::sTgcReadoutElement& testEle) const;
117 
119  const MuonGM::MuonReadoutElement& testEle) const;
120 
121  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
122 
123  SG::WriteCondHandleKey<MuonGM::MuonDetectorManager> m_writeKey{this, "WriteKey", "MuonDetectorManager"};
124 
126 
127  Gaudi::Property<bool> m_checkGeo{this, "checkGeo", false, "Checks the positions of the sensors"};
129 
130 };
131 }
132 #endif
MuonGMR4::ReadoutGeomCnvAlg::buildSTGC
StatusCode buildSTGC(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: ReadoutGeomCnvAlg.cxx:533
MuonGMR4::ReadoutGeomCnvAlg::buildMdt
StatusCode buildMdt(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: ReadoutGeomCnvAlg.cxx:635
MuonGMR4::ReadoutGeomCnvAlg::dumpAndCompare
StatusCode dumpAndCompare(const ActsGeometryContext &gctx, const MuonGMR4::RpcReadoutElement &refEle, const MuonGM::RpcReadoutElement &testEle) const
Definition: ReadoutGeomCnvAlg.cxx:852
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:19
MuonGMR4::ReadoutGeomCnvAlg::cloneReadoutVolume
StatusCode cloneReadoutVolume(const ActsGeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj, GeoIntrusivePtr< GeoVFullPhysVol > &clonedPhysVol, MuonGM::MuonStation *&station) const
Clones the fullPhysical volume of the readoutElement and embeds it into the associated station.
Definition: ReadoutGeomCnvAlg.cxx:240
MuonGMR4::ReadoutGeomCnvAlg::ConstructionCache::newIdTag
GeoIntrusivePtr< GeoIdentifierTag > newIdTag()
Returns an identifier tag.
Definition: ReadoutGeomCnvAlg.h:52
MuonGMR4::ReadoutGeomCnvAlg::buildStation
StatusCode buildStation(const ActsGeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj) const
builds a station object from readout element.
Definition: ReadoutGeomCnvAlg.cxx:146
Surface.h
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
MuonGMR4::ReadoutGeomCnvAlg::buildTgc
StatusCode buildTgc(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: ReadoutGeomCnvAlg.cxx:368
ActsGeometryContext.h
MuonGMR4::ReadoutGeomCnvAlg::ConstructionCache::world
PVLink world
Pointer to the world.
Definition: ReadoutGeomCnvAlg.h:48
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
WriteCondHandleKey.h
MuonGMR4::ReadoutGeomCnvAlg::ConstructionCache::ConstructionCache
ConstructionCache()=default
MuonGMR4::ReadoutGeomCnvAlg::~ReadoutGeomCnvAlg
~ReadoutGeomCnvAlg()=default
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:55
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
MuonGMR4::ReadoutGeomCnvAlg::m_alignStoreKeys
SG::ReadCondHandleKeyArray< ActsTrk::DetectorAlignStore > m_alignStoreKeys
Definition: ReadoutGeomCnvAlg.h:125
MuonGMR4::ReadoutGeomCnvAlg::buildMM
StatusCode buildMM(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: ReadoutGeomCnvAlg.cxx:479
MuonGMR4::ReadoutGeomCnvAlg::ConstructionCache::detMgr
std::unique_ptr< MuonGM::MuonDetectorManager > detMgr
Pointer to the legacy MuonDetectorManager.
Definition: ReadoutGeomCnvAlg.h:46
MuonGMR4::ReadoutGeomCnvAlg::m_checkGeo
Gaudi::Property< bool > m_checkGeo
Definition: ReadoutGeomCnvAlg.h:127
MuonGMR4::RpcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:17
MuonGMR4::ReadoutGeomCnvAlg::buildRpc
StatusCode buildRpc(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: ReadoutGeomCnvAlg.cxx:280
MuonGMR4::ReadoutGeomCnvAlg::checkIdCompability
StatusCode checkIdCompability(const MuonGMR4::MuonReadoutElement &refEle, const MuonGM::MuonReadoutElement &testEle) const
Definition: ReadoutGeomCnvAlg.cxx:730
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:83
MuonGM::MuonReadoutElement
Base class for the XxxReadoutElement, with Xxx = Mdt, Rpc, Tgc, Csc.
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MuonReadoutElement.h:40
MuonGMR4::ReadoutGeomCnvAlg::ConstructionCache::m_id
unsigned int m_id
Definition: ReadoutGeomCnvAlg.h:56
MuonGMR4::ReadoutGeomCnvAlg::cloneNswWedge
GeoIntrusivePtr< GeoVFullPhysVol > cloneNswWedge(const ActsGeometryContext &gctx, const MuonGMR4::MuonReadoutElement *nswRE, ConstructionCache &cacheObj) const
Clones the fullPhysicalVolume of the
Definition: ReadoutGeomCnvAlg.cxx:466
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:20
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:51
MuonGMR4::ReadoutGeomCnvAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: ReadoutGeomCnvAlg.cxx:78
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
MuonGM::sTgcReadoutElement
An sTgcReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station c...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/sTgcReadoutElement.h:30
MuonGM::MuonStation
Definition: MuonStation.h:51
MuonDetectorManager.h
MuonGM::TgcReadoutElement
A TgcReadoutElement corresponds to a single TGC chamber; therefore typically a TGC station contains s...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.h:42
MuonReadoutElement.h
CondHandleKeyArray.h
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
MuonGMR4::ReadoutGeomCnvAlg::ConstructionCache::translatedStations
std::set< PVConstLink > translatedStations
Set of all translated Physical volumes.
Definition: ReadoutGeomCnvAlg.h:50
ReadCondHandleKey.h
AthReentrantAlgorithm.h
MuonGMR4::ReadoutGeomCnvAlg::isReEntrant
bool isReEntrant() const override
Definition: ReadoutGeomCnvAlg.h:39
MuonGMR4::ReadoutGeomCnvAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: ReadoutGeomCnvAlg.h:121
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:22
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonDetectorManager.h
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:20
MuonGMR4::ReadoutGeomCnvAlg
Definition: ReadoutGeomCnvAlg.h:32
MuonGMR4::ReadoutGeomCnvAlg::initialize
StatusCode initialize() override
Definition: ReadoutGeomCnvAlg.cxx:69
MuonGMR4::ReadoutGeomCnvAlg::ReadoutGeomCnvAlg
ReadoutGeomCnvAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ReadoutGeomCnvAlg.cxx:66
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:25
SG::WriteCondHandleKey< MuonGM::MuonDetectorManager >
MuonGMR4::ReadoutGeomCnvAlg::ConstructionCache
Definition: ReadoutGeomCnvAlg.h:42
MuonGMR4::ReadoutGeomCnvAlg::m_writeKey
SG::WriteCondHandleKey< MuonGM::MuonDetectorManager > m_writeKey
Definition: ReadoutGeomCnvAlg.h:123
MuonGMR4::TgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/TgcReadoutElement.h:19
IMuonIdHelperSvc.h
MuonGMR4::ReadoutGeomCnvAlg::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: ReadoutGeomCnvAlg.h:128
ServiceHandle< Muon::IMuonIdHelperSvc >
Identifier
Definition: IdentifierFieldParser.cxx:14