![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "GaudiKernel/MsgStream.h"
28 : m_tile_region_index(0)
30 , m_SECTION_INDEX(999)
33 , m_CHANNEL_INDEX(999)
36 , m_module_hash_max(0)
37 , m_channel_hash_max(0)
57 return "TileTBID::to_string - unknown context";
62 return "TileTBID::to_string - can not expand ID";
64 return (std::string)(exp_id);
119 std::string errorMessage =
"TileTBID::type_id() result is not OK: ID, range = "
149 std::string errorMessage =
"TileTBID::module_id() result is not OK: ID, range = "
182 std::string errorMessage =
"TileTBID::channel_id() result is not OK: ID, range = "
226 std::string errorMessage =
"TileTBID::channel_id(module_id,channel) result is not OK: ID = "
236 std::string errorMessage =
"TileTBID::channel_id() result is not OK: ID, range = "
337 log << MSG::ERROR <<
"get_id: channel hash_id is out of range " << hash_id
346 log << MSG::ERROR <<
"get_id: module hash_id is out of range "
355 log << MSG::ERROR <<
"get_id: TYPE hash_id is out of range " << hash_id
401 log << MSG::INFO <<
"initialize_from_dictionary " <<
endmsg;
405 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
422 log << MSG::ERROR <<
"cannot access TileCalorimeter dictionary " <<
endmsg;
433 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
434 log << MSG::ERROR <<
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
441 int tiletbField = -1;
443 log << MSG::ERROR <<
"Could not get value for label 'Testbeam' of field 'section' in dictionary "
457 reg_id.
add(tileField);
458 reg_id.
add(tiletbField);
490 else if ( 0 ==
begin) {
505 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
521 log << MSG::ERROR <<
"initLevelsFromDict - unable to find tile region index: expId, reg "
533 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
543 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'section' field "
553 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'type' field "
563 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'tbmodule' field "
573 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'tbchannel' field "
592 log <<
MSG::DEBUG <<
"initLevelsFromDict decode index and bit fields for each level: " <<
endmsg ;
608 unsigned int nids = 0;
609 std::set<Identifier>
ids;
617 if(!(
ids.insert(
id)).second){
618 log << MSG::ERROR <<
"init_hashes "
619 <<
" Error: duplicated id for type id. nids= " << nids
640 if(!(
ids.insert(
id)).second){
641 log << MSG::ERROR <<
"init_hashes "
642 <<
" Error: duplicated id for module id. nids= " << nids
664 if(!(
ids.insert(
id)).second){
665 log << MSG::ERROR <<
"init_hashes "
666 <<
" Error: duplicated id for channel id. nids= " << nids
680 unsigned int hash_max, std::vector<Identifier> &
vec)
683 if(
ids.size() != hash_max) {
686 log << MSG::ERROR <<
"fill_vec "
687 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
688 <<
" hash max " << hash_max
694 vec.resize(hash_max);
696 std::set<Identifier>::const_iterator
first =
ids.begin();
697 std::set<Identifier>::const_iterator last =
ids.end();
std::vector< Identifier > m_module_vec
IdDictRegion * find_region(const std::string ®ion_name) const
Identifier channel_id(int type, int module, int channel) const
identifer for one channel of a Tile testbeam detector
MultiRange build_multirange() const
Get MultiRange for full dictionary.
size_type m_SECTION_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,...
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.
Identifier module_id(int type, int module) const
identifer for one module of a Tile testbeam detector
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
bool is_tiletb(const Identifier &id) const
Test ID if it is TileTBID.
Identifier type_id(int type) const
identifer for Tile testbeam detectors of a give type
TileTBID(void)
Default constructor.
std::string show_to_string(void) const
IdDictFieldImplementation m_system_impl
IdDictFieldImplementation m_section_impl
void add(element_type value)
IdDictFieldImplementation m_channel_impl
size_type m_type_hash_max
void pack(int value, Identifier &id) const
size_type end_index(void) const
IMessageSvc * m_msgSvc
pointer to the message service
const IdDictDictionary * m_dict
std::vector< size_t > vec
int fill_vec(std::set< Identifier > &ids, unsigned int hash_max, std::vector< Identifier > &vec)
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
int type(const Identifier &id) const
extract type field from TileTB identifier
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,...
ExpandedIdentifier tile_exp(void) const
IdDictField * find_field(const std::string &name) const
int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
int module(const Identifier &id) const
extract module field from TileTB identifier
int get_field(const Identifier &id, size_type index) const
unpack one field from Identifier
void reset(Identifier &id) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
virtual ~TileTBID()
Default destructor.
MultiRange m_full_module_range
size_type m_CHANNEL_INDEX
IdContext channel_context(void) const
idContext for channels
size_type m_channel_hash_max
int section(const Identifier &id) const
extract section field from TileTB identifier
std::vector< IdDictRegion * > m_regions
Identifier m_base_tile_type
Identifier::size_type size_type
Exception class for Tile Identifiers.
IdContext type_context(void) const
access to IdContext's which define which levels of fields are contained in the id
bool is_tile(Identifier id) const
int initLevelsFromDict(void)
MultiRange m_full_channel_range
bool m_quiet
If true, suppress DEBUG/INFO messages.
int channel(const Identifier &id) const
extract channel field from TileTB identifier
int register_dict_tag(const IdDictMgr &dict_mgr, const std::string &dict_name)
Register the file and tag names for a particular IdDict dictionary.
int tile_field_value() const
int get_label_value(const std::string &field, const std::string &label, int &value) const
size_type begin_index(void) const
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
IdContext module_context(void) const
idContext for modules
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)
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
size_type m_tile_region_index
IdDictFieldImplementation m_type_impl
int match(const ExpandedIdentifier &id) const
Match an identifier.
std::string getString() const
Provide a string form of the identifier - hexadecimal.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
MultiRange m_full_type_range
size_type m_module_hash_max
const ExpandedIdentifier & prefix_id(void) const
size_type cardinality() const
Computes a possible cardinality from all ranges.
std::vector< Identifier > m_channel_vec
virtual bool do_checks(void) const override
Checks are performed by default in debug compilation and NOT in optimized compilation.
std::vector< IdDictFieldImplementation > m_implementation
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(void) const
identifer for all Tile testbeam detectors
IdDictFieldImplementation m_module_impl