 |
ATLAS Offline Software
|
Go to the documentation of this file.
16 #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)
56 return "TileTBID::to_string - unknown context";
61 return "TileTBID::to_string - can not expand ID";
63 return (std::string)(exp_id);
118 std::string errorMessage =
"TileTBID::type_id() result is not OK: ID, range = "
148 std::string errorMessage =
"TileTBID::module_id() result is not OK: ID, range = "
181 std::string errorMessage =
"TileTBID::channel_id() result is not OK: ID, range = "
225 std::string errorMessage =
"TileTBID::channel_id(module_id,channel) result is not OK: ID = "
235 std::string errorMessage =
"TileTBID::channel_id() result is not OK: ID, range = "
336 log << MSG::ERROR <<
"get_id: channel hash_id is out of range " << hash_id
345 log << MSG::ERROR <<
"get_id: module hash_id is out of range "
354 log << MSG::ERROR <<
"get_id: TYPE hash_id is out of range " << hash_id
404 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
421 log << MSG::ERROR <<
"cannot access TileCalorimeter dictionary " <<
endmsg;
432 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
433 log << MSG::ERROR <<
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
440 int tiletbField = -1;
442 log << MSG::ERROR <<
"Could not get value for label 'Testbeam' of field 'section' in dictionary "
456 reg_id.
add(tileField);
457 reg_id.
add(tiletbField);
489 else if ( 0 ==
begin) {
504 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
520 log << MSG::ERROR <<
"initLevelsFromDict - unable to find tile region index: expId, reg "
532 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
542 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'section' field "
552 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'type' field "
562 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'tbmodule' field "
572 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'tbchannel' field "
591 log <<
MSG::DEBUG <<
"initLevelsFromDict decode index and bit fields for each level: " <<
endmsg ;
607 unsigned int nids = 0;
608 std::set<Identifier>
ids;
613 auto last = rit.
end();
617 if(!(
ids.insert(
id)).second){
618 log << MSG::ERROR <<
"init_hashes "
619 <<
" Error: duplicated id for type id. nids= " << nids
636 auto last = rit.
end();
641 if(!(
ids.insert(
id)).second){
642 log << MSG::ERROR <<
"init_hashes "
643 <<
" Error: duplicated id for module id. nids= " << nids
660 auto last = rit.
end();
666 if(!(
ids.insert(
id)).second){
667 log << MSG::ERROR <<
"init_hashes "
668 <<
" Error: duplicated id for channel id. nids= " << nids
682 unsigned int hash_max, std::vector<Identifier> &
vec)
685 if(
ids.size() != hash_max) {
688 log << MSG::ERROR <<
"fill_vec "
689 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
690 <<
" hash max " << hash_max
696 vec.resize(hash_max);
698 std::set<Identifier>::const_iterator
first =
ids.begin();
699 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