4#ifndef MUONREADOUTGEOMETRY_MUONDETECTORMANAGER_H
5#define MUONREADOUTGEOMETRY_MUONDETECTORMANAGER_H
11#include "GaudiKernel/ServiceHandle.h"
12#include "GeoModelKernel/GeoVDetectorManager.h"
38#define DECLARE_GETTERSETTER(ELE_TYPE, GETTER, SETTER) \
39 ELE_TYPE* GETTER(const IdentifierHash& hash); \
40 ELE_TYPE* GETTER(const Identifier& hash); \
42 const ELE_TYPE* GETTER(const IdentifierHash& hash) const; \
43 const ELE_TYPE* GETTER(const Identifier& hash) const; \
45 StatusCode SETTER(ElementPtr_t<ELE_TYPE> element);
47#define DECLARE_ELEMENT(ELE_TYPE) \
48 DECLARE_GETTERSETTER(ELE_TYPE, get##ELE_TYPE, add##ELE_TYPE) \
50 std::vector<const ELE_TYPE*> getAll##ELE_TYPE##s() const; \
51 std::vector<ELE_TYPE*> getAll##ELE_TYPE##s();
54class MdtReadoutElement;
55class TgcReadoutElement;
56class RpcReadoutElement;
57class sTgcReadoutElement;
58class MmReadoutElement;
59class SpectrometerSector;
70 template <
class MuonDetectorType>
using ElementPtr_t = std::unique_ptr<MuonDetectorType>;
73 template <
class MuonDetectorType>
using ElementStorage_t = std::vector<ElementPtr_t<MuonDetectorType>>;
101#ifndef SIMULATIONBASE
114 const unsigned sector,
115 const int side)
const;
141 MuonDetectorType* readOutEle);
144 "MuonDetectorManager"};
145#ifndef SIMULATIONBASE
148 using EnvelopeMap_t = std::unordered_map<unsigned, const SpectrometerSector*>;
168#undef DECLARE_GETTERSETTER
169#undef DECLARE_ELEMENT
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
#define DECLARE_ELEMENT(ELE_TYPE)
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
Chamber represent the volume enclosing a muon station.
ElementStorage_t< SpectrometerSector > m_secEnvelopes
ElementStorage_t< TgcReadoutElement > m_tgcEles
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.
ElementStorage_t< sTgcReadoutElement > m_sTgcEles
ElementStorage_t< MmReadoutElement > m_mmEles
Muon::MuonStationIndex::ChIndex ChIndex
std::vector< PVConstLink > m_treeTopVector
void clearTreeTops()
Clears all tree tops helds by the manager.
EnvelopeMap_t m_envelopesById
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.
MuonChamberSet getAllChambers() const
ElementStorage_t< RpcReadoutElement > m_rpcEles
std::unordered_map< unsigned, const SpectrometerSector * > EnvelopeMap_t
Abbrivation to find the sector envelopes sorted by the generic MS identifier.
std::vector< const Chamber * > MuonChamberSet
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.
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::vector< const SpectrometerSector * > MuonSectorSet
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.
ElementStorage_t< MdtReadoutElement > m_mdtEles
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.
Helper struct to ensure that the spectrometer sectors & chambers are sorted.
bool operator()(const SpectrometerSector *a, const SpectrometerSector *b) const