ATLAS Offline Software
TGCId.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 MUONTGC_CABLING_TGCID_H
6 #define MUONTGC_CABLING_TGCID_H
7 
8 namespace MuonTGC_Cabling {
9 
10 class TGCId {
11  public:
12  enum class IdType { NoIdType, Channel, Module, MaxIdType };
13 
14  public:
15  TGCId(IdType vtype = IdType::NoIdType);
16  virtual ~TGCId() = default;
17 
18  virtual bool isValid() const { return true; }
19 
20  public:
21  // <internal numbering scheme>
22  // 1. IdType
23  // 2. IdIndex
24  // int station [0..3]
25  // int sectorRO [0..11]
26  // int srod [0..2]
27  // int octant [0..7]
28  // int sector [0..47],[0..23]
29  // int chamber [0..n]
30  // int id [0..n]
31  //
33  // int layer [0..8]
34  // int block [0..n]
35  // int channel [0..n]
36 
37  static constexpr int NUM_STATIONS = 4;
38  static constexpr int NUM_LAYERS = 9; // [0..2]:M1, [3..4]:M2, [5..6]:M3, [7..8]:M4(Inner)
39  static constexpr int NUM_OCTANT = 8;
40  static constexpr int NUM_ENDCAP_SECTOR = 48;
41  static constexpr int NUM_FORWARD_SECTOR = 24;
42  static constexpr int NUM_INNER_SECTOR = 24;
43  static constexpr int N_RODS = 12;
44 
55 
56  IdType getIdType (void) const;
57  SideType getSideType (void) const;
58  ModuleType getModuleType (void) const;
59  SignalType getSignalType (void) const;
60  MultipletType getMultipletType (void) const;
61  RegionType getRegionType (void) const;
62 
63  int getSectorInReadout(void) const;
64 
65  virtual int getSectorInOctant() const;
66  virtual int getSectorModule() const;
67 
68  int getStation() const;
69  int getOctant() const;
70  virtual int getSector() const;
71  int getChamber() const;
72  int getId() const;
73  int getBlock() const;
74 
75  bool isAside() const;
76  bool isCside() const;
77  bool isStrip() const;
78  bool isWire() const;
79  bool isTriplet() const;
80  bool isDoublet() const;
81  bool isInner() const;
82  bool isForward() const;
83  bool isEndcap() const;
84  bool isBackward() const;
85 
86  public:
90  void setMultipletType(MultipletType multiplet);
91  void setRegionType(RegionType region);
92 
93  virtual void setStation (int vstation);
94  virtual void setOctant (int voctant);
95  virtual void setSector (int vsector);
96  virtual void setChamber(int chamber);
97  void setId(int id);
98 
99  protected:
100  void setIdType(IdType idtype);
101  void setReadoutSector(int sector);
102  void setSectorModule(int sectorModule);
103 
104  protected:
110 
111  int m_station{-1};
112  int m_octant{-1};
113  int m_sector{-1};
114  int m_chamber{-1};
115  int m_id{-1};
116 
117  private:
119 };
120 
121 inline TGCId::IdType TGCId::getIdType() const { return m_idType; }
122 inline TGCId::SideType TGCId::getSideType() const { return m_side; }
127 
128 inline int TGCId::getStation() const { return m_station; }
129 inline int TGCId::getOctant() const { return m_octant; }
130 inline int TGCId::getSector() const { return m_sector; }
131 inline int TGCId::getChamber() const { return m_chamber; }
132 inline int TGCId::getId() const { return m_id; }
133 
134 inline bool TGCId::isAside() const { return (m_side == Aside); }
135 inline bool TGCId::isCside() const { return (m_side == Cside); }
136 inline bool TGCId::isStrip() const { return (m_signal == Strip); }
137 inline bool TGCId::isWire() const { return (m_signal == Wire); }
138 inline bool TGCId::isTriplet() const { return (m_multiplet == Triplet); }
139 inline bool TGCId::isDoublet() const { return (m_multiplet == Doublet); }
140 inline bool TGCId::isInner() const { return (m_multiplet == Inner); }
141 inline bool TGCId::isForward() const { return (m_region == Forward); }
142 inline bool TGCId::isEndcap() const { return (m_region == Endcap); }
143 
145  m_side = side;
146 }
147 
148 inline void TGCId::setRegionType(RegionType region) {
149  m_region = region;
150 }
151 
152 inline void TGCId::setChamber(int chamber) {
153  m_chamber = chamber;
154 }
155 
156 inline void TGCId::setId(int id) {
157  m_id = id;
158 }
159 
160 inline void TGCId::setIdType(IdType idtype) {
161  m_idType = idtype;
162 }
163 
164 } // end of namespace
165 
166 #endif
MuonTGC_Cabling::TGCId::MaxModuleType
@ MaxModuleType
Definition: TGCId.h:48
MuonTGC_Cabling::TGCId::getChamber
int getChamber() const
Definition: TGCId.h:131
MuonTGC_Cabling::TGCId::m_station
int m_station
Definition: TGCId.h:111
MuonTGC_Cabling::TGCId::isEndcap
bool isEndcap() const
Definition: TGCId.h:142
MuonTGC_Cabling::TGCId::m_id
int m_id
Definition: TGCId.h:115
MuonTGC_Cabling::TGCId::getStation
int getStation() const
Definition: TGCId.h:128
MuonTGC_Cabling::TGCId::setRegionType
void setRegionType(RegionType region)
Definition: TGCId.h:148
MuonTGC_Cabling::TGCId::isValid
virtual bool isValid() const
Definition: TGCId.h:18
MuonTGC_Cabling::TGCId::SI
@ SI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::m_idType
IdType m_idType
Definition: TGCId.h:118
MuonTGC_Cabling::TGCId::getMultipletType
MultipletType getMultipletType(void) const
Definition: TGCId.h:125
MuonTGC_Cabling::TGCId::IdType::NoIdType
@ NoIdType
MuonTGC_Cabling::TGCId::getSideType
SideType getSideType(void) const
Definition: TGCId.h:122
MuonTGC_Cabling::TGCId::getSignalType
SignalType getSignalType(void) const
Definition: TGCId.h:124
MuonTGC_Cabling::TGCId::IdType::MaxIdType
@ MaxIdType
MuonTGC_Cabling::TGCId::m_module
ModuleType m_module
Definition: TGCId.h:106
calibdata.chamber
chamber
Definition: calibdata.py:32
MuonTGC_Cabling::TGCId::getRegionType
RegionType getRegionType(void) const
Definition: TGCId.h:126
MuonTGC_Cabling::TGCId::setMultipletType
void setMultipletType(MultipletType multiplet)
Definition: TGCId.cxx:104
MuonTGC_Cabling::TGCId::setIdType
void setIdType(IdType idtype)
Definition: TGCId.h:160
MuonTGC_Cabling::TGCId::getIdType
IdType getIdType(void) const
Definition: TGCId.h:121
MuonTGC_Cabling::TGCId::N_RODS
static constexpr int N_RODS
Definition: TGCId.h:43
MuonTGC_Cabling::TGCId::~TGCId
virtual ~TGCId()=default
MuonTGC_Cabling::TGCId::setSignalType
void setSignalType(SignalType signal)
Definition: TGCId.cxx:94
MuonTGC_Cabling::TGCId::isAside
bool isAside() const
Definition: TGCId.h:134
MuonTGC_Cabling::TGCId::setId
void setId(int id)
Definition: TGCId.h:156
MuonTGC_Cabling::TGCId::m_side
SideType m_side
Definition: TGCId.h:105
MuonTGC_Cabling::TGCId::setSector
virtual void setSector(int vsector)
Definition: TGCId.cxx:122
MuonTGC_Cabling::TGCId::setModuleType
void setModuleType(ModuleType module)
Definition: TGCId.cxx:66
MuonTGC_Cabling::TGCId::SignalType
SignalType
Definition: TGCId.h:49
MuonTGC_Cabling::TGCId::ModuleType
ModuleType
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::setSectorModule
void setSectorModule(int sectorModule)
Definition: TGCId.cxx:159
MuonTGC_Cabling::TGCId::setChamber
virtual void setChamber(int chamber)
Definition: TGCId.h:152
MuonTGC_Cabling::TGCId::getModuleType
ModuleType getModuleType(void) const
Definition: TGCId.h:123
MuonTGC_Cabling::TGCId::MaxSideType
@ MaxSideType
Definition: TGCId.h:46
MuonTGC_Cabling::TGCId::NUM_INNER_SECTOR
static constexpr int NUM_INNER_SECTOR
Definition: TGCId.h:42
MuonTGC_Cabling::TGCId::isStrip
bool isStrip() const
Definition: TGCId.h:136
MuonTGC_Cabling::TGCId::getSectorInOctant
virtual int getSectorInOctant() const
Definition: TGCId.cxx:13
MuonTGC_Cabling::TGCId::setSideType
void setSideType(SideType side)
Definition: TGCId.h:144
MuonTGC_Cabling::TGCId::isForward
bool isForward() const
Definition: TGCId.h:141
MuonTGC_Cabling::TGCId
Definition: TGCId.h:10
MuonTGC_Cabling::TGCId::getBlock
int getBlock() const
MuonTGC_Cabling::TGCId::isTriplet
bool isTriplet() const
Definition: TGCId.h:138
MuonTGC_Cabling::TGCId::SD
@ SD
Definition: TGCId.h:47
TRT::Hit::side
@ side
Definition: HitInfo.h:83
MuonTGC_Cabling::TGCId::NUM_FORWARD_SECTOR
static constexpr int NUM_FORWARD_SECTOR
Definition: TGCId.h:41
MuonTGC_Cabling::TGCId::isBackward
bool isBackward() const
Definition: TGCId.cxx:39
python.PyAthena.module
module
Definition: PyAthena.py:131
Cut::signal
@ signal
Definition: SUSYToolsAlg.cxx:67
MuonTGC_Cabling::TGCId::NUM_OCTANT
static constexpr int NUM_OCTANT
Definition: TGCId.h:39
MuonTGC_Cabling::TGCId::TGCId
TGCId(IdType vtype=IdType::NoIdType)
Definition: TGCId.cxx:9
MuonTGC_Cabling::TGCId::m_region
RegionType m_region
Definition: TGCId.h:109
MuonTGC_Cabling::TGCId::Doublet
@ Doublet
Definition: TGCId.h:51
MuonTGC_Cabling::TGCId::NUM_LAYERS
static constexpr int NUM_LAYERS
Definition: TGCId.h:38
MuonTGC_Cabling::TGCId::getSectorInReadout
int getSectorInReadout(void) const
Definition: TGCId.cxx:26
MuonTGC_Cabling::TGCId::isDoublet
bool isDoublet() const
Definition: TGCId.h:139
MuonTGC_Cabling::TGCId::m_sector
int m_sector
Definition: TGCId.h:113
MuonTGC_Cabling::TGCId::getOctant
int getOctant() const
Definition: TGCId.h:129
MuonTGC_Cabling::TGCId::WT
@ WT
Definition: TGCId.h:47
MuonTGC_Cabling
Definition: TGCCable.h:13
MuonTGC_Cabling::TGCId::getId
int getId() const
Definition: TGCId.h:132
MuonTGC_Cabling::TGCId::setStation
virtual void setStation(int vstation)
Definition: TGCId.cxx:114
MuonTGC_Cabling::TGCId::Strip
@ Strip
Definition: TGCId.h:49
MuonTGC_Cabling::TGCId::MultipletType
MultipletType
Definition: TGCId.h:51
MuonTGC_Cabling::TGCId::MaxChamberType
@ MaxChamberType
Definition: TGCId.h:52
MuonTGC_Cabling::TGCId::WD
@ WD
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::Inner
@ Inner
Definition: TGCId.h:51
MuonTGC_Cabling::TGCId::setReadoutSector
void setReadoutSector(int sector)
MuonTGC_Cabling::TGCId::Endcap
@ Endcap
Definition: TGCId.h:53
MuonTGC_Cabling::TGCId::WI
@ WI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::NoMultipletType
@ NoMultipletType
Definition: TGCId.h:51
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
MuonTGC_Cabling::TGCId::m_multiplet
MultipletType m_multiplet
Definition: TGCId.h:108
MuonTGC_Cabling::TGCId::MaxRegionType
@ MaxRegionType
Definition: TGCId.h:54
MuonTGC_Cabling::TGCId::m_chamber
int m_chamber
Definition: TGCId.h:114
MuonTGC_Cabling::TGCId::NoRegionType
@ NoRegionType
Definition: TGCId.h:53
MuonTGC_Cabling::TGCId::NoModuleType
@ NoModuleType
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::IdType::Module
@ Module
MuonTGC_Cabling::TGCId::MaxSignalType
@ MaxSignalType
Definition: TGCId.h:50
MuonTGC_Cabling::TGCId::NUM_STATIONS
static constexpr int NUM_STATIONS
in ChannelId
Definition: TGCId.h:37
MuonTGC_Cabling::TGCId::ST
@ ST
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::IdType::Channel
@ Channel
MuonTGC_Cabling::TGCId::isWire
bool isWire() const
Definition: TGCId.h:137
MuonTGC_Cabling::TGCId::getSector
virtual int getSector() const
Definition: TGCId.h:130
MuonTGC_Cabling::TGCId::Cside
@ Cside
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::NoSideType
@ NoSideType
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::isCside
bool isCside() const
Definition: TGCId.h:135
MuonTGC_Cabling::TGCId::isInner
bool isInner() const
Definition: TGCId.h:140
MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR
static constexpr int NUM_ENDCAP_SECTOR
Definition: TGCId.h:40
MuonTGC_Cabling::TGCId::Wire
@ Wire
Definition: TGCId.h:49
MuonTGC_Cabling::TGCId::Triplet
@ Triplet
Definition: TGCId.h:51
MuonTGC_Cabling::TGCId::RegionType
RegionType
Definition: TGCId.h:53
MuonTGC_Cabling::TGCId::NoSignalType
@ NoSignalType
Definition: TGCId.h:49
MuonTGC_Cabling::TGCId::SideType
SideType
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::m_octant
int m_octant
Definition: TGCId.h:112
MuonTGC_Cabling::TGCId::Aside
@ Aside
Definition: TGCId.h:45
MuonTGC_Cabling::TGCId::Forward
@ Forward
Definition: TGCId.h:53
MuonTGC_Cabling::TGCId::m_signal
SignalType m_signal
Definition: TGCId.h:107
MuonTGC_Cabling::TGCId::setOctant
virtual void setOctant(int voctant)
Definition: TGCId.cxx:135
MuonTGC_Cabling::TGCId::IdType
IdType
Definition: TGCId.h:12
MuonTGC_Cabling::TGCId::getSectorModule
virtual int getSectorModule() const
Definition: TGCId.cxx:139