ATLAS Offline Software
Loading...
Searching...
No Matches
TGCChannelId.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
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 setStation(0);
63 }
64 if (m_layer >= 3 && m_layer <= 4) {
66 setStation(1);
67 }
68 if (m_layer >= 5 && m_layer <= 6) {
70 setStation(2);
71 }
72 if (m_layer >= 7 && m_layer <= 8) {
74 setStation(3);
75 if (m_sector != -1) {
76 m_octant = m_sector / 3;
77 }
78 }
79}
80
81void TGCChannelId::setBlock(int block) {
82 m_block = block;
83}
84
85void TGCChannelId::setChannel(int channel) {
86 m_channel = channel;
87}
88
90 if (isEndcap()) {
91 if (!isInner()) {
92 if (isAside()) {
93 return (m_sector % 2 == 1);
94 } else {
95 return (m_sector % 2 == 0);
96 }
97 } else {
98 // EI
99 // Special case of EI11
100 if (m_sector == 15) {
101 if (isAside()) {
102 return false;
103 } else {
104 return true;
105 }
106 } else if (m_sector == 16) {
107 if (isAside()) {
108 return true;
109 } else {
110 return false;
111 }
112 } else {
113 // A-m_side phi0 F: phi1 F: phi2 B
114 // C-m_side phi0 B: phi1 B: phi2 F
115 if (isAside()) {
116 return (m_sector % 3 == 2);
117 } else {
118 return (m_sector % 3 != 2);
119 }
120 }
121 }
122 } else {
123 if (isAside()) {
124 return true; // all Backward
125 } else {
126 return false; // all Forward
127 }
128 }
129}
130
131} // namespace MuonTGC_Cabling
std::vector< short > v_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:190
bool isAside() const
Definition TGCId.h:166
virtual void setStation(int vstation)
Definition TGCId.cxx:111
bool isInner() const
Definition TGCId.h:184
void setMultipletType(MultipletType multiplet)
Definition TGCId.cxx:89