ATLAS Offline Software
Loading...
Searching...
No Matches
SpectrometerSector.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONREADOUTGEOMETRYR4_SPECTROMETERSECTOR_H
5#define MUONREADOUTGEOMETRYR4_SPECTROMETERSECTOR_H
6
8#ifndef SIMULATIONBASE
9
13#include <Acts/Geometry/VolumeBounds.hpp>
14
15namespace Acts {
16 class Volume;
17 class PlaneSurface;
18}
19namespace MuonGMR4{
21 class Chamber;
22}
23
24namespace MuonGMR4 {
39
41 public:
43 using ChamberSet = std::vector<ChamberPtr>;
44
49 public:
50 using BoundPtr_t = std::shared_ptr<const Acts::VolumeBounds>;
58 const MuonReadoutElement* reEle,
60 m_origin{origin}, m_reEle{reEle}, m_bounds{std::move(bounds)}{}
61
62 chamberLocation(const chamberLocation& other) = default;
64 chamberLocation(chamberLocation&& other) = default;
66 chamberLocation& operator=(const chamberLocation& other) = default;
72 bool insideYZ(const Amg::Vector3D& pos) const {
73 return minY() <= pos.y() && maxY() >= pos.y() &&
74 minZ() <= pos.z() && maxZ() >= pos.z();
75 }
76
77 double minY() const { return m_origin.y() - MuonGMR4::halfY(*m_bounds); }
79 double maxY() const { return m_origin.y() + MuonGMR4::halfY(*m_bounds); }
81 double minZ() const { return m_origin.z() - MuonGMR4::halfZ(*m_bounds); }
83 double maxZ() const { return m_origin.z() + MuonGMR4::halfZ(*m_bounds); }
85 double width(const double y0) const {
86 const double tanPhiHalf = 0.5*(MuonGMR4::halfXhighY(*m_bounds)- MuonGMR4::halfXlowY(*m_bounds)) / MuonGMR4::halfZ(*m_bounds);
87 return MuonGMR4::halfXlowY(*m_bounds) + tanPhiHalf * (y0 - minY());
88 }
89
90 const MuonReadoutElement* readoutEle() const { return m_reEle; }
92 const BoundPtr_t& bounds() const { return m_bounds; }
94 const Amg::Vector3D& location() const { return m_origin; }
95 private:
97 Amg::Vector3D m_origin{Amg::Vector3D::Zero()};
99 const MuonReadoutElement* m_reEle{nullptr};
102 };
103
108 std::shared_ptr<Acts::VolumeBounds> bounds{};
110 std::shared_ptr<const Acts::PlaneSurface> surface{};
112 std::vector<chamberLocation> detectorLocs{};
114 unsigned id{0};
115 };
116
122
124
125 bool operator<(const SpectrometerSector& other) const;
126
128 std::string identString() const;
130 const Muon::IMuonIdHelperSvc* idHelperSvc() const;
134 int stationPhi() const;
136 int sector() const;
138 int8_t side() const;
140 bool barrel() const;
147 const Acts::PlaneSurface& surface() const;
149 const ChamberSet& chambers() const;
151 double halfXLong() const;
153 double halfXShort() const;
155 double halfY() const;
157 double halfZ() const;
159 const defineArgs& parameters() const;
162 std::shared_ptr<Acts::Volume> boundingVolume(const ActsTrk::GeometryContext& gctx) const;
164 std::shared_ptr<Acts::VolumeBounds> bounds() const;
168 const std::vector<chamberLocation> & chamberLocations() const;
170 const std::vector<unsigned int>& logicalLayerIdx(const MuonReadoutElement* reEle) const;
171
172 private:
174
176 std::unordered_map<const MuonReadoutElement*, std::vector<unsigned int>> fillDetLayIdCache() const;
178 const std::unordered_map<const MuonReadoutElement*, std::vector<unsigned int>> m_detLayIdCache{fillDetLayIdCache()};
182 unsigned int nLayerPerReadout (const MuonReadoutElement* rele) const;
183 };
184
185 std::ostream& operator<<(std::ostream& ostr,
186 const SpectrometerSector::defineArgs& args);
187
188 std::ostream& operator<<(std::ostream& ostr,
189 const SpectrometerSector& chamber);
190
191}
192
193#endif
194#endif
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
std::vector< const MuonReadoutElement * > ReadoutSet
Define the list of read out elements of the chamber.
Definition Chamber.h:26
The MuonReadoutElement is an abstract class representing the geometry representing the muon detector.
A spectrometer sector forms the envelope of all chambers that are placed in the same MS sector & laye...
bool operator<(const SpectrometerSector &other) const
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
const std::vector< unsigned int > & logicalLayerIdx(const MuonReadoutElement *reEle) const
Returns the logic layer numbering of a given Readout Element.
double halfZ() const
Thickness of the chamber in the z-direction.
unsigned int nLayerPerReadout(const MuonReadoutElement *rele) const
Helper function giving the number of measurement layers in a given readout ele.
const Muon::IMuonIdHelperSvc * idHelperSvc() const
Returns the IdHelpeSvc.
bool barrel() const
Returns whether the sector is placed in the barrel.
Amg::Transform3D globalToLocalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
const Amg::Transform3D & localToGlobalTrans(const ActsTrk::GeometryContext &gctx) const
Returns the local -> global tarnsformation from the sector.
Chamber::ReadoutSet readoutEles() const
Returns the list of all associated readout elements.
SpectrometerSector(const SpectrometerSector &other)=delete
Delete the copy constructor and copy assignment.
std::unordered_map< const MuonReadoutElement *, std::vector< unsigned int > > fillDetLayIdCache() const
Function filling the map mapping the readout elements to layer numbers.
SpectrometerSector(defineArgs &&args)
Standard constructor taking the defining parameters.
Identifier computeDetLayerId(const MuonReadoutElement *rele) const
Helper function calculating the logic layer Id and the physical layer id.
std::string identString() const
Returns a string encoding the chamber index & the sector of the MS sector.
double halfY() const
Extend of the chamber in the y-direction.
const Acts::PlaneSurface & surface() const
Returns the associated surface.
const ChamberSet & chambers() const
Returns the associated chambers with this sector.
GeoModel::TransientConstSharedPtr< Chamber > ChamberPtr
double halfXLong() const
Long-extend of the chamber in the x-direction at positive Y.
int sector() const
Returns the sector of the MS-sector.
std::shared_ptr< Acts::VolumeBounds > bounds() const
Returns the volume bounds.
std::shared_ptr< Acts::Volume > boundingVolume(const ActsTrk::GeometryContext &gctx) const
Returns the Acts::Volume representation of the sector.
const std::unordered_map< const MuonReadoutElement *, std::vector< unsigned int > > m_detLayIdCache
Map mapping each Readout Element to the layer numbering in the sector frame.
const std::vector< chamberLocation > & chamberLocations() const
returns the list of all MDT chambers in the sector for fast navigation
double halfXShort() const
Short extend of the chamber in the x-direction at negative Y.
int stationPhi() const
: Returns the station phi of the sector
const defineArgs & parameters() const
Returns the reference to the defining parameters of the sector.
Muon::MuonStationIndex::ChIndex chamberIndex() const
Returns the chamber index scheme.
std::vector< ChamberPtr > ChamberSet
SpectrometerSector & operator=(const SpectrometerSector &other)=delete
Interface for Helper service that creates muon Identifiers and can be used to print Identifiers.
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 3, 1 > Vector3D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
double halfY(const Acts::VolumeBounds &bounds)
Returns the half-Y length for the parsed volume bounds (Trapezoid/ Cuboid)
std::ostream & operator<<(std::ostream &ostr, const Chamber::defineArgs &args)
Definition Chamber.cxx:14
RpcReadoutElement::defineArgs defineArgs
double halfZ(const Acts::VolumeBounds &bounds)
Returns the half-Z length for the parsed volume bounds (Trapezoid/ Cuboid)
double halfXhighY(const Acts::VolumeBounds &bounds)
Returns the half-Y length @ posiive Y for the parsed volume bounds (Trapezoid/ Cuboid)
double halfXlowY(const Acts::VolumeBounds &bounds)
Returns the half-X length @ negative Y for the parsed volume bounds (Trapezoid/ Cuboid)
ChIndex
enum to classify the different chamber layers in the muon spectrometer
STL namespace.
chamberLocation & operator=(const chamberLocation &other)=default
Copy assignment.
double minZ() const
Returns the minimum y covered by the chamber location.
double width(const double y0) const
Calculate the strip / tube length at a given position in the y-z plane.
chamberLocation(const Amg::Vector3D &origin, const MuonReadoutElement *reEle, BoundPtr_t bounds)
Standard constructor taking the position of the readout element inside the sector frame,...
BoundPtr_t m_bounds
Pointer to the associated bounds.
chamberLocation & operator=(chamberLocation &&other)=default
Move assignment.
double maxY() const
Returns the maximum u covered by the chamber location.
chamberLocation(chamberLocation &&other)=default
Move constructor.
Amg::Vector3D m_origin
Origin vector of the readout element inside the spectrometer frame.
std::shared_ptr< const Acts::VolumeBounds > BoundPtr_t
double maxZ() const
Returns the maximum u covered by the chamber location.
chamberLocation(const chamberLocation &other)=default
Copy constructor.
const MuonReadoutElement * readoutEle() const
Returns the poter to the associate readout element.
double minY() const
Returns the minimum y covered by the chamber location.
bool insideYZ(const Amg::Vector3D &pos) const
Returns whether the external position is inside the boundaries in the y-z plane.
const Amg::Vector3D & location() const
Returns the location.
const BoundPtr_t & bounds() const
Returns the pointer to the associate bounds.
const MuonReadoutElement * m_reEle
Associated readout element.
std::vector< chamberLocation > detectorLocs
2D pattern navigation structure
std::shared_ptr< const Acts::PlaneSurface > surface
Surface in the centre of the chamber plane.
std::shared_ptr< Acts::VolumeBounds > bounds
Surrouding box chamber bounds.
ChamberSet chambers
List of readout elements in the chamber.