|
ATLAS Offline Software
|
Go to the documentation of this file.
19 ATH_MSG_INFO(
"Request to reinitialize not satisfied - tags have not changed");
33 ATH_MSG_ERROR(
" initialize_from_dict - cannot access MuonSpectrometer dictionary ");
47 if (atlasDict->
get_label_value(
"subdet",
"MuonSpectrometer", muonField)) {
48 ATH_MSG_ERROR(
"Could not get value for label 'MuonSpectrometer' of field 'subdet' in dictionary ");
57 if (muon_range.
size()) {
58 ATH_MSG_INFO(
"MultiRange built successfully to Technology "
59 <<
"MultiRange size is " << muon_range.
size());
116 ATH_MSG_WARNING(
"MuonIdHelper::get_module_hash(): Could not determine hash for identifier " <<
id.get_compact());
135 ATH_MSG_WARNING(
"MuonIdHelper::get_detectorElement_hash(): Could not determine hash for identifier " <<
id.get_compact());
141 return get_hash(
id, hash_id, &context);
172 if (!
get_compact_id(old_id, compact_id, &context)) { new_id = compact_id; }
188 }
else if (0 ==
begin) {
206 for (
size_t i = 0;
i <
id.fields();
i++) exp_id[
i] =
id[
i];
210 size_t end = (context) ? context->
end_index() :
id.fields() - 1;
243 ATH_MSG_ERROR(
" initLevelsFromDict - dictionary NOT initialized ");
259 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find a muon station index: id, reg"
270 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field ");
279 for (
size_t i = 0;
i <
field->get_label_number();
i++) {
287 if (
'B' ==
name[0]) {
293 }
else if (
'F' ==
name[2]) {
301 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationName' field ");
308 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationEta' field ");
315 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'stationPhi' field ");
323 for (
size_t i = 0;
i <
field->get_label_number(); ++
i) {
333 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'technology' field ");
359 unsigned int nids = 0;
360 std::set<Identifier>
ids;
364 for (
const auto & expId:rit) {
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;
410 for (
const auto & expId:rit) {
413 if (!(
ids.insert(
id)).second) {
415 <<
" Error: duplicated id for channel id. nid " << nids <<
" compact id " <<
id <<
" id ");
429 std::set<Identifier>::const_iterator
first =
ids.begin();
430 std::set<Identifier>::const_iterator last =
ids.end();
451 unsigned int nids = 0;
452 std::set<Identifier>
ids;
456 for (
const auto & expId:rit) {
460 if (!(
ids.insert(
id)).second) {
462 <<
" Error: duplicated id for channel id. nid " << nids <<
" compact id " <<
id <<
" id ");
471 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size() <<
" hash max " <<
m_channel_hash_max);
537 for (
const auto &
id: rit) {
554 if (
get_hash(compact_id, hash_id, &wcontext)) {
555 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get hash, exp/compact "
556 <<
" " << std::hex << compact_id << std::dec <<
endmsg);
560 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get compact, exp/compact ");
565 unsigned short index = hash_id;
577 if (
get_hash(compact_id, hash_id, &wcontext)) {
578 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous phi hash, exp/compact "
579 <<
" " << std::hex << compact_id << std::dec);
583 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous phi compact, exp/compact ");
595 if (
get_hash(compact_id, hash_id, &wcontext)) {
596 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next phi hash, exp/compact "
597 <<
" " << std::hex << compact_id << std::dec);
601 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next phi compact, exp/compact ");
613 if (
get_hash(compact_id, hash_id, &wcontext)) {
614 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous eta hash, exp/compact "
615 <<
" " << std::hex << compact_id << std::dec);
619 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get previous eta compact, exp/compact ");
631 if (
get_hash(compact_id, hash_id, &wcontext)) {
632 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next eta hash, exp/compact "
633 <<
" " << std::hex << compact_id << std::dec);
637 ATH_MSG_ERROR(
" MuonIdHelper::init_neighbors - unable to get next eta compact, exp/compact ");
658 ATH_MSG_ERROR(
"test_module_packing: Unable to get expanded id. Compact id " << compact);
663 ATH_MSG_ERROR(
"test_module_packing: Unable to get compact id. Expanded id " << std::string(
id));
666 if (compact != new_compact) {
667 ATH_MSG_ERROR(
"test_module_packing: new and old compacts not equal "
668 <<
"New/old/expanded ids " << new_compact <<
" " << compact <<
" " << std::string(
id));
673 ATH_MSG_INFO(
"test_module_packing: Successful tested " << nids <<
" ids. ");
675 ATH_MSG_ERROR(
"Unable to test module is packing - no dictionary has been defined. ");
683 ATH_MSG_ERROR(
"Unable to get expanded id. Compact id " << compact);
691 if (compact != new_compact) {
692 ATH_MSG_ERROR(
"new and old compacts not equal. New/old/expanded ids " << new_compact <<
" " << compact <<
" "
714 if (
'I' ==
name[1] ||
'4' ==
name[1])
return 0;
715 if (
'E' ==
name[1] ||
'1' ==
name[1])
return 1;
716 if (
'M' ==
name[1] ||
'2' ==
name[1])
return 2;
717 if (
'O' ==
name[1] ||
'3' ==
name[1])
return 3;
718 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
bool validStation(int stationName, int technology) const
int stationNameIndex(const std::string &name) const
IdContext detectorElement_context() const
id for detector element
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
const MultiRange & multiRange() const
multirange
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 end_index() const
size_type m_channel_hash_max
std::map< std::string, int > m_technologyNameToIdxMap
Mapping string -> int.
bool is_mm(Identifier id) const
value_type get_compact() const
Get the compact id.
bool is_csc(const Identifier &id) 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
std::map< int, std::string > m_stationIdxToNameMap
Mapping int -> string.
bool is_stgc(const Identifier &id) const
size_type begin_index() 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
bool get_next(element_type current, element_type &next) 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
virtual int get_channel_hash(const Identifier &id, IdentifierHash &hash_id) const
const ExpandedIdentifier & prefix_id() const
Accessors.
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.
size_type m_TECHNOLOGY_INDEX
bool is_muon(Identifier id) const
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
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
size_type m_DETECTORELEMENT_INDEX
bool get_previous(element_type current, element_type &previous) const
Returns false if previous/next is at end of range, or not possible.
std::vector< Identifier >::const_iterator const_id_iterator
IdDictFieldImplementation m_tec_impl
unsigned long long value_type
int get_next_in_eta(const IdentifierHash &id, IdentifierHash &next) const
bool is_stgc(Identifier id) const
int init_channel_hashes()
const std::vector< Identifier > & idVector() const
the id's
static constexpr int NOT_VALID_HASH
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.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
std::set< int > m_isForward
int get_compact_id(const ExpandedIdentifier &id, Identifier &compact_id, const IdContext *context) const
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
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...
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