ATLAS Offline Software
TgcReadoutParams.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_TGCREADOUTPARAMS_H
6 #define MUONREADOUTGEOMETRY_TGCREADOUTPARAMS_H
7 
8 // ******************************************************************************
9 // class TgcReadoutParams
10 // ******************************************************************************
11 //
12 // Description
13 // -----------
14 // Provides access to the TGC readout parameters. Created from one of the
15 // "sources": TGC_ZebraDetDescrSource, TGC_NovaDetDescrSource, etc. One
16 // object is instantiated per chamber type and is pointed to by the
17 // TGC_DetDescriptor object corresponding to that type.
18 //
19 // Inheritance
20 // -----------
21 // None.
22 //
23 // Dependencies
24 // ------------
25 // None.
26 //
27 // ******************************************************************************
29 #include <CxxUtils/ArrayHelper.h>
30 #include <GaudiKernel/SystemOfUnits.h>
31 #include <array>
32 #include <string>
33 #include <vector>
34 
35 
36 namespace MuonGM {
37 
38  class TgcReadoutParams : public AthMessaging {
39  public:
40 
41  // Readout array sizes
43  using GasGapIntArray = std::array<int, MaxNGaps>;
44  using GasGapFloatArray = std::array<double, MaxNGaps>;
45  using WiregangArray = std::array<int, MaxNGangs>;
46  using StripArray = std::array<double, MaxNStrips>;
47 
50 
51  TgcReadoutParams(const std::string& name,
52  int iCh,
53  int Version,
54  double WireSp,
55  const int NCHRNG,
56  GasGapIntArray && numWireGangs,
57  WiregangArray&& IWGS1,
58  WiregangArray&& IWGS2,
59  WiregangArray&& IWGS3,
60  GasGapIntArray&& numStrips);
61 
62  // Another constructor for the layout Q
63  TgcReadoutParams(const std::string& name,
64  int iCh,
65  int Version, double WireSp,
66  const int NCHRNG,
67  GasGapIntArray && numWireGangs,
68  WiregangArray&& IWGS1,
69  WiregangArray&& IWGS2,
70  WiregangArray&& IWGS3,
71 
72  double PDIST,
73  StripArray&& SLARGE,
74  StripArray&& SSHORT,
75  GasGapIntArray&& numStrips);
76 
78 
79  inline const std::string& GetName() const;
80  int chamberType() const;
81  int readoutVersion() const;
82  int nPhiChambers() const;
83  int nGaps() const;
84 
86  double wirePitch() const;
88  inline double gangThickness() const;
90  int nWireGangs(int gasGap) const;
92  int totalWires(int gasGap) const;
94  int nWires(int gasGap, int gang) const;
96  int nSummedWires(int gasGap, int gang) const;
98  double nPitchesToGang(int gasGap, int gang) const;
99 
100  // Access to strip parameters
101  inline double stripThickness() const;
102  int nStrips(int gasGap) const;
103 
104  double physicalDistanceFromBase() const;
107  double stripPositionOnLargeBase(int strip) const;
110  double stripPositionOnShortBase(int strip) const;
113  double stripCenter(int strip) const;
114 
115  private:
116  // Data members
117  std::string m_chamberName{};
120  double m_wirePitch{0.};
122 
124  std::array<std::vector<int>, MaxNGaps> m_nWires{};
126  std::array<std::vector<int>, MaxNGaps> m_nAccWires{};
127 
128  GasGapIntArray m_nStrips{make_array<int, MaxNGaps>(0)};
129  GasGapIntArray m_totalWires{make_array<int, MaxNGaps>(0)};
130 
131 
132  // strip postion on the bases for the first layer in +Z
137  StripArray m_stripPositionOnLargeBase{make_array<double, MaxNStrips>(0)};
138  StripArray m_stripPositionOnShortBase{make_array<double, MaxNStrips>(0)};
141  StripArray m_stripPositionCenter{make_array<double, MaxNStrips>(0)};
142 
143  inline bool invalidGasGap(int gasGap) const{ return gasGap<1 or gasGap>MaxNGaps;}
144  inline bool invalidGang(int gang) const{ return gang<1 or gang>MaxNGangs;}
145  // Hard-coded data
146  static constexpr double m_gangThickness = 0.05 * Gaudi::Units::mm;
147  static constexpr double m_stripThickness = 0.03 * Gaudi::Units::mm;
148  };
151 
152  const std::string& TgcReadoutParams::GetName() const { return m_chamberName; }
153 } // namespace MuonGM
154 
155 #endif // MUONREADOUTGEOMETRY_TGCREADOUTPARAMS_H
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
MuonGM
Ensure that the Athena extensions are properly loaded.
Definition: GeoMuonHits.h:27
MuonGM::TgcReadoutParams::GasGapFloatArray
std::array< double, MaxNGaps > GasGapFloatArray
Definition: TgcReadoutParams.h:44
MuonGM::TgcReadoutParams::m_nAccWires
std::array< std::vector< int >, MaxNGaps > m_nAccWires
Map describing the number of all wires up to gang i in gasgap j.
Definition: TgcReadoutParams.h:126
MuonGM::TgcReadoutParams::chamberType
int chamberType() const
Definition: TgcReadoutParams.cxx:101
MuonGM::TgcReadoutParams::MaxNStrips
@ MaxNStrips
Definition: TgcReadoutParams.h:42
MuonGM::TgcReadoutParams::m_gangThickness
static constexpr double m_gangThickness
Definition: TgcReadoutParams.h:146
MuonGM::TgcReadoutParams::m_stripPositionOnShortBase
StripArray m_stripPositionOnShortBase
Definition: TgcReadoutParams.h:138
MuonGM::TgcReadoutParams::m_physicalDistanceFromBase
double m_physicalDistanceFromBase
Definition: TgcReadoutParams.h:133
MuonGM::TgcReadoutParams::stripThickness
double stripThickness() const
Definition: TgcReadoutParams.h:149
MuonGM::TgcReadoutParams::physicalDistanceFromBase
double physicalDistanceFromBase() const
Definition: TgcReadoutParams.cxx:156
MuonGM::TgcReadoutParams::m_stripThickness
static constexpr double m_stripThickness
Definition: TgcReadoutParams.h:147
MuonGM::TgcReadoutParams::m_nStrips
GasGapIntArray m_nStrips
Definition: TgcReadoutParams.h:128
MuonGM::TgcReadoutParams::StripArray
std::array< double, MaxNStrips > StripArray
Definition: TgcReadoutParams.h:46
MuonGM::TgcReadoutParams::m_nPhiChambers
int m_nPhiChambers
Definition: TgcReadoutParams.h:121
MuonGM::TgcReadoutParams::totalWires
int totalWires(int gasGap) const
Returns the total number of wires in a given gang.
Definition: TgcReadoutParams.cxx:116
MuonGM::TgcReadoutParams::nGaps
int nGaps() const
Definition: TgcReadoutParams.cxx:104
MuonGM::TgcReadoutParams::m_chamberName
std::string m_chamberName
Definition: TgcReadoutParams.h:117
MuonGM::TgcReadoutParams::nWires
int nWires(int gasGap, int gang) const
Returns the number of wires in a given gang.
Definition: TgcReadoutParams.cxx:124
MuonGM::TgcReadoutParams::m_nWires
std::array< std::vector< int >, MaxNGaps > m_nWires
Map of number of wires in a given wire gang & gas gap.
Definition: TgcReadoutParams.h:124
MuonGM::TgcReadoutParams::nStrips
int nStrips(int gasGap) const
Definition: TgcReadoutParams.cxx:149
MuonGM::TgcReadoutParams::TgcReadoutArraySizes
TgcReadoutArraySizes
Definition: TgcReadoutParams.h:42
MuonGM::TgcReadoutParams::invalidGasGap
bool invalidGasGap(int gasGap) const
Definition: TgcReadoutParams.h:143
MuonGM::TgcReadoutParams::GasGapIntArray
std::array< int, MaxNGaps > GasGapIntArray
Definition: TgcReadoutParams.h:43
ArrayHelper.h
MuonGM::TgcReadoutParams::wirePitch
double wirePitch() const
Returns the wire pitch.
Definition: TgcReadoutParams.cxx:106
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonGM::TgcReadoutParams::stripPositionOnShortBase
double stripPositionOnShortBase(int strip) const
Returns the signed distance of the i-th's strip's left edge w.r.t.
Definition: TgcReadoutParams.cxx:168
MuonGM::TgcReadoutParams::nSummedWires
int nSummedWires(int gasGap, int gang) const
Returns the sum of all wires from gang [1 - i)
Definition: TgcReadoutParams.cxx:131
MuonGM::TgcReadoutParams::invalidGang
bool invalidGang(int gang) const
Definition: TgcReadoutParams.h:144
MuonGM::TgcReadoutParams::m_stripPositionOnLargeBase
StripArray m_stripPositionOnLargeBase
These 2 arrays represent the left edges of the i-th strip in a Tgc chamber The numbers are given as t...
Definition: TgcReadoutParams.h:137
MuonGM::TgcReadoutParams::nWireGangs
int nWireGangs(int gasGap) const
Returns the number of wire gangs.
Definition: TgcReadoutParams.cxx:108
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
MuonGM::TgcReadoutParams::m_chamberType
int m_chamberType
Definition: TgcReadoutParams.h:118
MuonGM::TgcReadoutParams::TgcReadoutParams
TgcReadoutParams()
Constructor not setting any parameters.
Definition: TgcReadoutParams.cxx:20
MuonGM::TgcReadoutParams::m_wirePitch
double m_wirePitch
Definition: TgcReadoutParams.h:120
MuonGM::TgcReadoutParams::m_stripPositionCenter
StripArray m_stripPositionCenter
The position of the strip center is defined as the intersector of the large and short edge strip posi...
Definition: TgcReadoutParams.h:141
python.SystemOfUnits.mm
int mm
Definition: SystemOfUnits.py:83
MuonGM::TgcReadoutParams::m_readoutVersion
int m_readoutVersion
Definition: TgcReadoutParams.h:119
MuonGM::TgcReadoutParams::gangThickness
double gangThickness() const
Definition: TgcReadoutParams.h:150
AthMessaging.h
MuonGM::TgcReadoutParams
Definition: TgcReadoutParams.h:38
MuonGM::TgcReadoutParams::WiregangArray
std::array< int, MaxNGangs > WiregangArray
Definition: TgcReadoutParams.h:45
MuonGM::TgcReadoutParams::readoutVersion
int readoutVersion() const
Definition: TgcReadoutParams.cxx:102
MuonGM::TgcReadoutParams::stripCenter
double stripCenter(int strip) const
Returns the signed distance along the chamber edge of the strip expressed at the chamber center.
Definition: TgcReadoutParams.cxx:179
MuonGM::TgcReadoutParams::MaxNGaps
@ MaxNGaps
Definition: TgcReadoutParams.h:42
MuonGM::TgcReadoutParams::nPitchesToGang
double nPitchesToGang(int gasGap, int gang) const
Returns the number of wire pitches that have to be travelled to reach gang i.
Definition: TgcReadoutParams.cxx:138
MuonGM::TgcReadoutParams::GetName
const std::string & GetName() const
Definition: TgcReadoutParams.h:152
MuonGM::TgcReadoutParams::m_totalWires
GasGapIntArray m_totalWires
Definition: TgcReadoutParams.h:129
MuonGM::TgcReadoutParams::MaxNGangs
@ MaxNGangs
Definition: TgcReadoutParams.h:42
MuonGM::TgcReadoutParams::~TgcReadoutParams
~TgcReadoutParams()
MuonGM::TgcReadoutParams::stripPositionOnLargeBase
double stripPositionOnLargeBase(int strip) const
Returns the signed distance of the i-th's strip's left edge w.r.t the center of the bottom chamber ed...
Definition: TgcReadoutParams.cxx:158
MuonGM::TgcReadoutParams::nPhiChambers
int nPhiChambers() const
Definition: TgcReadoutParams.cxx:103