24 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
38 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
48 ATH_MSG_DEBUG(
"initLevelsFromDict - there are no CSC entries in the dictionary! ");
56 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'chamberLayer' field ");
60 field =
m_dict->find_field(
"wireLayer");
64 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'wireLayer' field ");
68 field =
m_dict->find_field(
"cscMeasuresPhi");
72 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'cscMeasuresPhi' field ");
76 field =
m_dict->find_field(
"cscStrip");
80 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'cscStrip' field ");
105 ATH_MSG_DEBUG(
" CSC 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 <<
" cham layer " <<
m_cla_impl.show_to_string() << std::endl
112 <<
" layer " <<
m_lay_impl.show_to_string() << std::endl
113 <<
" phi " <<
m_mea_impl.show_to_string() << std::endl
124 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
125 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field "
126 <<
"'subdet' in dictionary " << atlasDict->
name());
133 region_id.add(muonField);
135 MultiRange muon_range =
m_dict->build_multirange(region_id, prefix,
"technology");
136 if (muon_range.
size() > 0) {
137 ATH_MSG_INFO(
"MultiRange built successfully to Technology: "
138 <<
"MultiRange size is " << muon_range.
size());
146 detectorElement_region.
add(muonField);
147 Range detectorElement_prefix;
148 MultiRange muon_detectorElement_range =
m_dict->build_multirange(detectorElement_region, detectorElement_prefix,
"chamberLayer");
149 if (muon_detectorElement_range.
size() > 0) {
150 ATH_MSG_INFO(
"MultiRange built successfully to detector element: "
151 <<
"Multilayer MultiRange size is " << muon_detectorElement_range.
size());
153 ATH_MSG_ERROR(
"Muon CSC detector element MultiRange is empty");
159 csc_region.
add(muonField);
161 MultiRange muon_channel_range =
m_dict->build_multirange(csc_region, csc_prefix,
"cscStrip");
162 if (muon_channel_range.
size() > 0) {
163 ATH_MSG_INFO(
"MultiRange built successfully to cscStrip: "
164 <<
"MultiRange size is " << muon_channel_range.
size());
177 status =
m_dict->get_label_value(
"technology",
"CSC", cscField);
179 for (
int i = 0; i < (int)muon_range.
size(); ++i) {
180 const Range& range = muon_range[i];
185 ATH_MSG_DEBUG(
"field size is " << (
int)range.cardinality() <<
" field index = " << i);
190 for (
int j = 0; j < (int)muon_detectorElement_range.
size(); ++j) {
191 const Range& range = muon_detectorElement_range[j];
196 ATH_MSG_DEBUG(
"detector element field size is " << (
int)range.cardinality() <<
" field index = " << j);
201 for (
int j = 0; j < (int)muon_channel_range.
size(); ++j) {
202 const Range& range = muon_channel_range[j];
207 ATH_MSG_DEBUG(
"channel field size is " << (
int)range.cardinality() <<
" field index = " << j);
222 ATH_MSG_ERROR(
"CSC MultiRange ID is empty for detector elements");
244 ATH_MSG_INFO(
"Initializing CSC hash indices for finding neighbors ... ");
258 ATH_MSG_ERROR(
"Failed to retrieve ExpandedIdentifier from Identifier " <<
id.get_compact());
264 if (range.match(expId)) {
266 if (not !phi_field.
empty()) {
267 ATH_MSG_ERROR(
"Range::field for phi at position " << i <<
" does not have a maximum");
310 for (
unsigned int i = 0; i < hash_max; ++i) {
321 for (
unsigned int i = 0; i < hash_max; ++i) {
355 for (
const auto & expId : rit) {
358 if (
parentID(child) == parent) vect.push_back(child);
370 if (range.match(expId)) {
372 if (not eta_field.
empty()) {
394 if (range.match(expId)) {
396 if (not eta_field.
empty()) {
413 if (range.match(expId)) {
429 if (range.match(expId)) {
445 if (range.match(expId)) {
461 if (range.match(expId)) {
477 if (range.match(expId)) {
493 if (range.match(expId)) {
509 if (range.match(expId)) {
525 if (range.match(expId)) {
541 if (range.match(expId)) {
662 std::string version =
m_dict->version();
664 if (version ==
"H8 2004") {
668 }
else if (version ==
"CSC Cosmic") {
672 }
else if (version ==
"P.03" || version ==
"H8 2003" || version ==
"H8 2002" || version ==
"M2.8") {
698 }
catch (
const std::out_of_range&) {
isValid =
false; }
732 }
catch (
const std::out_of_range&) {
isValid =
false; }
758 }
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
int csc_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
unsigned int m_stripMaxPhi
int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const override
static int wireLayerMax()
static int stationEtaMax()
size_type m_CHAMBERLAYER_INDEX
static int measuresPhiMin()
int sector(const Identifier &id) const
Identifier parentID(const Identifier &id) const
get parent id from channel id
Identifier channelID(int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
Identifier elementID(int stationName, int stationEta, int stationPhi) const
int wireLayer(const Identifier &id) const
static int stationPhiMax()
unsigned int moduleHashIdx(const Identifier &id) const
static int stationEtaMin()
Access to min and max of level ranges.
IdDictFieldImplementation m_cla_impl
IdDictFieldImplementation m_mea_impl
int chamberLayer(const Identifier &id) const
void idChannels(const Identifier &id, std::vector< Identifier > &vect) const
bool isStNameInTech(const std::string &stationName) const override
The valid element checks converted the identifier to a stationName string in order to assess whether ...
IdDictFieldImplementation m_lay_impl
int gasGap(const Identifier &id) const override
get the hashes
int strip(const Identifier &id) const
unsigned int m_stripMaxEta
static constexpr unsigned int s_mlDim
2 multi layer
size_type m_MEASURESPHI_INDEX
static constexpr unsigned int s_etaDim
static int chamberLayerMin()
IdDictFieldImplementation m_str_impl
size_type m_WIRELAYER_INDEX
bool valid(const Identifier &id) const
Public validation of levels.
int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
bool validChannel(const Identifier &id, int stationName, int stationEta, int stationPhi, int chamberLayer, int wireLayer, int measuresPhi, int strip) const
unsigned int detEleHashIdx(const Identifier &id) const
bool measuresPhi(const Identifier &id) const override
static int measuresPhiMax()
static constexpr unsigned int s_phiDim
8 phi stations
std::array< unsigned int, s_modHashDim > m_module_hashes
bool validElement(const Identifier &id) const
unsigned int m_stationShift
Minimal station index found.
static int stationPhiMin()
std::array< unsigned int, s_detHashDim > m_detectorElement_hashes
int cscTechnology() const
Utility methods.
int channel(const Identifier &id) const override
static int chamberLayerMax()
int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const override
static int wireLayerMin()
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
bool is_csc(const Identifier &id) 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
int init_channel_hashes()
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.