Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
17 #include "GaudiKernel/MsgStream.h"
27 : m_tile_region_index(0)
29 , m_SECTION_INDEX(999)
32 , m_CHANNEL_INDEX(999)
36 , m_drawer_hash_max(0)
37 , m_channel_hash_max(0)
60 return "TileHWID::to_string - unknown context";
65 return "TileHWID::to_string - can not expand ID";
67 return (std::string)(exp_id);
146 std::string errorMessage =
"TileHWID::ros_id() result is not OK: ID, range = "
175 std::string errorMessage =
"TileHWID::drawer_id() result is not OK: ID, range = "
217 std::string errorMessage =
"TileHWID::channel_id() result is not OK: ID, range = "
248 std::string errorMessage =
"TileHWID::adc_id() result is not OK: ID, range = "
295 std::string errorMessage =
"TileHWID::channel_id(drawer_id,channel) result is not OK: ID = "
306 std::string errorMessage =
"TileHWID::channel_id() result is not OK: ID, range = "
335 std::string errorMessage =
"TileHWID::adc_id(channel_id,adc) result is not OK: ID = "
346 std::string errorMessage =
"TileHWID::adc_id() result is not OK: ID, range = "
376 std::string errorMessage =
"TileHWID::adc_id(drawer_id,channel,adc) result is not OK: ID = "
387 std::string errorMessage =
"TileHWID::adc_id() result is not OK: ID, range = "
508 log << MSG::ERROR <<
"get_id: hwadc hash_id out of range " << hash_id
517 log << MSG::ERROR <<
"get_id: channel hash_id is out of range "
526 log << MSG::ERROR <<
"get_id: drawer hash_id is out of range " << hash_id
535 log << MSG::ERROR <<
"get_id: ROS hash_id is out of range " << hash_id
546 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
561 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
579 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_ros_vec.begin(),
m_ros_vec.end(),
id);
604 log << MSG::INFO <<
"initialize_from_dictionary " <<
endmsg;
608 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
625 log << MSG::ERROR <<
"cannot access TileCalorimeter dictionary" <<
endmsg;
636 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
637 log << MSG::ERROR <<
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
644 int tilehwField = -1;
646 log << MSG::ERROR <<
"Could not get value for label 'Online' of field 'section' in dictionary "
660 reg_id.
add(tileField);
661 reg_id.
add(tilehwField);
693 else if ( 0 ==
begin) {
708 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
725 log << MSG::ERROR <<
"initLevelsFromDict - unable to find tile region index: expId, reg "
737 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
747 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'section' field "
757 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'ros' field "
767 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'drawer' field "
777 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'channel' field "
787 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'gain' field "
806 log <<
MSG::DEBUG <<
"initLevelsFromDict decode index and bit fields for each level: " <<
endmsg ;
822 unsigned int nids = 0;
823 std::set<HWIdentifier>
ids;
827 for (
const auto & exp_id : rit) {
829 if(!(
ids.insert(
id)).second){
830 log << MSG::ERROR <<
"init_hashes "
831 <<
" Error: duplicated id for ros id. nids= " << nids
847 for (
const auto & exp_id:rit) {
850 if(!(
ids.insert(
id)).second){
851 log << MSG::ERROR <<
"init_hashes "
852 <<
" Error: duplicated id for drawer id. nids= " << nids
868 for (
const auto & exp_id:rit) {
872 if(!(
ids.insert(
id)).second){
873 log << MSG::ERROR <<
"init_hashes "
874 <<
" Error: duplicated id for channel id. nids= " << nids
890 for (
const auto & exp_id : rit) {
895 if(!(
ids.insert(
id)).second){
896 log << MSG::ERROR <<
"init_hashes "
897 <<
" Error: duplicated id for adc id. nids= " << nids
920 unsigned int hash_max, std::vector<HWIdentifier> &
vec)
923 if(
ids.size() != hash_max) {
926 log << MSG::ERROR <<
"fill_vec "
927 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
928 <<
" hash max " << hash_max
934 vec.resize(hash_max);
936 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
937 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
size_type end_index() const
void add(element_type value)
Append a value into a new field.
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
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
size_type begin_index() const
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
MultiRange m_full_channel_range
const ExpandedIdentifier & prefix_id() const
Accessors.
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.
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,...
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
std::vector< HWIdentifier > m_drawer_vec
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
std::vector< IdDictFieldImplementation > m_implementation
size_type m_drawer_hash_max
IdDictFieldImplementation m_drawer_impl