ATLAS Offline Software
TgcReadoutParams.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 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>;
62  TgcReadoutParams(const std::string& name,
63  int iCh,
64  double WireSp,
65  const int NCHRNG,
66  GasGapIntArray && numWireGangs,
67  WiregangArray&& IWGS1,
68  WiregangArray&& IWGS2,
69  WiregangArray&& IWGS3,
70  double PDIST,
71  std::vector<StripArray>&& SLARGE,
72  std::vector<StripArray>&& SSHORT,
73  GasGapIntArray&& numStrips);
74 
76 
77  inline const std::string& GetName() const;
78  int chamberType() const;
79  int nPhiChambers() const;
80  int nGaps() const;
81 
83  double wirePitch() const;
85  inline double gangThickness() const;
87  int nWireGangs(int gasGap) const;
89  int totalWires(int gasGap) const;
91  int nWires(int gasGap, int gang) const;
93  int nSummedWires(int gasGap, int gang) const;
95  double nPitchesToGang(int gasGap, int gang) const;
96 
97  // Access to strip parameters
98  inline double stripThickness() const;
99  int nStrips(int gasGap) const;
100 
101  double physicalDistanceFromBase() const;
104  double stripPositionOnLargeBase(int strip, int gasGap) const;
107  double stripPositionOnShortBase(int strip, int gasGap) const;
110  double stripCenter(int strip , int gasGap) const;
112  int nStripLayers() const { return m_stripPositionCenter.size(); }
113  private:
114  // Data members
115  std::string m_chamberName{};
117  double m_wirePitch{0.};
119 
121  std::array<std::vector<int>, MaxNGaps> m_nWires{};
123  std::array<std::vector<int>, MaxNGaps> m_nAccWires{};
124 
125  GasGapIntArray m_nStrips{make_array<int, MaxNGaps>(0)};
126  GasGapIntArray m_totalWires{make_array<int, MaxNGaps>(0)};
127 
128 
129  // strip postion on the bases for the first layer in +Z
134  std::vector<StripArray> m_stripPositionOnLargeBase{};
135  std::vector<StripArray> m_stripPositionOnShortBase{};
138  std::vector<StripArray> m_stripPositionCenter{};
139 
140  inline bool invalidGasGap(int gasGap) const{ return gasGap<1 or gasGap>MaxNGaps;}
141  inline bool invalidGang(int gang) const{ return gang<1 or gang>MaxNGangs;}
142  // Hard-coded data
143  static constexpr double m_gangThickness = 0.05 * Gaudi::Units::mm;
144  static constexpr double m_stripThickness = 0.03 * Gaudi::Units::mm;
145  };
148 
149  const std::string& TgcReadoutParams::GetName() const { return m_chamberName; }
150 } // namespace MuonGM
151 
152 #endif // MUONREADOUTGEOMETRY_TGCREADOUTPARAMS_H
MuonGM::TgcReadoutParams::nStripLayers
int nStripLayers() const
Returns the number of defined strip layers.
Definition: TgcReadoutParams.h:112
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
python.SystemOfUnits.mm
float mm
Definition: SystemOfUnits.py:98
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:123
MuonGM::TgcReadoutParams::chamberType
int chamberType() const
Definition: TgcReadoutParams.cxx:80
MuonGM::TgcReadoutParams::MaxNStrips
@ MaxNStrips
Definition: TgcReadoutParams.h:42
MuonGM::TgcReadoutParams::m_gangThickness
static constexpr double m_gangThickness
Definition: TgcReadoutParams.h:143
MuonGM::TgcReadoutParams::stripPositionOnLargeBase
double stripPositionOnLargeBase(int strip, int gasGap) 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:130
MuonGM::TgcReadoutParams::m_physicalDistanceFromBase
double m_physicalDistanceFromBase
Definition: TgcReadoutParams.h:130
MuonGM::TgcReadoutParams::stripThickness
double stripThickness() const
Definition: TgcReadoutParams.h:146
MuonGM::TgcReadoutParams::physicalDistanceFromBase
double physicalDistanceFromBase() const
Definition: TgcReadoutParams.cxx:128
MuonGM::TgcReadoutParams::m_stripPositionOnLargeBase
std::vector< 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:134
MuonGM::TgcReadoutParams::m_stripThickness
static constexpr double m_stripThickness
Definition: TgcReadoutParams.h:144
MuonGM::TgcReadoutParams::m_nStrips
GasGapIntArray m_nStrips
Definition: TgcReadoutParams.h:125
MuonGM::TgcReadoutParams::StripArray
std::array< double, MaxNStrips > StripArray
Definition: TgcReadoutParams.h:46
MuonGM::TgcReadoutParams::m_nPhiChambers
int m_nPhiChambers
Definition: TgcReadoutParams.h:118
MuonGM::TgcReadoutParams::totalWires
int totalWires(int gasGap) const
Returns the total number of wires in a given gang.
Definition: TgcReadoutParams.cxx:93
MuonGM::TgcReadoutParams::nGaps
int nGaps() const
Definition: TgcReadoutParams.cxx:82
MuonGM::TgcReadoutParams::m_chamberName
std::string m_chamberName
Definition: TgcReadoutParams.h:115
MuonGM::TgcReadoutParams::nWires
int nWires(int gasGap, int gang) const
Returns the number of wires in a given gang.
Definition: TgcReadoutParams.cxx:100
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:121
MuonGM::TgcReadoutParams::nStrips
int nStrips(int gasGap) const
Definition: TgcReadoutParams.cxx:122
MuonGM::TgcReadoutParams::TgcReadoutArraySizes
TgcReadoutArraySizes
Definition: TgcReadoutParams.h:42
MuonGM::TgcReadoutParams::invalidGasGap
bool invalidGasGap(int gasGap) const
Definition: TgcReadoutParams.h:140
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:84
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
MuonGM::TgcReadoutParams::nSummedWires
int nSummedWires(int gasGap, int gang) const
Returns the sum of all wires from gang [1 - i)
Definition: TgcReadoutParams.cxx:106
MuonGM::TgcReadoutParams::m_stripPositionOnShortBase
std::vector< StripArray > m_stripPositionOnShortBase
Definition: TgcReadoutParams.h:135
MuonGM::TgcReadoutParams::invalidGang
bool invalidGang(int gang) const
Definition: TgcReadoutParams.h:141
MuonGM::TgcReadoutParams::nWireGangs
int nWireGangs(int gasGap) const
Returns the number of wire gangs.
Definition: TgcReadoutParams.cxx:86
MuonGM::TgcReadoutParams::m_stripPositionCenter
std::vector< 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:138
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
MuonGM::TgcReadoutParams::m_chamberType
int m_chamberType
Definition: TgcReadoutParams.h:116
MuonGM::TgcReadoutParams::TgcReadoutParams
TgcReadoutParams()
Default constructor used by the MuonTPCnv tests.
Definition: TgcReadoutParams.cxx:11
MuonGM::TgcReadoutParams::stripPositionOnShortBase
double stripPositionOnShortBase(int strip, int gasGap) const
Returns the signed distance of the i-th's strip's left edge w.r.t.
Definition: TgcReadoutParams.cxx:146
MuonGM::TgcReadoutParams::m_wirePitch
double m_wirePitch
Definition: TgcReadoutParams.h:117
MuonGM::TgcReadoutParams::stripCenter
double stripCenter(int strip, int gasGap) const
Returns the signed distance along the chamber edge of the strip expressed at the chamber center.
Definition: TgcReadoutParams.cxx:163
MuonGM::TgcReadoutParams::gangThickness
double gangThickness() const
Definition: TgcReadoutParams.h:147
AthMessaging.h
MuonGM::TgcReadoutParams
Definition: TgcReadoutParams.h:38
MuonGM::TgcReadoutParams::WiregangArray
std::array< int, MaxNGangs > WiregangArray
Definition: TgcReadoutParams.h:45
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:112
MuonGM::TgcReadoutParams::GetName
const std::string & GetName() const
Definition: TgcReadoutParams.h:149
MuonGM::TgcReadoutParams::m_totalWires
GasGapIntArray m_totalWires
Definition: TgcReadoutParams.h:126
MuonGM::TgcReadoutParams::MaxNGangs
@ MaxNGangs
Definition: TgcReadoutParams.h:42
MuonGM::TgcReadoutParams::~TgcReadoutParams
~TgcReadoutParams()
MuonGM::TgcReadoutParams::nPhiChambers
int nPhiChambers() const
Definition: TgcReadoutParams.cxx:81