![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "GaudiKernel/MsgStream.h"
26 : m_tile_region_index(0)
28 , m_SECTION_INDEX(999)
31 , m_CHANNEL_INDEX(999)
35 , m_drawer_hash_max(0)
36 , m_channel_hash_max(0)
59 return "TileHWID::to_string - unknown context";
64 return "TileHWID::to_string - can not expand ID";
66 return (std::string)(exp_id);
145 std::string errorMessage =
"TileHWID::ros_id() result is not OK: ID, range = "
174 std::string errorMessage =
"TileHWID::drawer_id() result is not OK: ID, range = "
216 std::string errorMessage =
"TileHWID::channel_id() result is not OK: ID, range = "
247 std::string errorMessage =
"TileHWID::adc_id() result is not OK: ID, range = "
294 std::string errorMessage =
"TileHWID::channel_id(drawer_id,channel) result is not OK: ID = "
305 std::string errorMessage =
"TileHWID::channel_id() result is not OK: ID, range = "
334 std::string errorMessage =
"TileHWID::adc_id(channel_id,adc) result is not OK: ID = "
345 std::string errorMessage =
"TileHWID::adc_id() result is not OK: ID, range = "
375 std::string errorMessage =
"TileHWID::adc_id(drawer_id,channel,adc) result is not OK: ID = "
386 std::string errorMessage =
"TileHWID::adc_id() result is not OK: ID, range = "
507 log << MSG::ERROR <<
"get_id: hwadc hash_id out of range " << hash_id
516 log << MSG::ERROR <<
"get_id: channel hash_id is out of range "
525 log << MSG::ERROR <<
"get_id: drawer hash_id is out of range " << hash_id
534 log << MSG::ERROR <<
"get_id: ROS hash_id is out of range " << hash_id
545 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
560 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
578 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_ros_vec.begin(),
m_ros_vec.end(),
id);
603 log << MSG::INFO <<
"initialize_from_dictionary " <<
endmsg;
607 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
624 log << MSG::ERROR <<
"cannot access TileCalorimeter dictionary" <<
endmsg;
635 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
636 log << MSG::ERROR <<
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
643 int tilehwField = -1;
645 log << MSG::ERROR <<
"Could not get value for label 'Online' of field 'section' in dictionary "
659 reg_id.
add(tileField);
660 reg_id.
add(tilehwField);
692 else if ( 0 ==
begin) {
707 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
724 log << MSG::ERROR <<
"initLevelsFromDict - unable to find tile region index: expId, reg "
736 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
746 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'section' field "
756 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'ros' field "
766 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'drawer' field "
776 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'channel' field "
786 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'gain' field "
805 log <<
MSG::DEBUG <<
"initLevelsFromDict decode index and bit fields for each level: " <<
endmsg ;
821 unsigned int nids = 0;
822 std::set<HWIdentifier>
ids;
830 if(!(
ids.insert(
id)).second){
831 log << MSG::ERROR <<
"init_hashes "
832 <<
" Error: duplicated id for ros id. nids= " << nids
853 if(!(
ids.insert(
id)).second){
854 log << MSG::ERROR <<
"init_hashes "
855 <<
" Error: duplicated id for drawer id. nids= " << nids
877 if(!(
ids.insert(
id)).second){
878 log << MSG::ERROR <<
"init_hashes "
879 <<
" Error: duplicated id for channel id. nids= " << nids
902 if(!(
ids.insert(
id)).second){
903 log << MSG::ERROR <<
"init_hashes "
904 <<
" Error: duplicated id for adc id. nids= " << nids
927 unsigned int hash_max, std::vector<HWIdentifier> &
vec)
930 if(
ids.size() != hash_max) {
933 log << MSG::ERROR <<
"fill_vec "
934 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
935 <<
" hash max " << hash_max
941 vec.resize(hash_max);
943 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
944 std::set<HWIdentifier>::const_iterator last =
ids.end();
IdDictRegion * find_region(const std::string ®ion_name) const
HWIdentifier ros_id(int ros) const
ROS HWIdentifer.
MultiRange build_multirange() const
Get MultiRange for full dictionary.
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.
virtual int get_id(const IdentifierHash &hash_id, HWIdentifier &id, const IdContext *context=0) const
create compact HW ID from hash id (return == 0 for OK)
int fill_vec(std::set< HWIdentifier > &ids, unsigned int hash_max, std::vector< HWIdentifier > &vec)
std::string show_to_string(void) const
bool is_low_gain(const HWIdentifier &id) const
Test ID for low gain.
IdDictFieldImplementation m_section_impl
std::vector< HWIdentifier > m_ros_vec
IdContext channel_context(void) const
idContext for channels
void add(element_type value)
bool is_tilehw(const HWIdentifier &id) const
Test ID for Tile online ID.
TileHWID(void)
Default constructor.
void pack(int value, Identifier &id) const
IdDictFieldImplementation m_channel_impl
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
size_type end_index(void) const
IMessageSvc * m_msgSvc
pointer to the message service
HWIdentifier tilehw_id(void) const
online identifer for whole Tile
std::vector< size_t > vec
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
size_type m_SECTION_INDEX
IdContext drawer_context(void) const
idContext for drawers
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
ExpandedIdentifier tile_exp(void) const
IdDictField * find_field(const std::string &name) const
int channel(const HWIdentifier &id) const
extract channel field from HW identifier
IdDictFieldImplementation m_ros_impl
int ros(const HWIdentifier &id) const
extract ros field from HW identifier
void reset(Identifier &id) const
std::vector< HWIdentifier > m_adc_vec
Identifier::size_type size_type
IdDictFieldImplementation m_adc_impl
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
int section(const HWIdentifier &id) const
extract section field from HW identifier
size_type m_channel_hash_max
virtual IdentifierHash get_hash(const HWIdentifier &id) const
create hash id from compact ADC id without error checking
std::vector< IdDictRegion * > m_regions
virtual IdentifierHash get_channel_hash(const HWIdentifier &id) const
create hash id from compact Channel id
Exception class for Tile Identifiers.
bool is_tile(Identifier id) const
size_type m_CHANNEL_INDEX
size_type m_tile_region_index
HWIdentifier m_base_tile_ros
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 ~TileHWID()
Default destructor.
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
MultiRange m_full_channel_range
HWIdentifier drawer_id(int frag) const
ROS HWIdentifer.
int get_field(const HWIdentifier &id, size_type index) const
unpack one field from Identifier
HWIdentifier channel_id(int ros, int drawer, int channel) const
channel HWIdentifer
MultiRange m_full_ros_range
MultiRange m_full_drawer_range
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
IdContext ros_context(void) const
access to IdContext's which define which levels of fields are contained in the id
IdContext adc_context(void) const
idContext for ADCs
HWIdentifier adc_id(int ros, int drawer, int channel, int adc) const
adc HWIdentifer
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.
int drawer(const HWIdentifier &id) const
extract drawer field from HW identifier
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
int initLevelsFromDict(void)
IdDictFieldImplementation m_system_impl
const IdDictDictionary * m_dict
std::vector< HWIdentifier > m_channel_vec
int get_expanded_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
bool is_high_gain(const HWIdentifier &id) const
Test ID for high gain.
const ExpandedIdentifier & prefix_id(void) const
MultiRange m_full_adc_range
size_type cardinality() const
Computes a possible cardinality from all ranges.
std::string to_string(const HWIdentifier &id, int level=0) const
extract all fields from HW identifier HWIdentifier get_all_fields ( const HWIdentifier & id,...
std::vector< HWIdentifier > m_drawer_vec
std::vector< IdDictFieldImplementation > m_implementation
size_type m_drawer_hash_max
IdDictFieldImplementation m_drawer_impl