ATLAS Offline Software
MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 #ifndef MUONREADOUTGEOMETRY_MUONDETECTORMANAGER_H
5 #define MUONREADOUTGEOMETRY_MUONDETECTORMANAGER_H
6 
10 #include "AthenaKernel/CLASS_DEF.h"
11 #include "GaudiKernel/ServiceHandle.h"
12 #include "GeoModelKernel/GeoVDetectorManager.h"
14 
15 #include <map>
16 #include <memory>
17 
36 
38 #define DECLARE_GETTERSETTER(ELE_TYPE, GETTER, SETTER) \
39  ELE_TYPE* GETTER(const IdentifierHash& hash); \
40  ELE_TYPE* GETTER(const Identifier& hash); \
41  \
42  const ELE_TYPE* GETTER(const IdentifierHash& hash) const; \
43  const ELE_TYPE* GETTER(const Identifier& hash) const; \
44  \
45  StatusCode SETTER(ElementPtr<ELE_TYPE> element);
46 
47 #define DECLARE_ELEMENT(ELE_TYPE) \
48  DECLARE_GETTERSETTER(ELE_TYPE, get##ELE_TYPE, add##ELE_TYPE) \
49  \
50  std::vector<const ELE_TYPE*> getAll##ELE_TYPE##s() const; \
51  std::vector<ELE_TYPE*> getAll##ELE_TYPE##s();
52 namespace MuonGMR4 {
53 
54 class MdtReadoutElement;
55 class TgcReadoutElement;
56 class RpcReadoutElement;
57 class sTgcReadoutElement;
58 class MmReadoutElement;
59 class SpectrometerSector;
60 class Chamber;
61 
62 class MuonDetectorManager : public GeoVDetectorManager, public AthMessaging {
63 
64  public:
67 
68  template <class MuonDetectorType>
69  using ElementPtr = std::unique_ptr<MuonDetectorType>;
70  template <class MuonDetectorType>
71  using ElementStorage = std::vector<ElementPtr<MuonDetectorType>>;
72 
79 
80 
81  unsigned int getNumTreeTops() const override final;
84  PVConstLink getTreeTop(unsigned int i) const override final;
86  void addTreeTop(PVConstLink pv);
88  const Muon::IMuonIdHelperSvc* idHelperSvc() const;
89 
96 
97 #ifndef SIMULATIONBASE
98 
106  const Chamber* getChamber(const Identifier& channelId) const;
107 
110  bool operator()(const SpectrometerSector* a, const SpectrometerSector* b) const;
111  bool operator()(const Chamber* a, const Chamber* b) const;
112  };
113  using MuonSectorSet = std::set<const SpectrometerSector*, MSEnvelopeSorter>;
114  using MuonChamberSet = std::set<const Chamber*, MSEnvelopeSorter>;
118 #endif
119 
121  std::vector<ActsTrk::DetectorType> getDetectorTypes() const;
122  private:
127  template <class MuonDetectorType> void linkElements(ElementStorage<MuonDetectorType>& allStore,
128  MuonDetectorType* readOutEle);
129 
130  ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
131  "MuonDetectorManager"};
132 #ifndef SIMULATIONBASE
134 #endif
140 
141  std::vector<PVConstLink> m_treeTopVector{};
142 
143 
144 };
145 
146 template <> void MuonDetectorManager::linkElements(ElementStorage<MdtReadoutElement>& detStore, MdtReadoutElement* refEle);
147 
148 } // namespace MuonGMR4
149 
152 #undef DECLARE_GETTERSETTER
153 #undef DECLARE_ELEMENT
155 #endif
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:19
MuonGMR4::MuonDetectorManager::getDetectorTypes
std::vector< ActsTrk::DetectorType > getDetectorTypes() const
Returns a list of all detector types.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:143
xAOD::L2MuonParameters::Chamber
Chamber
Define chamber types and locations.
Definition: TrigMuonDefs.h:15
MuonGMR4::SpectrometerSector
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
Definition: SpectrometerSector.h:40
MuonGMR4::MuonDetectorManager::MuonSectorSet
std::set< const SpectrometerSector *, MSEnvelopeSorter > MuonSectorSet
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:113
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:62
MuonGMR4::MuonDetectorManager::m_tgcEles
ElementStorage< TgcReadoutElement > m_tgcEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:136
MuonGMR4::MuonDetectorManager::m_secEnvelopes
ElementStorage< SpectrometerSector > m_secEnvelopes
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:133
MuonGMR4::MuonReadoutElement
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonReadoutElement.h:38
MuonGMR4::MuonDetectorManager::MuonDetectorManager
MuonDetectorManager()
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:114
MuonGMR4::MuonDetectorManager::getAllReadoutElements
std::vector< const MuonReadoutElement * > getAllReadoutElements() const
Returns the list of all detector elements.
MuonGMR4::MuonDetectorManager::m_idHelperSvc
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:130
MuonGMR4::MuonDetectorManager::m_rpcEles
ElementStorage< RpcReadoutElement > m_rpcEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:137
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
MuonGMR4::MuonDetectorManager::addSpectrometerSector
void addSpectrometerSector(ElementPtr< SpectrometerSector > &&chSector)
Add a spectrometer enevelope object to the manager.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:156
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition: TrackSystemController.h:45
MuonGMR4::RpcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:17
MuonGMR4::Chamber
Definition: Chamber.h:22
MuonGMR4::MuonDetectorManager::getChamber
const Chamber * getChamber(const Identifier &channelId) const
Retrieves the chamber enclosing the channel's readout element.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:164
MuonGMR4
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Definition: MdtCalibInput.h:19
MuonDetectorManager.icc
MuonGMR4::MuonDetectorManager::getNumTreeTops
unsigned int getNumTreeTops() const override final
Access specifically the individual readout element technologies.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:130
lumiFormat.i
int i
Definition: lumiFormat.py:85
DECLARE_ELEMENT
#define DECLARE_ELEMENT(ELE_TYPE)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:47
vector
Definition: MultiHisto.h:13
MuonGMR4::MuonDetectorManager::MuonChamberSet
std::set< const Chamber *, MSEnvelopeSorter > MuonChamberSet
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:114
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonGMR4::MuonDetectorManager::~MuonDetectorManager
~MuonDetectorManager()
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:109
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
MuonGMR4::MuonDetectorManager::MSEnvelopeSorter
Helper struct to ensure that the spectrometer sectors & chambers are sorted.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:109
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
MuonGMR4::MuonDetectorManager::getTreeTop
PVConstLink getTreeTop(unsigned int i) const override final
Returns the i-th top node of the MuonSystem trees.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:133
MuonGMR4::MuonDetectorManager::m_mdtEles
ElementStorage< MdtReadoutElement > m_mdtEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:135
MuonGMR4::MuonDetectorManager::m_treeTopVector
std::vector< PVConstLink > m_treeTopVector
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:141
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:22
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
MuonGMR4::MuonDetectorManager::addTreeTop
void addTreeTop(PVConstLink pv)
Adds a new GeoModelTree node indicating the entrance to a muon system description.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:137
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:21
MuonGMR4::MuonDetectorManager::ElementStorage
std::vector< ElementPtr< MuonDetectorType > > ElementStorage
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:71
MuonGMR4::MuonDetectorManager::getAllSectors
MuonSectorSet getAllSectors() const
: Returns all MuonChambers associated with the readout geometry
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:168
a
TList * a
Definition: liststreamerinfos.cxx:10
MuonGMR4::MuonDetectorManager::m_sTgcEles
ElementStorage< sTgcReadoutElement > m_sTgcEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:138
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:67
MuonGMR4::MuonDetectorManager::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the central MuonIdHelperSvc.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:140
python.changerun.pv
pv
Definition: changerun.py:81
MuonGMR4::MuonDetectorManager::ElementPtr
std::unique_ptr< MuonDetectorType > ElementPtr
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:69
MuonGMR4::MuonDetectorManager::m_mmEles
ElementStorage< MmReadoutElement > m_mmEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:139
MuonDetectorDefs.h
MuonGMR4::MuonDetectorManager::linkElements
void linkElements(ElementStorage< MuonDetectorType > &allStore, MuonDetectorType *readOutEle)
Method that connect the same elements from the station with the parsed readout Element and vice versa...
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:189
MuonGMR4::MuonDetectorManager::MSEnvelopeSorter::operator()
bool operator()(const SpectrometerSector *a, const SpectrometerSector *b) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:102
MuonGMR4::MuonDetectorManager::getAllChambers
MuonChamberSet getAllChambers() const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:176
MuonReadoutElement.h
CLASS_DEF.h
macros to associate a CLID to a type
MuonGMR4::TgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/TgcReadoutElement.h:19
IMuonIdHelperSvc.h
MuonGMR4::MuonDetectorManager::getSectorEnvelope
const SpectrometerSector * getSectorEnvelope(const Identifier &channelId) const
Retrieves the spectrometer envelope enclosing the channel's readout element.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:159
ServiceHandle< Muon::IMuonIdHelperSvc >
MuonGMR4::MuonDetectorManager::getReadoutElement
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.
Identifier
Definition: IdentifierFieldParser.cxx:14