Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
18 #include "GaudiKernel/MsgStream.h"
29 : m_tile_region_index(0)
31 , m_SECTION_INDEX(999)
34 , m_CHANNEL_INDEX(999)
37 , m_module_hash_max(0)
38 , m_channel_hash_max(0)
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 = "
338 log << MSG::ERROR <<
"get_id: channel hash_id is out of range " << hash_id
347 log << MSG::ERROR <<
"get_id: module hash_id is out of range "
356 log << MSG::ERROR <<
"get_id: TYPE hash_id is out of range " << hash_id
402 log << MSG::INFO <<
"initialize_from_dictionary " <<
endmsg;
406 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
423 log << MSG::ERROR <<
"cannot access TileCalorimeter dictionary " <<
endmsg;
434 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
435 log << MSG::ERROR <<
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
442 int tiletbField = -1;
444 log << MSG::ERROR <<
"Could not get value for label 'Testbeam' of field 'section' in dictionary "
458 reg_id.
add(tileField);
459 reg_id.
add(tiletbField);
491 else if ( 0 ==
begin) {
506 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
522 log << MSG::ERROR <<
"initLevelsFromDict - unable to find tile region index: expId, reg "
534 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
544 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'section' field "
554 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'type' field "
564 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'tbmodule' field "
574 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'tbchannel' field "
593 log <<
MSG::DEBUG <<
"initLevelsFromDict decode index and bit fields for each level: " <<
endmsg ;
609 unsigned int nids = 0;
610 std::set<Identifier>
ids;
615 auto last = rit.
end();
619 if(!(
ids.insert(
id)).second){
620 log << MSG::ERROR <<
"init_hashes "
621 <<
" Error: duplicated id for type id. nids= " << nids
638 auto last = rit.
end();
643 if(!(
ids.insert(
id)).second){
644 log << MSG::ERROR <<
"init_hashes "
645 <<
" Error: duplicated id for module id. nids= " << nids
662 auto last = rit.
end();
668 if(!(
ids.insert(
id)).second){
669 log << MSG::ERROR <<
"init_hashes "
670 <<
" Error: duplicated id for channel id. nids= " << nids
684 unsigned int hash_max, std::vector<Identifier> &
vec)
687 if(
ids.size() != hash_max) {
690 log << MSG::ERROR <<
"fill_vec "
691 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
692 <<
" hash max " << hash_max
698 vec.resize(hash_max);
700 std::set<Identifier>::const_iterator
first =
ids.begin();
701 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
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
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
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
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)
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
const ExpandedIdentifier & prefix_id() const
Accessors.
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
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< 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