58 return "TileTBID::to_string - unknown context";
63 return "TileTBID::to_string - can not expand ID";
65 return (std::string)(exp_id);
120 std::string errorMessage =
"TileTBID::type_id() result is not OK: ID, range = "
150 std::string errorMessage =
"TileTBID::module_id() result is not OK: ID, range = "
183 std::string errorMessage =
"TileTBID::channel_id() result is not OK: ID, range = "
227 std::string errorMessage =
"TileTBID::channel_id(module_id,channel) result is not OK: ID = "
237 std::string errorMessage =
"TileTBID::channel_id() result is not OK: ID, range = "
258 if (!
m_dict->pack32(
id,0,
id.fields() - 1,compactId)) {
276 if (!
m_dict->pack32(
id,0,
id.fields() - 1,compactId)) {
294 if (!
m_dict->pack32(
id,0,
id.fields() - 1,compactId)) {
326 size_t begin = (context) ? context->
begin_index(): 0;
328 size_t end = (context) ? context->
end_index() : 0;
337 ATH_MSG_ERROR(
"get_id: channel hash_id is out of range " << hash_id
353 ATH_MSG_ERROR(
"get_id: TYPE hash_id is out of range " << hash_id
368 size_t begin = (context) ? context->
begin_index(): 0;
369 size_t end = (context) ? context->
end_index() : 0;
385 std::vector<Identifier>::const_iterator it = std::lower_bound(
m_type_vec.begin(),
m_type_vec.end(),
id);
402 ATH_MSG_DEBUG(
"Request to reinitialize not satisfied - tags have not changed");
430 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
431 ATH_MSG_ERROR(
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
432 << atlasDict->
name());
437 int tiletbField = -1;
438 if (
m_dict->get_label_value(
"section",
"Testbeam", tiletbField)) {
439 ATH_MSG_ERROR(
"Could not get value for label 'Testbeam' of field 'section' in dictionary "
446 reg_id.
add(tileField);
447 reg_id.
add(tiletbField);
470 size_t begin = (context) ? context->
begin_index() : 0;
477 else if ( 0 == begin) {
490 ATH_MSG_ERROR(
"initLevelsFromDict - dictionary NOT initialized ");
505 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find tile region index: expId, reg "
516 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field ");
520 field =
m_dict->find_field(
"section") ;
525 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'section' field ");
529 field =
m_dict->find_field(
"type") ;
534 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'type' field ");
538 field =
m_dict->find_field(
"tbmodule") ;
543 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'tbmodule' field ");
547 field =
m_dict->find_field(
"tbchannel") ;
552 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'tbchannel' field ");
569 ATH_MSG_DEBUG(
"initLevelsFromDict decode index and bit fields for each level: " );
582 unsigned int nids = 0;
583 std::set<Identifier> ids;
587 auto first = rit.
begin();
588 auto last = rit.
end();
589 for (; first != last; ++first) {
592 if(!(ids.insert(
id)).second){
594 <<
" Error: duplicated id for type id. nids= " << nids
609 auto first = rit.
begin();
610 auto last = rit.
end();
611 for (; first != last; ++first) {
615 if(!(ids.insert(
id)).second){
617 <<
" Error: duplicated id for module id. nids= " << nids
632 auto first = rit.
begin();
633 auto last = rit.
end();
634 for (; first != last; ++first) {
639 if(!(ids.insert(
id)).second){
641 <<
" Error: duplicated id for channel id. nids= " << nids
654 unsigned int hash_max, std::vector<Identifier> &
vec)
657 if(ids.size() != hash_max) {
660 <<
" Error: set size NOT EQUAL to hash max. size " << ids.size()
661 <<
" hash max " << hash_max);
666 vec.resize(hash_max);
668 std::set<Identifier>::const_iterator first = ids.begin();
669 std::set<Identifier>::const_iterator last = ids.end();
672 for (;first != last; ++first) {
std::vector< size_t > vec
static const Attributes_t empty
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
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.
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
bool is_tile(Identifier id) const
ExpandedIdentifier tile_exp(void) const
int tile_field_value() const
const std::string & group() const
Group name for this helper.
AtlasDetectorID(const std::string &name, const std::string &group)
ConstRangeIterator end() const
ConstRangeIterator begin() 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...
size_type begin_index() const
size_type end_index() const
const ExpandedIdentifier & prefix_id() const
Accessors.
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
const IdDictFieldImplementation & implementation(size_t i) const
This is a "hash" representation of an Identifier.
std::string getString() const
Provide a string form of the identifier - hexadecimal.
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Exception class for Tile Identifiers.
virtual ~TileTBID()
Default destructor.
std::vector< Identifier > m_channel_vec
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
Identifier type_id(int type) const
identifer for Tile testbeam detectors of a give type
int fill_vec(std::set< Identifier > &ids, unsigned int hash_max, std::vector< Identifier > &vec)
size_type m_type_hash_max
size_type m_module_hash_max
std::vector< Identifier > m_module_vec
Identifier::size_type size_type
IdContext channel_context() const
idContext for channels
const IdDictDictionary * m_dict
IdDictFieldImplementation m_system_impl
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
IdDictFieldImplementation m_channel_impl
size_type m_tile_region_index
virtual int get_id(const IdentifierHash &hash_id, Identifier &id, const IdContext *context=0) const
create compact id from hash id (return == 0 for OK)
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
MultiRange m_full_type_range
Identifier m_base_tile_type
Identifier module_id(int type, int module) const
identifer for one module of a Tile testbeam detector
MultiRange m_full_module_range
TileTBID()
Default constructor.
int section(const Identifier &id) const
extract section field from TileTB identifier
size_type m_CHANNEL_INDEX
std::string to_string(const Identifier &id, int level=0) const
extract all fields from TileTB identifier Identifier get_all_fields ( const Identifier & id,...
size_type m_channel_hash_max
size_type m_SECTION_INDEX
MultiRange m_full_channel_range
IdDictFieldImplementation m_section_impl
int type(const Identifier &id) const
extract type field from TileTB identifier
IdDictFieldImplementation m_module_impl
Identifier channel_id(int type, int module, int channel) const
identifer for one channel of a Tile testbeam detector
IdContext type_context() const
access to IdContext's which define which levels of fields are contained in the id
int get_field(const Identifier &id, size_type index) const
unpack one field from Identifier
int channel(const Identifier &id) const
extract channel field from TileTB identifier
IdDictFieldImplementation m_type_impl
IdContext module_context() const
idContext for modules
std::vector< Identifier > m_type_vec
virtual int get_hash(const Identifier &id, IdentifierHash &hash_id, const IdContext *context=0) const
create hash id from compact id (return == 0 for OK)
Identifier tiletb_id() const
identifer for all Tile testbeam detectors
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs