ATLAS Offline Software
Loading...
Searching...
No Matches
SpectrometerSector.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef MUONREADOUTGEOMETRYR4_SPECTROMETERSECTOR_H
5#define MUONREADOUTGEOMETRYR4_SPECTROMETERSECTOR_H
6
8#ifndef SIMULATIONBASE
9
14#include "Acts/Geometry/VolumeBounds.hpp"
15
16namespace Acts {
17 class Volume;
18 class PlaneSurface;
19}
20namespace MuonGMR4{
22 class Chamber;
23}
24
25namespace MuonGMR4 {
40
42 public:
44 using ChamberSet = std::vector<ChamberPtr>;
45
50 public:
51 using BoundPtr_t = std::shared_ptr<const Acts::VolumeBounds>;
59 const MuonReadoutElement* reEle,
61 m_origin{origin}, m_reEle{reEle}, m_bounds{std::move(bounds)}{}
62
63 chamberLocation(const chamberLocation& other) = default;
65 chamberLocation(chamberLocation&& other) = default;
67 chamberLocation& operator=(const chamberLocation& other) = default;
73 bool insideYZ(const Amg::Vector3D& pos) const {
74 return minY() <= pos.y() && maxY() >= pos.y() &&
75 minZ() <= pos.z() && maxZ() >= pos.z();
76 }
77
78 double minY() const { return m_origin.y() - MuonGMR4::halfY(*m_bounds); }
80 double maxY() const { return m_origin.y() + MuonGMR4::halfY(*m_bounds); }
82 double minZ() const { return m_origin.z() - MuonGMR4::halfZ(*m_bounds); }
84 double maxZ() const { return m_origin.z() + MuonGMR4::halfZ(*m_bounds); }
86 double width(const double y0) const {
87 const double tanPhiHalf = 0.5*(MuonGMR4::halfXhighY(*m_bounds)- MuonGMR4::halfXlowY(*m_bounds)) / MuonGMR4::halfZ(*m_bounds);
88 return MuonGMR4::halfXlowY(*m_bounds) + tanPhiHalf * (y0 - minY());
89 }
90
91 const MuonReadoutElement* readoutEle() const { return m_reEle; }
93 const BoundPtr_t& bounds() const { return m_bounds; }
95 const Amg::Vector3D& location() const { return m_origin; }
96 private:
98 Amg::Vector3D m_origin{Amg::Vector3D::Zero()};
103 };
104
111 std::unique_ptr<ActsTrk::VolumePlacement> placement{};
113 std::shared_ptr<Acts::VolumeBounds> bounds{};
115 std::shared_ptr<const Acts::PlaneSurface> surface{};
117 std::vector<chamberLocation> detectorLocs{};
119 unsigned id{0};
120 };
121
127
129
130 bool operator<(const SpectrometerSector& other) const;
131
133 std::string identString() const;
135 const Muon::IMuonIdHelperSvc* idHelperSvc() const;
139 int stationPhi() const;
141 int sector() const;
143 int8_t side() const;
145 bool barrel() const;
148 const Acts::Transform3& localToGlobalTransform(const ActsTrk::GeometryContext& gctx) const;
150 const Acts::Transform3& globalToLocalTransform(const ActsTrk::GeometryContext& gctx) const;
153 const Acts::Transform3& localToGlobalTransform(const Acts::GeometryContext& tgContext) const;
155 const Acts::Transform3& globalToLocalTransform(const Acts::GeometryContext& tgContext) const;
157 const Acts::PlaneSurface& surface() const;
159 const ChamberSet& chambers() const;
161 double halfXLong() const;
163 double halfXShort() const;
165 double halfY() const;
167 double halfZ() const;
169 const defineArgs& parameters() const;
172 std::shared_ptr<Acts::Volume> boundingVolume() const;
174 std::shared_ptr<Acts::VolumeBounds> bounds() const;
178 const std::vector<chamberLocation> & chamberLocations() const;
180 const std::vector<unsigned int>& logicalLayerIdx(const MuonReadoutElement* reEle) const;
182 void addPlacement(std::unique_ptr<ActsTrk::VolumePlacement>&& placement) const;
183
184 private:
187 std::unordered_map<const MuonReadoutElement*, std::vector<unsigned int>> fillDetLayIdCache() const;
189 const std::unordered_map<const MuonReadoutElement*, std::vector<unsigned int>> m_detLayIdCache{fillDetLayIdCache()};
193 unsigned int nLayerPerReadout (const MuonReadoutElement* rele) const;
194 };
195
196 std::ostream& operator<<(std::ostream& ostr,
197 const SpectrometerSector::defineArgs& args);
198
199 std::ostream& operator<<(std::ostream& ostr,
200 const SpectrometerSector& chamber);
201
202}
203
204#endif
205#endif
GeoIntrusivePtr< GeoAlignableTransform > AlignableNode_t
Abrivation of an alignable GeoTransform.
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...
Chamber represent the volume enclosing a muon station.
Definition Chamber.h:29
std::vector< const MuonReadoutElement * > ReadoutSet
Define the list of read out elements of the chamber.
Definition Chamber.h:32
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...
bool operator<(const SpectrometerSector &other) const
int8_t side() const
Returns the side of the MS-sector 1 -> A side ; -1 -> C side.
const Acts::Transform3 & globalToLocalTransform(const ActsTrk::GeometryContext &gctx) const
Returns the global -> local transformation from the ATLAS global.
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.
std::shared_ptr< Acts::Volume > boundingVolume() const
Returns the Acts::Volume representation of the sector.
bool barrel() const
Returns whether the sector is placed in the barrel.
const Acts::Transform3 & localToGlobalTransform(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
void addPlacement(std::unique_ptr< ActsTrk::VolumePlacement > &&placement) const
Adds a volume placement to the Chamber's memory management.
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.
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::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:18
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::unique_ptr< ActsTrk::VolumePlacement > placement
The volume placement used to artifically align the envelope.
std::shared_ptr< Acts::VolumeBounds > bounds
Surrouding box chamber bounds.
ActsTrk::VolumePlacement::AlignableNode_t localToGlobalTrf
The Transform packed into an alignable node.
ChamberSet chambers
List of readout elements in the chamber.