|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
   19 #include "GaudiKernel/MsgStream.h" 
   31     , m_tile_region_index(0)
 
   33     , m_SECTION_INDEX(999)
 
   36     , m_CHANNEL_INDEX(999)
 
   39     , m_module_hash_max(0)
 
   40     , m_channel_hash_max(0)
 
   59     return "TileTBID::to_string - unknown context";
 
   64     return "TileTBID::to_string - can not expand ID";
 
   66     return (std::string)(exp_id);
 
  121         std::string errorMessage = 
"TileTBID::type_id() result is not OK: ID, range = " 
  151         std::string errorMessage = 
"TileTBID::module_id() result is not OK: ID, range = " 
  184         std::string errorMessage = 
"TileTBID::channel_id() result is not OK: ID, range = " 
  228         std::string errorMessage = 
"TileTBID::channel_id(module_id,channel) result is not OK: ID = " 
  238         std::string errorMessage = 
"TileTBID::channel_id() result is not OK: ID, range = " 
  339     log << MSG::ERROR << 
"get_id: channel hash_id is out of range " << hash_id
 
  348     log << MSG::ERROR << 
"get_id: module hash_id is out of range " 
  357     log << MSG::ERROR << 
"get_id: TYPE hash_id is out of range " << hash_id
 
  407     log << 
MSG::DEBUG << 
"Request to reinitialize not satisfied - tags have not changed" << 
endmsg;
 
  424     log << MSG::ERROR << 
"cannot access TileCalorimeter dictionary " << 
endmsg;
 
  435   if (atlasDict->
get_label_value(
"subdet", 
"TileCalorimeter", tileField)) {
 
  436     log << MSG::ERROR << 
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "  
  443   int tiletbField   = -1;
 
  445     log << MSG::ERROR << 
"Could not get value for label 'Testbeam' of field 'section' in dictionary "  
  459   reg_id.
add(tileField);
 
  460   reg_id.
add(tiletbField);
 
  492   else if ( 0 == 
begin) {
 
  507     log << MSG::ERROR << 
"initLevelsFromDict - dictionary NOT initialized " 
  523     log << MSG::ERROR << 
"initLevelsFromDict - unable to find tile region index: expId, reg "   
  535     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'subdet' field " 
  545     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'section' field " 
  555     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'type' field " 
  565     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'tbmodule' field " 
  575     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'tbchannel' field " 
  594     log << 
MSG::DEBUG << 
"initLevelsFromDict decode index and bit fields for each level: "              << 
endmsg ;
 
  610   unsigned int nids = 0;
 
  611   std::set<Identifier> 
ids;
 
  616     auto last  = rit.
end();
 
  620       if(!(
ids.insert(
id)).second){
 
  621     log << MSG::ERROR << 
"init_hashes " 
  622             << 
" Error: duplicated id for type id. nids= " << nids
 
  639     auto last  = rit.
end();
 
  644       if(!(
ids.insert(
id)).second){
 
  645     log << MSG::ERROR << 
"init_hashes " 
  646             << 
" Error: duplicated id for module id. nids= " << nids
 
  663     auto last  = rit.
end();
 
  669       if(!(
ids.insert(
id)).second){
 
  670     log << MSG::ERROR << 
"init_hashes " 
  671             << 
" Error: duplicated id for channel id. nids= " << nids
 
  685                          unsigned int hash_max, std::vector<Identifier> & 
vec)
 
  688   if(
ids.size() != hash_max) {
 
  691     log << MSG::ERROR << 
"fill_vec " 
  692         << 
" Error: set size NOT EQUAL to hash max. size " << 
ids.size()
 
  693         << 
" hash max " << hash_max
 
  699   vec.resize(hash_max);
 
  701   std::set<Identifier>::const_iterator 
first = 
ids.begin();
 
  702   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,...
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
IdContext type_context() const
access to IdContext's which define which levels of fields are contained in the id
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
IdContext channel_context() const
idContext for channels
std::string show_to_string(void) const
const IdDictRegion & region(size_t i) const
Region at index i.
Identifier tiletb_id() const
identifer for all Tile testbeam detectors
IdDictFieldImplementation m_system_impl
IdDictFieldImplementation m_section_impl
size_type end_index() const
void add(element_type value)
Append a value into a new field.
IdDictFieldImplementation m_channel_impl
size_type m_type_hash_max
void pack(int value, Identifier &id) const
IdContext module_context() const
idContext for modules
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.
const std::string & name() const
Dictionary name.
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
const IdDictFieldImplementation & implementation(size_t i) const
size_type begin_index() 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
size_type m_channel_hash_max
int section(const Identifier &id) const
extract section field from TileTB identifier
Identifier m_base_tile_type
Identifier::size_type size_type
Exception class for Tile Identifiers.
bool is_tile(Identifier id) const
const std::string & group() const
Group name for this helper.
ConstRangeIterator begin() const
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
int unpack(const std::string &group, const Identifier &id, const ExpandedIdentifier &prefix, size_t index2, ExpandedIdentifier &unpackedId) const
Unpack the value_type id to an expanded Identifier for a given group, considering the provided prefix...
const ExpandedIdentifier & prefix_id() const
Accessors.
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
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
TileTBID()
Default constructor.
size_type m_module_hash_max
ConstRangeIterator end() const
size_type cardinality() const
Computes a possible cardinality from all ranges.
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
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.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
std::vector< Identifier > m_type_vec
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
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)
IdDictFieldImplementation m_module_impl