ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCablings
MuonTGC_Cabling
src
TGCId.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonTGC_Cabling/TGCId.h
"
6
7
namespace
MuonTGC_Cabling
{
8
9
TGCId::TGCId
(
TGCId::IdType
vtype) {
10
m_idType
= vtype;
11
}
12
13
int
TGCId::getSectorInOctant
()
const
{
14
if
(
isInner
()) {
15
return
getSector
() % (
NUM_INNER_SECTOR
/
NUM_OCTANT
);
16
}
17
if
(
isEndcap
()) {
18
return
getSector
() % (
NUM_ENDCAP_SECTOR
/
NUM_OCTANT
);
19
}
20
if
(
isForward
()) {
21
return
getSector
() % (
NUM_FORWARD_SECTOR
/
NUM_OCTANT
);
22
}
23
return
-1;
24
}
25
26
int
TGCId::getSectorInReadout
()
const
{
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
void
TGCId::setModuleType
(
ModuleType
v_module) {
40
m_module
= v_module;
41
if
(
m_module
==
ModuleType::WI
) {
42
setSignalType
(
SignalType::Wire
);
43
}
44
if
(
m_module
==
ModuleType::SI
) {
45
setSignalType
(
SignalType::Strip
);
46
}
47
if
(
m_module
==
ModuleType::WD
) {
48
setSignalType
(
SignalType::Wire
);
49
}
50
if
(
m_module
==
ModuleType::SD
) {
51
setSignalType
(
SignalType::Strip
);
52
}
53
if
(
m_module
==
ModuleType::WT
) {
54
setSignalType
(
SignalType::Wire
);
55
}
56
if
(
m_module
==
ModuleType::ST
) {
57
setSignalType
(
SignalType::Strip
);
58
}
59
}
60
61
void
TGCId::setSignalType
(
SignalType
v_signal) {
62
m_signal
= v_signal;
63
if
(
isInner
() &&
m_signal
==
SignalType::Wire
) {
64
m_module
=
ModuleType::WI
;
65
}
else
if
(
isInner
() &&
m_signal
==
SignalType::Strip
) {
66
m_module
=
ModuleType::SI
;
67
}
else
if
(
isDoublet
() &&
m_signal
==
SignalType::Wire
) {
68
m_module
=
ModuleType::WD
;
69
}
else
if
(
isDoublet
() &&
m_signal
==
SignalType::Strip
) {
70
m_module
=
ModuleType::SD
;
71
}
else
if
(
isTriplet
() &&
m_signal
==
SignalType::Wire
) {
72
m_module
=
ModuleType::WT
;
73
}
else
if
(
isTriplet
() &&
m_signal
==
SignalType::Strip
) {
74
m_module
=
ModuleType::ST
;
75
}
76
}
77
78
void
TGCId::setStation
(
StationType
v_station) {
79
m_station
= v_station;
80
}
81
82
void
TGCId::setSector
(
int
v_sector) {
83
m_sector
= v_sector;
84
if
(
m_region
==
RegionType::Endcap
) {
85
if
(
isInner
()) {
86
m_octant
=
m_sector
/ (
NUM_INNER_SECTOR
/
NUM_OCTANT
);
87
}
else
{
88
m_octant
=
m_sector
/ (
NUM_ENDCAP_SECTOR
/
NUM_OCTANT
);
89
}
90
}
else
if
(
m_region
==
RegionType::Forward
) {
91
m_octant
=
m_sector
/ (
NUM_FORWARD_SECTOR
/
NUM_OCTANT
);
92
}
93
}
94
95
void
TGCId::setOctant
(
int
v_octant) {
96
m_octant
= v_octant;
97
}
98
99
int
TGCId::getSectorModule
()
const
{
100
if
(
m_sector
== -1) {
101
return
-1;
102
}
103
104
static
const
int
moduleEndcap[6] = {0, 1, 3, 4, 6, 7};
105
static
const
int
moduleForward[3] = {2, 5, 8};
106
static
const
int
moduleEI[3] = {9, 10, 11};
107
static
const
int
moduleFI[3] = {12, 13, 14};
108
109
if
(
isEndcap
()) {
110
if
(
isInner
()) {
111
return
moduleEI[
getSectorInOctant
()];
112
}
113
return
moduleEndcap[
getSectorInOctant
()];
114
}
115
if
(
isForward
()) {
116
if
(
isInner
()) {
117
return
moduleFI[
getSectorInOctant
()];
118
}
119
return
moduleForward[
getSectorInOctant
()];
120
}
121
return
-1;
122
}
123
124
// before this method, set m_octant.
125
void
TGCId::setSectorModule
(
int
sectorModule) {
126
if
(
m_octant
< 0) {
127
return
;
128
}
129
130
const
int
MaxModuleInOctant = 15;
131
static
const
int
regionId[MaxModuleInOctant] = {0, 0, 1, 0, 0, 1, 0, 0,
132
1, 2, 2, 2, 3, 3, 3};
133
static
const
int
sectorId[MaxModuleInOctant] = {0, 1, 0, 2, 3, 1, 4, 5,
134
2, 0, 1, 2, 0, 1, 2};
135
136
if
(sectorModule < 0 || sectorModule >= MaxModuleInOctant) {
137
return
;
138
}
139
140
if
(regionId[sectorModule] == 0) {
141
setRegionType
(
RegionType::Endcap
);
142
setSector
(sectorId[sectorModule] +
143
m_octant
* (
NUM_ENDCAP_SECTOR
/
NUM_OCTANT
));
144
145
}
else
if
(regionId[sectorModule] == 1) {
146
setRegionType
(
RegionType::Forward
);
147
setSector
(sectorId[sectorModule] +
148
m_octant
* (
NUM_FORWARD_SECTOR
/
NUM_OCTANT
));
149
}
else
{
150
setStation
(
StationType::M4
);
151
if
(regionId[sectorModule] == 2) {
152
setRegionType
(
RegionType::Endcap
);
153
}
154
if
(regionId[sectorModule] == 3) {
155
setRegionType
(
RegionType::Forward
);
156
}
157
setSector
(sectorId[sectorModule] +
158
m_octant
* (
NUM_INNER_SECTOR
/
NUM_OCTANT
));
159
}
160
}
161
162
}
// namespace MuonTGC_Cabling
TGCId.h
MuonTGC_Cabling::TGCId::isEndcap
bool isEndcap() const
Definition
TGCId.h:178
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::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::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::WT
@ WT
Definition
TGCId.h:52
MuonTGC_Cabling::TGCId::ModuleType::WD
@ WD
Definition
TGCId.h:51
MuonTGC_Cabling::TGCId::ModuleType::SI
@ SI
Definition
TGCId.h:53
MuonTGC_Cabling::TGCId::ModuleType::ST
@ ST
Definition
TGCId.h:52
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::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::Wire
@ Wire
Definition
TGCId.h:58
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::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::getSector
virtual int getSector() const
Definition
TGCId.h:144
MuonTGC_Cabling::TGCId::RegionType::Forward
@ Forward
Definition
TGCId.h:59
MuonTGC_Cabling::TGCId::RegionType::Endcap
@ Endcap
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::IdType
IdType
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::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::NUM_FORWARD_SECTOR
static constexpr int NUM_FORWARD_SECTOR
Definition
TGCId.h:44
MuonTGC_Cabling
Definition
TGCCable.h:12
Generated on
for ATLAS Offline Software by
1.17.0