25 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
40 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
52 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'multiLayer' field ");
56 field =
m_dict->find_field(
"tubeLayer");
60 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'tubeLayer' field ");
64 field =
m_dict->find_field(
"tube");
68 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'tube' field ");
89 ATH_MSG_DEBUG(
" MDT decode index and bit fields for each level: " << std::endl
90 <<
" muon " <<
m_muon_impl.show_to_string() << std::endl
91 <<
" station " <<
m_sta_impl.show_to_string() << std::endl
92 <<
" eta " <<
m_eta_impl.show_to_string() << std::endl
93 <<
" phi " <<
m_phi_impl.show_to_string() << std::endl
94 <<
" technology " <<
m_tec_impl.show_to_string() << std::endl
95 <<
" multilayer " <<
m_mla_impl.show_to_string() << std::endl
96 <<
" layer " <<
m_lay_impl.show_to_string() << std::endl
97 <<
" tube " <<
m_tub_impl.show_to_string() << std::endl);
107 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
108 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field "
109 <<
"'subdet' in dictionary " << atlasDict->
name());
116 region_id.add(muonField);
118 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"technology");
119 if (muon_range.
size() > 0) {
120 ATH_MSG_INFO(
"MultiRange built successfully to Technology: "
121 <<
"MultiRange size is " << muon_range.
size());
129 detectorElement_region.
add(muonField);
130 Range detectorElement_prefix;
131 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"multiLayer");
132 if (muon_detectorElement_range.
size() > 0) {
133 ATH_MSG_INFO(
"MultiRange built successfully to detector element: "
134 <<
"Multilayer MultiRange size is " << muon_detectorElement_range.
size());
136 ATH_MSG_ERROR(
"Muon MDT detector element MultiRange is empty");
142 mdt_region.
add(muonField);
144 MultiRange muon_channel_range =
m_dict->build_multirange(mdt_region, mdt_prefix,
"tube");
145 if (muon_channel_range.
size() > 0) {
147 <<
"MultiRange size is " << muon_channel_range.
size());
160 status =
m_dict->get_label_value(
"technology",
"MDT", mdtField);
162 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
163 const Range& range = muon_range[i];
168 ATH_MSG_DEBUG(
"module field size is " << (
int)range.cardinality() <<
" field index = " << i);
173 for (
int j = 0; j < (int)muon_detectorElement_range.
size(); ++j) {
174 const Range& range = muon_detectorElement_range[j];
179 ATH_MSG_DEBUG(
"detector element field size is " << (
int)range.cardinality() <<
" field index = " << j);
184 for (
int k = 0; k < (int)muon_channel_range.
size(); ++k) {
185 const Range& range = muon_channel_range[k];
190 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << k);
205 ATH_MSG_ERROR(
"MDT MultiRange ID is empty for detector elements");
222 assert (not station_f.
empty() &&
234 assert (not station_f.
empty() &&
252 ATH_MSG_INFO(
"Initializing MDT hash indices for finding neighbors ... ");
262 if (range.match(expId)) {
264 if (not channel_field.
empty()) {
276 ATH_MSG_ERROR(
"No maximum number of MDT tubes was retrieved");
289 for (
unsigned int i = 0; i < hash_max; ++i) {
300 for (
unsigned int i = 0; i < hash_max; ++i) {
357 }
catch (
const std::out_of_range&) {
isValid =
false; }
366 for (
const auto & expId: rit) {
369 if (
parentID(child) == parent) vect.push_back(child);
426 int resultMax = -999;
428 IdContext eta_context(expId, 0, field_index);
431 for (
const Range* range : ranges_by_station.at (station)) {
432 if (range->match(expId)) {
434 if (not field.empty()) {
435 resultMin = std::min (resultMin, field.get_minimum());
437 if (not field.empty()) {
438 resultMax = std::max (resultMax, field.get_maximum());
443 return std::make_pair (resultMin, resultMax);
457std::tuple<int, int, int, int>
472 if (range->match(expIdEta)) {
474 if (not eta_field.
empty()) {
478 if (not eta_field.
empty()) {
483 if (range->match(expIdPhi)) {
485 if (not phi_field.
empty()) {
489 if (not phi_field.
empty()) {
508 if (range->match(expId)) {
510 if (not multilayer_field.
empty()) {
555 if (tb < tubeMin || tb >
tubeMax) {
651 }
catch (
const std::out_of_range&) {
isValid =
false; }
685 }
catch (
const std::out_of_range&) {
isValid =
false; }
710 }
catch (
const std::out_of_range&) {
isValid =
false; }
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 mdt_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.
Identifier multilayerID(const Identifier &channeldID) const
std::pair< int, int > tubeLayerMinMax(const Identifier &id) const
static int stationPhiMin()
static int stationEtaMax(bool barrel)
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
ranges_by_station_t m_module_ranges_by_station
unsigned int detEleHashIdx(const Identifier &id) const
std::array< unsigned int, s_detDim > m_detectorElement_hashes
int multilayer(const Identifier &id) const
Access to components of the ID.
Identifier parentID(const Identifier &id) const
get parent id from channel id
Identifier elementID(int stationName, int stationEta, int stationPhi) const
bool validElement(const Identifier &id) const
std::tuple< int, int, int, int > stationEtaPhiMinMax(const Identifier &id) const
static int stationPhiMax()
std::pair< int, int > tubeMinMax(const Identifier &id) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
bool isBME(const Identifier &id) const
is this a BME chamber
static int multilayerMin()
bool valid(const Identifier &id) const
Public validation of levels.
std::pair< int, int > stationPhiMinMax(const Identifier &id) const
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
bool isStNameInTech(const std::string &stationName) const override
The valid element checks converted the identifier to a stationName string in order to assess whether ...
ranges_by_station_t m_channel_ranges_by_station
int mdtTechnology() const
Utility methods.
int tube(const Identifier &id) const
static constexpr unsigned s_mlDim
std::pair< int, int > stationEtaMinMax(const Identifier &id) const
IdDictFieldImplementation m_lay_impl
static int tubeLayerMax()
static constexpr unsigned s_etaDim
int tubeLayer(const Identifier &id) const
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
IdDictFieldImplementation m_tub_impl
static int stationEtaMin(bool barrel)
Access to min and max of level ranges.
int channel(const Identifier &id) const override
unsigned int moduleHashIdx(const Identifier &id) const
std::array< unsigned int, s_modHash > m_module_hashes
std::pair< int, int > multilayerMinMax(const Identifier &id) const
static constexpr unsigned s_phiDim
std::pair< int, int > findMinMax(const Identifier &id, const size_type field_index, const ranges_by_station_t &ranges_by_station) const
static int multilayerMax()
size_type m_TUBELAYER_INDEX
int numberOfMultilayers(const Identifier &id) const
IdDictFieldImplementation m_mla_impl
bool isBMG(const Identifier &id) const
is this a BMG chamber
static int tubeLayerMin()
bool measuresPhi(const Identifier &id) const override
always false for MDTs
int gasGap(const Identifier &id) const override
the gas-gap function for the MDT's returns the tube layer
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int tubeLayer, int tube) const
std::vector< std::vector< const Range * > > ranges_by_station_t
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
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
int nStationNames() const
IdContext technology_context() const
access to IdContext's which define which levels or fields are contained in the Muon id
int stationPhi(const Identifier &id) const
size_type m_DETECTORELEMENT_INDEX
int stationName(const Identifier &id) const
id_vec m_detectorElement_vec
virtual int init_detectorElement_hashes()
bool is_mdt(const Identifier &id) const
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
Identifier::size_type size_type
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.