![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
18 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
32 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
46 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
47 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary ");
56 if (muon_range.
size()) {
57 ATH_MSG_INFO(
"MultiRange built successfully to Technology "
58 <<
"MultiRange size is " << muon_range.
size());
115 ATH_MSG_WARNING(
"MuonIdHelper::get_module_hash(): Could not determine hash for identifier " <<
id.get_compact());
134 ATH_MSG_WARNING(
"MuonIdHelper::get_detectorElement_hash(): Could not determine hash for identifier " <<
id.get_compact());
140 return get_hash(
id, hash_id, &context);
171 if (!
get_compact_id(old_id, compact_id, &context)) { new_id = compact_id; }
187 }
else if (0 ==
begin) {
205 for (
size_t i = 0;
i <
id.fields();
i++) exp_id[
i] =
id[
i];
209 size_t end = (context) ? context->
end_index() :
id.fields() - 1;
242 ATH_MSG_ERROR(
" initLevelsFromDict - dictionary NOT initialized ");
258 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find a muon station index: id, reg"
269 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field ");
278 for (
size_t i = 0;
i <
field->get_label_number();
i++) {
286 if (
'B' ==
name[0]) {
292 }
else if (
'F' ==
name[2]) {
300 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationName' field ");
307 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationEta' field ");
314 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationPhi' field ");
322 for (
size_t i = 0;
i <
field->get_label_number(); ++
i) {
332 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'technology' field ");
358 unsigned int nids = 0;
359 std::set<Identifier>
ids;
367 if (!(
ids.insert(
id)).second) {
369 <<
" Error: duplicated id for module id. nid " << (
int)nids <<
" compact id " <<
id <<
" id ");
377 <<
" Error: set size NOT EQUAL to element hash max. size " <<
ids.size() <<
" hash max " <<
m_module_hash_max);
383 std::set<Identifier>::const_iterator
first =
ids.begin();
384 std::set<Identifier>::const_iterator last =
ids.end();
405 unsigned int nids = 0;
406 std::set<Identifier>
ids;
414 if (!(
ids.insert(
id)).second) {
416 <<
" Error: duplicated id for channel id. nid " << nids <<
" compact id " <<
id <<
" id ");
430 std::set<Identifier>::const_iterator
first =
ids.begin();
431 std::set<Identifier>::const_iterator last =
ids.end();
452 unsigned int nids = 0;
453 std::set<Identifier>
ids;
462 if (!(
ids.insert(
id)).second) {
464 <<
" Error: duplicated id for channel id. nid " << nids <<
" compact id " <<
id <<
" id ");
473 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size() <<
" hash max " <<
m_channel_hash_max);
558 if (
get_hash(compact_id, hash_id, &wcontext)) {
559 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get hash, exp/compact "
560 <<
" " << std::hex << compact_id << std::dec <<
endmsg);
564 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get compact, exp/compact ");
569 unsigned short index = hash_id;
581 if (
get_hash(compact_id, hash_id, &wcontext)) {
582 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous phi hash, exp/compact "
583 <<
" " << std::hex << compact_id << std::dec);
587 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous phi compact, exp/compact ");
599 if (
get_hash(compact_id, hash_id, &wcontext)) {
600 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next phi hash, exp/compact "
601 <<
" " << std::hex << compact_id << std::dec);
605 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next phi compact, exp/compact ");
617 if (
get_hash(compact_id, hash_id, &wcontext)) {
618 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous eta hash, exp/compact "
619 <<
" " << std::hex << compact_id << std::dec);
623 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous eta compact, exp/compact ");
635 if (
get_hash(compact_id, hash_id, &wcontext)) {
636 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next eta hash, exp/compact "
637 <<
" " << std::hex << compact_id << std::dec);
641 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next eta compact, exp/compact ");
662 ATH_MSG_ERROR(
"test_module_packing: Unable to get expanded id. Compact id " << compact);
667 ATH_MSG_ERROR(
"test_module_packing: Unable to get compact id. Expanded id " << std::string(
id));
670 if (compact != new_compact) {
671 ATH_MSG_ERROR(
"test_module_packing: new and old compacts not equal "
672 <<
"New/old/expanded ids " << new_compact <<
" " << compact <<
" " << std::string(
id));
677 ATH_MSG_INFO(
"test_module_packing: Successful tested " << nids <<
" ids. ");
679 ATH_MSG_ERROR(
"Unable to test module is packing - no dictionary has been defined. ");
687 ATH_MSG_ERROR(
"Unable to get expanded id. Compact id " << compact);
695 if (compact != new_compact) {
696 ATH_MSG_ERROR(
"new and old compacts not equal. New/old/expanded ids " << new_compact <<
" " << compact <<
" "
718 if (
'I' ==
name[1] ||
'4' ==
name[1])
return 0;
719 if (
'E' ==
name[1] ||
'1' ==
name[1])
return 1;
720 if (
'M' ==
name[1] ||
'2' ==
name[1])
return 2;
721 if (
'O' ==
name[1] ||
'3' ==
name[1])
return 3;
722 if (
name ==
"CSS" ||
name ==
"CSL")
return 0;
bool is_muon(const Identifier &id) const
IdDictRegion * find_region(const std::string ®ion_name) const
int get_prev_in_phi(const IdentifierHash &id, IdentifierHash &prev) const
Access to hashes for neighbors in phi and eta (return == 0 for neighbor found)
hash_vec m_next_eta_module_vec
IDENTIFIER_TYPE value_type
bool validStation(int stationName, int technology) const
int stationNameIndex(const std::string &name) const
IdContext detectorElement_context() const
id for detector element
MultiRange multiRange() const
multirange
std::map< int, std::string > m_technologyIdxToNameMap
Mapping int -> string.
constexpr uint8_t stationPhi
station Phi 1 to 8
MultiRange build_multirange() const
Get MultiRange for full dictionary.
bool is_rpc(Identifier id) const
hash_vec m_prev_eta_module_vec
void test_id(const Identifier &id, const IdContext &context) const
int stationRegion(const Identifier &id) const
int unpack(const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const
Unpack the value_type id to an expanded Identifier, considering the provided prefix (result will incl...
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
const_id_iterator detectorElement_begin() const
Iterators over full set of ids.
std::set< int > m_isSmall
bool is_rpc(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)
int technologyIndex(const std::string &name) const
singleton-like access to IMessageSvc via open function and helper
bool is_csc(Identifier id) const
hash_vec m_next_phi_module_vec
std::set< int > m_stationInTech
IdContext channel_context() const
id for channel
bool is_mdt(const Identifier &id) const
size_type m_detectorElement_hash_max
const_id_iterator channel_end() const
IdDictFieldImplementation m_sta_impl
size_type m_channel_hash_max
std::map< std::string, int > m_technologyNameToIdxMap
Mapping string -> int.
bool is_mm(Identifier id) const
bool is_csc(const Identifier &id) const
size_type end_index(void) const
const std::string & technologyString(const int &index) const
const_id_iterator module_end() const
hash_vec m_prev_phi_module_vec
int stationName(const Identifier &id) const
const_id_iterator detectorElement_end() const
#define ATH_MSG_VERBOSE(x)
IdDictFieldImplementation m_phi_impl
virtual bool isStNameInTech(const std::string &stationName) const =0
The valid element checks converted the identifier to a stationName string in order to assess whether ...
int unpack(Identifier id) const
Identifier manipulation methods.
MultiRange m_full_channel_range
int stationNameIndexMax() const
int pack32(const ExpandedIdentifier &id, size_t index1, size_t index2, Identifier &packedId) const
Pack to 32bits the subset of id between (inclusive) index1 and index2 - this is generic,...
IdDictField * find_field(const std::string &name) const
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
bool is_tgc(const Identifier &id) const
bool isSmall(const Identifier &id) const
bool get_next(element_type current, element_type &next) const
std::map< int, std::string > m_stationIdxToNameMap
Mapping int -> string.
bool is_stgc(const Identifier &id) const
std::map< std::string, int > m_stationNameToIdxMap
Mapping string -> int.
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
void addStationID(Identifier &id, int stationName, int stationEta, int stationPhi, int technology) const
bool is_tgc(Identifier id) const
int get_prev_in_eta(const IdentifierHash &id, IdentifierHash &prev) const
virtual int get_module_hash(const Identifier &id, IdentifierHash &hash_id) const
std::vector< IdDictRegion * > m_regions
MultiRange m_full_detectorElement_range
bool isForward(const Identifier &id) const
id_vec::const_iterator id_vec_it
virtual int get_detectorElement_hash(const Identifier &id, IdentifierHash &hash_id) const
MultiRange m_full_module_range
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
Create expanded id from compact id (return == 0 for OK)
bool is_mm(const Identifier &id) const
virtual int get_hash_calc(const Identifier &compact_id, IdentifierHash &hash_id, const IdContext *context) const
int technologyNameIndexMax() const
IdDictFieldImplementation m_eta_impl
MuonIdHelper(const std::string &logName)
IdDictFieldImplementation m_muon_impl
int nStationNames() const
int get_next_in_phi(const IdentifierHash &id, IdentifierHash &next) const
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
void clear()
Reset to invalid state.
int stationPhi(const Identifier &id) const
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & stationNameString(const int &index) const
size_type begin_index(void) const
virtual int get_channel_hash(const Identifier &id, IdentifierHash &hash_id) const
A MultiRange combines several Ranges.
id_vec m_detectorElement_vec
bool isBarrel(const Identifier &id) const
ExpandedIdentifier muon_exp(void) const
int stationEta(const Identifier &id) const
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
std::set< int > m_isBarrel
size_type module_hash_max() const
the maximum hash value
size_type m_module_hash_max
bool isEndcap(const Identifier &id) const
virtual int init_detectorElement_hashes()
size_type m_station_region_index
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
size_type m_TECHNOLOGY_INDEX
bool is_muon(Identifier id) const
value_type get_compact(void) const
Get the compact id.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
void test_module_packing() const
Tests of packing.
#define ATH_MSG_WARNING(x)
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const override
Create hash id from compact id (return == 0 for OK)
int technology(const Identifier &id) const
Identifier muon(void) const
Identifier::size_type size_type
int get_expanded_id_calc(const Identifier &compact_id, ExpandedIdentifier &id, const IdContext *context) const
const_id_iterator channel_begin() const
Iterators over full set of ids.
IdContext module_context() const
id for module
size_type m_DETECTORELEMENT_INDEX
std::vector< Identifier >::const_iterator const_id_iterator
IdDictFieldImplementation m_tec_impl
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
bool is_stgc(Identifier id) const
int init_channel_hashes()
static constexpr int NOT_VALID_HASH
const ExpandedIdentifier & prefix_id(void) const
This is the individual specification for the range of one ExpandedIdentifier field.
size_type cardinality() const
Computes a possible cardinality from all ranges.
constexpr uint8_t stationEta
1 to 3
const_id_iterator module_begin() const
Iterators over full set of ids.
std::set< int > m_isForward
int get_compact_id(const ExpandedIdentifier &id, Identifier &compact_id, const IdContext *context) const
std::vector< IdDictFieldImplementation > m_implementation
bool validTechnology(int technology) const
IdContext technology_context() const
access to IdContext's which define which levels or fields are contained in the Muon id
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
std::vector< Identifier > idVector() const
the id's
bool isInitialized() const
bool is_mdt(Identifier id) const
size_type m_CHANNEL_INDEX
static const std::string BAD_NAME
size_type channel_hash_max() const
const IdDictDictionary * m_dict