23 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
37 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
48 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'tgcGasGap' field ");
52 field =
m_dict->find_field(
"isStrip");
56 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'isStrip' field ");
60 field =
m_dict->find_field(
"channel");
64 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find channel' field ");
87 ATH_MSG_DEBUG(
" TGC decode index and bit fields for each level: " << std::endl
88 <<
" muon " <<
m_muon_impl.show_to_string() << std::endl
89 <<
" station " <<
m_sta_impl.show_to_string() << std::endl
90 <<
" eta " <<
m_eta_impl.show_to_string() << std::endl
91 <<
" phi " <<
m_phi_impl.show_to_string() << std::endl
92 <<
" technology " <<
m_tec_impl.show_to_string() << std::endl
93 <<
" gas gap " <<
m_gap_impl.show_to_string() << std::endl
94 <<
" is strip " <<
m_ist_impl.show_to_string() << std::endl
95 <<
" channel " <<
m_cha_impl.show_to_string());
102 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
103 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->
name());
109 region_id.add(muonField);
111 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"technology");
112 if (muon_range.
size() > 0) {
113 ATH_MSG_INFO(
"MultiRange built successfully to Technology: "
114 <<
"MultiRange size is " << muon_range.
size());
122 detectorElement_region.
add(muonField);
123 Range detectorElement_prefix;
124 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"technology");
125 if (muon_detectorElement_range.
size() > 0) {
126 ATH_MSG_INFO(
"MultiRange built successfully to detector element: "
127 <<
"Multilayer MultiRange size is " << muon_detectorElement_range.
size());
129 ATH_MSG_ERROR(
"Muon TGC detector element MultiRange is empty");
134 tgc_region.
add(muonField);
136 MultiRange muon_channel_range =
m_dict->build_multirange(tgc_region, tgc_prefix,
"channel");
137 if (muon_channel_range.
size() > 0) {
138 ATH_MSG_INFO(
"MultiRange built successfully to channel: "
139 <<
"MultiRange size is " << muon_channel_range.
size());
147 status =
m_dict->get_label_value(
"technology",
"TGC", tgcField);
149 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
150 const Range& range = muon_range[i];
155 ATH_MSG_DEBUG(
"field size is " << (
int)range.cardinality() <<
" field index = " << i);
160 for (
int j = 0; j < (int)muon_detectorElement_range.
size(); ++j) {
161 const Range& range = muon_detectorElement_range[j];
166 ATH_MSG_DEBUG(
"detector element field size is " << (
int)range.cardinality() <<
" field index = " << j);
171 for (
int j = 0; j < (int)muon_channel_range.
size(); ++j) {
172 const Range& range = muon_channel_range[j];
177 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << j);
191 ATH_MSG_ERROR(
"TGC MultiRange ID is empty for detector elements");
208 ATH_MSG_INFO(
"Initializing TGC hash indices for finding neighbors ... ");
227 for (
unsigned int i = 0; i < hash_max; ++i) {
256 for (
const auto &expId : rit) {
259 if (
parentID(child) == parent) vect.push_back(child);
271 if (range.match(expId)) {
273 if (not eta_field.
empty()) {
295 if (range.match(expId)) {
297 if (not eta_field.
empty()) {
314 if (range.match(expId)) {
330 if (range.match(expId)) {
347 if (range.match(expId)) {
349 if (not gasgap_field.
empty()) {
370 if (range.match(expId)) {
387 if (range.match(expId)) {
389 if (not isstrip_field.
empty()) {
411 if (range.match(expId)) {
413 if (not isstrip_field.
empty()) {
431 if (range.match(expId)) {
433 if (not channel_field.
empty()) {
455 if (range.match(expId)) {
457 if (not channel_field.
empty()) {
576 }
catch (
const std::out_of_range&) {
isValid =
false; }
607 }
catch (
const std::out_of_range&) {
isValid =
false; }
631 }
catch (
const std::out_of_range&) {
isValid =
false; }
687 return (
'E' == name[2]);
692 return (
'1' == name[1]);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
int muon_field_value() const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
int tgc_field_value() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
void add(element_type value)
Append a value into a new field.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
const IdDictRegion & region(size_t index) const
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const IdDictFieldImplementation & implementation(size_t i) const
element_type get_minimum() const
Query the values.
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
element_type get_maximum() const
This is a "hash" representation of an Identifier.
A MultiRange combines several Ranges.
int stationNameIndex(const std::string &name) const
int stationEta(const Identifier &id) const
IdDictFieldImplementation m_phi_impl
IdDictFieldImplementation m_tec_impl
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
Create expanded id from compact id (return == 0 for OK)
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const override
Create compact id from hash id (return == 0 for OK)
size_type m_CHANNEL_INDEX
int technologyIndex(const std::string &name) const
IdDictFieldImplementation m_sta_impl
MultiRange m_full_module_range
IdDictFieldImplementation m_eta_impl
size_type module_hash_max() const
the maximum hash value
MultiRange m_full_detectorElement_range
const IdDictDictionary * m_dict
bool is_tgc(const Identifier &id) const
int stationPhi(const Identifier &id) const
size_type m_DETECTORELEMENT_INDEX
int stationName(const Identifier &id) const
virtual int init_detectorElement_hashes()
IdDictFieldImplementation m_muon_impl
void resetAndSet(const IdDictFieldImplementation &dict, const int new_val, Identifier &id) const
bool validStation(int stationName, int technology) const
MultiRange m_full_channel_range
IdContext channel_context() const
id for channel
const std::string & stationNameString(const int &index) const
MuonIdHelper(const std::string &logName, const std::string &group)
size_type m_TECHNOLOGY_INDEX
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Identifier elementID(int stationName, int stationEta, int stationPhi) const
bool tripletChamber(int stationName) const
static int stationEtaMin()
int tgcTechnology() const
Utility methods.
Identifier parentID(const Identifier &id) const
IdDictFieldImplementation m_ist_impl
int channel(const Identifier &id) const override
unsigned int m_stationShift
Minimal station index found.
static int gasGapMax(bool triplet)
static int stationPhiMin(bool endcap)
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
int gasGap(const Identifier &id) const override
get the hashes
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
static constexpr unsigned int s_etaDim
Except T2E all stations have 4 associated eta stations.
bool valid(const Identifier &id) const
IdDictFieldImplementation m_cha_impl
bool measuresPhi(const Identifier &id) const override
IdDictFieldImplementation m_gap_impl
bool endcapChamber(int stationName) const
static int stationPhiMax(bool endcap)
size_type m_ISSTRIP_INDEX
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
std::array< unsigned int, s_modHashDim > m_module_hashes
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
unsigned int moduleHashIdx(const Identifier &id) const
static int chamberType(const std::string &stationName, int stationEta)
int isStrip(const Identifier &id) const
isStrip corresponds to measuresPhi
static constexpr unsigned int s_phiDim
48 phi stations
static int stationEtaMax()
Identifier channelID(int stationName, int stationEta, int stationPhi, int gasGap, int isStrip, int channel) const
bool validElement(const Identifier &id) const
bool isStNameInTech(const std::string &stationName) const override
The valid element checks converted the identifier to a stationName string in order to assess whether ...