ATLAS Offline Software
Loading...
Searching...
No Matches
CscReadoutElement.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 Csc Readout Element properties
7 -----------------------------------------
8***************************************************************************/
9
10#ifndef MUONREADOUTGEOMETRY_CSCREADOUTELEMENT_H
11#define MUONREADOUTGEOMETRY_CSCREADOUTELEMENT_H
12
17
18namespace Muon {
19 class CscAlignModule;
20 class CombinedMuonAlignModule;
21} // namespace Muon
22
23class CscInternalAlignmentPar;
24class GeoVFullPhysVol;
25
26namespace MuonGM {
27
28 //<<<<<< PUBLIC DEFINES >>>>>>
29 constexpr int maxwlay = 4;
30
31 /*
32 A CscReadoutElement corresponds to a single CSC chamber; therefore typically
33 (in the final MS layout, i.e. if no detector stagein is considered) a CSC
34 station contains 2 CscReadoutElements.
35 CscReadoutElements are identified by StationName, StationEta, StationPhi,
36 Technology=1 and ChamberLayer. Therefore the granularity of the data
37 collections is not equal to the granularity of the geometry description
38 (1 collection -> 2 CscReadoutElement [for final layout]; ->1 CscReadoutElement
39 in the initial layout).
40
41 Pointers to all CscReadoutElements are created in the build() method of the
42 MuonChamber class, and are held in arrays by the MuonDetectorManager, which
43 is responsible for storing, deleting and provide access to these objects.
44
45 A CscReadoutElement holds properties related to its internal structure
46 (i.e. number of strip panels) and general geometrical properties (size);
47 it implements tracking interfaces and provides access to typical
48 readout-geometry information: i.e. number of strips, strip positions, etc.
49
50 The globalToLocalCoords and globalToLocalTransform methods (+ their opposite)
51 define the link between the ATLAS global reference frame and the internal
52 (geo-model defined) local reference frame of any gas gap volume (which is the
53 frame where local coordinates of SimHits, in output from G4, are expressed).
54 */
55
59 friend class MuonChamber;
60 friend class MuonChamberLite;
61
62 public:
63 CscReadoutElement(GeoVFullPhysVol* pv, const std::string& stName, MuonDetectorManager* mgr);
64
65 virtual ~CscReadoutElement();
66
69 virtual double distanceToReadout(const Amg::Vector2D& pos, const Identifier& id) const override final;
70
73 virtual int stripNumber(const Amg::Vector2D& pos, const Identifier& id) const override final;
74
77 virtual bool stripPosition(const Identifier& id, Amg::Vector2D& pos) const override final;
78
80 virtual int layerHash(const Identifier& id) const override final;
81
83 virtual int surfaceHash(const Identifier& id) const override final;
84
86 virtual int boundaryHash(const Identifier& id) const override final;
87
89 virtual bool measuresPhi(const Identifier& id) const override final;
90
92 virtual int numberOfLayers(bool) const override final;
93
95 virtual int numberOfStrips(const Identifier& layerId) const override final;
96 virtual int numberOfStrips(int layer, bool) const override final;
97
101 virtual bool spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector2D& pos) const override;
102
105 virtual bool spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector3D& pos) const override;
106
110 void spacePointPosition(const Amg::Vector2D& phiPos, const Amg::Vector2D& etaPos, Amg::Vector2D& pos) const;
111
112 // Id set/get methods
113 int ChamberLayer() const;
114 void setChamberLayer(int cl);
115
116 int Ngasgaps() const;
117 int NphiStripLayers() const;
118 int NetaStripLayers() const;
119 int NphiStrips(int gasgaplayer) const;
120 int NetaStrips(int gasgaplayer) const;
121 // in the following methods the chlayer argument is irrelevant
122 // the first 3 will disappear
123 double StripWidth(int chlayer, int measphi) const;
124 double StripPitch(int chlayer, int measphi) const;
125 double cathodeReadoutPitch(int chLayer, int measuresPhi) const;
126 double StripWidth(int measphi) const;
127 double StripPitch(int measphi) const;
128 double cathodeReadoutPitch(int measuresPhi) const;
129
130 double shortWidth() const;
131 double length() const;
132 double longWidth() const;
133 int maxNumberOfStrips(int measuresPhi) const;
134 int maxNumberOfStrips(int measuresPhi, double width) const;
135 double activeWidth(int measuresPhi) const;
136 double z0() const;
137 inline double roxacellWidth() const;
138 inline double lengthUpToMaxWidth() const;
139 inline double excent() const;
140
141 Amg::Vector3D stripLayerPos(const Identifier& id) const;
143 Amg::Vector3D stripLayerPos(int chamberLayer, int wireLayer, int measPhi, int channel) const;
146 Amg::Vector3D localStripLayerPos(int chamberLayer, int wireLayer, int measPhi, int channel) const;
147 //
149 Amg::Vector3D localWireLayerPos(int gg) const;
150 Amg::Vector3D wireLayerPos(const Identifier& id) const;
151 Amg::Vector3D wireLayerPos(int gg) const;
152
153 //
156 Amg::Vector3D nominalStripPos(int eta, int chamberLayer, int wireLayer, int measPhi, int channel) const;
158 Amg::Vector3D stripPos(const Identifier& id) const;
160 Amg::Vector3D stripPos(int eta, int chamberLayer, int wireLayer, int measPhi, int channel) const;
162 Amg::Vector3D nominalGlobalPos(const Amg::Vector3D& localP) const;
164 Amg::Vector3D globalPos(const Amg::Vector3D& localP) const;
167 Amg::Vector3D localPos(const Amg::Vector3D& globalP) const;
173
174 Amg::Vector3D nominalLocalStripPos(int eta, int chamberLayer, int wireLayer, int measPhi, int channel) const;
177 Amg::Vector3D nominalLocalClusterPos(int eta, int wireLayer, int measPhi, double x0) const;
180 Amg::Vector3D localStripPos(const Identifier& id) const;
184 Amg::Vector3D localStripPos(int eta, int chamberLayer, int wireLayer, int measPhi, int channel) const;
188 Amg::Vector3D localClusterPos(int eta, int wireLayer, int measPhi, double x0) const;
193 Amg::Vector3D stripPosOnTrackingSurface(int eta, int chamberLayer, int wireLayer, int measPhi, int channel) const;
197 Amg::Transform3D nominalTransform(int gasGap, int measPhi) const;
199 Amg::Vector3D nominalCenter(int gasGap) const;
201 Amg::Vector3D originForInternalALines(int gasGap) const;
203
204 double stripLength(int chamberLayer, int measuresPhi, int stripNumber, double& epsilon) const;
205 double stripLength(const Identifier& id) const;
206 double lengthCorrection(int measuresPhi, double stripPos) const;
207
208 double anodeCathodeDistance() const;
209
219 // local to global and viceversa
221 //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame */
223 //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame */
224 Amg::Transform3D localToGlobalTransf(int gasGap) const;
225 //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame */
226
227 // global to local
229 //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame */
231 //**< localToGlobalCoords and Transf relates gas-gap frame (SensitiveDetectors) to the Global Frame */
232
233
234 void set_ngasgaps(int);
239 void set_stripwidth(double);
240 void set_strippitch(double);
241 void set_wirepitch(double);
245
246 double getGasGapIntAlign_s(int gasGap) const;
247 double getGasGapIntAlign_z(int gasGap) const;
248 double getGasGapIntAlign_t(int gasGap) const;
249 double getGasGapIntAlign_rots(int gasGap) const;
250 double getGasGapIntAlign_rotz(int gasGap) const;
251 double getGasGapIntAlign_rott(int gasGap) const;
252
253 virtual bool containsId(const Identifier& id) const override;
254
255 // compute sin(stereo angle) at a given position:
256 double sinStereo(const Identifier& stripId) const;
257
258 virtual void fillCache() override;
259 double xCoordinateInTrackingFrame(const Identifier& id) const;
260
261 private:
262 void doTests();
263
264 private:
265 double m_excent{-9999.};
266 double m_roxacellwidth{-9999.};
267 double m_RlengthUpToMaxWidth{-9999.};
270 int m_ngasgaps{-1};
276 double m_Phistripwidth{-9999.};
277 double m_Phistrippitch{-9999.};
278 double m_Etastripwidth{-9999.};
279 double m_Etastrippitch{-9999.};
280 double m_wirepitch{-9999.};
282 double m_first_wire_localcoo{-9999.};
283 std::array<double, maxwlay> m_wireplanez{make_array<double, maxwlay>(-9999.)};
284
285 // internal alignment
286 double m_cscIntTransl[4][3]{}; // first index is wireLayer, second = 0,1,2 for s,z,t
287 double m_cscIntRot[4][3]{}; // first index is wireLayer, second = 0,1,2 for rots,z,t
288 };
289
290 inline int CscReadoutElement::ChamberLayer() const { return m_chamberlayer; }
291
293
294 inline double CscReadoutElement::shortWidth() const { return getSsize(); }
295
296 inline double CscReadoutElement::length() const { return getRsize(); }
297
298 inline double CscReadoutElement::longWidth() const { return getLongSsize(); }
299
300 inline double CscReadoutElement::roxacellWidth() const { return m_roxacellwidth; }
301
303
304 inline double CscReadoutElement::excent() const { return m_excent; }
305
307
308 inline int CscReadoutElement::Ngasgaps() const { return m_ngasgaps; }
309
310 inline int CscReadoutElement::NphiStripLayers() const { return m_ngasgaps; }
311
312 inline int CscReadoutElement::NetaStripLayers() const { return m_ngasgaps; }
313
314 inline int CscReadoutElement::NphiStrips(int) const { return m_nPhistripsperlayer; }
315
316 inline int CscReadoutElement::NetaStrips(int) const { return m_nEtastripsperlayer; }
317
318 inline int CscReadoutElement::layerHash(const Identifier& id) const { return manager()->cscIdHelper()->wireLayer(id) - 1; }
319
320 inline int CscReadoutElement::surfaceHash(const Identifier& id) const {
321 return 2 * (manager()->cscIdHelper()->wireLayer(id) - 1) + (manager()->cscIdHelper()->measuresPhi(id) ? 0 : 1);
322 }
323
324 inline int CscReadoutElement::boundaryHash(const Identifier& id) const { return (measuresPhi(id) ? 0 : 1); }
325
326 inline bool CscReadoutElement::measuresPhi(const Identifier& id) const { return manager()->cscIdHelper()->measuresPhi(id); }
327
328 inline int CscReadoutElement::numberOfLayers(bool) const { return Ngasgaps(); }
329 inline int CscReadoutElement::numberOfStrips(const Identifier&) const { return NphiStrips(1); }
330 inline int CscReadoutElement::numberOfStrips(int, bool) const { return NphiStrips(1); }
331
332 inline bool CscReadoutElement::spacePointPosition(const Identifier& phiId, const Identifier& etaId, Amg::Vector3D& pos) const {
333 Amg::Vector2D lpos;
334 spacePointPosition(phiId, etaId, lpos);
335 surface(phiId).localToGlobal(lpos, pos, pos);
336 return true;
337 }
338
339 inline void CscReadoutElement::spacePointPosition(const Amg::Vector2D& phiPos, const Amg::Vector2D& etaPos, Amg::Vector2D& pos) const {
340 pos[0] = phiPos.x();
341 pos[1] = etaPos.x();
342 }
343
344} // namespace MuonGM
345
346#endif // MUONREADOUTGEOMETRY_CSCREADOUTELEMENT_H
Scalar eta() const
pseudorapidity method
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
const double width
#define x
int wireLayer(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
CscReadoutElement(GeoVFullPhysVol *pv, const std::string &stName, MuonDetectorManager *mgr)
This is a "hash" representation of an Identifier.
Amg::Vector3D localClusterPos(int eta, int wireLayer, int measPhi, double x0) const
takes into account internal alignment parameters, hence gives generally answer (local here is the sta...
virtual int numberOfLayers(bool) const override final
number of layers in phi/eta projection
virtual int surfaceHash(const Identifier &id) const override final
returns the hash function to be used to look up the surface and surface transform for a given identif...
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...
Amg::Vector3D localStripPos(const Identifier &id) const
takes into account internal alignment parameters, hence gives generally accurate answer (local here i...
double stripLength(int chamberLayer, int measuresPhi, int stripNumber, double &epsilon) const
std::array< double, maxwlay > m_wireplanez
Amg::Vector3D nominalLocalStripPos(const Identifier &id) const
ignores internal alignment parameters, hence gives generally incorrect answer (local here is the stat...
double getGasGapIntAlign_t(int gasGap) const
Amg::Vector3D localStripLayerPos(const IdentifierHash &id) const
double StripPitch(int chlayer, int measphi) const
double StripWidth(int chlayer, int measphi) const
virtual int layerHash(const Identifier &id) const override final
returns the hash function to be used to look up the center and the normal of the tracking surface for...
double cathodeReadoutPitch(int chLayer, int measuresPhi) const
friend class Muon::CombinedMuonAlignModule
virtual bool measuresPhi(const Identifier &id) const override final
returns whether the given identifier measures phi or not
Amg::Vector3D nominalLocalClusterPos(int eta, int wireLayer, int measPhi, double x0) const
ignores internal alignment parameters, hence gives generally incorrect answer (local here is the stat...
virtual int stripNumber(const Amg::Vector2D &pos, const Identifier &id) const override final
strip number corresponding to local position.
Amg::Vector3D wireLayerPos(const Identifier &id) const
double getGasGapIntAlign_rots(int gasGap) const
double getGasGapIntAlign_rotz(int gasGap) const
double getGasGapIntAlign_z(int gasGap) 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...
Amg::Vector3D globalToLocalCoords(const Amg::Vector3D &x, const Identifier &id) const
double activeWidth(int measuresPhi) const
double sinStereo(const Identifier &stripId) const
Amg::Vector3D globalPos(const Amg::Vector3D &localP) const
station-level method: does not depend on the strip view/layer, hence it cannot account for internal a...
double lengthCorrection(int measuresPhi, double stripPos) const
virtual int numberOfStrips(const Identifier &layerId) const override final
number of strips per layer
Amg::Vector3D localPos(const Amg::Vector3D &globalP) const
station-level method: does not depend on the strip view/layer, hence it cannot account for internal a...
int NphiStrips(int gasgaplayer) const
Amg::Vector3D localToGlobalCoords(const Amg::Vector3D &x, const Identifier &id) const
localToGlobalCoords and Transf connect the Gas Gap Frame (defined as a Sensitive Detector) to the Glo...
Amg::Transform3D nominalTransform(const Identifier &id) const
like tracking Transform but nominal - returns a transform not a reference to it
double getGasGapIntAlign_rott(int gasGap) const
Amg::Vector3D stripPosOnTrackingSurface(const Identifier &id) const
nominal strip pos in the tracking local frame of the measurement surface
void set_first_strip_localcoo(double)
Amg::Vector3D stripPos(const Identifier &id) const
takes into account internal alignment parameters, hence gives accurate answer
double xCoordinateInTrackingFrame(const Identifier &id) const
virtual double distanceToReadout(const Amg::Vector2D &pos, const Identifier &id) const override final
distance to readout.
Amg::Transform3D globalToLocalTransf(const Identifier &id) const
Amg::Vector3D nominalCenter(int gasGap) const
like tracking center but nominal - returns a Amg::Vector3D not a reference to it
friend class Muon::CscAlignModule
CscReadoutElement(GeoVFullPhysVol *pv, const std::string &stName, MuonDetectorManager *mgr)
Amg::Vector3D nominalGlobalPos(const Amg::Vector3D &localP) const
ignores internal alignment parameters, hence gives generally incorrect answer
Amg::Transform3D localToGlobalTransf(const Identifier &id) const
virtual void fillCache() override
int NetaStrips(int gasgaplayer) const
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
Amg::Vector3D originForInternalALines(int gasGap) const
like tracking center but nominal - returns a Amg::Vector3D not a reference to it
Amg::Vector3D localWireLayerPos(const Identifier &id) const
virtual bool containsId(const Identifier &id) const override
Amg::Vector3D nominalStripPos(const Identifier &id) const
ignores internal alignment parameters, hence gives generally incorrect answer
Amg::Vector3D localStripLayerPos(const Identifier &id) const
int maxNumberOfStrips(int measuresPhi) const
void setCscInternalAlignmentPar(const ALinePar &)
void set_first_wire_localcoo(double)
double getGasGapIntAlign_s(int gasGap) const
Amg::Vector3D stripLayerPos(const Identifier &id) const
virtual const Trk::PlaneSurface & surface() const override
access to chamber surface (phi orientation), uses the first gas gap
MuonClusterReadoutElement(GeoVFullPhysVol *pv, MuonDetectorManager *mgr, Trk::DetectorElemType detType)
The MuonDetectorManager stores the transient representation of the Muon Spectrometer geometry and pro...
virtual void localToGlobal(const Amg::Vector2D &locp, const Amg::Vector3D &mom, Amg::Vector3D &glob) const override final
Specified for PlaneSurface: LocalToGlobal method without dynamic memory allocation.
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
constexpr int maxwlay
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.