ATLAS Offline Software
Loading...
Searching...
No Matches
TGCChannelId.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
9bool TGCChannelId::operator==(const TGCChannelId& channelId) const {
10 if ((this->getChannelIdType() == channelId.getChannelIdType()) &&
11 (this->getSideType() == channelId.getSideType()) &&
12 (this->getRegionType() == channelId.getRegionType()) &&
13 (this->getSignalType() == channelId.getSignalType()) &&
14 (this->getModuleType() == channelId.getModuleType()) &&
15 (this->getSector() == channelId.getSector()) &&
16 (this->getLayer() == channelId.getLayer()) &&
17 (this->getChamber() == channelId.getChamber()) &&
18 (this->getId() == channelId.getId()) &&
19 (this->getBlock() == channelId.getBlock()) &&
20 (this->getChannel() == channelId.getChannel())) {
21 return true;
22 }
23 return false;
24}
25
30 return m_layer;
31}
33 return m_block;
34}
36 return m_channel;
37}
38
40 if (getLayer() == 0 || getLayer() == 3 || getLayer() == 5 ||
41 getLayer() == 7) {
42 return 1;
43 }
44 if (getLayer() == 1 || getLayer() == 4 || getLayer() == 6 ||
45 getLayer() == 8) {
46 return 2;
47 }
48 if (getLayer() == 2) {
49 return 3;
50 }
51 return -1;
52}
53
57
60 if (m_layer >= 0 && m_layer <= 2) {
62 }
63 if (m_layer >= 3 && m_layer <= 4) {
65 }
66 if (m_layer >= 5 && m_layer <= 6) {
68 }
69 if (m_layer >= 7 && m_layer <= 8) {
71 if (m_sector != -1) {
72 m_octant = m_sector / 3;
73 }
74 }
75}
76
77void TGCChannelId::setBlock(int block) {
78 m_block = block;
79}
80
81void TGCChannelId::setChannel(int channel) {
82 m_channel = channel;
83}
84
86 m_signal = signal;
87 m_layer = layer;
88 if (m_layer >= 0 && m_layer <= 2) {
92 } else if (m_signal == SignalType::Strip) {
94 }
95 } else if (m_layer >= 3 && m_layer <= 4) {
99 } else if (m_signal == SignalType::Strip) {
101 }
102 } else if (m_layer >= 5 && m_layer <= 6) {
104 if (m_signal == SignalType::Wire) {
106 } else if (m_signal == SignalType::Strip) {
108 }
109 } else if (m_layer >= 7 && m_layer <= 8) {
111 if (m_signal == SignalType::Wire) {
113 } else if (m_signal == SignalType::Strip) {
115 }
116 if (m_sector != -1) {
117 m_octant = m_sector / 3;
118 }
119 }
120}
121
123 if (isEndcap()) {
124 if (!isInner()) {
125 if (isAside()) {
126 return (m_sector % 2 == 1);
127 } else {
128 return (m_sector % 2 == 0);
129 }
130 } else {
131 // EI
132 // Special case of EI11
133 if (m_sector == 15) {
134 if (isAside()) {
135 return false;
136 } else {
137 return true;
138 }
139 } else if (m_sector == 16) {
140 if (isAside()) {
141 return true;
142 } else {
143 return false;
144 }
145 } else {
146 // A-m_side phi0 F: phi1 F: phi2 B
147 // C-m_side phi0 B: phi1 B: phi2 F
148 if (isAside()) {
149 return (m_sector % 3 == 2);
150 } else {
151 return (m_sector % 3 != 2);
152 }
153 }
154 }
155 } else {
156 if (isAside()) {
157 return true; // all Backward
158 } else {
159 return false; // all Forward
160 }
161 }
162}
163
164} // namespace MuonTGC_Cabling
std::vector< short > v_layer
void setSignalAndLayer(TGCId::SignalType signal, int layer)
virtual void setChannel(int channel)
void setChannelIdType(ChannelIdType type)
ChannelIdType getChannelIdType() const
virtual bool operator==(const TGCChannelId &channelId) const
TGCChannelId(ChannelIdType type=ChannelIdType::NoChannelIdType)
virtual void setBlock(int block)
virtual int getGasGap() const
bool isEndcap() const
Definition TGCId.h:178
ModuleType m_module
Definition TGCId.h:109
SignalType m_signal
Definition TGCId.h:110
bool isAside() const
Definition TGCId.h:154
void setStation(StationType vstation)
Definition TGCId.cxx:78
bool isInner() const
Definition TGCId.h:172