|  | ATLAS Offline Software
    | 
 
 
 
Go to the documentation of this file.
   13 #include "GaudiKernel/MsgStream.h" 
   30   m_detzside_index(999),
 
   31   m_l1online_regions_index(999),
 
   34   m_submodule_index(999),
 
   39   m_submoduleHashMax(0),
 
   41   m_iDetZSideFieldValue(-1)
 
   81   std::string strg = 
"initialize_from_dictionary";
 
   86     std::cout << strg << std::endl;
 
  111       strg = 
" initialize_from_dictionary - cannot access Calorimeter dictionary";
 
  117       std::cout << 
"TTOnlineID::" << strg << std::endl;
 
  140     std::stringstream strm;
 
  141     strm << atlasDict->
name();
 
  142     strg= 
" Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
 
  147       std::cout << 
"TTOnlineID:" << strg << std::endl;
 
  158   bool oldTag = ( 
tag.empty() || 
tag == 
"CaloIdentifier-DC3-05" || 
tag == 
"CaloIdentifier-LVL1-01");
 
  165       std::stringstream strm;
 
  167       strg = 
"WARNING : Could not get value for label 'DetZside' in dictionary "+strm.str();
 
  172     std::cout << strg << std::endl;
 
  186   reg_id.
add(caloValue);
 
  195   log << 
MSG::DEBUG << 
"[initialize_from_dictionary] >  Crate range -> " 
  197   log << 
MSG::DEBUG << 
"[initialize_from_dictionary] >  Module range -> " 
  199   log << 
MSG::DEBUG << 
"[initialize_from_dictionary] >  SubModule range -> " 
  201   log << 
MSG::DEBUG << 
"[initialize_from_dictionary] >  Channel range -> " 
  217   MsgStream 
log(m_msgSvc, 
"TTOnlineID" );
 
  220   exp_id << calo_field_value();
 
  221   exp_id << detzside_field_value();
 
  222   if(context && context->end_index() >= m_crate_index) {
 
  224     if(context->end_index() >= m_module_index) {
 
  226       if(context->end_index() >= m_submodule_index) {
 
  227                 exp_id << submodule(
id);
 
  228                 if(context->end_index() >= m_channel_index)
 
  243   id << detzside_field_value() << crate << 
module << submodule << 
channel;
 
  244   if (!m_full_channel_range.match(
id)) {
 
  245     std::string errorMessage = 
"[TTOnlineID]::channnelId() result is not OK: ID, range = " 
  246       + std::string(
id) + 
" , " + (std::string)m_full_channel_range;
 
  259     if (get_expanded_id(submoduleId, expId, &context)) {
 
  260     std::string errorMessage = 
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID = " 
  261         + show_to_string(submoduleId) ;
 
  266     if (!m_full_channel_range.match(expId)) {
 
  267     std::string errorMessage = 
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = " 
  268         + std::string(expId) + 
" , " + (std::string)m_full_channel_range;
 
  281     if (get_expanded_id(moduleId, expId, &context)) {
 
  282     std::string errorMessage = 
"TTOnlineID::channel_Id_checks(moduleId) result is not OK: ID = " 
  283         + show_to_string(moduleId) ;
 
  288     if (!m_full_channel_range.match(expId)) {
 
  289     std::string errorMessage = 
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = " 
  290         + std::string(expId) + 
" , " + (std::string)m_full_channel_range;
 
  303     if (get_expanded_id(crateId, expId, &context)) {
 
  304     std::string errorMessage = 
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID = " 
  305         + show_to_string(crateId) ;
 
  310     if (!m_full_channel_range.match(expId)) {
 
  311     std::string errorMessage = 
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID, range = " 
  312         + std::string(expId) + 
" , " + (std::string)m_full_channel_range;
 
  324   expId << detzside_field_value() << crate <<  
module << submodule;
 
  326   if (!m_full_submodule_range.match(expId)) { std::string errorMessage = 
"TTOnlineID::submodule_Id_checks() result is not OK: ID, range = " 
  327       + std::string(expId) + 
" , " + (std::string)m_full_submodule_range;
 
  339   expId << detzside_field_value() << crate << 
module;
 
  341   if (!m_full_module_range.match(expId)) { std::string errorMessage = 
"TTOnlineID::module_Id_checks() result is not OK: ID, range = " 
  342       + std::string(expId) + 
" , " + (std::string)m_full_module_range;
 
  354   expId << detzside_field_value() << crate;
 
  356   if (!m_full_crate_range.match(expId)) { std::string errorMessage = 
"TTOnlineID::crate_Id_checks() result is not OK: ID, range = " 
  357       + std::string(expId) + 
" , " + (std::string)m_full_crate_range;
 
  371     log << 
MSG::INFO  << 
"TTOnlineID::initLevelsFromDict - dictionary NOT initialized " 
  387   log << 
MSG::DEBUG  << 
"[initLevelsFromDict] (2) data member initialization OK ... "  << 
endmsg;
 
  391   bool oldTag = ( 
tag.empty() || 
tag == 
"CaloIdentifier-DC3-05" || 
tag == 
"CaloIdentifier-LVL1-01");
 
  399     if(!oldTag) 
log << 
MSG::INFO  << 
"WARNING : TTOnlineID::initLevelsFromDict - unable to find 'PPM_Crate-00' region" << 
endmsg;
 
  410     log << 
MSG::INFO  <<  
"TTOnlineID::initLevelsFromDict - unable to find 'Calo' field " 
  421     log << 
MSG::INFO  <<  
"TTOnlineID::initLevelsFromDict - unable to find 'DetZside' field " 
  432     log << 
MSG::INFO  <<  
"TTOnlineID::initLevelsFromDict - unable to find 'crate' field " 
  443     log << 
MSG::INFO  <<  
"TTOnlineID::initLevelsFromDict - unable to find 'module' field " 
  454     log << 
MSG::INFO  <<  
"TTOnlineID::initLevelsFromDict - unable to find 'submodule' field " << 
endmsg ;
 
  464     log << 
MSG::INFO  <<  
"TTOnlineID::initLevelsFromDict - unable to find 'channel' field " << 
endmsg;
 
  485   log << 
MSG::DEBUG  << 
"[initLevelsFromDict] > ...implementation: m_det_side_index " << 
endmsg;
 
  491   log << 
MSG::DEBUG  << 
"[initLevelsFromDict] > ...implementation: m_module_index " << 
endmsg;
 
  493   log << 
MSG::DEBUG  << 
"[initLevelsFromDict] > ...implementation: m_submodule_index " << 
endmsg;
 
  495   log << 
MSG::DEBUG  << 
"[initLevelsFromDict] > ...implementation: m_channel_index " << 
endmsg;
 
  499     log << 
MSG::DEBUG  << 
"[initLevelsFromDict] (11) decode index and bit fields for each level: " << 
endmsg;
 
  517   std::stringstream strm1;
 
  518   std::stringstream strm2;
 
  519   std::stringstream strm3;
 
  529       unsigned int nids = 0;
 
  530       std::set<HWIdentifier> 
ids;
 
  535         auto last  = rit.
end();
 
  540           if(!(
ids.insert(cra_id)).second){
 
  542         strg1 = 
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
 
  544         strg3 = 
" expanded Id= "+strm3.str();
 
  550           std::cout << 
"TTOnlineID::Error" << strg1 << std::endl;
 
  551           std::cout << strg3 << std::endl;
 
  560         strg1 = 
"[init_hashes] >";
 
  561         strg2 = 
" set size NOT EQUAL to hash max. size "+strm1.str();
 
  562         strg3 = 
" hash max "+strm2.str();
 
  571         std::cout << 
"TTOnlineID::" << strg1 << std::endl;
 
  572         std::cout << 
"Error" << strg2 << std::endl;
 
  573         std::cout << strg3 << std::endl;
 
  579       std::set<HWIdentifier>::const_iterator 
first = 
ids.begin();
 
  580       std::set<HWIdentifier>::const_iterator last  = 
ids.end();
 
  593       unsigned int nids = 0;
 
  594       std::set<HWIdentifier> 
ids;
 
  599         auto last  = rit.
end();
 
  604           if(!(
ids.insert(mod_id)).second){
 
  606         strg1 = 
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
 
  608         strg3 = 
" expanded Id= "+strm3.str();
 
  614           std::cout << 
"TTOnlineID::Error" << strg1 << std::endl;
 
  615           std::cout << strg3 << std::endl;
 
  624         strg1 = 
"[init_hashes] >";
 
  625         strg2 = 
" set size NOT EQUAL to hash max. size "+strm1.str();
 
  626         strg3 = 
" hash max "+strm2.str();
 
  635         std::cout << 
"TTOnlineID::" << strg1 << std::endl;
 
  636         std::cout << 
"Error" << strg2 << std::endl;
 
  637         std::cout << strg3 << std::endl;
 
  643       std::set<HWIdentifier>::const_iterator 
first = 
ids.begin();
 
  644       std::set<HWIdentifier>::const_iterator last  = 
ids.end();
 
  657       unsigned int nids = 0;
 
  658       std::set<HWIdentifier> 
ids;
 
  663         auto last  = rit.
end();
 
  668           if(!(
ids.insert(submod_id)).second){
 
  670         strg1 = 
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
 
  672         strg3 = 
" expanded Id= "+strm3.str();
 
  678           std::cout << 
"TTOnlineID::Error" << strg1 << std::endl;
 
  680           std::cout << strg3 << std::endl;
 
  689         strg1 = 
"[init_hashes] >";
 
  690         strg2 = 
" set size NOT EQUAL to hash max. size "+strm1.str();
 
  691         strg3 = 
" hash max "+strm2.str();
 
  700         std::cout << 
"TTOnlineID::" << strg1 << std::endl;
 
  701         std::cout << 
"Error" << strg2 << std::endl;
 
  702         std::cout << strg3 << std::endl;
 
  708       std::set<HWIdentifier>::const_iterator 
first = 
ids.begin();
 
  709       std::set<HWIdentifier>::const_iterator last  = 
ids.end();
 
  722       unsigned int nids = 0;
 
  723       std::set<HWIdentifier> 
ids;
 
  728         auto last  = rit.
end();
 
  733           if(!(
ids.insert(chan_id)).second){
 
  735         strg1 = 
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
 
  737         strg3 = 
" expanded Id= "+strm3.str();
 
  743           std::cout << 
"TTOnlineID::Error" << strg1 << std::endl;
 
  744           std::cout << strg3 << std::endl;
 
  753         strg1 = 
"[init_hashes] >";
 
  754         strg2 = 
" set size NOT EQUAL to hash max. size "+strm1.str();
 
  755         strg3 = 
" hash max "+strm2.str();
 
  764         std::cout << 
"TTOnlineID::" << strg1 << std::endl;
 
  765         std::cout << 
"Error" << strg2 << std::endl;
 
  766         std::cout << strg3 << std::endl;
 
  772       std::set<HWIdentifier>::const_iterator 
first = 
ids.begin();
 
  773       std::set<HWIdentifier>::const_iterator last  = 
ids.end();
 
  
IdDictRegion * find_region(const std::string ®ion_name) const
IdDictFieldImplementation m_channel_impl
IdDictFieldImplementation m_calo_detzside_impl
MultiRange build_multirange() const
Get MultiRange for full dictionary.
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr) override
Initialization from the identifier dictionary.
std::vector< HWIdentifier > m_submodule_vec
Exception class for Calo Identifiers.
void crate_Id_checks(int crate) const
std::string show_to_string(void) const
IdContext submoduleContext() const
const IdDictRegion & region(size_t i) const
Region at index i.
size_type m_submodule_index
void add(element_type value)
Append a value into a new field.
size_type m_l1online_regions_index
MultiRange m_full_channel_range
IMessageSvc * m_msgSvc
pointer to the message service
virtual int initialize_from_dictionary(const IdDictMgr &dict_mgr)
Initialization from the identifier dictionary.
const std::string & name() const
Dictionary name.
IdDictFieldImplementation m_module_impl
int m_iDetZSideFieldValue
IdDictField * find_field(const std::string &name) const
HWIdentifier moduleId(int crate, int module) const
(1) create towerId from fields
const IdDictFieldImplementation & implementation(size_t i) const
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
std::vector< HWIdentifier > m_module_vec
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
HWIdentifier submoduleId(int crate, int module, int submodule) const
(1) create towerId from fields
size_type m_detzside_index
size_type m_submoduleHashMax
int detzside_field_value() const
return the value of the detzside field (initialized in initialize_from_dictionary())
ConstRangeIterator begin() const
void channel_Id_checks(int crate, int module, int submodule, int channel) const
bool m_quiet
If true, suppress DEBUG/INFO messages.
size_type m_moduleHashMax
IdDictFieldImplementation m_crate_impl
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 get_label_value(const std::string &field, const std::string &label, int &value) const
MultiRange m_full_module_range
size_type m_calo_index
Member Data index.
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
IdContext moduleContext() const
IdDictFieldImplementation m_submodule_impl
int initLevelsFromDict()
init() hashes
IdDictFieldImplementation m_calo_impl
Field Implementation.
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
int get_expanded_id(const HWIdentifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded HWIdentifier from HWIdentifier (return == 0 for OK)
void submodule_Id_checks(int crate, int module, int submodule) const
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
MultiRange m_full_crate_range
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
const std::string & dict_tag() const
Access to the dictionary tag.
size_type m_channel_index
HWIdentifier crateId(int crate) const
(1) create towerId from fields
HWIdentifier channelId(int crate, int module, int submodule, int channel) const
(1) create towerId from fields
const IdDictDictionary * m_dict
ConstRangeIterator end() const
size_type cardinality() const
Computes a possible cardinality from all ranges.
std::vector< HWIdentifier > m_crate_vec
size_type m_channelHashMax
void module_Id_checks(int crate, int module) const
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
IdContext channelContext() const
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
IdContext crateContext() const
context for feedthroughs, feb & channels
MultiRange m_full_submodule_range
std::vector< HWIdentifier > m_channel_vec