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 ");
114 ATH_MSG_DEBUG(
" RPC decode index and bit fields for each level: " << std::endl
115 <<
" muon " <<
m_muon_impl.show_to_string() << std::endl
116 <<
" station " <<
m_sta_impl.show_to_string() << std::endl
117 <<
" eta " <<
m_eta_impl.show_to_string() << std::endl
118 <<
" phi " <<
m_phi_impl.show_to_string() << std::endl
119 <<
" technology " <<
m_tec_impl.show_to_string() << std::endl
120 <<
" TR " <<
m_dbr_impl.show_to_string() << std::endl
121 <<
" TZ " <<
m_dbz_impl.show_to_string() << std::endl
122 <<
" TPHI " <<
m_dbp_impl.show_to_string() << std::endl
123 <<
" gas gap " <<
m_gap_impl.show_to_string() << std::endl
124 <<
" phi " <<
m_mea_impl.show_to_string() << std::endl
134 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
135 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->
name());
141 region_id.add(muonField);
143 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"doubletR");
145 if (muon_range.
size() > 0) {
146 ATH_MSG_INFO(
"MultiRange built successfully to doubletR: "
147 <<
"MultiRange size is " << muon_range.
size());
156 detectorElement_region.
add(muonField);
157 Range detectorElement_prefix;
158 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"doubletPhi");
159 if (muon_detectorElement_range.
size() > 0) {
160 ATH_MSG_INFO(
"MultiRange built successfully to detectorElement: "
161 <<
"DetectorElement MultiRange size is " << muon_detectorElement_range.
size());
163 ATH_MSG_ERROR(
"Muon RPC ReadoutElement MultiRange is empty");
169 rpc_region.
add(muonField);
171 MultiRange muon_channel_range =
m_dict->build_multirange(rpc_region, rpc_prefix,
"rpcStrip");
173 if (muon_channel_range.
size() > 0) {
174 ATH_MSG_INFO(
"MultiRange built successfully to rpcStrip: "
175 <<
"MultiRange size is " << muon_channel_range.
size());
184 status =
m_dict->get_label_value(
"technology",
"RPC", rpcField);
186 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
187 const Range& range = muon_range[i];
192 ATH_MSG_DEBUG(
"field size is " << (
int)range.cardinality() <<
" field index = " << i);
197 for (
int j = 0; j < (int)muon_detectorElement_range.
size(); ++j) {
198 const Range& range = muon_detectorElement_range[j];
203 ATH_MSG_DEBUG(
"detectorElement field size is " << (
int)range.cardinality() <<
" field index = " << j);
208 for (
int j = 0; j < (int)muon_channel_range.
size(); ++j) {
209 const Range& range = muon_channel_range[j];
214 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << j);
229 ATH_MSG_ERROR(
"MDT MultiRange ID is empty for detector elements");
248 ATH_MSG_INFO(
"Initializing RPC hash indices for finding neighbors ... ");
258 if (range.match(expId)) {
260 if (not gap_field.
empty()) {
272 ATH_MSG_ERROR(
"No maximum number of RPC gas gaps was retrieved");
283 for (
unsigned int i = 0; i < hash_max; ++i) {
289 for (
unsigned int i = 0; i < hash_max; ++i) {
302 hash_id = itr->second;
321 hash_id = itr->second;
331 for (
const auto & expId:rit) {
334 if (
parentID(child) == parent) vect.push_back(child);
347 if (range.match(expId)) {
349 if (not eta_field.
empty()) {
365 if (range.match(expId)) {
367 if (not eta_field.
empty()) {
383 if (range.match(expId)) {
399 if (range.match(expId)) {
415 if (range.match(expId)) {
431 if (range.match(expId)) {
447 if (range.match(expId)) {
463 if (range.match(expId)) {
479 if (range.match(expId)) {
495 if (range.match(expId)) {
511 if (range.match(expId)) {
527 if (range.match(expId)) {
543 if (range.match(expId)) {
559 if (range.match(expId)) {
575 if (range.match(expId)) {
591 if (range.match(expId)) {
770 unsigned int nids = 0;
771 std::set<Identifier> ids;
775 for (
const auto & expId:rit) {
780 if (!ids.insert(doubletZ_id).second)
782 <<
"Please check the dictionary for possible duplication for " <<
id);
783 }
else if (!ids.insert(
id).second) {
785 <<
" Error: duplicated id for detector element id. nid " << (
int)nids
786 <<
" doubletPhi ID " <<
id);
817 }
catch (
const std::out_of_range&) {
isValid =
false; }
839 }
catch (
const std::out_of_range&) {
isValid =
false; }
867 }
catch (
const std::out_of_range&) {
isValid =
false; }
888 }
catch (
const std::out_of_range&) {
isValid =
false; }
914 }
catch (
const std::out_of_range&) {
isValid =
false; }
934 }
catch (
const std::out_of_range&) {
isValid =
false; }
962 }
catch (
const std::out_of_range&) {
isValid =
false; }
991 }
catch (
const std::out_of_range&) {
isValid =
false; }
1037 }
catch (
const std::out_of_range&) {
isValid =
false; }
1053 }
catch (
const std::out_of_range&) {
isValid =
false; }
1147 if (std::abs(
eta) != 4 && dZ != 3) {
1152 return (dZ == 3 && dP == 2) ||
1153 (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.
bool is_rpc(Identifier id) const
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)
const std::string & stationNameString(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
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