ATLAS Offline Software
Loading...
Searching...
No Matches
MuonDetDescr/MuonReadoutGeometry/MuonReadoutGeometry/TgcReadoutElement.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#ifndef MUONREADOUTGEOMETRY_TGCREADOUTELEMENT_H
6#define MUONREADOUTGEOMETRY_TGCREADOUTELEMENT_H
7
8
9#include "Identifier/Identifier.h"
14
15
16namespace MuonGM {
17
41
43
44 public:
45 TgcReadoutElement(GeoVFullPhysVol* pv, const std::string& stName, MuonDetectorManager* mgr);
46
47 virtual ~TgcReadoutElement() = default;
48
51 virtual double distanceToReadout(const Amg::Vector2D& pos, const Identifier& id) const override;
52
55 virtual int stripNumber(const Amg::Vector2D& pos, const Identifier& id) const override final;
56
59 virtual bool stripPosition(const Identifier& id, Amg::Vector2D& pos) const override;
60
62 virtual int layerHash(const Identifier& id) const override;
63
65 virtual int surfaceHash(const Identifier& id) const override;
66
68 virtual int boundaryHash(const Identifier& id) const override;
69
71 virtual bool measuresPhi(const Identifier& id) const override;
72
74 virtual int numberOfLayers(bool isStrip) const override;
75
77 virtual int numberOfStrips(const Identifier& layerId) const override;
78 virtual int numberOfStrips(int layer, bool isStrip) const override;
79
83 virtual bool spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector2D& pos) const override;
84
87 virtual bool spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector3D& pos) const override;
88
90 const Amg::Vector3D& etaHitPos,
91 const Amg::Vector3D& phiHitPos) const;
92
93 virtual bool containsId(const Identifier& id) const override;
94
95
96
97 int chamberType() const;
99 int nGasGaps() const;
101 bool validGap(int gasGap) const;
102
103
105 int nStrips(int gasGap) const;
107 bool validStrip(int gasGap, int strip) const;
109 double stripWidth(int gasGap, int strip) const;
111 double stripLength() const;
113 double stripPitch(int gasGap, int strip) const;
115 double stripPitch(int gasGap, int strip, double radialPos) const;
120 double stripLowEdgeLocX(int gasGap, int strip, double radialPos) const;
125 double stripHighEdgeLocX(int gasGap, int strip , double radialPos) const;
127 double stripCenterLocX(int gasGap, int strip, double radialPos) const;
128
130 double stripPosOnLargeBase(int strip, int gasGap) const;
131 double stripPosOnShortBase(int strip, int gasGap) const;
132
133
134 double stripDeltaPhi() const;
135 double stripDeltaPhi(int gasGap, int strip) const;
136
137
139 bool validGang(int gasGap, int wireGang) const;
141 int nWires(int gasGap) const;
143 int nWires(int gasGap, int gang) const;
145 int nWireGangs(int gasGap) const;
147 double nPitchesToGang(int gasGap, int gang) const;
149 double gangRadialLength(int gasGap, int gang) const;
151 double gangShortWidth(int gasGap, int gang) const;
153 double gangCentralWidth(int gasGap, int gang) const;
155 double gangLongWidth(int gasGap, int gang) const;
157 double gangThickness() const;
160 double wireLength(int wire) const;
162 double wirePitch() const;
163
164
165
166 double stripShortWidth(int, int) const;
167 double stripLongWidth(int, int) const;
168
176
179 Amg::Vector3D channelPos(int gasGap, bool isStrip, int channel) const;
180
183 Amg::Vector3D wireGangPos(int gasGap, int gang) const;
184
186 Amg::Vector3D stripPos(int gasGap, int strip) const;
189 Amg::Vector3D stripDir(int gasGap, int strip) const;
191
192
194 bool isEndcap() const;
196 bool isForward() const;
198 bool isDoublet() const;
200 bool isTriplet() const;
202 double chamberLocPhiMin() const;
204 double chamberLocPhiMax() const;
205
206
207 double length() const;
208
209 double frameZwidth() const;
210 double frameXwidth() const;
211 double chamberWidth(double z) const;
212
213
214 int nPhiChambers() const;
215 int nPhiSectors() const;
216
218 void setPlaneZ(double value, int gasGap);
219
221 int findGang(int gasGap, const Amg::Vector3D& extPos) const;
223 int findStrip(int gasGap, const Amg::Vector3D& extPos) const;
224
225
226
227 void setReadOutName(const std::string& rName);
229
230 void setFrameThickness(const double frameH, const double frameAB);
231
232 // Access to readout parameters
233 const std::string& readOutName() const;
234
236
237 virtual void fillCache() override;
238
239
240 private:
243 Amg::Vector3D localChannelPos(int gasGap, bool isStrip, int channel) const;
244 // Returns the local position of a strip
245 Amg::Vector3D localStripPos(int gasGap, int strip) const;
248 Amg::Vector3D localStripDir(int gasGap, int strip) const;
250
252 Amg::Vector3D localWireGangPos(int gasGap, int gang) const;
255 Amg::Vector3D localGasGapPos(int gg) const;
256
257 static int surfaceHash(int GasGap, bool isStrip);
258
262 double stripLocalX(const int gasGap,
263 const int stripNum,
264 const double locY,
265 const double refPoint) const;
266
268 double wireGangLocalX(const int gasGap,
269 const int gangNum) const;
270
272 double wireGangBottomX(int gasGap, int gangNum) const;
274 double wireGangTopX(int gasGap, int gangNum) const;
275
278 std::pair<double, int> stripNumberToFetch(int gasGap, int inStrip) const;
279
281
282 static constexpr int s_maxGasGap{3};
283 std::array<double, s_maxGasGap> m_gasPlaneZ{make_array<double, s_maxGasGap>(-9999.)};
284
285 std::string m_readout_name{};
286 GeoModel::TransientConstSharedPtr <TgcReadoutParams> m_readoutParams{nullptr};
289 double m_stripSlope{0.};
290 double m_locMinPhi{0.};
291 double m_locMaxPhi{0.};
292
293 int m_stIdxT4E{m_idHelper.stationNameIndex("T4E")};
294
295 double m_frameH{0.};
296 double m_frameAB{0.};
297
298 };
299
300} // namespace MuonGM
302#endif // MUONREADOUTGEOMETRY_TGCREADOUTELEMENT_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
#define z
The TransientConstSharedPtr allows non-const access if the pointer itself is non-const but in the con...
MuonClusterReadoutElement(GeoVFullPhysVol *pv, MuonDetectorManager *mgr, Trk::DetectorElemType detType)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
int findGang(int gasGap, const Amg::Vector3D &extPos) const
Returns the gang number that's closest to the given external position.
virtual bool measuresPhi(const Identifier &id) const override
returns whether the given identifier measures phi or not
double wireLength(int wire) const
Returns the length of a wire.
Amg::Vector3D stripDir(int gasGap, int strip) const
Returns the direction of a strip.
Amg::Vector3D stripDir(const Identifier &id) const
GeoModel::TransientConstSharedPtr< TgcReadoutParams > m_readoutParams
virtual int boundaryHash(const Identifier &id) const override
returns the hash function to be used to look up the surface boundary for a given identifier
int nWireGangs(int gasGap) const
Returns the number of wire gangs (Random grouping of wires) in a given gas gap.
Amg::Vector3D channelPos(int gasGap, bool isStrip, int channel) const
static int surfaceHash(int GasGap, bool isStrip)
void setReadOutParams(GeoModel::TransientConstSharedPtr< TgcReadoutParams > pars)
void setFrameThickness(const double frameH, const double frameAB)
virtual double distanceToReadout(const Amg::Vector2D &pos, const Identifier &id) const override
distance to readout.
double chamberLocPhiMax() const
Returns the maximum angle measured from the center that's covered by the chamber.
Amg::Vector3D localStripPos(int gasGap, int strip) const
bool isDoublet() const
Returns true if the chamber has 2 gasgaps.
virtual bool stripPosition(const Identifier &id, Amg::Vector2D &pos) const override
strip position If the strip number is outside the range of valid strips, the function will return fal...
std::pair< double, int > stripNumberToFetch(int gasGap, int inStrip) const
Returns whether a strip needs to be flipped and the final strip number parsed to the TgcReadoutParams...
Amg::Vector3D localWireGangPos(const Identifier &id) const
Amg::Vector3D channelPos(const Identifier &id) const
Returns the position of the active channel (wireGang or strip)
double stripLength() const
Returns the length of each strip which is equal to the height of the chamber.
virtual int numberOfStrips(const Identifier &layerId) const override
number of strips per layer
const Amg::Transform3D & localToGlobalTransf(const Identifier &id) const
Returns the local -> global transformation x-axis: Parallel to the wires (strips) if the Identifier b...
const TgcReadoutParams * getReadoutParams() const
double stripLocalX(const int gasGap, const int stripNum, const double locY, const double refPoint) const
Returns the local X given the reference point E.g.
double stripHighEdgeLocX(int gasGap, int strip, double radialPos) const
Returns the local X of the right edge of the strip at a given local radial position.
int findStrip(int gasGap, const Amg::Vector3D &extPos) const
Returns the strip number that's closest to the given external position.
double stripPitch(int gasGap, int strip) const
Returns the pitch of the given strip in gasGap i.
virtual int numberOfStrips(int layer, bool isStrip) const override
Amg::Vector3D stripPos(const Identifier &id) const
virtual bool spacePointPosition(const Identifier &phiId, const Identifier &etaId, Amg::Vector2D &pos) const override
space point position for a given pair of phi and eta identifiers The LocalPosition is expressed in th...
double stripPosOnShortBase(int strip, int gasGap) const
double gangThickness() const
Returns the spatial thickness of the wire gang.
virtual ~TgcReadoutElement()=default
virtual int stripNumber(const Amg::Vector2D &pos, const Identifier &id) const override final
strip number corresponding to local position.
double gangShortWidth(int gasGap, int gang) const
Returns the length of the most bottom wire in the gang.
double chamberWidth(double z) const
double nPitchesToGang(int gasGap, int gang) const
Returns the number of wire pitches that have to be travelled to reach gang i.
double wireGangLocalX(const int gasGap, const int gangNum) const
Returns the local X of the wire gang in gasGap i.
bool validStrip(int gasGap, int strip) const
Returns whether the strip in the given gasgap is within the allowed range.
double gangCentralWidth(int gasGap, int gang) const
Returns the length of the central wire in the gang.
const std::string & readOutName() const
Amg::Vector3D localSpacePoint(const Identifier &stripId, const Amg::Vector3D &etaHitPos, const Amg::Vector3D &phiHitPos) const
double stripWidth(int gasGap, int strip) const
Returns the width of a given strip in the gasGap i.
double stripPosOnLargeBase(int strip, int gasGap) const
Amg::Vector3D localStripDir(const Identifier &id) const
Amg::Vector3D localChannelPos(const Identifier &id) const
Returns the local position of the active channel (wireGang or strip)
virtual int numberOfLayers(bool isStrip) const override
number of layers in phi/eta projection
Amg::Vector3D localChannelPos(int gasGap, bool isStrip, int channel) const
Amg::Vector3D localStripDir(int gasGap, int strip) const
Returns the local strip direction of a strip.
bool isTriplet() const
Returns true if the chamber has 3 gasgaps.
Amg::Transform3D globalToLocalTransf(const Identifier &id) const
Returns the global -> local transformation.
virtual int layerHash(const Identifier &id) const override
returns the hash function to be used to look up the center and the normal of the tracking surface for...
double stripLowEdgeLocX(int gasGap, int strip, double radialPos) const
Returns the local X of the left edge of the strip at a given local radial position.
Amg::Vector3D wireGangPos(int gasGap, int gang) const
TgcReadoutElement(GeoVFullPhysVol *pv, const std::string &stName, MuonDetectorManager *mgr)
double gangLongWidth(int gasGap, int gang) const
Returns the length of the most top wire in the gang.
virtual int surfaceHash(const Identifier &id) const override
returns the hash function to be used to look up the surface and surface transform for a given identif...
double stripCenterLocX(int gasGap, int strip, double radialPos) const
Returns the local X of the strip center at a given local radial position.
Amg::Vector3D stripPos(int gasGap, int strip) const
Returns the global position of a strip.
double gangRadialLength(int gasGap, int gang) const
Returns the length of the wire gang along the radial direction [pitch x N_{wire}^{gang}...
int nGasGaps() const
Returns the number of gas gaps associated with the readout element (2 or 3)
bool isEndcap() const
Returns true if the chamber is belonging to the 48-fold TxE chambers.
int nWires(int gasGap) const
Returns the total number of wires in a given gas gap.
bool validGang(int gasGap, int wireGang) const
Returns whether the wire gang in the given gasgap is within the allowed range.
Amg::Vector3D localWireGangPos(int gasGap, int gang) const
Returns the local position fo a wireGang.
int nWires(int gasGap, int gang) const
Returns the number of wires in a given gang in gas gap i.
double wireGangTopX(int gasGap, int gangNum) const
Returns the local X of the top wire in the wireGang i in gasGap j.
bool isForward() const
Returns true if the chamber is mounted on the most inner ring, i.e. a TxF chamber.
Amg::Vector3D localGasGapPos(int gg) const
Returns the local position of the gasGap in the AMDB coordinate system.
double physicalDistanceFromBase() const
double wireGangBottomX(int gasGap, int gangNum) const
Returns the local X of the bottom wire in the wireGang i in gasGap j.
double chamberLocPhiMin() const
Returns the minimum angle measured from the center that's covered by the chamber.
int nStrips(int gasGap) const
Returns the number of strips in a given gas gap.
virtual bool containsId(const Identifier &id) const override
Amg::Vector3D wireGangPos(const Identifier &id) const
Returns the global position of a wireGang.
Amg::Vector3D localStripPos(const Identifier &id) const
void setPlaneZ(double value, int gasGap)
Set the local Z coordinate of the i-th gasGap [1-3].
double wirePitch() const
Returns the pitch of the wires.
bool validGap(int gasGap) const
Returns whether the gasGap is within the allowed range [1-nGasGaps()].
virtual const TgcIdHelper & tgcIdHelper() const =0
access to TgcIdHelper
Eigen::Affine3d Transform3D
Eigen::Matrix< double, 2, 1 > Vector2D
Eigen::Matrix< double, 3, 1 > Vector3D
Ensure that the Athena extensions are properly loaded.
Definition GeoMuonHits.h:27