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()){
29 }
30 if(isEndcap()){
32 }
33 if(isForward()){
35 }
36 return -1;
37}
38
66
76
86
87void TGCId::setStation(int v_station) {
88 m_station = v_station;
93}
94
95void TGCId::setSector(int v_sector) {
96 m_sector = v_sector;
97 if(m_region==Endcap) {
98 if(m_multiplet==Inner) {
100 } else {
102 }
103 } else if(m_region==Forward) {
105 }
106}
107
108void TGCId::setOctant(int v_octant) {
109 m_octant = v_octant;
110}
111
112int TGCId::getSectorModule(void) const {
113 if(m_sector==-1) return -1;
114
115 static const int moduleEndcap[6]={ 0, 1, 3, 4, 6, 7};
116 static const int moduleForward[3]={ 2, 5, 8};
117 static const int moduleEI[3]={ 9, 10, 11};
118 static const int moduleFI[3]={ 12, 13, 14};
119
120 if(isEndcap()){
121 if(isInner()) return moduleEI[getSectorInOctant()];
122 return moduleEndcap[getSectorInOctant()];
123 }
124 if(isForward()){
125 if(isInner()) return moduleFI[getSectorInOctant()];
126 return moduleForward[getSectorInOctant()];
127 }
128 return -1;
129}
130
131// before this method, set m_octant.
132void TGCId::setSectorModule(int sectorModule) {
133 if(m_octant <0) return;
134
135 const int MaxModuleInOctant = 15;
136 static const int regionId[MaxModuleInOctant] ={
137 0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 2, 2, 3, 3, 3
138 } ;
139 static const int sectorId[MaxModuleInOctant] ={
140 0, 1, 0, 2, 3, 1, 4, 5, 2, 0, 1, 2, 0, 1, 2
141 };
142
143 if(sectorModule< 0 || sectorModule>=MaxModuleInOctant) return;
144
145 if(regionId[sectorModule]==0){
147 setSector(sectorId[sectorModule] + m_octant*(NUM_ENDCAP_SECTOR/NUM_OCTANT));
148
149 } else if(regionId[sectorModule]==1){
151 setSector(sectorId[sectorModule] + m_octant*(NUM_FORWARD_SECTOR/NUM_OCTANT));
152 } else {
154 if(regionId[sectorModule]==2){ setRegionType(Endcap); }
155 if(regionId[sectorModule]==3){ setRegionType(Forward); }
156 setSector(sectorId[sectorModule] + m_octant*(NUM_INNER_SECTOR/NUM_OCTANT));
157 }
158}
159
160
161} // end of namespace
bool isEndcap() const
Definition TGCId.h:141
ModuleType m_module
Definition TGCId.h:105
SignalType m_signal
Definition TGCId.h:106
bool isForward() const
Definition TGCId.h:140
RegionType m_region
Definition TGCId.h:108
virtual int getSectorModule() const
Definition TGCId.cxx:112
static constexpr int NUM_INNER_SECTOR
Definition TGCId.h:42
void setRegionType(RegionType region)
Definition TGCId.h:147
void setSectorModule(int sectorModule)
Definition TGCId.cxx:132
virtual void setOctant(int voctant)
Definition TGCId.cxx:108
static constexpr int NUM_ENDCAP_SECTOR
Definition TGCId.h:40
virtual void setStation(int vstation)
Definition TGCId.cxx:87
MultipletType m_multiplet
Definition TGCId.h:107
static constexpr int N_RODS
Definition TGCId.h:43
virtual int getSector() const
Definition TGCId.h:129
void setSignalType(SignalType signal)
Definition TGCId.cxx:67
int getSectorInReadout(void) const
Definition TGCId.cxx:26
virtual void setSector(int vsector)
Definition TGCId.cxx:95
bool isInner() const
Definition TGCId.h:139
virtual int getSectorInOctant() const
Definition TGCId.cxx:13
static constexpr int NUM_OCTANT
Definition TGCId.h:39
void setModuleType(ModuleType module)
Definition TGCId.cxx:39
TGCId(IdType vtype=IdType::NoIdType)
Definition TGCId.cxx:9
void setMultipletType(MultipletType multiplet)
Definition TGCId.cxx:77
static constexpr int NUM_FORWARD_SECTOR
Definition TGCId.h:41