ATLAS Offline Software
Loading...
Searching...
No Matches
TGCId.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 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
60
62 m_signal = v_signal;
63 if (isInner() && m_signal == SignalType::Wire) {
65 } else if (isInner() && m_signal == SignalType::Strip) {
67 } else if (isDoublet() && m_signal == SignalType::Wire) {
69 } else if (isDoublet() && m_signal == SignalType::Strip) {
71 } else if (isTriplet() && m_signal == SignalType::Wire) {
73 } else if (isTriplet() && m_signal == SignalType::Strip) {
75 }
76}
77
79 m_station = v_station;
80}
81
82void TGCId::setSector(int v_sector) {
83 m_sector = v_sector;
85 if (isInner()) {
87 } else {
89 }
90 } else if (m_region == RegionType::Forward) {
92 }
93}
94
95void TGCId::setOctant(int v_octant) {
96 m_octant = v_octant;
97}
98
100 if (m_sector == -1) {
101 return -1;
102 }
103
104 static const int moduleEndcap[6] = {0, 1, 3, 4, 6, 7};
105 static const int moduleForward[3] = {2, 5, 8};
106 static const int moduleEI[3] = {9, 10, 11};
107 static const int moduleFI[3] = {12, 13, 14};
108
109 if (isEndcap()) {
110 if (isInner()) {
111 return moduleEI[getSectorInOctant()];
112 }
113 return moduleEndcap[getSectorInOctant()];
114 }
115 if (isForward()) {
116 if (isInner()) {
117 return moduleFI[getSectorInOctant()];
118 }
119 return moduleForward[getSectorInOctant()];
120 }
121 return -1;
122}
123
124// before this method, set m_octant.
125void TGCId::setSectorModule(int sectorModule) {
126 if (m_octant < 0) {
127 return;
128 }
129
130 const int MaxModuleInOctant = 15;
131 static const int regionId[MaxModuleInOctant] = {0, 0, 1, 0, 0, 1, 0, 0,
132 1, 2, 2, 2, 3, 3, 3};
133 static const int sectorId[MaxModuleInOctant] = {0, 1, 0, 2, 3, 1, 4, 5,
134 2, 0, 1, 2, 0, 1, 2};
135
136 if (sectorModule < 0 || sectorModule >= MaxModuleInOctant) {
137 return;
138 }
139
140 if (regionId[sectorModule] == 0) {
142 setSector(sectorId[sectorModule] +
144
145 } else if (regionId[sectorModule] == 1) {
147 setSector(sectorId[sectorModule] +
149 } else {
151 if (regionId[sectorModule] == 2) {
153 }
154 if (regionId[sectorModule] == 3) {
156 }
157 setSector(sectorId[sectorModule] +
159 }
160}
161
162} // namespace MuonTGC_Cabling
bool isEndcap() const
Definition TGCId.h:178
bool isTriplet() const
Definition TGCId.h:166
bool isDoublet() const
Definition TGCId.h:169
ModuleType m_module
Definition TGCId.h:109
SignalType m_signal
Definition TGCId.h:110
bool isForward() const
Definition TGCId.h:175
RegionType m_region
Definition TGCId.h:111
virtual int getSectorModule() const
Definition TGCId.cxx:99
static constexpr int NUM_INNER_SECTOR
Definition TGCId.h:45
void setRegionType(RegionType region)
Definition TGCId.h:186
void setSectorModule(int sectorModule)
Definition TGCId.cxx:125
int getSectorInReadout() const
Definition TGCId.cxx:26
virtual void setOctant(int voctant)
Definition TGCId.cxx:95
static constexpr int NUM_ENDCAP_SECTOR
Definition TGCId.h:43
static constexpr int N_RODS
Definition TGCId.h:46
virtual int getSector() const
Definition TGCId.h:144
void setSignalType(SignalType signal)
Definition TGCId.cxx:61
void setStation(StationType vstation)
Definition TGCId.cxx:78
virtual void setSector(int vsector)
Definition TGCId.cxx:82
StationType m_station
Definition TGCId.h:108
bool isInner() const
Definition TGCId.h:172
virtual int getSectorInOctant() const
Definition TGCId.cxx:13
static constexpr int NUM_OCTANT
Definition TGCId.h:42
virtual void setModuleType(ModuleType module)
Definition TGCId.cxx:39
TGCId(IdType vtype=IdType::NoIdType)
Definition TGCId.cxx:9
static constexpr int NUM_FORWARD_SECTOR
Definition TGCId.h:44