 |
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
26 m_detzside_index(999),
27 m_l1online_regions_index(999),
30 m_submodule_index(999),
35 m_submoduleHashMax(0),
37 m_iDetZSideFieldValue(-1)
77 std::string strg =
"initialize_from_dictionary";
82 std::cout << strg << std::endl;
107 strg =
" initialize_from_dictionary - cannot access Calorimeter dictionary";
113 std::cout <<
"TTOnlineID::" << strg << std::endl;
136 std::stringstream strm;
137 strm << atlasDict->
name();
138 strg=
" Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
143 std::cout <<
"TTOnlineID:" << strg << std::endl;
154 bool oldTag = (
tag.empty() ||
tag ==
"CaloIdentifier-DC3-05" ||
tag ==
"CaloIdentifier-LVL1-01");
161 std::stringstream strm;
163 strg =
"WARNING : Could not get value for label 'DetZside' in dictionary "+strm.str();
168 std::cout << strg << std::endl;
182 reg_id.
add(caloValue);
191 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Crate range -> "
193 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Module range -> "
195 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > SubModule range -> "
197 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Channel range -> "
213 MsgStream
log(m_msgSvc,
"TTOnlineID" );
216 exp_id << calo_field_value();
217 exp_id << detzside_field_value();
218 if(context && context->end_index() >= m_crate_index) {
220 if(context->end_index() >= m_module_index) {
222 if(context->end_index() >= m_submodule_index) {
223 exp_id << submodule(
id);
224 if(context->end_index() >= m_channel_index)
239 id << detzside_field_value() << crate <<
module << submodule <<
channel;
240 if (!m_full_channel_range.match(
id)) {
241 std::string errorMessage =
"[TTOnlineID]::channnelId() result is not OK: ID, range = "
242 + std::string(
id) +
" , " + (std::string)m_full_channel_range;
255 if (get_expanded_id(submoduleId, expId, &context)) {
256 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID = "
257 + show_to_string(submoduleId) ;
262 if (!m_full_channel_range.match(expId)) {
263 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = "
264 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
277 if (get_expanded_id(moduleId, expId, &context)) {
278 std::string errorMessage =
"TTOnlineID::channel_Id_checks(moduleId) result is not OK: ID = "
279 + show_to_string(moduleId) ;
284 if (!m_full_channel_range.match(expId)) {
285 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = "
286 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
299 if (get_expanded_id(crateId, expId, &context)) {
300 std::string errorMessage =
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID = "
301 + show_to_string(crateId) ;
306 if (!m_full_channel_range.match(expId)) {
307 std::string errorMessage =
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID, range = "
308 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
320 expId << detzside_field_value() << crate <<
module << submodule;
322 if (!m_full_submodule_range.match(expId)) { std::string errorMessage =
"TTOnlineID::submodule_Id_checks() result is not OK: ID, range = "
323 + std::string(expId) +
" , " + (std::string)m_full_submodule_range;
335 expId << detzside_field_value() << crate <<
module;
337 if (!m_full_module_range.match(expId)) { std::string errorMessage =
"TTOnlineID::module_Id_checks() result is not OK: ID, range = "
338 + std::string(expId) +
" , " + (std::string)m_full_module_range;
350 expId << detzside_field_value() << crate;
352 if (!m_full_crate_range.match(expId)) { std::string errorMessage =
"TTOnlineID::crate_Id_checks() result is not OK: ID, range = "
353 + std::string(expId) +
" , " + (std::string)m_full_crate_range;
367 log <<
MSG::INFO <<
"TTOnlineID::initLevelsFromDict - dictionary NOT initialized "
383 log <<
MSG::DEBUG <<
"[initLevelsFromDict] (2) data member initialization OK ... " <<
endmsg;
387 bool oldTag = (
tag.empty() ||
tag ==
"CaloIdentifier-DC3-05" ||
tag ==
"CaloIdentifier-LVL1-01");
395 if(!oldTag)
log <<
MSG::INFO <<
"WARNING : TTOnlineID::initLevelsFromDict - unable to find 'PPM_Crate-00' region" <<
endmsg;
406 log <<
MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'Calo' field "
417 log <<
MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'DetZside' field "
428 log <<
MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'crate' field "
439 log <<
MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'module' field "
450 log <<
MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'submodule' field " <<
endmsg ;
460 log <<
MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'channel' field " <<
endmsg;
481 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_det_side_index " <<
endmsg;
487 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_module_index " <<
endmsg;
489 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_submodule_index " <<
endmsg;
491 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_channel_index " <<
endmsg;
495 log <<
MSG::DEBUG <<
"[initLevelsFromDict] (11) decode index and bit fields for each level: " <<
endmsg;
513 std::stringstream strm1;
514 std::stringstream strm2;
515 std::stringstream strm3;
525 unsigned int nids = 0;
526 std::set<HWIdentifier>
ids;
531 auto last = rit.
end();
536 if(!(
ids.insert(cra_id)).second){
538 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
540 strg3 =
" expanded Id= "+strm3.str();
546 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
547 std::cout << strg3 << std::endl;
556 strg1 =
"[init_hashes] >";
557 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
558 strg3 =
" hash max "+strm2.str();
567 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
568 std::cout <<
"Error" << strg2 << std::endl;
569 std::cout << strg3 << std::endl;
575 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
576 std::set<HWIdentifier>::const_iterator last =
ids.end();
589 unsigned int nids = 0;
590 std::set<HWIdentifier>
ids;
595 auto last = rit.
end();
600 if(!(
ids.insert(mod_id)).second){
602 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
604 strg3 =
" expanded Id= "+strm3.str();
610 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
611 std::cout << strg3 << std::endl;
620 strg1 =
"[init_hashes] >";
621 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
622 strg3 =
" hash max "+strm2.str();
631 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
632 std::cout <<
"Error" << strg2 << std::endl;
633 std::cout << strg3 << std::endl;
639 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
640 std::set<HWIdentifier>::const_iterator last =
ids.end();
653 unsigned int nids = 0;
654 std::set<HWIdentifier>
ids;
659 auto last = rit.
end();
664 if(!(
ids.insert(submod_id)).second){
666 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
668 strg3 =
" expanded Id= "+strm3.str();
674 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
676 std::cout << strg3 << std::endl;
685 strg1 =
"[init_hashes] >";
686 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
687 strg3 =
" hash max "+strm2.str();
696 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
697 std::cout <<
"Error" << strg2 << std::endl;
698 std::cout << strg3 << std::endl;
704 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
705 std::set<HWIdentifier>::const_iterator last =
ids.end();
718 unsigned int nids = 0;
719 std::set<HWIdentifier>
ids;
724 auto last = rit.
end();
729 if(!(
ids.insert(chan_id)).second){
731 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
733 strg3 =
" expanded Id= "+strm3.str();
739 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
740 std::cout << strg3 << std::endl;
749 strg1 =
"[init_hashes] >";
750 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
751 strg3 =
" hash max "+strm2.str();
760 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
761 std::cout <<
"Error" << strg2 << std::endl;
762 std::cout << strg3 << std::endl;
768 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
769 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