ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonStationIndex Namespace Reference

Enumerations

enum class  ChIndex : int8_t {
  ChUnknown = -1 , BIS , BIL , BMS ,
  BML , BOS , BOL , BEE ,
  EIS , EIL , EMS , EML ,
  EOS , EOL , EES , EEL ,
  CSS , CSL , ChIndexMax
}
 enum to classify the different chamber layers in the muon spectrometer More...
enum class  StIndex : int8_t {
  StUnknown = -1 , BI , BM , BO ,
  BE , EI , EM , EO ,
  EE , StIndexMax
}
 enum to classify the different station layers in the muon spectrometer More...
enum class  PhiIndex : int8_t {
  PhiUnknown = -1 , BI1 , BI2 , BM1 ,
  BM2 , BO1 , BO2 , T1 ,
  T2 , T3 , T4 , CSC ,
  STGC1 , STGC2 , PhiIndexMax
}
 enum to classify the different phi layers in the muon spectrometer More...
enum class  LayerIndex : int8_t {
  LayerUnknown = -1 , Inner , Middle , Outer ,
  Extended , BarrelExtended , LayerIndexMax
}
 enum to classify the different layers in the muon spectrometer More...
enum class  DetectorRegionIndex : int8_t {
  DetectorRegionUnknown = -1 , EndcapA , Barrel , EndcapC ,
  DetectorRegionIndexMax
}
 enum to classify the different layers in the muon spectrometer More...
enum class  TechnologyIndex : int8_t {
  TechnologyUnknown = -1 , MDT , CSC , RPC ,
  TGC , STGC , MM , TechnologyIndexMax
}
 enum to classify the different layers in the muon spectrometer More...

Functions

template<typename EnumType>
constexpr int toInt (const EnumType enumVal)
StIndex toStationIndex (ChIndex index)
 convert ChIndex into StIndex
LayerIndex toLayerIndex (ChIndex index)
 convert ChIndex into LayerIndex
LayerIndex toLayerIndex (StIndex index)
 convert StIndex into LayerIndex
StIndex toStationIndex (DetectorRegionIndex region, LayerIndex layer)
 convert DetectorRegionIndex + LayerIndex into StIndex
ChIndex toChamberIndex (DetectorRegionIndex region, LayerIndex layer, bool isSmall)
 convert DetectorRegionIndex + LayerIndex + isSmall into ChIndex
bool isBarrel (const ChIndex index)
 Returns true if the chamber index points to a barrel chamber.
bool isBarrel (const StIndex index)
 Returns true if the station index points to a barrel chamber.
bool isSmall (const ChIndex index)
 Returns true if the chamber index is in a small sector.
ChIndex toChamberIndex (StIndex stIndex, bool isSmall)
 convert StIndex + isSmall into ChIndex
const std::string & phiName (PhiIndex index)
 convert PhiIndex into a string
const std::string & stName (StIndex index)
 convert StIndex into a string
const std::string & chName (ChIndex index)
 convert ChIndex into a string
const std::string & regionName (DetectorRegionIndex index)
 convert DetectorRegionIndex into a string
const std::string & layerName (LayerIndex index)
 convert LayerIndex into a string
const std::string & technologyName (TechnologyIndex index)
 convert LayerIndex into a string
unsigned int sectorLayerHash (DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
 create a hash out of region and layer
constexpr unsigned int sectorLayerHashMax ()
 maximum create a hash out of region and layer
std::pair< DetectorRegionIndex, LayerIndexdecomposeSectorLayerHash (unsigned int hash)
 decompose the hash into Region and Layer
constexpr unsigned numberOfSectors ()
 return total number of sectors
ChIndex chIndex (const std::string &index)
 convert ChIndex name string to enum

Enumeration Type Documentation

◆ ChIndex

enum class Muon::MuonStationIndex::ChIndex : int8_t
strong

enum to classify the different chamber layers in the muon spectrometer

Enumerator
ChUnknown 
BIS 
BIL 
BMS 
BML 
BOS 
BOL 
BEE 
EIS 
EIL 
EMS 
EML 
EOS 
EOL 
EES 
EEL 
CSS 
CSL 
ChIndexMax 

Definition at line 15 of file MuonStationIndex.h.

◆ DetectorRegionIndex

enum class Muon::MuonStationIndex::DetectorRegionIndex : int8_t
strong

enum to classify the different layers in the muon spectrometer

Enumerator
DetectorRegionUnknown 
EndcapA 
Barrel 
EndcapC 
DetectorRegionIndexMax 

Definition at line 47 of file MuonStationIndex.h.

◆ LayerIndex

enum class Muon::MuonStationIndex::LayerIndex : int8_t
strong

enum to classify the different layers in the muon spectrometer

Enumerator
LayerUnknown 
Inner 
Middle 
Outer 
Extended 
BarrelExtended 

EE.

LayerIndexMax 

BEE.

Definition at line 38 of file MuonStationIndex.h.

◆ PhiIndex

enum class Muon::MuonStationIndex::PhiIndex : int8_t
strong

◆ StIndex

enum class Muon::MuonStationIndex::StIndex : int8_t
strong

enum to classify the different station layers in the muon spectrometer

Enumerator
StUnknown 
BI 
BM 
BO 
BE 
EI 
EM 
EO 
EE 
StIndexMax 

Definition at line 23 of file MuonStationIndex.h.

◆ TechnologyIndex

enum class Muon::MuonStationIndex::TechnologyIndex : int8_t
strong

enum to classify the different layers in the muon spectrometer

Enumerator
TechnologyUnknown 
MDT 
CSC 
RPC 
TGC 
STGC 
MM 
TechnologyIndexMax 

Definition at line 54 of file MuonStationIndex.h.

Function Documentation

◆ chIndex()

ChIndex Muon::MuonStationIndex::chIndex ( const std::string & index)

convert ChIndex name string to enum

Definition at line 11 of file MuonStationIndex.cxx.

11 {
12 if( index == "BIL" ) {
13 return ChIndex::BIL;
14 } else if( index == "BMS" ) {
15 return ChIndex::BMS;
16 } else if( index == "BIS" ) {
17 return ChIndex::BIS;
18 } else if( index == "BML" ) {
19 return ChIndex::BML;
20 } else if( index == "BOS" ) {
21 return ChIndex::BOS;
22 } else if( index == "BOL" ) {
23 return ChIndex::BOL;
24 } else if( index == "BEE" ) {
25 return ChIndex::BEE;
26 } else if( index == "EIS" ) {
27 return ChIndex::EIS;
28 } else if( index == "EIL" ) {
29 return ChIndex::EIL;
30 } else if( index == "EMS" ) {
31 return ChIndex::EMS;
32 } else if( index == "EML" ) {
33 return ChIndex::EML;
34 } else if( index == "EOS" ) {
35 return ChIndex::EOS;
36 } else if( index == "EOL" ) {
37 return ChIndex::EOL;
38 } else if( index == "EES" ) {
39 return ChIndex::EES;
40 } else if( index == "EEL" ) {
41 return ChIndex::EEL;
42 } else if( index == "CSS" ) {
43 return ChIndex::CSS;
44 } else if( index == "CSL" ) {
45 return ChIndex::CSL;
46 }
47 return ChIndex::ChUnknown;
48 }
Definition index.py:1

◆ chName()

const std::string & Muon::MuonStationIndex::chName ( ChIndex index)

convert ChIndex into a string

Definition at line 119 of file MuonStationIndex.cxx.

119 {
120 static const std::array<std::string, toInt(ChIndex::ChIndexMax)> chamberIndexNames {
121 "BIS", "BIL", "BMS", "BML", "BOS", "BOL", "BEE",
122 "EIS", "EIL", "EMS", "EML", "EOS", "EOL", "EES",
123 "EEL", "CSS", "CSL"
124 };
125
126 if( index == ChIndex::ChUnknown ) {
127 static const std::string dummy{"ChUnknown"};
128 return dummy;
129 }
130 if( index >= ChIndex::ChIndexMax ) {
131 static const std::string dummy{"ChOutOfRange"};
132 return dummy;
133 }
134 return chamberIndexNames[toInt(index)];
135 }
constexpr int toInt(const EnumType enumVal)

◆ decomposeSectorLayerHash()

std::pair< DetectorRegionIndex, LayerIndex > Muon::MuonStationIndex::decomposeSectorLayerHash ( unsigned int hash)

decompose the hash into Region and Layer

◆ isBarrel() [1/2]

bool Muon::MuonStationIndex::isBarrel ( const ChIndex index)

Returns true if the chamber index points to a barrel chamber.

◆ isBarrel() [2/2]

bool Muon::MuonStationIndex::isBarrel ( const StIndex index)

Returns true if the station index points to a barrel chamber.

◆ isSmall()

bool Muon::MuonStationIndex::isSmall ( const ChIndex index)

Returns true if the chamber index is in a small sector.

◆ layerName()

const std::string & Muon::MuonStationIndex::layerName ( LayerIndex index)

convert LayerIndex into a string

Definition at line 153 of file MuonStationIndex.cxx.

153 {
154 static const std::array<std::string, toInt(LayerIndex::LayerIndexMax)> layerIndexNames {
155 "Inner", "Middle", "Outer", "Extended", "BarrelExtended"};
156
158 static const std::string dummy{"LayerUnknown"};
159 return dummy;
160 }
161 if( index >= LayerIndex::LayerIndexMax) {
162 static const std::string dummy{"LayerOutOfRange"};
163 return dummy;
164 }
165 return layerIndexNames[toInt(index)];
166 }

◆ numberOfSectors()

unsigned Muon::MuonStationIndex::numberOfSectors ( )
constexpr

return total number of sectors

Definition at line 118 of file MuonStationIndex.h.

118{ return 16; }

◆ phiName()

const std::string & Muon::MuonStationIndex::phiName ( PhiIndex index)

convert PhiIndex into a string

Definition at line 87 of file MuonStationIndex.cxx.

87 {
88 static const std::array<std::string, toInt(PhiIndex::PhiIndexMax)> phiIndexNames = {
89 "BI1", "BI2", "BM1", "BM2", "BO1", "BO2", "T1", "T2", "T3", "T4", "CSC", "STGC1",
90 "STGC2"
91 };
92
94 static const std::string dummy{"PhiUnknown"};
95 return dummy;
96 }
97 if(index >= PhiIndex::PhiIndexMax) {
98 static const std::string dummy{"PhiOutOfRange"};
99 return dummy;
100 }
101 return phiIndexNames[toInt(index)];
102 }

◆ regionName()

const std::string & Muon::MuonStationIndex::regionName ( DetectorRegionIndex index)

convert DetectorRegionIndex into a string

Definition at line 138 of file MuonStationIndex.cxx.

138 {
139 static const std::array<std::string, toInt(DetectorRegionIndex::DetectorRegionIndexMax)> detectorRegionIndexNames {
140 "EndcapA", "Barrel", "EndcapC"};
141
143 static const std::string dummy( "DetectorRegionUnknown" );
144 return dummy;
145 }
147 static const std::string dummy( "DetectorRegionIndexMax" );
148 return dummy;
149 }
150 return detectorRegionIndexNames[ toInt(index) ];
151 }

◆ sectorLayerHash()

unsigned int Muon::MuonStationIndex::sectorLayerHash ( DetectorRegionIndex detectorRegionIndex,
LayerIndex layerIndex )

create a hash out of region and layer

◆ sectorLayerHashMax()

unsigned int Muon::MuonStationIndex::sectorLayerHashMax ( )
constexpr

maximum create a hash out of region and layer

Definition at line 110 of file MuonStationIndex.h.

◆ stName()

const std::string & Muon::MuonStationIndex::stName ( StIndex index)

convert StIndex into a string

Definition at line 104 of file MuonStationIndex.cxx.

104 {
105 static const std::array<std::string, toInt(StIndex::StIndexMax)> stationIndexNames {
106 "BI", "BM", "BO", "BE", "EI", "EM", "EO", "EE"};
107
108 if( index == StIndex::StUnknown ) {
109 static const std::string dummy{"StUnknown"};
110 return dummy;
111 }
112 if( index >= StIndex::StIndexMax) {
113 static const std::string dummy{"StIndexMax"};
114 return dummy;
115 }
116 return stationIndexNames[ toInt(index) ];
117 }

◆ technologyName()

const std::string & Muon::MuonStationIndex::technologyName ( TechnologyIndex index)

convert LayerIndex into a string

Definition at line 169 of file MuonStationIndex.cxx.

169 {
170 using TechIdx = TechnologyIndex;
171 static const std::array<std::string, toInt(TechIdx::TechnologyIndexMax)> technologyIndexNames {
172 "MDT", "CSC", "RPC", "TGC", "STGC", "MM"};
173
174 if( index == TechIdx::TechnologyUnknown ) {
175 static const std::string dummy{"TechnologyUnknown"};
176 return dummy;
177 }
178 if( index >= TechIdx::TechnologyIndexMax ) {
179 static const std::string dummy{"TechnologyIndexMax"};
180 return dummy;
181 }
182 return technologyIndexNames[ toInt(index) ];
183 }
TechnologyIndex
enum to classify the different layers in the muon spectrometer

◆ toChamberIndex() [1/2]

ChIndex Muon::MuonStationIndex::toChamberIndex ( DetectorRegionIndex region,
LayerIndex layer,
bool isSmall )

convert DetectorRegionIndex + LayerIndex + isSmall into ChIndex

EndCapA hash

Barrel hash column BEE is not counted for the small sectors

EndCapC hash

EndCapA hash

Barrel hash column BEE is not counted for the large sectors

EndCapC hash

Definition at line 63 of file MuonStationIndex.cxx.

63 {
64 constexpr unsigned nMax = sectorLayerHashMax();
65 static constexpr std::array<ChIndex, nMax> regionLayerToChamberIndexSmall {
72 };
73 static constexpr std::array<ChIndex, nMax> regionLayerToChamberIndexLarge {
80 };
81 if( isSmall ) {
82 return regionLayerToChamberIndexSmall[ sectorLayerHash(region, layer)];
83 }
84 return regionLayerToChamberIndexLarge[sectorLayerHash(region, layer )];
85 }
bool isSmall(const ChIndex index)
Returns true if the chamber index is in a small sector.
constexpr unsigned int sectorLayerHashMax()
maximum create a hash out of region and layer
unsigned int sectorLayerHash(DetectorRegionIndex detectorRegionIndex, LayerIndex layerIndex)
create a hash out of region and layer

◆ toChamberIndex() [2/2]

ChIndex Muon::MuonStationIndex::toChamberIndex ( StIndex stIndex,
bool isSmall )

convert StIndex + isSmall into ChIndex

◆ toInt()

template<typename EnumType>
int Muon::MuonStationIndex::toInt ( const EnumType enumVal)
constexpr

Definition at line 61 of file MuonStationIndex.h.

61 {
62 return static_cast<int>(enumVal);
63 }

◆ toLayerIndex() [1/2]

LayerIndex Muon::MuonStationIndex::toLayerIndex ( ChIndex index)

convert ChIndex into LayerIndex

◆ toLayerIndex() [2/2]

LayerIndex Muon::MuonStationIndex::toLayerIndex ( StIndex index)

convert StIndex into LayerIndex

◆ toStationIndex() [1/2]

StIndex Muon::MuonStationIndex::toStationIndex ( ChIndex index)

convert ChIndex into StIndex

◆ toStationIndex() [2/2]

StIndex Muon::MuonStationIndex::toStationIndex ( DetectorRegionIndex region,
LayerIndex layer )

convert DetectorRegionIndex + LayerIndex into StIndex

Definition at line 49 of file MuonStationIndex.cxx.

49 {
50 constexpr unsigned nMax = sectorLayerHashMax();
51 static constexpr std::array<StIndex, nMax> regionLayerToStationIndex {
52 StIndex::EI, StIndex::EM, StIndex::EO,
53 StIndex::EE, StIndex::BE, StIndex::BI,
54 StIndex::BM, StIndex::BO, StIndex::StUnknown,
55 StIndex::StUnknown,
56 StIndex::EI, StIndex::EM, StIndex::EO,
57 StIndex::EE, StIndex::BE
58 };
59 return regionLayerToStationIndex[ sectorLayerHash( region, layer ) ];
60 }