26 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
40 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
49 ATH_MSG_DEBUG(
"initLevelsFromDict - there are no sTGC entries in the dictionary! ");
57 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stgcMultilayer' field ");
61 field =
m_dict->find_field(
"stgcGasGap");
65 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stgcGasGap' field ");
69 field =
m_dict->find_field(
"stgcChannelType");
73 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'channelType' field ");
77 field =
m_dict->find_field(
"stgcChannel");
81 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'channel' field ");
105 ATH_MSG_DEBUG(
" sTGC decode index and bit fields for each level: " << std::endl
106 <<
" muon " <<
m_muon_impl.show_to_string() << std::endl
107 <<
" station " <<
m_sta_impl.show_to_string() << std::endl
108 <<
" eta " <<
m_eta_impl.show_to_string() << std::endl
109 <<
" phi " <<
m_phi_impl.show_to_string() << std::endl
110 <<
" technology " <<
m_tec_impl.show_to_string() << std::endl
111 <<
" multilayer " <<
m_mplet_impl.show_to_string() << std::endl
112 <<
" gasgap " <<
m_gap_impl.show_to_string() << std::endl
113 <<
" channelType " <<
m_typ_impl.show_to_string() << std::endl
114 <<
" channel " <<
m_cha_impl.show_to_string());
123 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
124 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary " << atlasDict->
name());
130 region_id.add(muonField);
132 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"technology");
133 if (muon_range.
size() > 0) {
134 ATH_MSG_INFO(
"MultiRange built successfully to Technology: "
135 <<
"MultiRange size is " << muon_range.
size());
137 ATH_MSG_ERROR(
"Muon sTGC detector element MultiRange is empty");
142 detectorElement_region.
add(muonField);
143 Range detectorElement_prefix;
144 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"stgcMultilayer");
145 if (muon_detectorElement_range.
size() > 0) {
146 ATH_MSG_INFO(
"MultiRange built successfully to detector element: "
147 <<
"Multilayer MultiRange size is " << muon_detectorElement_range.
size());
149 ATH_MSG_ERROR(
"Muon sTGC detector element MultiRange is empty");
154 stgc_region.
add(muonField);
156 MultiRange muon_channel_range =
m_dict->build_multirange(stgc_region, stgc_prefix,
"stgcChannel");
157 if (muon_channel_range.
size() > 0) {
158 ATH_MSG_INFO(
"MultiRange built successfully to channel: "
159 <<
"MultiRange size is " << muon_channel_range.
size());
161 ATH_MSG_ERROR(
"Muon sTGC detector MultiRange is empty for channels");
167 status =
m_dict->get_label_value(
"technology",
"STGC", stgcField);
169 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
170 const Range& range = muon_range[i];
175 ATH_MSG_DEBUG(
"field size is " << (
int)range.cardinality() <<
" field index = " << i);
180 for (
int j = 0; j < (int)muon_detectorElement_range.
size(); ++j) {
181 const Range& range = muon_detectorElement_range[j];
186 ATH_MSG_DEBUG(
"detector element field size is " << (
int)range.cardinality() <<
" field index = " << j);
191 for (
int j = 0; j < (int)muon_channel_range.
size(); ++j) {
192 const Range& range = muon_channel_range[j];
197 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << j);
210 ATH_MSG_ERROR(
"sTGC MultiRange ID is empty for detector elements");
241 ATH_MSG_INFO(
"Initializing sTGC hash indices for finding neighbors ... ");
263 for (
unsigned int i = 0; i < hash_max; ++i) {
274 for (
unsigned int i = 0; i < hash_max; ++i) {
321 }
catch (
const std::out_of_range&) {
isValid =
false; }
396 for (
const auto & expId:rit) {
399 if (
parentID(child) == parent) vect.push_back(child);
411 if (range.match(expId)) {
413 if (not eta_field.
empty()) {
435 if (range.match(expId)) {
437 if (not eta_field.
empty()) {
455 if (range.match(expId)) {
472 if (range.match(expId)) {
489 if (range.match(expId)) {
491 if (not multilayer_field.
empty()) {
492 int multilayermax = multilayer_field.
get_maximum();
509 if (range.match(expId)) {
511 if (not multilayer_field.
empty()) {
512 int multilayermin = multilayer_field.
get_minimum();
533 if (range.match(expId)) {
535 if (not multilayer_field.
empty()) {
536 int multilayermax = multilayer_field.
get_maximum();
553 if (range.match(expId)) {
555 if (not gasgap_field.
empty()) {
576 if (range.match(expId)) {
593 if (range.match(expId)) {
595 if (not channeltype_field.
empty()) {
596 int channeltypemin = channeltype_field.
get_minimum();
617 if (range.match(expId)) {
619 if (not channeltype_field.
empty()) {
620 int channeltypemax = channeltype_field.
get_maximum();
637 if (range.match(expId)) {
639 if (not channel_field.
empty()) {
661 if (range.match(expId)) {
663 if (not channel_field.
empty()) {
677 if (ChannelType ==
Pad) {
679 PadEta = ((Channel - 1) %
PadEtaMax) + 1;
687 if (ChannelType ==
Pad) {
689 PadPhi = ((Channel - 1) /
PadEtaMax) + 1;
723 if (channeltype ==
Pad) {
726 if (PadEta < PadEtaMin || PadEta >
PadEtaMax) {
730 if (PadPhi < PadPhiMin || PadPhi >
PadPhiMax) {
812 if (PadEta < PadEtaMin || PadEta >
PadEtaMax) {
816 if (PadPhi < PadPhiMin || PadPhi >
PadPhiMax) {
846 <<
" for given padEta=" <<
padEta <<
" and padPhi=" <<
padPhi);
876 }
catch (
const std::out_of_range&) {
isValid =
false; }
913 }
catch (
const std::out_of_range&) {
isValid =
false; }
940 }
catch (
const std::out_of_range&) {
isValid =
false; }
974 }
catch (
const std::out_of_range&) {
isValid =
false; }
1006 }
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.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
int stgc_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)
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
bool is_stgc(const Identifier &id) const
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
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.
int padPhi(const Identifier &id) const
static constexpr unsigned int s_etaDim
-3, -2, -1, 1, 2, 3
std::array< unsigned int, s_modHashDim > m_module_hashes
IdDictFieldImplementation m_cha_impl
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
int multilayer(const Identifier &id) const
bool valid(const Identifier &id) const
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
static constexpr unsigned int s_mlDim
2 multilayer
bool SmallSector(int stationName) const
unsigned int m_stationShift
Minimal station index found.
static int stationPhiMax()
IdDictFieldImplementation m_gap_impl
int stgcTechnology() const
Utility methods.
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
Identifier hvID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, bool isInnerQ1) const
int channelType(const Identifier &id) const
unsigned int detEleHashIdx(const Identifier &id) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
int padEta(const Identifier &id) const
Identifier parentID(const Identifier &id) const
static int multilayerMax()
size_type m_CHANNELTYPE_INDEX
Identifier febID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
static int stationPhiMin()
int channel(const Identifier &id) const override
static int stationEtaMin()
static int multilayerMin()
bool measuresPhi(const Identifier &id) const override
returns measuresPhi
Identifier padID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int padEta, int padPhi) const
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
IdDictFieldImplementation m_mplet_impl
static int stationEtaMax()
bool LargeSector(int stationName) const
int gasGap(const Identifier &id) const override
get the hashes
static constexpr unsigned int s_phiDim
8 phi station
Identifier channelID(int stationName, int stationEta, int stationPhi, int multilayer, int gasGap, int channelType, int channel) const
unsigned int moduleHashIdx(const Identifier &id) const
bool validElement(const Identifier &id) const
Identifier multilayerID(const Identifier &channeldID) const
static int channelTypeMax()
int numberOfMultilayers(const Identifier &id) const
IdDictFieldImplementation m_typ_impl
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 ...
static int channelTypeMin()