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 ");
98 ATH_MSG_DEBUG(
" MicroMegas decode index and bit fields for each level: " << std::endl
99 <<
" muon " <<
m_muon_impl.show_to_string() << std::endl
100 <<
" station " <<
m_sta_impl.show_to_string() << std::endl
101 <<
" eta " <<
m_eta_impl.show_to_string() << std::endl
102 <<
" phi " <<
m_phi_impl.show_to_string() << std::endl
103 <<
" technology " <<
m_tec_impl.show_to_string() << std::endl
106 <<
" gasgap " <<
m_gap_impl.show_to_string() << std::endl
107 <<
" channel " <<
m_cha_impl.show_to_string());
116 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
117 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->
name());
123 region_id.add(muonField);
125 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"technology");
126 if (muon_range.
size() > 0) {
127 ATH_MSG_INFO(
"MultiRange built successfully to Technology: "
128 <<
"MultiRange size is " << muon_range.
size());
135 detectorElement_region.
add(muonField);
136 Range detectorElement_prefix;
137 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"mmMultilayer");
138 if (muon_detectorElement_range.
size() > 0) {
139 ATH_MSG_INFO(
"MultiRange built successfully to detector element: "
140 <<
"Multilayer MultiRange size is " << muon_detectorElement_range.
size());
142 ATH_MSG_ERROR(
"Muon MicroMegas detector element MultiRange is empty");
147 mm_region.
add(muonField);
149 MultiRange muon_channel_range =
m_dict->build_multirange(mm_region, mm_prefix,
"mmChannel");
150 if (muon_channel_range.
size() > 0) {
151 ATH_MSG_INFO(
"MultiRange built successfully to channel: "
152 <<
"MultiRange size is " << muon_channel_range.
size());
160 status =
m_dict->get_label_value(
"technology",
"MM", mmField);
162 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
163 const Range& range = muon_range[i];
168 ATH_MSG_DEBUG(
"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 j = 0; j < (int)muon_channel_range.
size(); ++j) {
185 const Range& range = muon_channel_range[j];
190 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << j);
197 ATH_MSG_ERROR(
"MicroMegas MultiRange ID is empty for modules");
203 ATH_MSG_ERROR(
"MicroMegas MultiRange ID is empty for detector elements");
209 ATH_MSG_ERROR(
"MicroMegas MultiRange ID is empty for channels");
214 ATH_MSG_INFO(
"Initializing MicroMegas hash indices ... ");
220 ATH_MSG_INFO(
"Initializing MicroMegas hash indices for finding neighbors ... ");
243 for (
unsigned int i = 0; i < hash_max; ++i) {
254 for (
unsigned int i = 0; i < hash_max; ++i) {
300 }
catch (
const std::out_of_range&) {
isValid =
false; }
305 int pcbNb = std::abs(
stationEta)==1 ? pcb : pcb-5;
306 return (pcbNb-1)*1024+1;
336 int pcb = (chnl-1)/1024+1 + (std::abs(
stationEta(channelId))==2 ? 5:0);
337 return pcbID(channelId, pcb);
341 int radiusNb = std::abs(
stationEta)==1 ? radius : radius-10;
342 return radiusNb*512+1;
372 int radius = (chnl-1)/512 + (std::abs(
stationEta(channelId))==2 ? 10:0);
373 return febID(channelId, radius);
382 for (
const auto & expId : rit) {
385 if (
parentID(child) == parent) vect.push_back(child);
394 if (range.match(expId)) {
396 if (not eta_field.
empty()) {
422 if (range.match(expId)) {
424 if (not eta_field.
empty()) {
445 if (range.match(expId)) {
468 if (range.match(expId)) {
495 if (range.match(expId)) {
497 if (not multilayer_field.
empty()) {
498 int multilayermax = multilayer_field.
get_maximum();
512 if (range.match(expId)) {
514 if (not multilayer_field.
empty()) {
515 int multilayermin = multilayer_field.
get_minimum();
540 if (range.match(expId)) {
542 if (not multilayer_field.
empty()) {
543 int multilayermax = multilayer_field.
get_maximum();
564 if (range.match(expId)) {
566 if (not gasgap_field.
empty()) {
591 if (range.match(expId)) {
614 if (range.match(expId)) {
616 if (not channel_field.
empty()) {
642 if (range.match(expId)) {
644 if (not channel_field.
empty()) {
752 }
catch (
const std::out_of_range&) {
isValid =
false; }
786 }
catch (
const std::out_of_range&) {
isValid =
false; }
812 }
catch (
const std::out_of_range&) {
isValid =
false; }
852 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
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)
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
bool is_mm(const Identifier &id) const
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
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.
singleton-like access to IMessageSvc via open function and helper