ATLAS Offline Software
Loading...
Searching...
No Matches
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
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_t<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();
52namespace MuonGMR4 {
53
54class MdtReadoutElement;
55class TgcReadoutElement;
56class RpcReadoutElement;
57class sTgcReadoutElement;
58class MmReadoutElement;
59class SpectrometerSector;
60class Chamber;
61
62class MuonDetectorManager : public GeoVDetectorManager, public AthMessaging {
63
64 public:
67
70 template <class MuonDetectorType> using ElementPtr_t = std::unique_ptr<MuonDetectorType>;
73 template <class MuonDetectorType> using ElementStorage_t = std::vector<ElementPtr_t<MuonDetectorType>>;
74
82
83
84 unsigned int getNumTreeTops() const override final;
86 PVConstLink getTreeTop(unsigned int i) const override final;
88 void addTreeTop(PVConstLink pv);
90 void clearTreeTops();
92 const Muon::IMuonIdHelperSvc* idHelperSvc() const;
93
100
101#ifndef SIMULATIONBASE
107 const SpectrometerSector* getSectorEnvelope(const Identifier& channelId) const;
114 const unsigned sector,
115 const int side) const;
118 const Chamber* getChamber(const Identifier& channelId) const;
119
122 bool operator()(const SpectrometerSector* a, const SpectrometerSector* b) const;
123 bool operator()(const Chamber* a, const Chamber* b) const;
124 };
125 using MuonSectorSet = std::vector<const SpectrometerSector*>;
126 using MuonChamberSet = std::vector<const Chamber*>;
130#endif
131
133 std::vector<ActsTrk::DetectorType> getDetectorTypes() const;
134 private:
140 template <class MuonDetectorType> void linkElements(ElementStorage_t<MuonDetectorType>& allStore,
141 MuonDetectorType* readOutEle);
142
143 ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc{"Muon::MuonIdHelperSvc/MuonIdHelperSvc",
144 "MuonDetectorManager"};
145#ifndef SIMULATIONBASE
148 using EnvelopeMap_t = std::unordered_map<unsigned, const SpectrometerSector*>;
150#endif
156
157 std::vector<PVConstLink> m_treeTopVector{};
158
159
160};
161
163
164} // namespace MuonGMR4
165
168#undef DECLARE_GETTERSETTER
169#undef DECLARE_ELEMENT
171#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
static Double_t a
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Chamber represent the volume enclosing a muon station.
Definition Chamber.h:28
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns a pointer to the central MuonIdHelperSvc.
std::vector< ActsTrk::DetectorType > getDetectorTypes() const
Returns a list of all detector types.
std::vector< ElementPtr_t< MuonDetectorType > > ElementStorage_t
: Abbrivation of the container holding all readout elements of a technology.
void addSpectrometerSector(ElementPtr_t< SpectrometerSector > &&chSector)
Add a spectrometer enevelope object to the manager.
const Chamber * getChamber(const Identifier &channelId) const
Retrieves the chamber enclosing the channel's readout element.
PVConstLink getTreeTop(unsigned int i) const override final
Returns the i-the tree top GeoModel volume.
std::unordered_map< unsigned, const SpectrometerSector * > EnvelopeMap_t
Abbrivation to find the sector envelopes sorted by the generic MS identifier.
MuonSectorSet getAllSectors() const
: Returns all MuonChambers associated with the readout geometry
std::vector< const MuonReadoutElement * > getAllReadoutElements() const
Returns the list of all detector elements.
std::unique_ptr< MuonDetectorType > ElementPtr_t
: Abrivation of the smart pointer holding the readout element
const MuonReadoutElement * getReadoutElement(const Identifier &id) const
Returns a generic Muon readout element.
unsigned int getNumTreeTops() const override final
Declaration of the readout element getters & setter function as described above.
const SpectrometerSector * getSectorEnvelope(const Identifier &channelId) const
Retrieves the spectrometer envelope enclosing the channel's readout element.
void linkElements(ElementStorage_t< MuonDetectorType > &allStore, MuonDetectorType *readOutEle)
Method that connects the same elements from the station with the parsed readout Element and vice vers...
void addTreeTop(PVConstLink pv)
Adds a new GeoModelVolume with its children as a new top node of the muon system.
MuonReadoutElement is an abstract class representing the geometry of a muon detector.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
ChIndex
enum to classify the different chamber layers in the muon spectrometer
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
STL namespace.