|  | 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)
 
   38     , m_drawer_hash_max(0)
 
   39     , m_channel_hash_max(0)
 
   62     return "TileHWID::to_string - unknown context";
 
   67     return "TileHWID::to_string - can not expand ID";
 
   69     return (std::string)(exp_id);
 
  148         std::string errorMessage = 
"TileHWID::ros_id() result is not OK: ID, range = " 
  177         std::string errorMessage = 
"TileHWID::drawer_id() result is not OK: ID, range = " 
  219         std::string errorMessage = 
"TileHWID::channel_id() result is not OK: ID, range = " 
  250         std::string errorMessage = 
"TileHWID::adc_id() result is not OK: ID, range = " 
  297         std::string errorMessage = 
"TileHWID::channel_id(drawer_id,channel) result is not OK: ID = " 
  308         std::string errorMessage = 
"TileHWID::channel_id() result is not OK: ID, range = " 
  337         std::string errorMessage = 
"TileHWID::adc_id(channel_id,adc) result is not OK: ID = " 
  348         std::string errorMessage = 
"TileHWID::adc_id() result is not OK: ID, range = " 
  378         std::string errorMessage = 
"TileHWID::adc_id(drawer_id,channel,adc) result is not OK: ID = " 
  389         std::string errorMessage = 
"TileHWID::adc_id() result is not OK: ID, range = " 
  510     log << MSG::ERROR << 
"get_id: hwadc hash_id out of range " << hash_id
 
  519     log << MSG::ERROR << 
"get_id: channel hash_id is out of range " 
  528     log << MSG::ERROR << 
"get_id: drawer hash_id is out of range " << hash_id
 
  537     log << MSG::ERROR << 
"get_id: ROS hash_id is out of range " << hash_id
 
  548   std::vector<HWIdentifier>::const_iterator 
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
 
  563       std::vector<HWIdentifier>::const_iterator 
it = std::lower_bound(
m_adc_vec.begin(),
m_adc_vec.end(),
id);
 
  581       std::vector<HWIdentifier>::const_iterator 
it = std::lower_bound(
m_ros_vec.begin(),
m_ros_vec.end(),
id);
 
  610     log << 
MSG::DEBUG << 
"Request to reinitialize not satisfied - tags have not changed" << 
endmsg;
 
  627     log << MSG::ERROR << 
"cannot access TileCalorimeter dictionary" << 
endmsg;
 
  638   if (atlasDict->
get_label_value(
"subdet", 
"TileCalorimeter", tileField)) {
 
  639     log << MSG::ERROR << 
"Could not get value for label 'TileCalorimeter' of field 'subdet' in dictionary "  
  646   int tilehwField   = -1;
 
  648     log << MSG::ERROR << 
"Could not get value for label 'Online' of field 'section' in dictionary "  
  662   reg_id.
add(tileField);
 
  663   reg_id.
add(tilehwField);
 
  695   else if ( 0 == 
begin) {
 
  710     log << MSG::ERROR << 
"initLevelsFromDict - dictionary NOT initialized " 
  727     log << MSG::ERROR << 
"initLevelsFromDict - unable to find tile region index: expId, reg "   
  739     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'subdet' field " 
  749     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'section' field " 
  759     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'ros' field " 
  769     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'drawer' field " 
  779     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'channel' field " 
  789     log << MSG::ERROR <<  
"initLevelsFromDict - unable to find 'gain' field " 
  808   log << 
MSG::DEBUG << 
"initLevelsFromDict decode index and bit fields for each level: "              << 
endmsg ;
 
  824   unsigned int nids = 0;
 
  825   std::set<HWIdentifier> 
ids;
 
  829     for (
const auto & exp_id : rit) {
 
  831       if(!(
ids.insert(
id)).second){
 
  832     log << MSG::ERROR << 
"init_hashes " 
  833             << 
" Error: duplicated id for ros id. nids= " << nids
 
  849     for (
const auto & exp_id:rit) {
 
  852       if(!(
ids.insert(
id)).second){
 
  853     log << MSG::ERROR << 
"init_hashes " 
  854             << 
" Error: duplicated id for drawer id. nids= " << nids
 
  870     for (
const auto & exp_id:rit) {
 
  874       if(!(
ids.insert(
id)).second){
 
  875     log << MSG::ERROR << 
"init_hashes " 
  876             << 
" Error: duplicated id for channel id. nids= " << nids
 
  892     for (
const auto & exp_id : rit) {
 
  897       if(!(
ids.insert(
id)).second){
 
  898     log << MSG::ERROR << 
"init_hashes " 
  899             << 
" Error: duplicated id for adc id. nids= " << nids
 
  922                          unsigned int hash_max, std::vector<HWIdentifier> & 
vec)
 
  925   if(
ids.size() != hash_max) {
 
  928     log << MSG::ERROR << 
"fill_vec " 
  929         << 
" Error: set size NOT EQUAL to hash max. size " << 
ids.size()
 
  930         << 
" hash max " << hash_max
 
  936   vec.resize(hash_max);
 
  938   std::set<HWIdentifier>::const_iterator 
first = 
ids.begin();
 
  939   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.
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.
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
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
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
const IdDictFieldImplementation & implementation(size_t i) const
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
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
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...