8 #include "GaudiKernel/MsgStream.h"
25 m_detzside_index(999),
26 m_l1online_regions_index(999),
29 m_submodule_index(999),
34 m_submoduleHashMax(0),
36 m_iDetZSideFieldValue(-1)
76 std::string strg =
"initialize_from_dictionary";
81 std::cout << strg << std::endl;
106 strg =
" initialize_from_dictionary - cannot access Calorimeter dictionary";
112 std::cout <<
"TTOnlineID::" << strg << std::endl;
135 std::stringstream strm;
136 strm << atlasDict->
m_name;
137 strg=
" Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
142 std::cout <<
"TTOnlineID:" << strg << std::endl;
153 bool oldTag = (
tag.empty() ||
tag ==
"CaloIdentifier-DC3-05" ||
tag ==
"CaloIdentifier-LVL1-01");
160 std::stringstream strm;
162 strg =
"WARNING : Could not get value for label 'DetZside' in dictionary "+strm.str();
167 std::cout << strg << std::endl;
181 reg_id.
add(caloValue);
190 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Crate range -> "
192 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Module range -> "
194 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > SubModule range -> "
196 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Channel range -> "
212 MsgStream
log(m_msgSvc,
"TTOnlineID" );
215 exp_id << calo_field_value();
216 exp_id << detzside_field_value();
217 if(context && context->end_index() >= m_crate_index) {
219 if(context->end_index() >= m_module_index) {
221 if(context->end_index() >= m_submodule_index) {
222 exp_id << submodule(
id);
223 if(context->end_index() >= m_channel_index)
238 id << detzside_field_value() << crate <<
module << submodule <<
channel;
239 if (!m_full_channel_range.match(
id)) {
240 std::string errorMessage =
"[TTOnlineID]::channnelId() result is not OK: ID, range = "
241 + std::string(
id) +
" , " + (std::string)m_full_channel_range;
254 if (get_expanded_id(submoduleId, expId, &context)) {
255 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID = "
256 + show_to_string(submoduleId) ;
261 if (!m_full_channel_range.match(expId)) {
262 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = "
263 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
276 if (get_expanded_id(moduleId, expId, &context)) {
277 std::string errorMessage =
"TTOnlineID::channel_Id_checks(moduleId) result is not OK: ID = "
278 + show_to_string(moduleId) ;
283 if (!m_full_channel_range.match(expId)) {
284 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = "
285 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
298 if (get_expanded_id(crateId, expId, &context)) {
299 std::string errorMessage =
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID = "
300 + show_to_string(crateId) ;
305 if (!m_full_channel_range.match(expId)) {
306 std::string errorMessage =
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID, range = "
307 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
319 expId << detzside_field_value() << crate <<
module << submodule;
321 if (!m_full_submodule_range.match(expId)) { std::string errorMessage =
"TTOnlineID::submodule_Id_checks() result is not OK: ID, range = "
322 + std::string(expId) +
" , " + (std::string)m_full_submodule_range;
334 expId << detzside_field_value() << crate <<
module;
336 if (!m_full_module_range.match(expId)) { std::string errorMessage =
"TTOnlineID::module_Id_checks() result is not OK: ID, range = "
337 + std::string(expId) +
" , " + (std::string)m_full_module_range;
349 expId << detzside_field_value() << crate;
351 if (!m_full_crate_range.match(expId)) { std::string errorMessage =
"TTOnlineID::crate_Id_checks() result is not OK: ID, range = "
352 + std::string(expId) +
" , " + (std::string)m_full_crate_range;
366 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - dictionary NOT initialized "
382 log <<
MSG::DEBUG <<
"[initLevelsFromDict] (2) data member initialization OK ... " <<
endmsg;
386 bool oldTag = (
tag.empty() ||
tag ==
"CaloIdentifier-DC3-05" ||
tag ==
"CaloIdentifier-LVL1-01");
394 if(!oldTag)
log << MSG::INFO <<
"WARNING : TTOnlineID::initLevelsFromDict - unable to find 'PPM_Crate-00' region" <<
endmsg;
405 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'Calo' field "
416 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'DetZside' field "
427 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'crate' field "
438 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'module' field "
449 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'submodule' field " <<
endmsg ;
459 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'channel' field " <<
endmsg;
480 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_det_side_index " <<
endmsg;
486 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_module_index " <<
endmsg;
488 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_submodule_index " <<
endmsg;
490 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_channel_index " <<
endmsg;
494 log <<
MSG::DEBUG <<
"[initLevelsFromDict] (11) decode index and bit fields for each level: " <<
endmsg;
512 std::stringstream strm1;
513 std::stringstream strm2;
514 std::stringstream strm3;
524 unsigned int nids = 0;
525 std::set<HWIdentifier>
ids;
530 auto last = rit.
end();
535 if(!(
ids.insert(cra_id)).second){
537 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
539 strg3 =
" expanded Id= "+strm3.str();
545 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
546 std::cout << strg3 << std::endl;
555 strg1 =
"[init_hashes] >";
556 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
557 strg3 =
" hash max "+strm2.str();
566 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
567 std::cout <<
"Error" << strg2 << std::endl;
568 std::cout << strg3 << std::endl;
574 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
575 std::set<HWIdentifier>::const_iterator last =
ids.end();
588 unsigned int nids = 0;
589 std::set<HWIdentifier>
ids;
594 auto last = rit.
end();
599 if(!(
ids.insert(mod_id)).second){
601 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
603 strg3 =
" expanded Id= "+strm3.str();
609 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
610 std::cout << strg3 << std::endl;
619 strg1 =
"[init_hashes] >";
620 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
621 strg3 =
" hash max "+strm2.str();
630 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
631 std::cout <<
"Error" << strg2 << std::endl;
632 std::cout << strg3 << std::endl;
638 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
639 std::set<HWIdentifier>::const_iterator last =
ids.end();
652 unsigned int nids = 0;
653 std::set<HWIdentifier>
ids;
658 auto last = rit.
end();
663 if(!(
ids.insert(submod_id)).second){
665 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
667 strg3 =
" expanded Id= "+strm3.str();
673 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
675 std::cout << strg3 << std::endl;
684 strg1 =
"[init_hashes] >";
685 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
686 strg3 =
" hash max "+strm2.str();
695 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
696 std::cout <<
"Error" << strg2 << std::endl;
697 std::cout << strg3 << std::endl;
703 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
704 std::set<HWIdentifier>::const_iterator last =
ids.end();
717 unsigned int nids = 0;
718 std::set<HWIdentifier>
ids;
723 auto last = rit.
end();
728 if(!(
ids.insert(chan_id)).second){
730 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
732 strg3 =
" expanded Id= "+strm3.str();
738 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
739 std::cout << strg3 << std::endl;
748 strg1 =
"[init_hashes] >";
749 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
750 strg3 =
" hash max "+strm2.str();
759 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
760 std::cout <<
"Error" << strg2 << std::endl;
761 std::cout << strg3 << std::endl;
767 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
768 std::set<HWIdentifier>::const_iterator last =
ids.end();