|
ATLAS Offline Software
|
Go to the documentation of this file.
27 using AllHelperArray = std::array<const MuonIdHelper*, 6>;
30 AllHelperArray::const_iterator itr = std::ranges::find_if(allHelpers,
32 if (itr == allHelpers.end()){
33 ATH_MSG_WARNING(
"No MuonIdHelper has been created before. Please do not setup the service if no muon layout is loaded");
34 return StatusCode::SUCCESS;
38 std::stringstream techStr{};
49 techStr<<
", " << tech <<
" " <<
name;
66 if (
data.stationName[1] ==
'1')
67 data.chIndex = ChIdx::EML;
68 else if (
data.stationName[1] ==
'2')
69 data.chIndex = ChIdx::EML;
70 else if (
data.stationName[1] ==
'3')
71 data.chIndex = ChIdx::EML;
72 else if (
data.stationName[1] ==
'4')
73 data.chIndex = ChIdx::EIL;
75 if (
data.stationName[1] ==
'O') {
76 if (
data.stationName[2] ==
'L')
77 data.chIndex = ChIdx::EOL;
79 data.chIndex = ChIdx::EOS;
80 }
else if (
data.stationName[1] ==
'M') {
81 if (
data.stationName[2] ==
'L')
82 data.chIndex = ChIdx::EML;
84 data.chIndex = ChIdx::EMS;
85 }
else if (
data.stationName[1] ==
'I') {
86 if (
data.stationName[2] ==
'L')
87 data.chIndex = ChIdx::EIL;
89 data.chIndex = ChIdx::EIS;
90 }
else if (
data.stationName[1] ==
'E') {
91 if (
data.stationName[0] ==
'B') {
94 if (
data.stationName[2] ==
'L')
95 data.chIndex = ChIdx::EEL;
97 data.chIndex = ChIdx::EES;
99 }
else if (
data.stationName[0] ==
'C') {
100 if (
data.stationName[2] ==
'L')
105 if (
data.stationName[0] ==
'S' ||
data.stationName[0] ==
'M') {
107 data.chIndex = ChIdx::EIS;
109 data.chIndex = ChIdx::EIL;
113 if (
data.stationName[1] ==
'O') {
114 if (
data.stationName[2] ==
'L')
118 }
else if (
data.stationName[1] ==
'M') {
119 if (
data.stationName[2] ==
'L' ||
data.stationName[2] ==
'E')
123 }
else if (
data.stationName[1] ==
'I') {
124 if (
data.stationName[2] ==
'L' ||
data.stationName[2] ==
'M' ||
data.stationName[2] ==
'R')
130 if (
data.chIndex == ChIdx::ChUnknown) {
131 ATH_MSG_ERROR(
"data.chIndex is negative in MuonIdHelperSvc::initialize ");
132 return StatusCode::FAILURE;
156 for (
int phi = 1; phi <= 8; ++phi) {
170 std::ranges::for_each(allHelpers, [
this](
const MuonIdHelper* idHelper){
171 if (!idHelper)
return;
181 return StatusCode::SUCCESS;
187 }
else if (
isTgc(
id)) {
190 }
else if (
isCsc(
id)) {
196 }
else if (
isMM(
id)) {
228 const std::set<MuonStationIndex::TechnologyIndex>&
253 }
else if (
isTgc(
id)) {
255 }
else if (
isCsc(
id)) {
273 if (!
id.is_valid() || !
isMuon(
id)) {
275 return ChIdx::ChUnknown;
281 if (!
id.is_valid() || !
isMuon(
id)) {
283 return StIdx::StUnknown;
289 if (!
id.is_valid() || !
isMuon(
id)) {
291 return PhiIdx::PhiUnknown;
295 return PhiIdx::PhiUnknown;
299 if (stIndex == StIdx::BI) {
301 }
else if (stIndex == StIdx::BM) {
303 }
else if (stIndex == StIdx::BO) {
305 }
else if (stIndex == StIdx::EI) {
308 }
else if (
isTgc(
id)) {
311 index = PhiIdx::STGC1;
313 index = PhiIdx::STGC2;
317 if (chamberName[1] ==
'1')
319 else if (chamberName[1] ==
'2')
329 if (
isEndcap(
id))
return stationEta(
id) < 0 ? DetRegIdx::EndcapC : DetRegIdx::EndcapA;
339 if (
isCsc(
id))
return TechIdx::CSCI;
344 return TechIdx::TechnologyUnknown;
347 if (!
id.is_valid())
return " Invalid Identifier";
351 const std::string_view phiStr{
measuresPhi(
id) ?
"phi" :
"eta"};
354 }
else if (
isTgc(
id)) {
356 }
else if (
isCsc(
id)) {
358 }
else if (
isMM(
id)) {
364 channelType == sTgcType::Strip ?
"eta" : channelType == sTgcType::Wire ?
"phi" :
"pad" ,
381 if (!
id.is_valid()) {
382 return " Invalid Identifier";
392 if (!
id.is_valid())
return " Invalid Identifier";
395 }
else if (
isRpc(
id)) {
397 }
else if (
isTgc(
id)) {
403 }
else if (
isMM(
id)) {
412 if (!
id.is_valid())
return " Invalid Identifier";
426 }
else if (
isRpc(
id)) {
428 }
else if (
isMM(
id)) {
432 }
else if (
isCsc(
id)) {
434 }
else if (
isMdt(
id)) {
444 }
else if (
isRpc(
id)) {
446 }
else if (
isCsc(
id)) {
450 }
else if (
isMM(
id)) {
460 }
else if (
isRpc(
id)) {
463 }
else if (
isCsc(
id)) {
466 }
else if (
isMM(
id)) {
481 }
else if (
isRpc(
id)) {
485 }
else if (
isCsc(
id)) {
487 }
else if (
isMM(
id)) {
492 sTgcIdHelper::sTgcChannelTypes::Strip, 1);
499 if (!
id.is_valid()) {
505 }
else if (
isTgc(
id)) {
507 }
else if (
isMdt(
id)) {
509 }
else if (
isCsc(
id)) {
513 }
else if (
isMM(
id)) {
520 if (!
id.is_valid()) {
526 }
else if (
isTgc(
id)) {
528 }
else if (
isMdt(
id)) {
530 }
else if (
isCsc(
id)) {
534 }
else if (
isMM(
id)) {
541 if (!
id.is_valid()) {
547 }
else if (
isTgc(
id)) {
549 }
else if (
isMdt(
id)) {
551 }
else if (
isCsc(
id)) {
555 }
else if (
isMM(
id)) {
562 if (!
id.is_valid()) {
568 }
else if (
isTgc(
id)) {
570 }
else if (
isMdt(
id)) {
572 }
else if (
isCsc(
id)) {
576 }
else if (
isMM(
id)) {
585 auto initTgcSectorMapping = [&]() -> std::vector<int>* {
586 std::vector<int>*
mapping =
nullptr;
595 static const std::vector<int> tgcSectorMapping = *initTgcSectorMapping();
599 if (
hash >= tgcSectorMapping.size()) {
603 return tgcSectorMapping[
hash];
bool isBMG(const Identifier &id) const
is this a BMG chamber
bool is_muon(const Identifier &id) const
static const std::string & chName(ChIndex index)
convert ChIndex into a string
int multilayer(const Identifier &id) const
Access to components of the ID.
const MmIdHelper * m_mmIdHelper
virtual StatusCode initialize() override
AlgTool initilize.
virtual bool isTgc(const Identifier &id) const override
returns whether this is a TGC Identifier or not
int stationNameIndex(const std::string &name) const
int multilayer(const Identifier &id) const
static StIndex toStationIndex(ChIndex index)
convert ChIndex into StIndex
char data[hepevt_bytes_allocation_ATLAS]
int stationRegion(const Identifier &id) const
Gaudi::Property< bool > m_hasSTGC
static int stationEtaMin(bool barrel)
Access to min and max of level ranges.
bool is_rpc(const Identifier &id) const
Gaudi::Property< bool > m_hasMDT
const RpcIdHelper * m_rpcIdHelper
Sub detector specific IdHelpers.
int gasGap(const Identifier &id) const override
get the hashes
virtual int stationName(const Identifier &id) const override
Return stationName for all technologies.
Identifier elementID(int stationName, int stationEta, int stationPhi, int doubletR) const
virtual MuonStationIndex::LayerIndex layerIndex(const Identifier &id) const override
calculate layer index from Identifier
virtual std::string toString(const Identifier &id) const override
print all fields to string
bool is_mdt(const Identifier &id) const
int doubletZ(const Identifier &id) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
virtual bool isCsc(const Identifier &id) const override
returns whether this is a CSC Identifier or not
size_type detectorElement_hash_max() const
const MuonIdHelper * m_primaryHelper
Gaudi::Property< bool > m_hasRPC
@ BEE
BEE measurement point.
bool measuresPhi(const Identifier &id) const override
returns measuresPhi
virtual MuonStationIndex::ChIndex chamberIndex(const Identifier &id) const override
calculate chamber index from Identifier
LayerIndex
enum to classify the different layers in the muon spectrometer
bool measuresPhi(const Identifier &id) const override
virtual std::string stationNameString(const Identifier &id) const override
Return the station name string for all technologies.
virtual bool isEndcap(const Identifier &id) const override
returns whether this is an endcap Identifier or not
bool is_csc(const Identifier &id) const
int tubeLayer(const Identifier &id) const
virtual bool isSmallChamber(const Identifier &id) const override
returns whether this is a small chamber, always returns true for TGCs
const std::string & technologyString(const int &index) const
virtual int sector(const Identifier &id) const override
return sector number 1-16, odd=large, even=small
const_id_iterator module_end() const
ServiceHandle< StoreGateSvc > m_detStore
const sTgcIdHelper * m_stgcIdHelper
int stationName(const Identifier &id) const
#define ATH_MSG_VERBOSE(x)
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
int stationNameIndexMax() const
PhiIndex
enum to classify the different phi layers in the muon spectrometer
bool measuresPhi(const Identifier &id) const override
std::vector< StationNameData > m_stationNameData
int channel(const Identifier &id) const override
bool is_tgc(const Identifier &id) const
int multilayer(const Identifier &id) const
Gaudi::Property< bool > m_hasMM
int gasGap(const Identifier &id) const override
get the hashes
bool isSmall(const Identifier &id) const
virtual bool isMM(const Identifier &id) const override
returns whether this is a MM Identifier or not
int channel(const Identifier &id) const override
virtual int stationPhi(const Identifier &id) const override
Return stationPhi for all technologies.
virtual Identifier chamberId(const Identifier &id) const override
create a chamber ID
int wireLayer(const Identifier &id) const
bool is_stgc(const Identifier &id) const
virtual MuonStationIndex::DetectorRegionIndex regionIndex(const Identifier &id) const override
calculate detector region index from Identifier
const MdtIdHelper * m_mdtIdHelper
virtual bool issTgc(const Identifier &id) const override
returns whether this is a sTGC Identifier or not
virtual std::string toStringGasGap(const Identifier &id) const override
print all fields up to gas gap to string
int channel(const Identifier &id) const override
Gaudi::Property< bool > m_hasCSC
int doubletR(const Identifier &id) const
virtual Identifier layerId(const Identifier &id) const override
create a layer ID, returns tube id for the MDTs
MuonIdHelperSvc(const std::string &name, ISvcLocator *svc)
default AlgService constructor
static int stationEtaMax(bool barrel)
virtual bool hasHPTDC(const Identifier &id) const override
returns whether this Identifier belongs to an MDT with HPTDC or not NOTE that in Run4,...
::StatusCode StatusCode
StatusCode definition for legacy code.
int channel(const Identifier &id) const override
virtual bool isMdt(const Identifier &id) const override
returns whether this is a MDT Identifier or not
virtual Identifier detElId(const Identifier &id) const override
create a detector element ID
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
virtual bool isTrigger(const Identifier &id) const override
returns whether trigger chamber id or not
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const
int gasGap(const Identifier &id) const override
get the hashes
virtual const std::set< MuonStationIndex::TechnologyIndex > & technologiesInStation(MuonStationIndex::StIndex stIndex) const override
Recieve all technologies in a station.
int tube(const Identifier &id) const
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const
AthROOTErrorHandlerSvc * svc
static LayerIndex toLayerIndex(ChIndex index)
convert ChIndex into LayerIndex
bool is_mm(const Identifier &id) const
bool hasCSC() const override
const TgcIdHelper * m_tgcIdHelper
int technologyNameIndexMax() const
bool hasTGC() const override
virtual bool isRpc(const Identifier &id) const override
returns whether this is a RPC Identifier or not
std::array< std::set< TechIdx >, static_cast< int >StIdx::StIndexMax)> m_techPerStation
Array holding which technologies are there per station.
Identifier elementID(int stationName, int stationEta, int stationPhi) const
int stationPhi(const Identifier &id) const
DetectorRegionIndex
enum to classify the different layers in the muon spectrometer
Gaudi::Property< bool > m_hasTGC
int channel(const Identifier &id) const override
const std::string & stationNameString(const int &index) const
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
virtual int stationEta(const Identifier &id) const override
Return stationEta for all technologies.
virtual Identifier gasGapId(const Identifier &id) const override
create a gasGap ID (will return layer Id for MDTs)
Identifier elementID(int stationName, int stationEta, int stationPhi) const
virtual IdentifierHash detElementHash(const Identifier &id) const override
Returns the detector element hash associated to an Identifier.
virtual std::string toStringTech(const Identifier &id) const override
print all fields up to technology to string
Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
virtual MuonStationIndex::StIndex stationIndex(const Identifier &id) const override
calculate station index from Identifier
virtual std::string chamberNameString(const Identifier &id) const override
print chamber name to string
virtual int stationRegion(const Identifier &id) const override
Return stationRegion for all technologies.
virtual bool measuresPhi(const Identifier &id) const override
returns whether channel measures phi or not
int stationEta(const Identifier &id) const
virtual bool isMuon(const Identifier &id) const override
returns whether this is a Muon Identifier or not
virtual MuonStationIndex::TechnologyIndex technologyIndex(const Identifier &id) const override
calculate layer index from Identifier
virtual bool issMdt(const Identifier &id) const override
returns whether this is a sMDT Identifier or not
virtual std::string toStringDetEl(const Identifier &id) const override
print all fields up to detector element to string
size_type module_hash_max() const
the maximum hash value
bool isBME(const Identifier &id) const
is this a BME chamber
bool isEndcap(const Identifier &id) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
bool hasMDT() const override
Identifier elementID(int stationName, int stationEta, int stationPhi) const
int channel(const Identifier &id) const override
int gasGap(const Identifier &id) const override
get the hashes
std::unordered_set< Identifier > m_smdt_stat
#define ATH_MSG_WARNING(x)
const CscIdHelper * m_cscIdHelper
ChIndex
enum to classify the different chamber layers in the muon spectrometer
virtual IdentifierHash moduleHash(const Identifier &id) const override
Returns the module hash associated to an Identifier.
bool hasSTGC() const override
static const std::string & stName(StIndex index)
convert StIndex into a string
virtual std::string toStringStation(const Identifier &id) const override
print all fields up to stationName to string
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
StIndex
enum to classify the different station layers in the muon spectrometer
bool hasRPC() const override
bool measuresPhi(const Identifier &id) const override
virtual MuonStationIndex::PhiIndex phiIndex(const Identifier &id) const override
calculate phi index from Identifier (not supported for MDT hits)
virtual std::string toStringChamber(const Identifier &id) const override
print all fields up to chamber to string
const_id_iterator module_begin() const
Iterators over full set of ids.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
std::vector< TechIdx > m_technologies
bool hasMM() const override
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
TechnologyIndex
enum to classify the different layers in the muon spectrometer
int channelType(const Identifier &id) const
int chamberLayer(const Identifier &id) const
virtual int gasGap(const Identifier &id) const override
returns gas gap: gasGap for RPC + TGC, wireLayer for CSC, tube for MDT
int doubletPhi(const Identifier &id) const
static const std::string BAD_NAME
static const std::string & technologyName(TechnologyIndex index)
convert LayerIndex into a string