ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonStationIndex
Root
MuonStationIndex.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
MuonStationIndex/MuonStationIndex.h
"
6
#include <array>
7
#include <ostream>
8
9
namespace
Muon
{
10
namespace
MuonStationIndex
{
11
12
ChIndex
chIndex
(
const
std::string&
index
) {
13
if
(
index
==
"BIL"
) {
14
return
ChIndex::BIL
;
15
}
else
if
(
index
==
"BMS"
) {
16
return
ChIndex::BMS
;
17
}
else
if
(
index
==
"BIS"
) {
18
return
ChIndex::BIS
;
19
}
else
if
(
index
==
"BML"
) {
20
return
ChIndex::BML
;
21
}
else
if
(
index
==
"BOS"
) {
22
return
ChIndex::BOS
;
23
}
else
if
(
index
==
"BOL"
) {
24
return
ChIndex::BOL
;
25
}
else
if
(
index
==
"BEE"
) {
26
return
ChIndex::BEE
;
27
}
else
if
(
index
==
"EIS"
) {
28
return
ChIndex::EIS
;
29
}
else
if
(
index
==
"EIL"
) {
30
return
ChIndex::EIL
;
31
}
else
if
(
index
==
"EMS"
) {
32
return
ChIndex::EMS
;
33
}
else
if
(
index
==
"EML"
) {
34
return
ChIndex::EML
;
35
}
else
if
(
index
==
"EOS"
) {
36
return
ChIndex::EOS
;
37
}
else
if
(
index
==
"EOL"
) {
38
return
ChIndex::EOL
;
39
}
else
if
(
index
==
"EES"
) {
40
return
ChIndex::EES
;
41
}
else
if
(
index
==
"EEL"
) {
42
return
ChIndex::EEL
;
43
}
else
if
(
index
==
"CSS"
) {
44
return
ChIndex::CSS
;
45
}
else
if
(
index
==
"CSL"
) {
46
return
ChIndex::CSL
;
47
}
48
return
ChIndex::ChUnknown
;
49
}
50
StIndex
toStationIndex
(
DetectorRegionIndex
region,
LayerIndex
layer ) {
51
constexpr
unsigned
nMax =
sectorLayerHashMax
();
52
static
constexpr
std::array<StIndex, nMax> regionLayerToStationIndex {
53
StIndex::EI, StIndex::EM, StIndex::EO,
54
StIndex::EE, StIndex::BE, StIndex::BI,
55
StIndex::BM, StIndex::BO, StIndex::StUnknown,
56
StIndex::StUnknown,
57
StIndex::EI, StIndex::EM, StIndex::EO,
58
StIndex::EE, StIndex::BE
59
};
60
return
regionLayerToStationIndex[
sectorLayerHash
( region, layer ) ];
61
}
62
63
ChIndex
64
toChamberIndex
(
DetectorRegionIndex
region,
LayerIndex
layer,
bool
isSmall
) {
65
constexpr
unsigned
nMax =
sectorLayerHashMax
();
66
static
constexpr
std::array<ChIndex, nMax> regionLayerToChamberIndexSmall {
68
ChIndex::EIS
,
ChIndex::EMS
,
ChIndex::EOS
,
ChIndex::EES
,
ChIndex::BEE
,
70
ChIndex::BIS
,
ChIndex::BMS
,
ChIndex::BOS
,
ChIndex::ChUnknown
,
ChIndex::ChUnknown
,
72
ChIndex::EIS
,
ChIndex::EMS
,
ChIndex::EOS
,
ChIndex::EES
,
ChIndex::BEE
73
};
74
static
constexpr
std::array<ChIndex, nMax> regionLayerToChamberIndexLarge {
76
ChIndex::EIL
,
ChIndex::EML
,
ChIndex::EOL
,
ChIndex::EEL
,
ChIndex::ChUnknown
,
78
ChIndex::BIL
,
ChIndex::BML
,
ChIndex::BOL
,
ChIndex::ChUnknown
,
ChIndex::ChUnknown
,
80
ChIndex::EIL
,
ChIndex::EML
,
ChIndex::EOL
,
ChIndex::EEL
,
ChIndex::ChUnknown
,
81
};
82
if
(
isSmall
) {
83
return
regionLayerToChamberIndexSmall[
sectorLayerHash
(region, layer)];
84
}
85
return
regionLayerToChamberIndexLarge[
sectorLayerHash
(region, layer )];
86
}
87
88
const
std::string&
phiName
(
PhiIndex
index
) {
89
static
const
std::array<std::string,
toInt
(
PhiIndex::PhiIndexMax
)> phiIndexNames = {
90
"BI1"
,
"BI2"
,
"BM1"
,
"BM2"
,
"BO1"
,
"BO2"
,
"T1"
,
"T2"
,
"T3"
,
"T4"
,
"CSC"
,
"STGC1"
,
91
"STGC2"
92
};
93
94
if
(
index
==
PhiIndex::PhiUnknown
) {
95
static
const
std::string dummy{
"PhiUnknown"
};
96
return
dummy;
97
}
98
if
(
index
>=
PhiIndex::PhiIndexMax
) {
99
static
const
std::string dummy{
"PhiOutOfRange"
};
100
return
dummy;
101
}
102
return
phiIndexNames[
toInt
(
index
)];
103
}
104
105
const
std::string&
stName
(
StIndex
index
) {
106
static
const
std::array<std::string,
toInt
(StIndex::StIndexMax)> stationIndexNames {
107
"BI"
,
"BM"
,
"BO"
,
"BE"
,
"EI"
,
"EM"
,
"EO"
,
"EE"
};
108
109
if
(
index
== StIndex::StUnknown ) {
110
static
const
std::string dummy{
"StUnknown"
};
111
return
dummy;
112
}
113
if
(
index
>= StIndex::StIndexMax) {
114
static
const
std::string dummy{
"StIndexMax"
};
115
return
dummy;
116
}
117
return
stationIndexNames[
toInt
(
index
) ];
118
}
119
120
const
std::string&
chName
(
ChIndex
index
) {
121
static
const
std::array<std::string,
toInt
(
ChIndex::ChIndexMax
)> chamberIndexNames {
122
"BIS"
,
"BIL"
,
"BMS"
,
"BML"
,
"BOS"
,
"BOL"
,
"BEE"
,
123
"EIS"
,
"EIL"
,
"EMS"
,
"EML"
,
"EOS"
,
"EOL"
,
"EES"
,
124
"EEL"
,
"CSS"
,
"CSL"
125
};
126
127
if
(
index
==
ChIndex::ChUnknown
) {
128
static
const
std::string dummy{
"ChUnknown"
};
129
return
dummy;
130
}
131
if
(
index
>=
ChIndex::ChIndexMax
) {
132
static
const
std::string dummy{
"ChOutOfRange"
};
133
return
dummy;
134
}
135
return
chamberIndexNames[
toInt
(
index
)];
136
}
137
138
const
std::string&
139
regionName
(
DetectorRegionIndex
index
) {
140
static
const
std::array<std::string,
toInt
(
DetectorRegionIndex::DetectorRegionIndexMax
)> detectorRegionIndexNames {
141
"EndcapA"
,
"Barrel"
,
"EndcapC"
};
142
143
if
(
index
==
DetectorRegionIndex::DetectorRegionUnknown
) {
144
static
const
std::string dummy(
"DetectorRegionUnknown"
);
145
return
dummy;
146
}
147
if
(
index
>=
DetectorRegionIndex::DetectorRegionIndexMax
) {
148
static
const
std::string dummy(
"DetectorRegionIndexMax"
);
149
return
dummy;
150
}
151
return
detectorRegionIndexNames[
toInt
(
index
) ];
152
}
153
154
const
std::string&
layerName
(
LayerIndex
index
) {
155
static
const
std::array<std::string,
toInt
(
LayerIndex::LayerIndexMax
)> layerIndexNames {
156
"Inner"
,
"Middle"
,
"Outer"
,
"Extended"
,
"BarrelExtended"
};
157
158
if
(
index
==
LayerIndex::LayerUnknown
) {
159
static
const
std::string dummy{
"LayerUnknown"
};
160
return
dummy;
161
}
162
if
(
index
>=
LayerIndex::LayerIndexMax
) {
163
static
const
std::string dummy{
"LayerOutOfRange"
};
164
return
dummy;
165
}
166
return
layerIndexNames[
toInt
(
index
)];
167
}
168
169
const
std::string&
170
technologyName
(
TechnologyIndex
index
) {
171
using
TechIdx =
TechnologyIndex
;
172
static
const
std::array<std::string,
toInt
(TechIdx::TechnologyIndexMax)> technologyIndexNames {
173
"MDT"
,
"CSC"
,
"RPC"
,
"TGC"
,
"STGC"
,
"MM"
};
174
175
if
(
index
== TechIdx::TechnologyUnknown ) {
176
static
const
std::string dummy{
"TechnologyUnknown"
};
177
return
dummy;
178
}
179
if
(
index
>= TechIdx::TechnologyIndexMax ) {
180
static
const
std::string dummy{
"TechnologyIndexMax"
};
181
return
dummy;
182
}
183
return
technologyIndexNames[
toInt
(
index
) ];
184
}
185
186
std::ostream&
operator<<
(std::ostream& ostr,
const
StIndex
stIdx){
187
return
(ostr<<
stName
(stIdx));
188
}
189
std::ostream&
operator<<
(std::ostream& ostr,
const
ChIndex
chIdx){
190
return
(ostr<<
chName
(chIdx));
191
}
192
std::ostream&
operator<<
(std::ostream& ostr,
const
PhiIndex
phiIdx){
193
return
(ostr<<
phiName
(phiIdx));
194
}
195
std::ostream&
operator<<
(std::ostream& ostr,
const
DetectorRegionIndex
detIdx){
196
return
(ostr<<
regionName
(detIdx));
197
}
198
std::ostream&
operator<<
(std::ostream& ostr,
const
LayerIndex
layIdx){
199
return
(ostr<<
layerName
(layIdx));
200
}
201
std::ostream&
operator<<
(std::ostream& ostr,
const
TechnologyIndex
techIdx){
202
return
(ostr<<
technologyName
(techIdx));
203
}
204
}
205
}
// namespace Muon
MuonStationIndex.h
Muon::MuonStationIndex
Definition
MuonStationIndex.h:14
Muon::MuonStationIndex::StIndex
StIndex
enum to classify the different station layers in the muon spectrometer
Definition
MuonStationIndex.h:24
Muon::MuonStationIndex::layerName
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string
Definition
MuonStationIndex.cxx:154
Muon::MuonStationIndex::chIndex
ChIndex chIndex(const std::string &index)
convert ChIndex name string to enum
Definition
MuonStationIndex.cxx:12
Muon::MuonStationIndex::operator<<
std::ostream & operator<<(std::ostream &ostr, const StIndex stIdx)
Definition
MuonStationIndex.cxx:186
Muon::MuonStationIndex::TechnologyIndex
TechnologyIndex
enum to classify the different layers in the muon spectrometer
Definition
MuonStationIndex.h:55
Muon::MuonStationIndex::DetectorRegionIndex
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
Definition
MuonStationIndex.h:48
Muon::MuonStationIndex::DetectorRegionIndex::DetectorRegionIndexMax
@ DetectorRegionIndexMax
Definition
MuonStationIndex.h:51
Muon::MuonStationIndex::DetectorRegionIndex::DetectorRegionUnknown
@ DetectorRegionUnknown
Definition
MuonStationIndex.h:49
Muon::MuonStationIndex::PhiIndex
PhiIndex
enum to classify the different phi layers in the muon spectrometer
Definition
MuonStationIndex.h:32
Muon::MuonStationIndex::PhiIndex::PhiIndexMax
@ PhiIndexMax
Definition
MuonStationIndex.h:35
Muon::MuonStationIndex::PhiIndex::PhiUnknown
@ PhiUnknown
Definition
MuonStationIndex.h:33
Muon::MuonStationIndex::toStationIndex
StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
Muon::MuonStationIndex::isSmall
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
Muon::MuonStationIndex::toInt
constexpr int toInt(const EnumType enumVal)
Definition
MuonStationIndex.h:62
Muon::MuonStationIndex::sectorLayerHashMax
constexpr unsigned int sectorLayerHashMax()
maximum create a hash out of region and layer
Definition
MuonStationIndex.h:117
Muon::MuonStationIndex::toChamberIndex
ChIndex toChamberIndex(DetectorRegionIndex region, LayerIndex layer, bool isSmall)
convert DetectorRegionIndex + LayerIndex + isSmall into ChIndex
Definition
MuonStationIndex.cxx:64
Muon::MuonStationIndex::sectorLayerHash
unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer
Muon::MuonStationIndex::LayerIndex
LayerIndex
enum to classify the different layers in the muon spectrometer
Definition
MuonStationIndex.h:39
Muon::MuonStationIndex::LayerIndex::LayerUnknown
@ LayerUnknown
Definition
MuonStationIndex.h:40
Muon::MuonStationIndex::LayerIndex::LayerIndexMax
@ LayerIndexMax
BEE.
Definition
MuonStationIndex.h:44
Muon::MuonStationIndex::stName
const std::string & stName(StIndex index)
convert StIndex into a string
Definition
MuonStationIndex.cxx:105
Muon::MuonStationIndex::technologyName
const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string
Definition
MuonStationIndex.cxx:170
Muon::MuonStationIndex::chName
const std::string & chName(ChIndex index)
convert ChIndex into a string
Definition
MuonStationIndex.cxx:120
Muon::MuonStationIndex::regionName
const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string
Definition
MuonStationIndex.cxx:139
Muon::MuonStationIndex::phiName
const std::string & phiName(PhiIndex index)
convert PhiIndex into a string
Definition
MuonStationIndex.cxx:88
Muon::MuonStationIndex::ChIndex
ChIndex
enum to classify the different chamber layers in the muon spectrometer
Definition
MuonStationIndex.h:16
Muon::MuonStationIndex::ChIndex::BIL
@ BIL
Definition
MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex::ChUnknown
@ ChUnknown
Definition
MuonStationIndex.h:17
Muon::MuonStationIndex::ChIndex::BEE
@ BEE
Definition
MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex::EMS
@ EMS
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::CSS
@ CSS
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::EML
@ EML
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::EIS
@ EIS
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::EEL
@ EEL
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::BOL
@ BOL
Definition
MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex::CSL
@ CSL
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::ChIndexMax
@ ChIndexMax
Definition
MuonStationIndex.h:20
Muon::MuonStationIndex::ChIndex::BML
@ BML
Definition
MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex::EOS
@ EOS
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::BOS
@ BOS
Definition
MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex::EIL
@ EIL
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::EOL
@ EOL
Definition
MuonStationIndex.h:19
Muon::MuonStationIndex::ChIndex::BMS
@ BMS
Definition
MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex::BIS
@ BIS
Definition
MuonStationIndex.h:18
Muon::MuonStationIndex::ChIndex::EES
@ EES
Definition
MuonStationIndex.h:19
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
index
Definition
index.py:1
Generated on
for ATLAS Offline Software by
1.17.0