ATLAS Offline Software
Loading...
Searching...
No Matches
TGCId.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7namespace MuonTGC_Cabling {
8
10 m_idType = vtype;
11}
12
14 if (isInner()) {
16 }
17 if (isEndcap()) {
19 }
20 if (isForward()) {
22 }
23 return -1;
24}
25
27 if (isInner()) {
28 return getSector() % (NUM_INNER_SECTOR / N_RODS);
29 }
30 if (isEndcap()) {
31 return getSector() % (NUM_ENDCAP_SECTOR / N_RODS);
32 }
33 if (isForward()) {
34 return getSector() % (NUM_FORWARD_SECTOR / N_RODS);
35 }
36 return -1;
37}
38
40 m_module = v_module;
41 if (m_module == WI) {
44 }
45 if (m_module == SI) {
48 }
49 if (m_module == WD) {
52 }
53 if (m_module == SD) {
56 }
57 if (m_module == WT) {
60 }
61 if (m_module == ST) {
64 }
65}
66
68 m_signal = v_signal;
69 if (m_multiplet == Inner && m_signal == Wire) {
70 m_module = WI;
71 }
72 if (m_multiplet == Inner && m_signal == Strip) {
73 m_module = SI;
74 }
75 if (m_multiplet == Doublet && m_signal == Wire) {
76 m_module = WD;
77 }
78 if (m_multiplet == Doublet && m_signal == Strip) {
79 m_module = SD;
80 }
81 if (m_multiplet == Triplet && m_signal == Wire) {
82 m_module = WT;
83 }
84 if (m_multiplet == Triplet && m_signal == Strip) {
85 m_module = ST;
86 }
87}
88
90 this->m_multiplet = v_multiplet;
91 if (m_multiplet == Inner && m_signal == Wire) {
92 m_module = WI;
93 }
94 if (m_multiplet == Inner && m_signal == Strip) {
95 m_module = SI;
96 }
97 if (m_multiplet == Doublet && m_signal == Wire) {
98 m_module = WD;
99 }
100 if (m_multiplet == Doublet && m_signal == Strip) {
101 m_module = SD;
102 }
103 if (m_multiplet == Triplet && m_signal == Wire) {
104 m_module = WT;
105 }
106 if (m_multiplet == Triplet && m_signal == Strip) {
107 m_module = ST;
108 }
109}
110
111void TGCId::setStation(int v_station) {
112 m_station = v_station;
113 if (m_station == 0) {
115 }
116 if (m_station == 1) {
118 }
119 if (m_station == 2) {
121 }
122 if (m_station == 3) {
124 }
125}
126
127void TGCId::setSector(int v_sector) {
128 m_sector = v_sector;
129 if (m_region == Endcap) {
130 if (m_multiplet == Inner) {
132 } else {
134 }
135 } else if (m_region == Forward) {
137 }
138}
139
140void TGCId::setOctant(int v_octant) {
141 m_octant = v_octant;
142}
143
144int TGCId::getSectorModule(void) const {
145 if (m_sector == -1) {
146 return -1;
147 }
148
149 static const int moduleEndcap[6] = {0, 1, 3, 4, 6, 7};
150 static const int moduleForward[3] = {2, 5, 8};
151 static const int moduleEI[3] = {9, 10, 11};
152 static const int moduleFI[3] = {12, 13, 14};
153
154 if (isEndcap()) {
155 if (isInner()) {
156 return moduleEI[getSectorInOctant()];
157 }
158 return moduleEndcap[getSectorInOctant()];
159 }
160 if (isForward()) {
161 if (isInner()) {
162 return moduleFI[getSectorInOctant()];
163 }
164 return moduleForward[getSectorInOctant()];
165 }
166 return -1;
167}
168
169// before this method, set m_octant.
170void TGCId::setSectorModule(int sectorModule) {
171 if (m_octant < 0) {
172 return;
173 }
174
175 const int MaxModuleInOctant = 15;
176 static const int regionId[MaxModuleInOctant] = {0, 0, 1, 0, 0, 1, 0, 0,
177 1, 2, 2, 2, 3, 3, 3};
178 static const int sectorId[MaxModuleInOctant] = {0, 1, 0, 2, 3, 1, 4, 5,
179 2, 0, 1, 2, 0, 1, 2};
180
181 if (sectorModule < 0 || sectorModule >= MaxModuleInOctant) {
182 return;
183 }
184
185 if (regionId[sectorModule] == 0) {
187 setSector(sectorId[sectorModule] +
189
190 } else if (regionId[sectorModule] == 1) {
192 setSector(sectorId[sectorModule] +
194 } else {
196 if (regionId[sectorModule] == 2) {
198 }
199 if (regionId[sectorModule] == 3) {
201 }
202 setSector(sectorId[sectorModule] +
204 }
205}
206
207} // namespace MuonTGC_Cabling
bool isEndcap() const
Definition TGCId.h:190
ModuleType m_module
Definition TGCId.h:116
SignalType m_signal
Definition TGCId.h:117
bool isForward() const
Definition TGCId.h:187
RegionType m_region
Definition TGCId.h:119
virtual int getSectorModule() const
Definition TGCId.cxx:144
static constexpr int NUM_INNER_SECTOR
Definition TGCId.h:43
void setRegionType(RegionType region)
Definition TGCId.h:198
void setSectorModule(int sectorModule)
Definition TGCId.cxx:170
virtual void setOctant(int voctant)
Definition TGCId.cxx:140
static constexpr int NUM_ENDCAP_SECTOR
Definition TGCId.h:41
virtual void setStation(int vstation)
Definition TGCId.cxx:111
MultipletType m_multiplet
Definition TGCId.h:118
static constexpr int N_RODS
Definition TGCId.h:44
virtual int getSector() const
Definition TGCId.h:156
void setSignalType(SignalType signal)
Definition TGCId.cxx:67
int getSectorInReadout(void) const
Definition TGCId.cxx:26
virtual void setSector(int vsector)
Definition TGCId.cxx:127
bool isInner() const
Definition TGCId.h:184
virtual int getSectorInOctant() const
Definition TGCId.cxx:13
static constexpr int NUM_OCTANT
Definition TGCId.h:40
void setModuleType(ModuleType module)
Definition TGCId.cxx:39
TGCId(IdType vtype=IdType::NoIdType)
Definition TGCId.cxx:9
void setMultipletType(MultipletType multiplet)
Definition TGCId.cxx:89
static constexpr int NUM_FORWARD_SECTOR
Definition TGCId.h:42