ATLAS Offline Software
MuonReadoutGeomCnvAlg.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_MUONREADOUTGEOMCNVALG_H
5 #define MUONGEOMETRYCNV_MUONREADOUTGEOMCNVALG_H
6 
7 #include "TrkSurfaces/Surface.h" // Work around cppcheck false positive
12 
16 
17 #include "GeoModelKernel/GeoTransform.h"
18 #include "GeoModelHelpers/TransformSorter.h"
19 #include "GeoModelKernel/GeoVFullPhysVol.h"
20 #include "GeoModelKernel/GeoIdentifierTag.h"
21 
24 
32  public:
33  MuonReadoutGeomCnvAlg(const std::string& name, ISvcLocator* pSvcLocator);
35 
36  StatusCode execute(const EventContext& ctx) const override;
37  StatusCode initialize() override;
38  bool isReEntrant() const override { return false; }
39 
40  private:
42  public:
43  ConstructionCache() = default;
44 
48  GeoIntrusivePtr<GeoTransform> makeTransform(const Amg::Transform3D& trf) {
49  return *m_trfPool.insert(make_intrusive<GeoTransform>(trf)).first;
50  }
52  std::unique_ptr<MuonGM::MuonDetectorManager> detMgr{};
54  PVLink world{};
56  std::set<PVConstLink> translatedStations{};
58  GeoIntrusivePtr<GeoIdentifierTag> newIdTag() {
59  return make_intrusive<GeoIdentifierTag>(++m_id);
60  }
61  private:
62  std::set<GeoIntrusivePtr<GeoTransform>, GeoTrf::TransformSorter> m_trfPool{};
63  unsigned int m_id{0};
64 
65  };
66 
73  const Identifier& stationId,
74  ConstructionCache& cacheObj) const;
80  const Identifier& stationId,
81  ConstructionCache& cacheObj,
82  GeoIntrusivePtr<GeoVFullPhysVol>& clonedPhysVol,
83  MuonGM::MuonStation* & station) const;
85  GeoIntrusivePtr<GeoVFullPhysVol> cloneNswWedge(const ActsGeometryContext& gctx,
86  const MuonGMR4::MuonReadoutElement* nswRE,
87  ConstructionCache& cacheObj) const;
88 
90  ConstructionCache& cacheObj) const;
91 
93  ConstructionCache& cacheObj) const;
94 
96  ConstructionCache& cacheObj) const;
97 
99  ConstructionCache& cacheObj) const;
100 
102  ConstructionCache& cacheObj) const;
103 
104 
106  const MuonGMR4::RpcReadoutElement& refEle,
107  const MuonGM::RpcReadoutElement& testEle) const;
108 
110  const MuonGMR4::MdtReadoutElement& refEle,
111  const MuonGM::MdtReadoutElement& testEle) const;
112 
114  const MuonGMR4::MmReadoutElement& refEle,
115  const MuonGM::MMReadoutElement& testEle) const;
116 
118  const MuonGMR4::TgcReadoutElement& refEle,
119  const MuonGM::TgcReadoutElement& testEle) const;
120 
122  const MuonGMR4::sTgcReadoutElement& refEle,
123  const MuonGM::sTgcReadoutElement& testEle) const;
124 
126  const MuonGM::MuonReadoutElement& testEle) const;
127 
128  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"};
129 
130  SG::WriteCondHandleKey<MuonGM::MuonDetectorManager> m_writeKey{this, "WriteKey", "MuonDetectorManager"};
131 
133 
134  Gaudi::Property<bool> m_checkGeo{this, "checkGeo", false, "Checks the positions of the sensors"};
136 
137 
138 
139 };
140 
141 #endif
MuonReadoutGeomCnvAlg::buildMM
StatusCode buildMM(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:451
MuonReadoutGeomCnvAlg
The MuonReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the lega...
Definition: MuonReadoutGeomCnvAlg.h:31
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:18
MuonReadoutGeomCnvAlg::ConstructionCache::translatedStations
std::set< PVConstLink > translatedStations
Set of all translated Physical volumes.
Definition: MuonReadoutGeomCnvAlg.h:56
MuonReadoutGeomCnvAlg::ConstructionCache::newIdTag
GeoIntrusivePtr< GeoIdentifierTag > newIdTag()
Returns an identifier tag.
Definition: MuonReadoutGeomCnvAlg.h:58
MuonReadoutGeomCnvAlg::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: MuonReadoutGeomCnvAlg.cxx:236
Surface.h
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:61
ActsGeometryContext.h
MuonReadoutGeomCnvAlg::m_checkGeo
Gaudi::Property< bool > m_checkGeo
Definition: MuonReadoutGeomCnvAlg.h:134
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
MuonGM::RpcReadoutElement
An RpcReadoutElement corresponds to a single RPC module; therefore typicaly a barrel muon station con...
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h:54
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
MuonReadoutGeomCnvAlg::ConstructionCache::world
PVLink world
Pointer to the world.
Definition: MuonReadoutGeomCnvAlg.h:54
MuonGMR4::RpcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:14
MuonReadoutGeomCnvAlg::ConstructionCache::detMgr
std::unique_ptr< MuonGM::MuonDetectorManager > detMgr
Pointer to the legacy MuonDetectorManager.
Definition: MuonReadoutGeomCnvAlg.h:52
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
MuonReadoutGeomCnvAlg::isReEntrant
bool isReEntrant() const override
Definition: MuonReadoutGeomCnvAlg.h:38
MuonReadoutGeomCnvAlg::ConstructionCache
Definition: MuonReadoutGeomCnvAlg.h:41
MuonReadoutGeomCnvAlg::dumpAndCompare
StatusCode dumpAndCompare(const ActsGeometryContext &gctx, const MuonGMR4::RpcReadoutElement &refEle, const MuonGM::RpcReadoutElement &testEle) const
Definition: MuonReadoutGeomCnvAlg.cxx:821
MuonGM::MdtReadoutElement
Definition: MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/MdtReadoutElement.h:50
MuonReadoutGeomCnvAlg::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonReadoutGeomCnvAlg.h:128
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
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:28
Amg::Transform3D
Eigen::Affine3d Transform3D
Definition: GeoPrimitives.h:46
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
MuonReadoutGeomCnvAlg::m_writeKey
SG::WriteCondHandleKey< MuonGM::MuonDetectorManager > m_writeKey
Definition: MuonReadoutGeomCnvAlg.h:130
MuonReadoutGeomCnvAlg::cloneNswWedge
GeoIntrusivePtr< GeoVFullPhysVol > cloneNswWedge(const ActsGeometryContext &gctx, const MuonGMR4::MuonReadoutElement *nswRE, ConstructionCache &cacheObj) const
Clones the fullPhysicalVolume of the
Definition: MuonReadoutGeomCnvAlg.cxx:438
MuonReadoutElement.h
CondHandleKeyArray.h
MuonReadoutGeomCnvAlg::ConstructionCache::m_id
unsigned int m_id
Definition: MuonReadoutGeomCnvAlg.h:63
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:28
ReadCondHandleKey.h
AthReentrantAlgorithm.h
MuonReadoutGeomCnvAlg::buildTgc
StatusCode buildTgc(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:340
MuonReadoutGeomCnvAlg::buildRpc
StatusCode buildRpc(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:261
MuonReadoutGeomCnvAlg::m_alignStoreKeys
SG::ReadCondHandleKeyArray< ActsTrk::DetectorAlignStore > m_alignStoreKeys
Definition: MuonReadoutGeomCnvAlg.h:132
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:15
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
MuonReadoutGeomCnvAlg::MuonReadoutGeomCnvAlg
MuonReadoutGeomCnvAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: MuonReadoutGeomCnvAlg.cxx:65
MuonReadoutGeomCnvAlg::m_detMgr
const MuonGMR4::MuonDetectorManager * m_detMgr
Definition: MuonReadoutGeomCnvAlg.h:135
MuonReadoutGeomCnvAlg::initialize
StatusCode initialize() override
Definition: MuonReadoutGeomCnvAlg.cxx:68
MuonDetectorManager.h
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:19
MuonReadoutGeomCnvAlg::ConstructionCache::ConstructionCache
ConstructionCache()=default
MuonGM::MMReadoutElement
An MMReadoutElement corresponds to a single STGC module; therefore typicaly a barrel muon station con...
Definition: MMReadoutElement.h:23
SG::WriteCondHandleKey< MuonGM::MuonDetectorManager >
MuonReadoutGeomCnvAlg::ConstructionCache::makeTransform
GeoIntrusivePtr< GeoTransform > makeTransform(const Amg::Transform3D &trf)
Transforms an Amg::Transform3D into a GeoModelTransform node If the transform has been shown before t...
Definition: MuonReadoutGeomCnvAlg.h:48
MuonReadoutGeomCnvAlg::~MuonReadoutGeomCnvAlg
~MuonReadoutGeomCnvAlg()=default
CaloLCW_tf.trf
trf
Definition: CaloLCW_tf.py:20
MuonReadoutGeomCnvAlg::buildStation
StatusCode buildStation(const ActsGeometryContext &gctx, const Identifier &stationId, ConstructionCache &cacheObj) const
builds a station object from readout element.
Definition: MuonReadoutGeomCnvAlg.cxx:145
MuonReadoutGeomCnvAlg::buildMdt
StatusCode buildMdt(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:608
MuonReadoutGeomCnvAlg::checkIdCompability
StatusCode checkIdCompability(const MuonGMR4::MuonReadoutElement &refEle, const MuonGM::MuonReadoutElement &testEle) const
Definition: MuonReadoutGeomCnvAlg.cxx:702
MuonReadoutGeomCnvAlg::ConstructionCache::m_trfPool
std::set< GeoIntrusivePtr< GeoTransform >, GeoTrf::TransformSorter > m_trfPool
Definition: MuonReadoutGeomCnvAlg.h:62
MuonGMR4::TgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/TgcReadoutElement.h:16
IMuonIdHelperSvc.h
ServiceHandle< Muon::IMuonIdHelperSvc >
MuonReadoutGeomCnvAlg::execute
StatusCode execute(const EventContext &ctx) const override
Definition: MuonReadoutGeomCnvAlg.cxx:77
MuonReadoutGeomCnvAlg::buildSTGC
StatusCode buildSTGC(const ActsGeometryContext &gctx, ConstructionCache &cacheObj) const
Definition: MuonReadoutGeomCnvAlg.cxx:506