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
DetectorRegionIndex toDetectorRegionIndex (ChIndex index, int8_t etaSign)
 convert ChamberIndex + etaSign into DetectorRegionIndex
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
unsigned int regionChambernHash (DetectorRegionIndex regionIdx, ChIndex chamberIdx)
 create a hash out of chamber index and detector region
constexpr unsigned int sectorLayerHashMax ()
 maximum create a hash out of region and layer
constexpr unsigned int regionChamberHashMax ()
 maximum create a hash out of chamber and region index
std::pair< DetectorRegionIndex, LayerIndexdecomposeSectorLayerHash (unsigned int hash)
 decompose the hash into Region and Layer
std::pair< DetectorRegionIndex, ChIndexdecomposeRegionChamberHash (unsigned int hash)
 decompose the hash into Region and Chamber
constexpr unsigned numberOfSectors ()
 return total number of sectors
ChIndex chIndex (const std::string &index)
 convert ChIndex name string to enum
std::ostream & operator<< (std::ostream &ostr, const StIndex stIdx)
std::ostream & operator<< (std::ostream &ostr, const ChIndex chIdx)
std::ostream & operator<< (std::ostream &ostr, const PhiIndex phiIdx)
std::ostream & operator<< (std::ostream &ostr, const DetectorRegionIndex detIdx)
std::ostream & operator<< (std::ostream &ostr, const LayerIndex layIdx)
std::ostream & operator<< (std::ostream &ostr, const TechnologyIndex techIdx)

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 16 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 48 of file MuonStationIndex.h.

◆ LayerIndex

enum class typedef HitSummary::LayerIndex MuonR4::LayerIndex = HitSummary::LayerIndex
strong

enum to classify the different layers in the muon spectrometer

Enumerator
LayerUnknown 
Inner 
Middle 
Outer 
Extended 
BarrelExtended 

EE.

LayerIndexMax 

BEE.

Definition at line 39 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 24 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 55 of file MuonStationIndex.h.

Function Documentation

◆ chIndex()

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

convert ChIndex name string to enum

Definition at line 12 of file MuonStationIndex.cxx.

12 {
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 }
Definition index.py:1

◆ chName()

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

convert ChIndex into a string

Definition at line 120 of file MuonStationIndex.cxx.

120 {
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 }
constexpr int toInt(const EnumType enumVal)

◆ decomposeRegionChamberHash()

std::pair< DetectorRegionIndex, ChIndex > Muon::MuonStationIndex::decomposeRegionChamberHash ( unsigned int hash)

decompose the hash into Region and Chamber

◆ 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 154 of file MuonStationIndex.cxx.

154 {
155 static const std::array<std::string, toInt(LayerIndex::LayerIndexMax)> layerIndexNames {
156 "Inner", "Middle", "Outer", "Extended", "BarrelExtended"};
157
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 }

◆ numberOfSectors()

unsigned Muon::MuonStationIndex::numberOfSectors ( )
constexpr

return total number of sectors

Definition at line 132 of file MuonStationIndex.h.

132{ return 16; }

◆ operator<<() [1/6]

std::ostream & Muon::MuonStationIndex::operator<< ( std::ostream & ostr,
const ChIndex chIdx )

Definition at line 189 of file MuonStationIndex.cxx.

189 {
190 return (ostr<<chName(chIdx));
191 }
const std::string & chName(ChIndex index)
convert ChIndex into a string

◆ operator<<() [2/6]

std::ostream & Muon::MuonStationIndex::operator<< ( std::ostream & ostr,
const DetectorRegionIndex detIdx )

Definition at line 195 of file MuonStationIndex.cxx.

195 {
196 return (ostr<<regionName(detIdx));
197 }
const std::string & regionName(DetectorRegionIndex index)
convert DetectorRegionIndex into a string

◆ operator<<() [3/6]

std::ostream & Muon::MuonStationIndex::operator<< ( std::ostream & ostr,
const LayerIndex layIdx )

Definition at line 198 of file MuonStationIndex.cxx.

198 {
199 return (ostr<<layerName(layIdx));
200 }
const std::string & layerName(LayerIndex index)
convert LayerIndex into a string

◆ operator<<() [4/6]

std::ostream & Muon::MuonStationIndex::operator<< ( std::ostream & ostr,
const PhiIndex phiIdx )

Definition at line 192 of file MuonStationIndex.cxx.

192 {
193 return (ostr<<phiName(phiIdx));
194 }
const std::string & phiName(PhiIndex index)
convert PhiIndex into a string

◆ operator<<() [5/6]

std::ostream & Muon::MuonStationIndex::operator<< ( std::ostream & ostr,
const StIndex stIdx )

Definition at line 186 of file MuonStationIndex.cxx.

186 {
187 return (ostr<<stName(stIdx));
188 }
const std::string & stName(StIndex index)
convert StIndex into a string

◆ operator<<() [6/6]

std::ostream & Muon::MuonStationIndex::operator<< ( std::ostream & ostr,
const TechnologyIndex techIdx )

Definition at line 201 of file MuonStationIndex.cxx.

201 {
202 return (ostr<<technologyName(techIdx));
203 }
const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string

◆ phiName()

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

convert PhiIndex into a string

Definition at line 88 of file MuonStationIndex.cxx.

88 {
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
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 }

◆ regionChamberHashMax()

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

maximum create a hash out of chamber and region index

Definition at line 121 of file MuonStationIndex.h.

◆ regionChambernHash()

unsigned int Muon::MuonStationIndex::regionChambernHash ( DetectorRegionIndex regionIdx,
ChIndex chamberIdx )

create a hash out of chamber index and detector region

◆ regionName()

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

convert DetectorRegionIndex into a string

Definition at line 139 of file MuonStationIndex.cxx.

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

◆ 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 117 of file MuonStationIndex.h.

◆ stName()

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

convert StIndex into a string

Definition at line 105 of file MuonStationIndex.cxx.

105 {
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 }

◆ technologyName()

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

convert LayerIndex into a string

Definition at line 170 of file MuonStationIndex.cxx.

170 {
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 }
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 64 of file MuonStationIndex.cxx.

64 {
65 constexpr unsigned nMax = sectorLayerHashMax();
66 static constexpr std::array<ChIndex, nMax> regionLayerToChamberIndexSmall {
73 };
74 static constexpr std::array<ChIndex, nMax> regionLayerToChamberIndexLarge {
81 };
82 if( isSmall ) {
83 return regionLayerToChamberIndexSmall[ sectorLayerHash(region, layer)];
84 }
85 return regionLayerToChamberIndexLarge[sectorLayerHash(region, layer )];
86 }
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

◆ toDetectorRegionIndex()

DetectorRegionIndex Muon::MuonStationIndex::toDetectorRegionIndex ( ChIndex index,
int8_t etaSign )

convert ChamberIndex + etaSign into DetectorRegionIndex

◆ toInt()

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

Definition at line 62 of file MuonStationIndex.h.

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

◆ 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 50 of file MuonStationIndex.cxx.

50 {
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 }