ATLAS Offline Software
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 
7 namespace 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 
39 bool TGCId::isBackward() const {
40  if (isEndcap()){
41  if ( !isInner() ) {
42  if(isAside()) return (m_sector%2==1);
43  else return (m_sector%2==0);
44  } else {
45  // EI
46  // Special case of EI11
47  if (m_sector == 15) {
48  if(isAside()) return false;
49  else return true;
50  } else if (m_sector == 16) {
51  if(isAside()) return true;
52  else return false;
53  } else {
54  // A-m_side phi0 F: phi1 F: phi2 B
55  // C-m_side phi0 B: phi1 B: phi2 F
56  if(isAside()) return (m_sector%3==2);
57  else return (m_sector%3!=2);
58  }
59  }
60  } else {
61  if(isAside()) return true; // all Backward
62  else return false; // all Forward
63  }
64 }
65 
67  m_module=v_module;
68  if(m_module==WI){
71  }
72  if(m_module==SI){
75  }
76  if(m_module==WD){
79  }
80  if(m_module==SD){
83  }
84  if(m_module==WT){
87  }
88  if(m_module==ST){
91  }
92 }
93 
95  m_signal = v_signal;
102 }
103 
105  this->m_multiplet = v_multiplet;
112 }
113 
114 void TGCId::setStation(int v_station) {
115  m_station = v_station;
120 }
121 
122 void TGCId::setSector(int v_sector) {
123  m_sector = v_sector;
124  if(m_region==Endcap) {
125  if(m_multiplet==Inner) {
127  } else {
129  }
130  } else if(m_region==Forward) {
132  }
133 }
134 
135 void TGCId::setOctant(int v_octant) {
136  m_octant = v_octant;
137 }
138 
139 int TGCId::getSectorModule(void) const {
140  if(m_sector==-1) return -1;
141 
142  static const int moduleEndcap[6]={ 0, 1, 3, 4, 6, 7};
143  static const int moduleForward[3]={ 2, 5, 8};
144  static const int moduleEI[3]={ 9, 10, 11};
145  static const int moduleFI[3]={ 12, 13, 14};
146 
147  if(isEndcap()){
148  if(isInner()) return moduleEI[getSectorInOctant()];
149  return moduleEndcap[getSectorInOctant()];
150  }
151  if(isForward()){
152  if(isInner()) return moduleFI[getSectorInOctant()];
153  return moduleForward[getSectorInOctant()];
154  }
155  return -1;
156 }
157 
158 // before this method, set m_octant.
159 void TGCId::setSectorModule(int sectorModule) {
160  if(m_octant <0) return;
161 
162  const int MaxModuleInOctant = 15;
163  static const int regionId[MaxModuleInOctant] ={
164  0, 0, 1, 0, 0, 1, 0, 0, 1, 2, 2, 2, 3, 3, 3
165  } ;
166  static const int sectorId[MaxModuleInOctant] ={
167  0, 1, 0, 2, 3, 1, 4, 5, 2, 0, 1, 2, 0, 1, 2
168  };
169 
170  if(sectorModule< 0 || sectorModule>=MaxModuleInOctant) return;
171 
172  if(regionId[sectorModule]==0){
174  setSector(sectorId[sectorModule] + m_octant*(NUM_ENDCAP_SECTOR/NUM_OCTANT));
175 
176  } else if(regionId[sectorModule]==1){
178  setSector(sectorId[sectorModule] + m_octant*(NUM_FORWARD_SECTOR/NUM_OCTANT));
179  } else {
181  if(regionId[sectorModule]==2){ setRegionType(Endcap); }
182  if(regionId[sectorModule]==3){ setRegionType(Forward); }
183  setSector(sectorId[sectorModule] + m_octant*(NUM_INNER_SECTOR/NUM_OCTANT));
184  }
185 }
186 
187 
188 } // end of namespace
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::setRegionType
void setRegionType(RegionType region)
Definition: TGCId.h:148
MuonTGC_Cabling::TGCId::SI
@ SI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::m_idType
IdType m_idType
Definition: TGCId.h:118
MuonTGC_Cabling::TGCId::m_module
ModuleType m_module
Definition: TGCId.h:106
MuonTGC_Cabling::TGCId::setMultipletType
void setMultipletType(MultipletType multiplet)
Definition: TGCId.cxx:104
ST
Definition: Electrons.cxx:41
MuonTGC_Cabling::TGCId::N_RODS
static constexpr int N_RODS
Definition: TGCId.h:43
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::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::NUM_INNER_SECTOR
static constexpr int NUM_INNER_SECTOR
Definition: TGCId.h:42
MuonTGC_Cabling::TGCId::getSectorInOctant
virtual int getSectorInOctant() const
Definition: TGCId.cxx:13
MuonTGC_Cabling::TGCId::isForward
bool isForward() const
Definition: TGCId.h:141
TGCId.h
MuonTGC_Cabling::TGCId::SD
@ SD
Definition: TGCId.h:47
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
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::getSectorInReadout
int getSectorInReadout(void) const
Definition: TGCId.cxx:26
MuonTGC_Cabling::TGCId::m_sector
int m_sector
Definition: TGCId.h:113
MuonTGC_Cabling::TGCId::WT
@ WT
Definition: TGCId.h:47
MuonTGC_Cabling
Definition: TGCCable.h:13
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::WD
@ WD
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::Inner
@ Inner
Definition: TGCId.h:51
MuonTGC_Cabling::TGCId::Endcap
@ Endcap
Definition: TGCId.h:53
MuonTGC_Cabling::TGCId::WI
@ WI
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::m_multiplet
MultipletType m_multiplet
Definition: TGCId.h:108
MuonTGC_Cabling::TGCId::ST
@ ST
Definition: TGCId.h:47
MuonTGC_Cabling::TGCId::getSector
virtual int getSector() const
Definition: TGCId.h:130
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::m_octant
int m_octant
Definition: TGCId.h:112
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