 |
ATLAS Offline Software
|
Go to the documentation of this file.
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 = "
507 ATH_MSG_ERROR(
"get_id: hwadc hash_id out of range " << hash_id
523 ATH_MSG_ERROR(
"get_id: drawer hash_id is out of range " << hash_id
531 ATH_MSG_ERROR(
"get_id: ROS hash_id is out of range " << hash_id
542 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
557 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
575 std::vector<HWIdentifier>::const_iterator
it = std::lower_bound(
m_ros_vec.begin(),
m_ros_vec.end(),
id);
603 ATH_MSG_DEBUG(
"Request to reinitialize not satisfied - tags have not changed");
631 if (atlasDict->
get_label_value(
"subdet",
"TileCalorimeter", tileField)) {
632 ATH_MSG_ERROR(
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "
633 << atlasDict->
name());
638 int tilehwField = -1;
640 ATH_MSG_ERROR(
"Could not get value for label 'Online' of field 'section' in dictionary "
647 reg_id.
add(tileField);
648 reg_id.
add(tilehwField);
680 else if ( 0 ==
begin) {
693 ATH_MSG_ERROR(
"initLevelsFromDict - dictionary NOT initialized ");
709 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find tile region index: expId, reg "
720 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field ");
729 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'section' field ");
738 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'ros' field ");
747 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'drawer' field ");
756 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'channel' field ");
765 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'gain' field ");
783 ATH_MSG_DEBUG(
"initLevelsFromDict decode index and bit fields for each level: " );
797 unsigned int nids = 0;
798 std::set<HWIdentifier>
ids;
802 for (
const auto & exp_id : rit) {
804 if(!(
ids.insert(
id)).second){
806 <<
" Error: duplicated id for ros id. nids= " << nids
821 for (
const auto & exp_id:rit) {
824 if(!(
ids.insert(
id)).second){
826 <<
" Error: duplicated id for drawer id. nids= " << nids
841 for (
const auto & exp_id:rit) {
845 if(!(
ids.insert(
id)).second){
847 <<
" Error: duplicated id for channel id. nids= " << nids
862 for (
const auto & exp_id : rit) {
867 if(!(
ids.insert(
id)).second){
869 <<
" Error: duplicated id for adc id. nids= " << nids
891 unsigned int hash_max, std::vector<HWIdentifier> &
vec)
894 if(
ids.size() != hash_max) {
897 <<
" Error: set size NOT EQUAL to hash max. size " <<
ids.size()
898 <<
" hash max " << hash_max);
903 vec.resize(hash_max);
905 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
906 std::set<HWIdentifier>::const_iterator last =
ids.end();
HWIdentifier ros_id(int ros) const
ROS HWIdentifer.
MultiRange build_multirange() const
Get MultiRange for full dictionary.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
IdContext adc_context() const
idContext for ADCs
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
const IdDictRegion & region(size_t i) const
Region at index i.
std::vector< HWIdentifier > m_ros_vec
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.
const IdDictField * find_field(const std::string &name) const
void pack(int value, Identifier &id) const
IdDictFieldImplementation m_channel_impl
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
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
const std::string & name() const
Dictionary name.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
initialization from the identifier dictionary
TileHWID()
Default constructor.
ExpandedIdentifier tile_exp(void) 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
const IdDictRegion * find_region(const std::string ®ion_name) const
IdDictFieldImplementation m_adc_impl
const IdDictFieldImplementation & implementation(size_t i) const
int adc(const HWIdentifier &id) const
extract adc field from HW identifier
size_type begin_index() const
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
IdContext ros_context() const
access to IdContext's which define which levels of fields are contained in the id
IdContext channel_context() const
idContext for channels
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
const std::string & group() const
Group name for this helper.
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
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...
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 drawer_context() const
idContext for drawers
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.
HWIdentifier tilehw_id() const
online identifer for whole Tile
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
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
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...
size_type m_drawer_hash_max
IdDictFieldImplementation m_drawer_impl
This class provides an interface to generate or decode an identifier for the upper levels of the dete...