ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCablings
MuonTGC_Cabling
MuonTGC_Cabling
TGCId.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef MUONTGC_CABLING_TGCID_H
6
#define MUONTGC_CABLING_TGCID_H
7
8
#include <type_traits>
9
#include <ostream>
10
11
namespace
MuonTGC_Cabling
{
12
13
class
TGCId
{
14
public
:
15
enum class
IdType
{
NoIdType
,
Channel
,
Module
};
16
17
public
:
18
TGCId
(
IdType
vtype =
IdType::NoIdType
);
19
virtual
~TGCId
() =
default
;
20
21
virtual
bool
isValid
()
const
{
return
true
; }
22
23
public
:
24
// <internal numbering scheme>
25
// 1. IdType
26
// 2. IdIndex
27
// int station [0..3]
28
// int sectorRO [0..11]
29
// int srod [0..2]
30
// int octant [0..7]
31
// int sector [0..47],[0..23]
32
// int chamber [0..n]
33
// int id [0..n]
34
//
36
// int layer [0..8]
37
// int block [0..n]
38
// int channel [0..n]
39
40
static
constexpr
int
NUM_LAYERS
=
41
9;
// [0..2]:M1, [3..4]:M2, [5..6]:M3, [7..8]:M4(Inner)
42
static
constexpr
int
NUM_OCTANT
= 8;
43
static
constexpr
int
NUM_ENDCAP_SECTOR
= 48;
44
static
constexpr
int
NUM_FORWARD_SECTOR
= 24;
45
static
constexpr
int
NUM_INNER_SECTOR
= 24;
46
static
constexpr
int
N_RODS
= 12;
47
48
enum class
SideType
:
int
{
Aside
= 0,
Cside
= 1,
MaxSideType
= 2,
Undefined
= 99 };
49
enum class
StationType
:
int
{
M1
= 0,
M2
= 1,
M3
= 2,
M4
= 3,
// M3 is also used for M2/M3 SLB
50
MaxStationType
= 4,
Undefined
= 99 };
51
enum class
ModuleType
:
int
{
WD
= 0,
SD
= 1,
52
WT
= 2,
ST
= 3,
53
WI
= 4,
SI
= 5,
54
MaxModuleType
= 6,
55
SL_SLB
= 6,
// SL SLB module, not used in TGCId but in TGCModuleSLB
56
Undefined
= 99
57
};
58
enum class
SignalType
:
int
{
Wire
= 0,
Strip
= 1,
MaxSignalType
= 2,
Undefined
= 99 };
59
enum class
RegionType
:
int
{
Endcap
= 0,
Forward
= 1,
MaxRegionType
= 2,
Undefined
= 99 };
60
61
IdType
getIdType
()
const
;
62
SideType
getSideType
()
const
;
63
StationType
getStation
()
const
;
64
ModuleType
getModuleType
()
const
;
65
SignalType
getSignalType
()
const
;
66
RegionType
getRegionType
()
const
;
67
68
int
getSectorInReadout
()
const
;
69
70
virtual
int
getSectorInOctant
()
const
;
71
virtual
int
getSectorModule
()
const
;
72
73
int
getOctant
()
const
;
74
virtual
int
getSector
()
const
;
75
int
getChamber
()
const
;
76
int
getId
()
const
;
77
int
getBlock
()
const
;
78
79
bool
isAside
()
const
;
80
bool
isCside
()
const
;
81
bool
isStrip
()
const
;
82
bool
isWire
()
const
;
83
bool
isTriplet
()
const
;
84
bool
isDoublet
()
const
;
85
bool
isInner
()
const
;
86
bool
isForward
()
const
;
87
bool
isEndcap
()
const
;
88
89
public
:
90
void
setSideType
(
SideType
side);
91
void
setStation
(
StationType
vstation);
92
virtual
void
setModuleType
(
ModuleType
module);
93
void
setSignalType
(
SignalType
signal);
94
void
setRegionType
(
RegionType
region);
95
96
virtual
void
setOctant
(
int
voctant);
97
virtual
void
setSector
(
int
vsector);
98
virtual
void
setChamber
(
int
chamber);
99
void
setId
(
int
id
);
100
101
protected
:
102
void
setIdType
(
IdType
idtype);
103
void
setReadoutSector
(
int
sector);
104
void
setSectorModule
(
int
sectorModule);
105
106
protected
:
107
SideType
m_side
{
SideType::Undefined
};
108
StationType
m_station
{
StationType::Undefined
};
109
ModuleType
m_module
{
ModuleType::Undefined
};
110
SignalType
m_signal
{
SignalType::Undefined
};
111
RegionType
m_region
{
RegionType::Undefined
};
112
113
int
m_octant
{-1};
114
int
m_sector
{-1};
115
int
m_chamber
{-1};
116
int
m_id
{-1};
117
118
private
:
119
IdType
m_idType
{
IdType::NoIdType
};
120
};
121
122
inline
TGCId::IdType
TGCId::getIdType
()
const
{
123
return
m_idType
;
124
}
125
inline
TGCId::SideType
TGCId::getSideType
()
const
{
126
return
m_side
;
127
}
128
inline
TGCId::StationType
TGCId::getStation
()
const
{
129
return
m_station
;
130
}
131
inline
TGCId::ModuleType
TGCId::getModuleType
()
const
{
132
return
m_module
;
133
}
134
inline
TGCId::SignalType
TGCId::getSignalType
()
const
{
135
return
m_signal
;
136
}
137
inline
TGCId::RegionType
TGCId::getRegionType
()
const
{
138
return
m_region
;
139
}
140
141
inline
int
TGCId::getOctant
()
const
{
142
return
m_octant
;
143
}
144
inline
int
TGCId::getSector
()
const
{
145
return
m_sector
;
146
}
147
inline
int
TGCId::getChamber
()
const
{
148
return
m_chamber
;
149
}
150
inline
int
TGCId::getId
()
const
{
151
return
m_id
;
152
}
153
154
inline
bool
TGCId::isAside
()
const
{
155
return
(
m_side
==
SideType::Aside
);
156
}
157
inline
bool
TGCId::isCside
()
const
{
158
return
(
m_side
==
SideType::Cside
);
159
}
160
inline
bool
TGCId::isStrip
()
const
{
161
return
(
m_signal
==
SignalType::Strip
);
162
}
163
inline
bool
TGCId::isWire
()
const
{
164
return
(
m_signal
==
SignalType::Wire
);
165
}
166
inline
bool
TGCId::isTriplet
()
const
{
167
return
(
m_station
==
StationType::M1
);
168
}
169
inline
bool
TGCId::isDoublet
()
const
{
170
return
(
m_station
==
StationType::M2
||
m_station
==
StationType::M3
);
171
}
172
inline
bool
TGCId::isInner
()
const
{
173
return
(
m_station
==
StationType::M4
);
174
}
175
inline
bool
TGCId::isForward
()
const
{
176
return
(
m_region
==
RegionType::Forward
);
177
}
178
inline
bool
TGCId::isEndcap
()
const
{
179
return
(
m_region
==
RegionType::Endcap
);
180
}
181
182
inline
void
TGCId::setSideType
(
SideType
side) {
183
m_side
= side;
184
}
185
186
inline
void
TGCId::setRegionType
(
RegionType
region) {
187
m_region
= region;
188
}
189
190
inline
void
TGCId::setChamber
(
int
chamber) {
191
m_chamber
= chamber;
192
}
193
194
inline
void
TGCId::setId
(
int
id
) {
195
m_id
= id;
196
}
197
198
inline
void
TGCId::setIdType
(
IdType
idtype) {
199
m_idType
= idtype;
200
}
201
202
constexpr
auto
operator +
(
TGCId::SideType
e)
noexcept
{
203
return
static_cast<
std::underlying_type_t<TGCId::SideType>
>
(e);
204
}
205
constexpr
auto
operator +
(
TGCId::ModuleType
e)
noexcept
{
206
return
static_cast<
std::underlying_type_t<TGCId::ModuleType>
>
(e);
207
}
208
constexpr
auto
operator +
(
TGCId::SignalType
e)
noexcept
{
209
return
static_cast<
std::underlying_type_t<TGCId::SignalType>
>
(e);
210
}
211
constexpr
auto
operator +
(
TGCId::RegionType
e)
noexcept
{
212
return
static_cast<
std::underlying_type_t<TGCId::RegionType>
>
(e);
213
}
214
215
inline
std::ostream&
operator<<
(std::ostream& os,
const
TGCId::SideType
&
type
) {
216
return
os << (
type
==
TGCId::SideType::Aside
?
"Aside"
:
"Cside"
);
217
}
218
inline
std::ostream&
operator<<
(std::ostream& os,
const
TGCId::StationType
&
type
) {
219
return
os << static_cast<int>(
type
);
220
}
221
inline
std::ostream&
operator<<
(std::ostream& os,
const
TGCId::ModuleType
&
type
) {
222
return
os << static_cast<int>(
type
);
223
}
224
inline
std::ostream&
operator<<
(std::ostream& os,
const
TGCId::SignalType
&
type
) {
225
return
os << (
type
==
TGCId::SignalType::Wire
?
"Wire"
:
"Strip"
);
226
}
227
inline
std::ostream&
operator<<
(std::ostream& os,
const
TGCId::RegionType
&
type
) {
228
return
os << (
type
==
TGCId::RegionType::Endcap
?
"Endcap"
:
"Forward"
);
229
}
230
231
}
// namespace MuonTGC_Cabling
232
233
#endif
Cside
@ Cside
Definition
CellClusterLinkTool.h:52
Aside
@ Aside
Definition
CellClusterLinkTool.h:52
SI
#define SI
Definition
EMECAccordionConstruction.cxx:44
Undefined
@ Undefined
Definition
MaterialTypes.h:8
MuonTGC_Cabling::TGCId::setSideType
void setSideType(SideType side)
Definition
TGCId.h:182
MuonTGC_Cabling::TGCId::getStation
StationType getStation() const
Definition
TGCId.h:128
MuonTGC_Cabling::TGCId::isEndcap
bool isEndcap() const
Definition
TGCId.h:178
MuonTGC_Cabling::TGCId::getOctant
int getOctant() const
Definition
TGCId.h:141
MuonTGC_Cabling::TGCId::m_side
SideType m_side
Definition
TGCId.h:107
MuonTGC_Cabling::TGCId::isValid
virtual bool isValid() const
Definition
TGCId.h:21
MuonTGC_Cabling::TGCId::isTriplet
bool isTriplet() const
Definition
TGCId.h:166
MuonTGC_Cabling::TGCId::isDoublet
bool isDoublet() const
Definition
TGCId.h:169
MuonTGC_Cabling::TGCId::m_module
ModuleType m_module
Definition
TGCId.h:109
MuonTGC_Cabling::TGCId::m_signal
SignalType m_signal
Definition
TGCId.h:110
MuonTGC_Cabling::TGCId::isAside
bool isAside() const
Definition
TGCId.h:154
MuonTGC_Cabling::TGCId::isForward
bool isForward() const
Definition
TGCId.h:175
MuonTGC_Cabling::TGCId::m_region
RegionType m_region
Definition
TGCId.h:111
MuonTGC_Cabling::TGCId::getSectorModule
virtual int getSectorModule() const
Definition
TGCId.cxx:99
MuonTGC_Cabling::TGCId::NUM_INNER_SECTOR
static constexpr int NUM_INNER_SECTOR
Definition
TGCId.h:45
MuonTGC_Cabling::TGCId::setRegionType
void setRegionType(RegionType region)
Definition
TGCId.h:186
MuonTGC_Cabling::TGCId::setSectorModule
void setSectorModule(int sectorModule)
Definition
TGCId.cxx:125
MuonTGC_Cabling::TGCId::getSectorInReadout
int getSectorInReadout() const
Definition
TGCId.cxx:26
MuonTGC_Cabling::TGCId::getModuleType
ModuleType getModuleType() const
Definition
TGCId.h:131
MuonTGC_Cabling::TGCId::ModuleType
ModuleType
Definition
TGCId.h:51
MuonTGC_Cabling::TGCId::ModuleType::WI
@ WI
Definition
TGCId.h:53
MuonTGC_Cabling::TGCId::ModuleType::SD
@ SD
Definition
TGCId.h:51
MuonTGC_Cabling::TGCId::ModuleType::SL_SLB
@ SL_SLB
Definition
TGCId.h:55
MuonTGC_Cabling::TGCId::ModuleType::WT
@ WT
Definition
TGCId.h:52
MuonTGC_Cabling::TGCId::ModuleType::WD
@ WD
Definition
TGCId.h:51
MuonTGC_Cabling::TGCId::ModuleType::MaxModuleType
@ MaxModuleType
Definition
TGCId.h:54
MuonTGC_Cabling::TGCId::ModuleType::Undefined
@ Undefined
Definition
TGCId.h:56
MuonTGC_Cabling::TGCId::setOctant
virtual void setOctant(int voctant)
Definition
TGCId.cxx:95
MuonTGC_Cabling::TGCId::NUM_ENDCAP_SECTOR
static constexpr int NUM_ENDCAP_SECTOR
Definition
TGCId.h:43
MuonTGC_Cabling::TGCId::getChamber
int getChamber() const
Definition
TGCId.h:147
MuonTGC_Cabling::TGCId::setIdType
void setIdType(IdType idtype)
Definition
TGCId.h:198
MuonTGC_Cabling::TGCId::m_idType
IdType m_idType
Definition
TGCId.h:119
MuonTGC_Cabling::TGCId::SignalType
SignalType
Definition
TGCId.h:58
MuonTGC_Cabling::TGCId::SignalType::Strip
@ Strip
Definition
TGCId.h:58
MuonTGC_Cabling::TGCId::SignalType::MaxSignalType
@ MaxSignalType
Definition
TGCId.h:58
MuonTGC_Cabling::TGCId::SignalType::Wire
@ Wire
Definition
TGCId.h:58
MuonTGC_Cabling::TGCId::SignalType::Undefined
@ Undefined
Definition
TGCId.h:58
MuonTGC_Cabling::TGCId::setId
void setId(int id)
Definition
TGCId.h:194
MuonTGC_Cabling::TGCId::isCside
bool isCside() const
Definition
TGCId.h:157
MuonTGC_Cabling::TGCId::isStrip
bool isStrip() const
Definition
TGCId.h:160
MuonTGC_Cabling::TGCId::setReadoutSector
void setReadoutSector(int sector)
MuonTGC_Cabling::TGCId::m_sector
int m_sector
Definition
TGCId.h:114
MuonTGC_Cabling::TGCId::StationType
StationType
Definition
TGCId.h:49
MuonTGC_Cabling::TGCId::StationType::M4
@ M4
Definition
TGCId.h:49
MuonTGC_Cabling::TGCId::StationType::MaxStationType
@ MaxStationType
Definition
TGCId.h:50
MuonTGC_Cabling::TGCId::StationType::M2
@ M2
Definition
TGCId.h:49
MuonTGC_Cabling::TGCId::StationType::Undefined
@ Undefined
Definition
TGCId.h:50
MuonTGC_Cabling::TGCId::StationType::M3
@ M3
Definition
TGCId.h:49
MuonTGC_Cabling::TGCId::StationType::M1
@ M1
Definition
TGCId.h:49
MuonTGC_Cabling::TGCId::getBlock
int getBlock() const
MuonTGC_Cabling::TGCId::getRegionType
RegionType getRegionType() const
Definition
TGCId.h:137
MuonTGC_Cabling::TGCId::m_octant
int m_octant
Definition
TGCId.h:113
MuonTGC_Cabling::TGCId::N_RODS
static constexpr int N_RODS
Definition
TGCId.h:46
MuonTGC_Cabling::TGCId::isWire
bool isWire() const
Definition
TGCId.h:163
MuonTGC_Cabling::TGCId::getSector
virtual int getSector() const
Definition
TGCId.h:144
MuonTGC_Cabling::TGCId::getIdType
IdType getIdType() const
Definition
TGCId.h:122
MuonTGC_Cabling::TGCId::RegionType
RegionType
Definition
TGCId.h:59
MuonTGC_Cabling::TGCId::RegionType::Forward
@ Forward
Definition
TGCId.h:59
MuonTGC_Cabling::TGCId::RegionType::Endcap
@ Endcap
Definition
TGCId.h:59
MuonTGC_Cabling::TGCId::RegionType::Undefined
@ Undefined
Definition
TGCId.h:59
MuonTGC_Cabling::TGCId::RegionType::MaxRegionType
@ MaxRegionType
Definition
TGCId.h:59
MuonTGC_Cabling::TGCId::setSignalType
void setSignalType(SignalType signal)
Definition
TGCId.cxx:61
MuonTGC_Cabling::TGCId::setStation
void setStation(StationType vstation)
Definition
TGCId.cxx:78
MuonTGC_Cabling::TGCId::setSector
virtual void setSector(int vsector)
Definition
TGCId.cxx:82
MuonTGC_Cabling::TGCId::m_station
StationType m_station
Definition
TGCId.h:108
MuonTGC_Cabling::TGCId::getSideType
SideType getSideType() const
Definition
TGCId.h:125
MuonTGC_Cabling::TGCId::m_chamber
int m_chamber
Definition
TGCId.h:115
MuonTGC_Cabling::TGCId::IdType
IdType
Definition
TGCId.h:15
MuonTGC_Cabling::TGCId::IdType::Channel
@ Channel
Definition
TGCId.h:15
MuonTGC_Cabling::TGCId::IdType::NoIdType
@ NoIdType
Definition
TGCId.h:15
MuonTGC_Cabling::TGCId::IdType::Module
@ Module
Definition
TGCId.h:15
MuonTGC_Cabling::TGCId::isInner
bool isInner() const
Definition
TGCId.h:172
MuonTGC_Cabling::TGCId::getSectorInOctant
virtual int getSectorInOctant() const
Definition
TGCId.cxx:13
MuonTGC_Cabling::TGCId::NUM_OCTANT
static constexpr int NUM_OCTANT
Definition
TGCId.h:42
MuonTGC_Cabling::TGCId::getSignalType
SignalType getSignalType() const
Definition
TGCId.h:134
MuonTGC_Cabling::TGCId::getId
int getId() const
Definition
TGCId.h:150
MuonTGC_Cabling::TGCId::m_id
int m_id
Definition
TGCId.h:116
MuonTGC_Cabling::TGCId::SideType
SideType
Definition
TGCId.h:48
MuonTGC_Cabling::TGCId::SideType::Cside
@ Cside
Definition
TGCId.h:48
MuonTGC_Cabling::TGCId::SideType::MaxSideType
@ MaxSideType
Definition
TGCId.h:48
MuonTGC_Cabling::TGCId::SideType::Aside
@ Aside
Definition
TGCId.h:48
MuonTGC_Cabling::TGCId::SideType::Undefined
@ Undefined
Definition
TGCId.h:48
MuonTGC_Cabling::TGCId::~TGCId
virtual ~TGCId()=default
MuonTGC_Cabling::TGCId::setModuleType
virtual void setModuleType(ModuleType module)
Definition
TGCId.cxx:39
MuonTGC_Cabling::TGCId::TGCId
TGCId(IdType vtype=IdType::NoIdType)
Definition
TGCId.cxx:9
MuonTGC_Cabling::TGCId::setChamber
virtual void setChamber(int chamber)
Definition
TGCId.h:190
MuonTGC_Cabling::TGCId::NUM_LAYERS
static constexpr int NUM_LAYERS
in ChannelId
Definition
TGCId.h:40
MuonTGC_Cabling::TGCId::NUM_FORWARD_SECTOR
static constexpr int NUM_FORWARD_SECTOR
Definition
TGCId.h:44
MuonTGC_Cabling
Definition
TGCCable.h:12
MuonTGC_Cabling::operator<<
std::ostream & operator<<(std::ostream &os, const TGCId::SideType &type)
Definition
TGCId.h:215
MuonTGC_Cabling::operator+
constexpr auto operator+(TGCId::SideType e) noexcept
Definition
TGCId.h:202
ST
Definition
Electrons.cxx:41
type
Generated on
for ATLAS Offline Software by
1.17.0