21 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
35 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
46 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'doubletR' field ");
50 field =
m_dict->find_field(
"doubletZ");
54 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'doubletZ' field ");
58 field =
m_dict->find_field(
"doubletPhi");
62 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'doubletPhi' field ");
66 field =
m_dict->find_field(
"rpcGasGap");
70 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'rpcGasGap' field ");
74 field =
m_dict->find_field(
"rpcMeasuresPhi");
78 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'rpcMeasuresPhi' field ");
82 field =
m_dict->find_field(
"rpcStrip");
86 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'rpcStrip' field ");
113 ATH_MSG_DEBUG(
" RPC decode index and bit fields for each level: " << std::endl
114 <<
" muon " <<
m_muon_impl.show_to_string() << std::endl
115 <<
" station " <<
m_sta_impl.show_to_string() << std::endl
116 <<
" eta " <<
m_eta_impl.show_to_string() << std::endl
117 <<
" phi " <<
m_phi_impl.show_to_string() << std::endl
118 <<
" technology " <<
m_tec_impl.show_to_string() << std::endl
119 <<
" TR " <<
m_dbr_impl.show_to_string() << std::endl
120 <<
" TZ " <<
m_dbz_impl.show_to_string() << std::endl
121 <<
" TPHI " <<
m_dbp_impl.show_to_string() << std::endl
122 <<
" gas gap " <<
m_gap_impl.show_to_string() << std::endl
123 <<
" phi " <<
m_mea_impl.show_to_string() << std::endl
133 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
134 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->
name());
140 region_id.add(muonField);
142 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"doubletR");
144 if (muon_range.
size() > 0) {
145 ATH_MSG_INFO(
"MultiRange built successfully to doubletR: "
146 <<
"MultiRange size is " << muon_range.
size());
154 detectorElement_region.
add(muonField);
155 Range detectorElement_prefix;
156 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"doubletPhi");
157 if (muon_detectorElement_range.
size() > 0) {
158 ATH_MSG_INFO(
"MultiRange built successfully to detectorElement: "
159 <<
"DetectorElement MultiRange size is " << muon_detectorElement_range.
size());
161 ATH_MSG_ERROR(
"Muon RPC ReadoutElement MultiRange is empty");
167 rpc_region.
add(muonField);
169 MultiRange muon_channel_range =
m_dict->build_multirange(rpc_region, rpc_prefix,
"rpcStrip");
171 if (muon_channel_range.
size() > 0) {
172 ATH_MSG_INFO(
"MultiRange built successfully to rpcStrip: "
173 <<
"MultiRange size is " << muon_channel_range.
size());
182 status =
m_dict->get_label_value(
"technology",
"RPC", rpcField);
184 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
185 const Range& range = muon_range[i];
190 ATH_MSG_DEBUG(
"field size is " << (
int)range.cardinality() <<
" field index = " << i);
195 for (
int j = 0; j < (int)muon_detectorElement_range.
size(); ++j) {
196 const Range& range = muon_detectorElement_range[j];
201 ATH_MSG_DEBUG(
"detectorElement field size is " << (
int)range.cardinality() <<
" field index = " << j);
206 for (
int j = 0; j < (int)muon_channel_range.
size(); ++j) {
207 const Range& range = muon_channel_range[j];
212 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << j);
227 ATH_MSG_ERROR(
"MDT MultiRange ID is empty for detector elements");
246 ATH_MSG_INFO(
"Initializing RPC hash indices for finding neighbors ... ");
256 if (range.match(expId)) {
258 if (not gap_field.
empty()) {
270 ATH_MSG_ERROR(
"No maximum number of RPC gas gaps was retrieved");
281 for (
unsigned int i = 0; i < hash_max; ++i) {
287 for (
unsigned int i = 0; i < hash_max; ++i) {
300 hash_id = itr->second;
319 hash_id = itr->second;
329 for (
const auto & expId:rit) {
332 if (
parentID(child) == parent) vect.push_back(child);
345 if (range.match(expId)) {
347 if (not eta_field.
empty()) {
363 if (range.match(expId)) {
365 if (not eta_field.
empty()) {
381 if (range.match(expId)) {
397 if (range.match(expId)) {
413 if (range.match(expId)) {
429 if (range.match(expId)) {
445 if (range.match(expId)) {
461 if (range.match(expId)) {
477 if (range.match(expId)) {
493 if (range.match(expId)) {
509 if (range.match(expId)) {
525 if (range.match(expId)) {
541 if (range.match(expId)) {
557 if (range.match(expId)) {
573 if (range.match(expId)) {
589 if (range.match(expId)) {
768 unsigned int nids = 0;
769 std::set<Identifier> ids;
773 for (
const auto & expId:rit) {
778 if (!ids.insert(doubletZ_id).second)
780 <<
"Please check the dictionary for possible duplication for " <<
id);
781 }
else if (!ids.insert(
id).second) {
783 <<
" Error: duplicated id for detector element id. nid " << (
int)nids
784 <<
" doubletPhi ID " <<
id);
815 }
catch (
const std::out_of_range&) {
isValid =
false; }
837 }
catch (
const std::out_of_range&) {
isValid =
false; }
865 }
catch (
const std::out_of_range&) {
isValid =
false; }
886 }
catch (
const std::out_of_range&) {
isValid =
false; }
912 }
catch (
const std::out_of_range&) {
isValid =
false; }
932 }
catch (
const std::out_of_range&) {
isValid =
false; }
960 }
catch (
const std::out_of_range&) {
isValid =
false; }
989 }
catch (
const std::out_of_range&) {
isValid =
false; }
1035 }
catch (
const std::out_of_range&) {
isValid =
false; }
1051 }
catch (
const std::out_of_range&) {
isValid =
false; }
1145 if (std::abs(
eta) != 4 && dZ != 3) {
1150 return (dZ == 3 && dP == 2) ||
1151 (std::abs(
eta) == 4 && dZ !=1 && dR != 2 && dP == 2);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#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.
int muon_field_value() const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
std::string print_to_string(Identifier id, const IdContext *context=0) const
or provide the printout in string form
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 rpc_field_value() const
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)
bool is_rpc(const Identifier &id) const
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
int stationPhi(const Identifier &id) const
size_type m_DETECTORELEMENT_INDEX
int stationName(const Identifier &id) const
IdContext detectorElement_context() const
id for detector element
id_vec m_detectorElement_vec
size_type detectorElement_hash_max() const
IdDictFieldImplementation m_muon_impl
void resetAndSet(const IdDictFieldImplementation &dict, const int new_val, Identifier &id) const
bool validStation(int stationName, int technology) const
size_type m_detectorElement_hash_max
MultiRange m_full_channel_range
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 padID(const Identifier &elementID, int doubletZ, int doubletPhi) const
Identifier channelID(int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
size_type m_DOUBLETPHI_INDEX
bool validPad(const Identifier &id) const
int gasGap(const Identifier &id) const override
get the hashes
static int measuresPhiMax()
IdDictFieldImplementation m_mea_impl
size_type m_DOUBLETZ_INDEX
Identifier panelID(const Identifier &padID, int gasGap, int measuresPhi) const
Identifier parentID(const Identifier &id) const
std::unordered_map< Identifier, unsigned int > m_detectorElement_hashes
bool validElement(const Identifier &id) const
IdDictFieldImplementation m_dbr_impl
bool isExtraDetElId(const Identifier &id) const
virtual int init_detectorElement_hashes() override
Identifier elementID(int stationName, int stationEta, int stationPhi, int doubletR) const
int channel(const Identifier &id) const override
IdDictFieldImplementation m_dbz_impl
Identifier gapID(const Identifier &padID, int gasGap) const
std::unordered_map< Identifier, unsigned int > m_module_hashes
static int stationPhiMin()
int doubletPhi(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
int rpcTechnology() const
Utility methods.
static int doubletPhiMax()
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
static int stationPhiMax()
int doubletR(const Identifier &id) const
bool valid(const Identifier &id) const
int strip(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
static int stationEtaMin()
static int measuresPhiMin()
static int doubletPhiMin()
size_type m_DOUBLETR_INDEX
bool isStNameInTech(const std::string &stationName) const override
The valid element checks converted the identifier to a stationName string in order to assess whether ...
static int stationEtaMax()
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
Identifier doubletZID(const Identifier &id) const
int doubletZ(const Identifier &id) const
size_type m_MEASURESPHI_INDEX
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int doubletR, int doubletZ, int doubletPhi, int gasGap, int measuresPhi, int strip) const
IdDictFieldImplementation m_gap_impl
IdDictFieldImplementation m_dbp_impl
IdDictFieldImplementation m_str_impl