28 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
42 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
51 ATH_MSG_DEBUG(
"initLevelsFromDict - there are no MM entries in the dictionary! ");
59 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'mmMultilayer' field ");
63 field =
m_dict->find_field(
"mmGasGap");
67 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'mmGasGap' field ");
71 field =
m_dict->find_field(
"mmChannel");
75 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find mmChannel' field ");
99 ATH_MSG_DEBUG(
" MicroMegas decode index and bit fields for each level: " << std::endl
100 <<
" muon " <<
m_muon_impl.show_to_string() << std::endl
101 <<
" station " <<
m_sta_impl.show_to_string() << std::endl
102 <<
" eta " <<
m_eta_impl.show_to_string() << std::endl
103 <<
" phi " <<
m_phi_impl.show_to_string() << std::endl
104 <<
" technology " <<
m_tec_impl.show_to_string() << std::endl
107 <<
" gasgap " <<
m_gap_impl.show_to_string() << std::endl
108 <<
" channel " <<
m_cha_impl.show_to_string());
117 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
118 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->
name());
124 region_id.add(muonField);
126 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"technology");
127 if (muon_range.
size() > 0) {
128 ATH_MSG_INFO(
"MultiRange built successfully to Technology: "
129 <<
"MultiRange size is " << muon_range.
size());
137 detectorElement_region.
add(muonField);
138 Range detectorElement_prefix;
139 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"mmMultilayer");
140 if (muon_detectorElement_range.
size() > 0) {
141 ATH_MSG_INFO(
"MultiRange built successfully to detector element: "
142 <<
"Multilayer MultiRange size is " << muon_detectorElement_range.
size());
144 ATH_MSG_ERROR(
"Muon MicroMegas detector element MultiRange is empty");
150 mm_region.
add(muonField);
152 MultiRange muon_channel_range =
m_dict->build_multirange(mm_region, mm_prefix,
"mmChannel");
153 if (muon_channel_range.
size() > 0) {
154 ATH_MSG_INFO(
"MultiRange built successfully to channel: "
155 <<
"MultiRange size is " << muon_channel_range.
size());
163 status =
m_dict->get_label_value(
"technology",
"MM", mmField);
165 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
166 const Range& range = muon_range[i];
171 ATH_MSG_DEBUG(
"field size is " << (
int)range.cardinality() <<
" field index = " << i);
176 for (
int j = 0; j < (int)muon_detectorElement_range.
size(); ++j) {
177 const Range& range = muon_detectorElement_range[j];
182 ATH_MSG_DEBUG(
"detector element field size is " << (
int)range.cardinality() <<
" field index = " << j);
187 for (
int j = 0; j < (int)muon_channel_range.
size(); ++j) {
188 const Range& range = muon_channel_range[j];
193 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << j);
200 ATH_MSG_ERROR(
"MicroMegas MultiRange ID is empty for modules");
206 ATH_MSG_ERROR(
"MicroMegas MultiRange ID is empty for detector elements");
212 ATH_MSG_ERROR(
"MicroMegas MultiRange ID is empty for channels");
217 ATH_MSG_INFO(
"Initializing MicroMegas hash indices ... ");
223 ATH_MSG_INFO(
"Initializing MicroMegas hash indices for finding neighbors ... ");
246 for (
unsigned int i = 0; i < hash_max; ++i) {
257 for (
unsigned int i = 0; i < hash_max; ++i) {
303 }
catch (
const std::out_of_range&) {
isValid =
false; }
308 int pcbNb = std::abs(
stationEta)==1 ? pcb : pcb-5;
309 return (pcbNb-1)*1024+1;
339 int pcb = (chnl-1)/1024+1 + (std::abs(
stationEta(channelId))==2 ? 5:0);
340 return pcbID(channelId, pcb);
344 int radiusNb = std::abs(
stationEta)==1 ? radius : radius-10;
345 return radiusNb*512+1;
375 int radius = (chnl-1)/512 + (std::abs(
stationEta(channelId))==2 ? 10:0);
376 return febID(channelId, radius);
385 for (
const auto & expId : rit) {
388 if (
parentID(child) == parent) vect.push_back(child);
397 if (range.match(expId)) {
399 if (not eta_field.
empty()) {
425 if (range.match(expId)) {
427 if (not eta_field.
empty()) {
448 if (range.match(expId)) {
471 if (range.match(expId)) {
498 if (range.match(expId)) {
500 if (not multilayer_field.
empty()) {
501 int multilayermax = multilayer_field.
get_maximum();
515 if (range.match(expId)) {
517 if (not multilayer_field.
empty()) {
518 int multilayermin = multilayer_field.
get_minimum();
543 if (range.match(expId)) {
545 if (not multilayer_field.
empty()) {
546 int multilayermax = multilayer_field.
get_maximum();
567 if (range.match(expId)) {
569 if (not gasgap_field.
empty()) {
594 if (range.match(expId)) {
617 if (range.match(expId)) {
619 if (not channel_field.
empty()) {
645 if (range.match(expId)) {
647 if (not channel_field.
empty()) {
755 }
catch (
const std::out_of_range&) {
isValid =
false; }
789 }
catch (
const std::out_of_range&) {
isValid =
false; }
815 }
catch (
const std::out_of_range&) {
isValid =
false; }
855 if ((ml == 1 && gg > 2) || (ml == 2 && gg < 3))
isStereo =
true;
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
int mm_field_value() const
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.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
bool is_mm(Identifier id) 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.
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
static int stationEtaMax()
IdDictFieldImplementation m_cha_impl
unsigned int detEleHashIdx(const Identifier &id) const
Identifier pcbID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int pcb) const
bool LargeSector(int stationName) const
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channel) const
unsigned int moduleHashIdx(const Identifier &id) const
Identifier multilayerID(const Identifier &channeldID) const
bool isStereo(const Identifier &id) const
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
bool valid(const Identifier &id) const
IdDictFieldImplementation m_gap_impl
Identifier febID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int radius) const
static int sectorType(const std::string &stationName, int stationEta)
int channel(const Identifier &id) const override
int numberOfMultilayers(const Identifier &id) const
static int stationPhiMin()
IdDictFieldImplementation m_mplet_impl
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
std::array< unsigned int, s_detHashDim > m_detectorElement_hashes
bool isStNameInTech(const std::string &stationName) const override
The valid element checks converted the identifier to a stationName string in order to assess whether ...
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
static int stationEtaMin()
int mmTechnology() const
Utility methods.
int gasGap(const Identifier &id) const override
get the hashes
static int multilayerMin()
std::array< unsigned int, s_modHashDim > m_module_hashes
unsigned int m_stationShift
Minimal station index found.
static int getFirstPcbChnl(int stationEta, int pcb)
static constexpr unsigned int s_etaDim
-2, -1 , 1, 2
static constexpr unsigned int s_phiDim
8 phi station
bool SmallSector(int stationName) const
static int getFirstRadiusChnl(int stationEta, int pcb)
static int multilayerMax()
static int stationPhiMax()
static constexpr unsigned int s_mlDim
2 multilayer
Identifier parentID(const Identifier &id) const
bool validElement(const Identifier &id) const
int multilayer(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
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
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()
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
MultiRange m_full_channel_range
IdContext channel_context() const
id for channel
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.
singleton-like access to IMessageSvc via open function and helper