|
ATLAS Offline Software
|
Helper service that creates muon Identifiers and can be used to print Identifiers.
More...
#include <MuonIdHelperSvc.h>
|
const RpcIdHelper * | m_rpcIdHelper {nullptr} |
| Sub detector specific IdHelpers. More...
|
|
const TgcIdHelper * | m_tgcIdHelper {nullptr} |
|
const CscIdHelper * | m_cscIdHelper {nullptr} |
|
const MdtIdHelper * | m_mdtIdHelper {nullptr} |
|
const MmIdHelper * | m_mmIdHelper {nullptr} |
|
const sTgcIdHelper * | m_stgcIdHelper {nullptr} |
|
const MuonIdHelper * | m_primaryHelper {nullptr} |
|
Gaudi::Property< bool > | m_hasMDT {this, "HasMDT", true, "Specify whether the current detector layour contains MDT chambers"} |
|
Gaudi::Property< bool > | m_hasRPC {this, "HasRPC", true, "Specify whether the current detector layour contains RPC chambers"} |
|
Gaudi::Property< bool > | m_hasTGC {this, "HasTGC", true, "Specify whether the current detector layour contains TGC chambers"} |
|
Gaudi::Property< bool > | m_hasCSC {this, "HasCSC", true, "Specify whether current detector layout contains CSC chambers"} |
|
Gaudi::Property< bool > | m_hasSTGC {this, "HasSTGC", true, "Specify whether current detector layout contains STGC chambers"} |
|
Gaudi::Property< bool > | m_hasMM {this, "HasMM", true, "Specify whether current detector layout contains MicroMegas chambers"} |
|
ServiceHandle< StoreGateSvc > | m_detStore {this, "DetectorStore", "DetectorStore"} |
|
std::vector< StationNameData > | m_stationNameData |
|
std::vector< MuonStationIndex::TechnologyIndex > | m_technologies |
|
int | m_BIS_stat {-1} |
|
std::set< Identifier > | m_smdt_stat {} |
|
Helper service that creates muon Identifiers and can be used to print Identifiers.
Definition at line 16 of file MuonIdHelperSvc.h.
◆ MuonIdHelperSvc()
Muon::MuonIdHelperSvc::MuonIdHelperSvc |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
svc |
|
) |
| |
◆ ~MuonIdHelperSvc()
virtual Muon::MuonIdHelperSvc::~MuonIdHelperSvc |
( |
| ) |
|
|
overridevirtualdefault |
◆ chamberId()
◆ chamberIndex()
◆ chamberNameString()
std::string Muon::MuonIdHelperSvc::chamberNameString |
( |
const Identifier & |
id | ) |
const |
|
overridevirtual |
◆ cscIdHelper()
◆ detElementHash() [1/2]
◆ detElementHash() [2/2]
◆ detElId()
◆ gasGap()
returns gas gap: gasGap for RPC + TGC, wireLayer for CSC, tube for MDT
Definition at line 173 of file MuonIdHelperSvc.cxx.
176 }
else if (
isTgc(
id)) {
179 }
else if (
isCsc(
id)) {
185 }
else if (
isMM(
id)) {
◆ gasGapId()
create a gasGap ID (will return layer Id for MDTs)
Definition at line 585 of file MuonIdHelperSvc.cxx.
593 }
else if (
isRpc(
id)) {
600 }
else if (
isCsc(
id)) {
605 }
else if (
isMM(
id)) {
◆ hasCSC()
bool Muon::MuonIdHelperSvc::hasCSC |
( |
| ) |
const |
|
override |
◆ hasHPTDC()
returns whether this Identifier belongs to an MDT with HPTDC or not NOTE that in Run4, no HPTDCs at all are planned to be present any more, so this function should be obsolete from Run4 onwards
NOTE that in Run4, no HPTDCs at all are planned to be present any more, so this function should be obsolete from Run4 onwards
Definition at line 226 of file MuonIdHelperSvc.cxx.
◆ hasMDT()
bool Muon::MuonIdHelperSvc::hasMDT |
( |
| ) |
const |
|
override |
◆ hasMM()
bool Muon::MuonIdHelperSvc::hasMM |
( |
| ) |
const |
|
override |
◆ hasRPC()
bool Muon::MuonIdHelperSvc::hasRPC |
( |
| ) |
const |
|
override |
◆ hasSTGC()
bool Muon::MuonIdHelperSvc::hasSTGC |
( |
| ) |
const |
|
override |
◆ hasTGC()
bool Muon::MuonIdHelperSvc::hasTGC |
( |
| ) |
const |
|
override |
◆ initialize()
StatusCode Muon::MuonIdHelperSvc::initialize |
( |
| ) |
|
|
overridevirtual |
AlgTool initilize.
Find an id helper that is not a nullptr
Cache the sMDT stations
Definition at line 16 of file MuonIdHelperSvc.cxx.
28 std::array<const MuonIdHelper*, 6>::const_iterator itr = std::find_if(all_helpers.begin(),
31 if (itr == all_helpers.end()){
32 ATH_MSG_WARNING(
"No MuonIdHelper has been created before. Please do not setup the service if no muon layout is loaded");
33 return StatusCode::SUCCESS;
37 std::stringstream techStr{};
47 techStr<<
", " << tech <<
" " <<
name;
65 if (
data.stationName[1] ==
'1')
67 else if (
data.stationName[1] ==
'2')
69 else if (
data.stationName[1] ==
'3')
71 else if (
data.stationName[1] ==
'4')
74 if (
data.stationName[1] ==
'O') {
75 if (
data.stationName[2] ==
'L')
79 }
else if (
data.stationName[1] ==
'M') {
80 if (
data.stationName[2] ==
'L')
84 }
else if (
data.stationName[1] ==
'I') {
85 if (
data.stationName[2] ==
'L')
89 }
else if (
data.stationName[1] ==
'E') {
90 if (
data.stationName[0] ==
'B') {
93 if (
data.stationName[2] ==
'L')
98 }
else if (
data.stationName[0] ==
'C') {
99 if (
data.stationName[2] ==
'L')
104 if (
data.stationName[0] ==
'S' ||
data.stationName[0] ==
'M') {
112 if (
data.stationName[1] ==
'O') {
113 if (
data.stationName[2] ==
'L')
117 }
else if (
data.stationName[1] ==
'M') {
118 if (
data.stationName[2] ==
'L' ||
data.stationName[2] ==
'E')
122 }
else if (
data.stationName[1] ==
'I') {
123 if (
data.stationName[2] ==
'L' ||
data.stationName[2] ==
'M' ||
data.stationName[2] ==
'R')
129 if (
data.chIndex <0){
130 ATH_MSG_ERROR(
"data.chIndex is negative in MuonIdHelperSvc::initialize ");
131 return StatusCode::FAILURE;
155 for (
int phi = 1;
phi <= 8; ++
phi) {
170 return StatusCode::SUCCESS;
◆ isCsc()
◆ isEndcap()
◆ isMdt()
◆ isMM()
◆ isMuon()
◆ isRpc()
◆ isSmallChamber()
returns whether this is a small chamber, always returns true for TGCs
Definition at line 254 of file MuonIdHelperSvc.cxx.
◆ issMdt()
◆ issTgc()
◆ isTgc()
◆ isTrigger()
◆ layerId()
create a layer ID, returns tube id for the MDTs
Definition at line 543 of file MuonIdHelperSvc.cxx.
552 }
else if (
isRpc(
id)) {
560 }
else if (
isCsc(
id)) {
567 }
else if (
isMM(
id)) {
◆ layerIndex()
◆ mdtIdHelper()
◆ measuresPhi()
◆ mmIdHelper()
◆ moduleHash() [1/2]
◆ moduleHash() [2/2]
◆ phiIndex()
calculate phi index from Identifier (not supported for MDT hits)
Definition at line 272 of file MuonIdHelperSvc.cxx.
273 if (!
id.is_valid() || !
isMuon(
id)) {
309 if (chamberName[1] ==
'1')
311 else if (chamberName[1] ==
'2')
◆ regionIndex()
◆ rpcIdHelper()
◆ sector()
return sector number 1-16, odd=large, even=small
Definition at line 710 of file MuonIdHelperSvc.cxx.
713 auto initTgcSectorMapping = [&]() -> std::vector<int>* {
714 std::vector<int>*
mapping =
nullptr;
723 static const std::vector<int> tgcSectorMapping = *initTgcSectorMapping();
727 if (
hash >= tgcSectorMapping.size()) {
731 return tgcSectorMapping[
hash];
◆ stationEta()
Return stationEta for all technologies.
Definition at line 647 of file MuonIdHelperSvc.cxx.
648 if (!
id.is_valid()) {
654 }
else if (
isTgc(
id)) {
656 }
else if (
isMdt(
id)) {
658 }
else if (
isCsc(
id)) {
662 }
else if (
isMM(
id)) {
◆ stationIndex()
◆ stationName()
Return stationName for all technologies.
Definition at line 668 of file MuonIdHelperSvc.cxx.
669 if (!
id.is_valid()) {
675 }
else if (
isTgc(
id)) {
677 }
else if (
isMdt(
id)) {
679 }
else if (
isCsc(
id)) {
683 }
else if (
isMM(
id)) {
◆ stationNameString()
std::string Muon::MuonIdHelperSvc::stationNameString |
( |
const Identifier & |
id | ) |
const |
|
overridevirtual |
◆ stationPhi()
Return stationPhi for all technologies.
Definition at line 626 of file MuonIdHelperSvc.cxx.
627 if (!
id.is_valid()) {
633 }
else if (
isTgc(
id)) {
635 }
else if (
isMdt(
id)) {
637 }
else if (
isCsc(
id)) {
641 }
else if (
isMM(
id)) {
◆ stationRegion()
Return stationRegion for all technologies.
Definition at line 689 of file MuonIdHelperSvc.cxx.
690 if (!
id.is_valid()) {
696 }
else if (
isTgc(
id)) {
698 }
else if (
isMdt(
id)) {
700 }
else if (
isCsc(
id)) {
704 }
else if (
isMM(
id)) {
◆ stgcIdHelper()
◆ technologyIndex()
◆ tgcIdHelper()
◆ toString()
print all fields to string
Definition at line 338 of file MuonIdHelperSvc.cxx.
339 std::ostringstream sout;
340 if (!
id.is_valid())
return " Invalid Identifier";
344 }
else if (
isTgc(
id)) {
346 }
else if (
isCsc(
id)) {
350 if (channelType == 0)
352 else if (channelType == 1)
354 else if (channelType == 2)
357 }
else if (
isMM(
id)) {
◆ toStringChamber()
std::string Muon::MuonIdHelperSvc::toStringChamber |
( |
const Identifier & |
id | ) |
const |
|
overridevirtual |
print all fields up to chamber to string
Definition at line 417 of file MuonIdHelperSvc.cxx.
418 std::ostringstream sout;
419 if (!
id.is_valid())
return " Invalid Identifier";
425 }
else if (
isTgc(
id)) {
429 }
else if (
isCsc(
id)) {
437 }
else if (
isMM(
id)) {
◆ toStringDetEl()
std::string Muon::MuonIdHelperSvc::toStringDetEl |
( |
const Identifier & |
id | ) |
const |
|
overridevirtual |
print all fields up to detector element to string
Definition at line 449 of file MuonIdHelperSvc.cxx.
450 std::ostringstream sout;
451 if (!
id.is_valid())
return " Invalid Identifier";
454 }
else if (
isTgc(
id)) {
456 }
else if (
isCsc(
id)) {
458 }
else if (
isMM(
id)) {
◆ toStringGasGap()
std::string Muon::MuonIdHelperSvc::toStringGasGap |
( |
const Identifier & |
id | ) |
const |
|
overridevirtual |
print all fields up to gas gap to string
Definition at line 468 of file MuonIdHelperSvc.cxx.
469 std::ostringstream sout;
470 if (!
id.is_valid())
return " Invalid Identifier";
473 }
else if (
isTgc(
id)) {
475 }
else if (
isCsc(
id)) {
479 }
else if (
isMM(
id)) {
◆ toStringStation()
std::string Muon::MuonIdHelperSvc::toStringStation |
( |
const Identifier & |
id | ) |
const |
|
overridevirtual |
print all fields up to stationName to string
Definition at line 386 of file MuonIdHelperSvc.cxx.
387 std::ostringstream sout;
388 if (!
id.is_valid())
return " Invalid Identifier";
393 }
else if (
isTgc(
id)) {
397 }
else if (
isCsc(
id)) {
401 }
else if (
isMM(
id)) {
◆ toStringTech()
std::string Muon::MuonIdHelperSvc::toStringTech |
( |
const Identifier & |
id | ) |
const |
|
overridevirtual |
print all fields up to technology to string
Definition at line 363 of file MuonIdHelperSvc.cxx.
364 std::ostringstream sout;
365 if (!
id.is_valid())
return " Invalid Identifier";
368 }
else if (
isTgc(
id)) {
370 }
else if (
isCsc(
id)) {
374 }
else if (
isMM(
id)) {
◆ m_BIS_stat
int Muon::MuonIdHelperSvc::m_BIS_stat {-1} |
|
private |
◆ m_cscIdHelper
◆ m_detStore
◆ m_hasCSC
Gaudi::Property<bool> Muon::MuonIdHelperSvc::m_hasCSC {this, "HasCSC", true, "Specify whether current detector layout contains CSC chambers"} |
|
private |
◆ m_hasMDT
Gaudi::Property<bool> Muon::MuonIdHelperSvc::m_hasMDT {this, "HasMDT", true, "Specify whether the current detector layour contains MDT chambers"} |
|
private |
◆ m_hasMM
Gaudi::Property<bool> Muon::MuonIdHelperSvc::m_hasMM {this, "HasMM", true, "Specify whether current detector layout contains MicroMegas chambers"} |
|
private |
◆ m_hasRPC
Gaudi::Property<bool> Muon::MuonIdHelperSvc::m_hasRPC {this, "HasRPC", true, "Specify whether the current detector layour contains RPC chambers"} |
|
private |
◆ m_hasSTGC
Gaudi::Property<bool> Muon::MuonIdHelperSvc::m_hasSTGC {this, "HasSTGC", true, "Specify whether current detector layout contains STGC chambers"} |
|
private |
◆ m_hasTGC
Gaudi::Property<bool> Muon::MuonIdHelperSvc::m_hasTGC {this, "HasTGC", true, "Specify whether the current detector layour contains TGC chambers"} |
|
private |
◆ m_mdtIdHelper
◆ m_mmIdHelper
◆ m_primaryHelper
◆ m_rpcIdHelper
◆ m_smdt_stat
std::set<Identifier> Muon::MuonIdHelperSvc::m_smdt_stat {} |
|
private |
◆ m_stationNameData
◆ m_stgcIdHelper
◆ m_technologies
◆ m_tgcIdHelper
The documentation for this class was generated from the following files:
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 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 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
bool measuresPhi(const Identifier &id) const override
returns measuresPhi
bool measuresPhi(const Identifier &id) const override
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
ServiceHandle< StoreGateSvc > m_detStore
const sTgcIdHelper * m_stgcIdHelper
int stationName(const Identifier &id) const
#define ATH_MSG_VERBOSE(x)
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
int stationNameIndexMax() const
std::vector< MuonStationIndex::TechnologyIndex > m_technologies
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
bool isSmall(const Identifier &id) const
int gasGap(const Identifier &id) const override
get the hashes
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.
int wireLayer(const Identifier &id) const
bool is_stgc(const Identifier &id) const
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
std::set< Identifier > m_smdt_stat
virtual Identifier layerId(const Identifier &id) const override
create a layer ID, returns tube id for the MDTs
static int stationEtaMax(bool barrel)
::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 int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const
int gasGap(const Identifier &id) const override
get the hashes
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
Identifier elementID(int stationName, int stationEta, int stationPhi) const
int stationPhi(const Identifier &id) const
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.
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 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 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
Identifier elementID(int stationName, int stationEta, int stationPhi) const
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
#define ATH_MSG_WARNING(x)
int technology(const Identifier &id) const
const CscIdHelper * m_cscIdHelper
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
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 std::string toStringChamber(const Identifier &id) const override
print all fields up to chamber to string
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
bool hasMM() const override
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
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