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 MuonChamber;
60 
61 class MuonDetectorManager : public GeoVDetectorManager, public AthMessaging {
62 
63  public:
65  ~MuonDetectorManager() = default;
66 
67  template <class MuonDetectorType>
68  using ElementPtr = std::unique_ptr<MuonDetectorType>;
69  template <class MuonDetectorType>
70  using ElementStorage = std::vector<ElementPtr<MuonDetectorType>>;
71 
78 
79 
80  unsigned int getNumTreeTops() const override final;
83  PVConstLink getTreeTop(unsigned int i) const override final;
85  void addTreeTop(PVConstLink pv);
87  const Muon::IMuonIdHelperSvc* idHelperSvc() const;
88 
95 
96 #ifndef SIMULATIONBASE
97  const MuonChamber* getChamber(const Identifier& channelId) const;
101  bool operator()(const MuonChamber* a, const MuonChamber* b) const;
102  };
103  using MuonChamberSet = std::set<const MuonChamber*, ChamberSorter>;
106 #endif
107 
109  std::vector<ActsTrk::DetectorType> getDetectorTypes() const;
110  private:
112  "Muon::MuonIdHelperSvc/MuonIdHelperSvc", "MuonDetectorManager"};
113 
119 
120  std::vector<PVConstLink> m_treeTopVector{};
121 };
122 
123 } // namespace MuonGMR4
124 
127 #undef DECLARE_GETTERSETTER
128 #undef DECLARE_ELEMENT
130 #endif
MuonGMR4::MuonDetectorManager::~MuonDetectorManager
~MuonDetectorManager()=default
MuonGMR4::MmReadoutElement
Definition: MmReadoutElement.h:18
MuonGMR4::MuonDetectorManager::getDetectorTypes
std::vector< ActsTrk::DetectorType > getDetectorTypes() const
Returns a list of all detector types.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:135
MuonGMR4::MuonDetectorManager
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:61
MuonGMR4::MuonDetectorManager::m_tgcEles
ElementStorage< TgcReadoutElement > m_tgcEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:115
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:105
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:111
MuonGMR4::MuonDetectorManager::m_rpcEles
ElementStorage< RpcReadoutElement > m_rpcEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:116
MuonGMR4::MuonChamber
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonChamber.h:39
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:562
MuonGMR4::MuonDetectorManager::ChamberSorter::operator()
bool operator()(const MuonChamber *a, const MuonChamber *b) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:98
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
MuonGMR4::RpcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/RpcReadoutElement.h:14
MuonGMR4
A muon chamber is a collection of readout elements belonging to the same station.
Definition: ChamberAssembleTool.h:16
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:122
lumiFormat.i
int i
Definition: lumiFormat.py:92
DECLARE_ELEMENT
#define DECLARE_ELEMENT(ELE_TYPE)
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:47
Identifier
Definition: DetectorDescription/Identifier/Identifier/Identifier.h:32
vector
Definition: MultiHisto.h:13
MuonGMR4::MuonDetectorManager::MuonChamberSet
std::set< const MuonChamber *, ChamberSorter > MuonChamberSet
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:103
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonGMR4::MuonDetectorManager::getChamber
const MuonChamber * getChamber(const Identifier &channelId) const
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:146
CaloCondBlobAlgs_fillNoiseFromASCII.channelId
channelId
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:122
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:125
MuonGMR4::MuonDetectorManager::m_mdtEles
ElementStorage< MdtReadoutElement > m_mdtEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:114
MuonGMR4::MuonDetectorManager::m_treeTopVector
std::vector< PVConstLink > m_treeTopVector
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:120
MuonGMR4::MdtReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MdtReadoutElement.h:15
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:129
MuonGMR4::sTgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/sTgcReadoutElement.h:19
MuonGMR4::MuonDetectorManager::ElementStorage
std::vector< ElementPtr< MuonDetectorType > > ElementStorage
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:70
a
TList * a
Definition: liststreamerinfos.cxx:10
MuonGMR4::MuonDetectorManager::getAllChambers
MuonChamberSet getAllChambers() const
: Returns all MuonChambers associated with the readout geometry
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:150
MuonGMR4::MuonDetectorManager::m_sTgcEles
ElementStorage< sTgcReadoutElement > m_sTgcEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:117
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:64
MuonGMR4::MuonDetectorManager::idHelperSvc
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the central MuonIdHelperSvc.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/src/MuonDetectorManager.cxx:132
python.changerun.pv
pv
Definition: changerun.py:81
MuonGMR4::MuonDetectorManager::ElementPtr
std::unique_ptr< MuonDetectorType > ElementPtr
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:68
MuonGMR4::MuonDetectorManager::m_mmEles
ElementStorage< MmReadoutElement > m_mmEles
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:118
MuonDetectorDefs.h
MuonReadoutElement.h
CLASS_DEF.h
macros to associate a CLID to a type
MuonGMR4::TgcReadoutElement
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/TgcReadoutElement.h:16
IMuonIdHelperSvc.h
MuonGMR4::MuonDetectorManager::ChamberSorter
Helper struct to ensur that the sorting of the MuonChambers remains constants across the jobs.
Definition: MuonPhaseII/MuonDetDescr/MuonReadoutGeometryR4/MuonReadoutGeometryR4/MuonDetectorManager.h:100
ServiceHandle< Muon::IMuonIdHelperSvc >
MuonGMR4::MuonDetectorManager::getReadoutElement
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.