ATLAS Offline Software
Loading...
Searching...
No Matches
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/RpcReadoutElement.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 Rpc Readout Element properties
7 -----------------------------------------
8***************************************************************************/
9
10#ifndef MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_H
11#define MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_H
12
18
19namespace MuonGMR4 {
21}
22
23namespace MuonGM {
54
57 friend class MuonChamber;
58 friend class MuonChamberLite;
59
60 public:
62 RpcReadoutElement(GeoVFullPhysVol* pv, const std::string& stName, int zi, int fi, bool is_mirrored, MuonDetectorManager* mgr);
63
66
67 int getDoubletR() const;
68 int getDoubletZ() const;
69 int getDoubletPhi() const;
70 bool hasDEDontop() const;
71
73 virtual bool containsId(const Identifier& id) const override;
74
76 bool inTheRibs() const;
77
78 int nGasGapPerLay() const;
79 int NphiStripPanels() const;
80 int NphiStrips() const;
81 int NetaStrips() const;
82 int Nstrips(bool measphi ) const;
83 double StripWidth(bool measphi ) const;
84 double StripLength(bool measphi ) const;
85 double StripPitch(bool measphi ) const;
86 double StripPanelDead(bool measphi ) const;
87 double stripPanelSsize(bool measphi ) const;
88 double stripPanelZsize(bool measphi ) const;
89 double gasGapSsize() const;
90 double gasGapZsize() const;
91
94 virtual double distanceToReadout(const Amg::Vector2D& pos, const Identifier& id) const override final;
95
98 virtual int stripNumber(const Amg::Vector2D& pos, const Identifier& id) const override final;
99
102 virtual bool stripPosition(const Identifier& id, Amg::Vector2D& pos) const override final;
103
105 virtual int numberOfLayers(bool measphi = true) const override final;
106 void setNumberOfLayers(const int = 2);
107
109 virtual int numberOfStrips(const Identifier& layerId) const override final;
110 virtual int numberOfStrips(int, bool measuresPhi) const override final;
111
115 virtual bool spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector2D& pos) const override final;
116
120 virtual bool spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector3D& pos) const override final;
121
125 void spacePointPosition(const Amg::Vector2D& phiPos, const Amg::Vector2D& etaPos, Amg::Vector2D& pos) const;
126
129
131 virtual void fillCache() override final;
132
134 virtual int surfaceHash(const Identifier& id) const override final;
135
137 int surfaceHash(int doubletPhi, int gasGap, bool measphi ) const;
138
140 virtual int layerHash(const Identifier& id) const override final;
142 int layerHash(int doubletPhi, int gasGap) const;
143
145 virtual int boundaryHash(const Identifier& id) const override final;
146
148 virtual bool measuresPhi(const Identifier& id) const override final;
149
151 void initDesign();
152
153 void setDoubletR(int doubletR);
154 void setDoubletZ(int dobuletZ);
155 void setDoubletPhi(int doubletPhi);
156 bool rotatedRpcModule() const;
157
158 void setYTranslation(const double y);
159 void setZTranslation(const double z);
160
161
162 // local to global
169 Amg::Transform3D localToGlobalTransf(int doubletPhi, int gasGap) const;
170 // global to local
171
174
176 Amg::Vector3D stripPos(int doubletPhi, int gasGap, bool measphi, int strip) const;
177
179 Amg::Vector3D localStripPos(int doubletPhi, int gasGap, bool measphi, int strip) const;
181
184 Amg::Vector3D localGasGapPos(int doubletPhi, int gasGap) const;
185
187 Amg::Vector3D gasGapPos(int doubletPhi, int gasGap) const;
189
190 // Readout side infos
191 // P is a point in the global reference frame
192 // we want to have the distance from the side of the phi readout (length travelled along a phi strip) from a signal produced at P)
194 // P is a point in the global reference frame
195 // we want to have the distance from the side of the eta readout (length travelled along a eta strip) from a signal produced at P)
197
198
199 inline bool isMirrored() const { return m_mirrored; }
200 inline bool isDescrAtNegZ() const { return m_descratzneg; }
201 private:
202 double localStripSCoord(int doubletPhi, bool measphi, int strip) const;
203 double localStripZCoord(bool measphi, int strip) const;
205 bool m_mirrored{false};
206 bool m_descratzneg{false};
208 const MuonStripDesign* getDesign(const Identifier& id) const;
209
210 int m_dbR{0};
211 int m_dbZ{0};
212 int m_dbPhi{0};
213 bool m_hasDEDontop{false};
214 int m_nlayers{2};
215 // default=2, all BI RPCs always have 3 gas gaps, need this flag since amdb only supports a maximum of 2 gas
216 // gaps, so this is steering the hardcoded third gas gap for Run3/4 layouts based on amdb primary numbers
217
218 bool m_inTheRibs{false};
219
221
222 double m_gasgapssize{-9999.};
223 double m_gasgapzsize{-9999.};
224
228 double m_phistripwidth{-9999.};
229 double m_etastripwidth{-9999.};
230 double m_phistrippitch{-9999.};
231 double m_etastrippitch{-9999.};
232 double m_phistriplength{-9999.};
233 double m_etastriplength{-9999.};
234 double m_phipaneldead{-9999.};
235 double m_etapaneldead{-9999.};
236
237 static constexpr int s_maxphipanels = 2;
238 static constexpr int s_nLayers = 3;
239 std::array<double, s_maxphipanels> m_first_phistrip_s{ make_array<double, s_maxphipanels>(-9999.)};
240 std::array<double, s_maxphipanels> m_etastrip_s{make_array<double, s_maxphipanels>(-9999.)};
242 std::array<double, s_nLayers> m_gasGap_xPos{make_array<double,s_nLayers>(-9999.)};
243 double m_phistrip_z{-9999.};
244 double m_first_etastrip_z{-9999.};
245
246 std::vector<MuonStripDesign> m_phiDesigns{};
247 std::vector<MuonStripDesign> m_etaDesigns{};
248
249 double m_y_translation{0.f};
250 double m_z_translation{0.f};
251 };
252
253
254} // namespace MuonGM
255
257
258#endif // MUONREADOUTGEOMETRY_RPCREADOUTELEMENT_H
constexpr std::array< T, N > make_array(const T &def_val)
Helper function to initialize in-place arrays with non-zero values.
Definition ArrayHelper.h:10
Eigen::Affine3d Transform3D
static Double_t P(Double_t *tt, Double_t *par)
Eigen::Matrix< double, 3, 1 > Vector3D
#define y
#define x
#define z
MuonClusterReadoutElement(GeoVFullPhysVol *pv, MuonDetectorManager *mgr, Trk::DetectorElemType detType)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
int nGasGapPerLay() const
returns the number of gasgaps
double stripPanelSsize(bool measphi) const
returns strip panel S size for the phi or eta plane
int getDoubletPhi() const
return DoubletPhi value for the given readout element, be aware that one RE can contain two DoubletPh...
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override final
strip position If the strip number is outside the range of valid strips, the function will return fal...
double gasGapZsize() const
returns the gas gap Z size
void initDesign()
initialize the design classes for this readout element
int NphiStripPanels() const
returns the number of phi strip panels (1 or 2)
Amg::Transform3D globalToLocalTransf(const Identifier &id) const
virtual int surfaceHash(const Identifier &id) const override final
returns the hash to be used to look up the surface and transform in the MuonClusterReadoutElement tra...
int getDoubletR() const
return DoubletR value for the given readout element
virtual int layerHash(const Identifier &id) const override final
returns the hash to be used to look up the normal and center in the MuonClusterReadoutElement trackin...
double StripLength(bool measphi) const
returns the strip length for the phi or eta plane
Amg::Vector3D localStripPos(int doubletPhi, int gasGap, bool measphi, int strip) const
Returns the local strip position in the AMDB frame.
virtual int stripNumber(const Amg::Vector2D &pos, const Identifier &id) const override final
strip number corresponding to local position.
Amg::Vector3D localGasGapPos(const Identifier &id) const
Returns the position of the gasGap w.r.t. rest frame of the chamber.
int NphiStrips() const
returns the number of phi strips
int NetaStrips() const
returns the number of eta strips
~RpcReadoutElement()
destructor
Amg::Vector3D localToGlobalCoords(const Amg::Vector3D &x, const Identifier &id) const
Attention: these transformations do not represent the tracking transformations as obtained by the tra...
int getDoubletZ() const
return DoubletZ value for the given readout element
virtual bool measuresPhi(const Identifier &id) const override final
returns whether the current identifier corresponds to a phi measurement
double gasGapSsize() const
returns the gas gap S size
Amg::Transform3D localToGlobalTransf(const Identifier &id) const
double localStripSCoord(int doubletPhi, bool measphi, int strip) const
std::array< double, s_nLayers > m_gasGap_xPos
Array caching the distance of the gasGap center to the origin plane in global radial direction.
Amg::Vector3D globalToLocalCoords(const Amg::Vector3D &x, const Identifier &id) const
virtual void fillCache() override final
function to fill tracking cache
Amg::Vector3D gasGapPos(int doubletPhi, int gasGap) const
Returns the centre of the gasGap.
const Amg::Vector3D REcenter() const
center of an RPC RE is not trivially the center of the first surface, overloading MuonClusterReadoutE...
bool hasDEDontop() const
return whether the RPC is 'up-side-down'
int Nstrips(bool measphi) const
returns the number of strips for the phi or eta plane
virtual int numberOfLayers(bool measphi=true) const override final
number of layers in phi/eta projection, same for eta/phi planes
virtual int numberOfStrips(const Identifier &layerId) const override final
number of strips per layer
virtual bool spacePointPosition(const Identifier &phiId, const Identifier &etaId, Amg::Vector2D &pos) const override final
space point position for a given pair of phi and eta identifiers The LocalPosition is expressed in th...
bool inTheRibs() const
returns whether the RE is in the ribs of the muon spectrometer
virtual double distanceToReadout(const Amg::Vector2D &pos, const Identifier &id) const override final
distance to readout.
RpcReadoutElement(GeoVFullPhysVol *pv, const std::string &stName, int zi, int fi, bool is_mirrored, MuonDetectorManager *mgr)
constructor
double stripPanelZsize(bool measphi) const
returns strip panel Z size for the phi or eta plane
virtual int boundaryHash(const Identifier &id) const override final
returns the hash function to be used to look up the surface boundary for a given identifier
double StripWidth(bool measphi) const
returns the strip width for the phi or eta plane
double StripPitch(bool measphi) const
returns the strip pitch for the phi or eta plane
const MuonStripDesign * getDesign(const Identifier &id) const
returns the MuonStripDesign class for the given identifier
double StripPanelDead(bool measphi) const
returns strip panel dead area for the phi or eta plane
virtual bool containsId(const Identifier &id) const override
function to be used to check whether a given Identifier is contained in the readout element
virtual const RpcIdHelper & rpcIdHelper() const =0
access to RpcIdHelper
Definition of ATLAS Math & Geometry primitives (Amg)
Eigen::Matrix< double, 2, 1 > Vector2D
The ReadoutGeomCnvAlg converts the Run4 Readout geometry build from the GeoModelXML into the legacy M...
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27