8 #include "GaudiKernel/MsgStream.h"
24 m_detzside_index(999),
25 m_l1online_regions_index(999),
28 m_submodule_index(999),
33 m_submoduleHashMax(0),
35 m_iDetZSideFieldValue(-1)
75 std::string strg =
"initialize_from_dictionary";
80 std::cout << strg << std::endl;
105 strg =
" initialize_from_dictionary - cannot access Calorimeter dictionary";
111 std::cout <<
"TTOnlineID::" << strg << std::endl;
134 std::stringstream strm;
135 strm << atlasDict->
m_name;
136 strg=
" Could not get value for label 'Calorimeter' of field 'subdet' in dictionary "+strm.str();
141 std::cout <<
"TTOnlineID:" << strg << std::endl;
152 bool oldTag = (
tag.empty() ||
tag ==
"CaloIdentifier-DC3-05" ||
tag ==
"CaloIdentifier-LVL1-01");
159 std::stringstream strm;
161 strg =
"WARNING : Could not get value for label 'DetZside' in dictionary "+strm.str();
166 std::cout << strg << std::endl;
180 reg_id.
add(caloValue);
189 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Crate range -> "
191 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Module range -> "
193 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > SubModule range -> "
195 log <<
MSG::DEBUG <<
"[initialize_from_dictionary] > Channel range -> "
211 MsgStream
log(m_msgSvc,
"TTOnlineID" );
214 exp_id << calo_field_value();
215 exp_id << detzside_field_value();
216 if(context && context->end_index() >= m_crate_index) {
218 if(context->end_index() >= m_module_index) {
220 if(context->end_index() >= m_submodule_index) {
221 exp_id << submodule(
id);
222 if(context->end_index() >= m_channel_index)
237 id << detzside_field_value() << crate <<
module << submodule <<
channel;
238 if (!m_full_channel_range.match(
id)) {
239 std::string errorMessage =
"[TTOnlineID]::channnelId() result is not OK: ID, range = "
240 + std::string(
id) +
" , " + (std::string)m_full_channel_range;
253 if (get_expanded_id(submoduleId, expId, &context)) {
254 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID = "
255 + show_to_string(submoduleId) ;
260 if (!m_full_channel_range.match(expId)) {
261 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = "
262 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
275 if (get_expanded_id(moduleId, expId, &context)) {
276 std::string errorMessage =
"TTOnlineID::channel_Id_checks(moduleId) result is not OK: ID = "
277 + show_to_string(moduleId) ;
282 if (!m_full_channel_range.match(expId)) {
283 std::string errorMessage =
"TTOnlineID::channel_Id_checks(submoduleId) result is not OK: ID, range = "
284 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
297 if (get_expanded_id(crateId, expId, &context)) {
298 std::string errorMessage =
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID = "
299 + show_to_string(crateId) ;
304 if (!m_full_channel_range.match(expId)) {
305 std::string errorMessage =
"TTOnlineID::channel_Id_checks(crateId) result is not OK: ID, range = "
306 + std::string(expId) +
" , " + (std::string)m_full_channel_range;
318 expId << detzside_field_value() << crate <<
module << submodule;
320 if (!m_full_submodule_range.match(expId)) { std::string errorMessage =
"TTOnlineID::submodule_Id_checks() result is not OK: ID, range = "
321 + std::string(expId) +
" , " + (std::string)m_full_submodule_range;
333 expId << detzside_field_value() << crate <<
module;
335 if (!m_full_module_range.match(expId)) { std::string errorMessage =
"TTOnlineID::module_Id_checks() result is not OK: ID, range = "
336 + std::string(expId) +
" , " + (std::string)m_full_module_range;
348 expId << detzside_field_value() << crate;
350 if (!m_full_crate_range.match(expId)) { std::string errorMessage =
"TTOnlineID::crate_Id_checks() result is not OK: ID, range = "
351 + std::string(expId) +
" , " + (std::string)m_full_crate_range;
365 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - dictionary NOT initialized "
381 log <<
MSG::DEBUG <<
"[initLevelsFromDict] (2) data member initialization OK ... " <<
endmsg;
385 bool oldTag = (
tag.empty() ||
tag ==
"CaloIdentifier-DC3-05" ||
tag ==
"CaloIdentifier-LVL1-01");
393 if(!oldTag)
log << MSG::INFO <<
"WARNING : TTOnlineID::initLevelsFromDict - unable to find 'PPM_Crate-00' region" <<
endmsg;
404 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'Calo' field "
415 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'DetZside' field "
426 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'crate' field "
437 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'module' field "
448 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'submodule' field " <<
endmsg ;
458 log << MSG::INFO <<
"TTOnlineID::initLevelsFromDict - unable to find 'channel' field " <<
endmsg;
479 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_det_side_index " <<
endmsg;
485 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_module_index " <<
endmsg;
487 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_submodule_index " <<
endmsg;
489 log <<
MSG::DEBUG <<
"[initLevelsFromDict] > ...implementation: m_channel_index " <<
endmsg;
493 log <<
MSG::DEBUG <<
"[initLevelsFromDict] (11) decode index and bit fields for each level: " <<
endmsg;
511 std::stringstream strm1;
512 std::stringstream strm2;
513 std::stringstream strm3;
523 unsigned int nids = 0;
524 std::set<HWIdentifier>
ids;
533 if(!(
ids.insert(cra_id)).second){
535 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
537 strg3 =
" expanded Id= "+strm3.str();
543 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
544 std::cout << strg3 << std::endl;
553 strg1 =
"[init_hashes] >";
554 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
555 strg3 =
" hash max "+strm2.str();
564 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
565 std::cout <<
"Error" << strg2 << std::endl;
566 std::cout << strg3 << std::endl;
572 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
573 std::set<HWIdentifier>::const_iterator last =
ids.end();
586 unsigned int nids = 0;
587 std::set<HWIdentifier>
ids;
596 if(!(
ids.insert(mod_id)).second){
598 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
600 strg3 =
" expanded Id= "+strm3.str();
606 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
607 std::cout << strg3 << std::endl;
616 strg1 =
"[init_hashes] >";
617 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
618 strg3 =
" hash max "+strm2.str();
627 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
628 std::cout <<
"Error" << strg2 << std::endl;
629 std::cout << strg3 << std::endl;
635 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
636 std::set<HWIdentifier>::const_iterator last =
ids.end();
649 unsigned int nids = 0;
650 std::set<HWIdentifier>
ids;
659 if(!(
ids.insert(submod_id)).second){
661 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
663 strg3 =
" expanded Id= "+strm3.str();
669 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
671 std::cout << strg3 << std::endl;
680 strg1 =
"[init_hashes] >";
681 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
682 strg3 =
" hash max "+strm2.str();
691 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
692 std::cout <<
"Error" << strg2 << std::endl;
693 std::cout << strg3 << std::endl;
699 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
700 std::set<HWIdentifier>::const_iterator last =
ids.end();
713 unsigned int nids = 0;
714 std::set<HWIdentifier>
ids;
723 if(!(
ids.insert(chan_id)).second){
725 strg1 =
"[init_hashes] > duplicated id for channel nb = "+strm1.str();
727 strg3 =
" expanded Id= "+strm3.str();
733 std::cout <<
"TTOnlineID::Error" << strg1 << std::endl;
734 std::cout << strg3 << std::endl;
743 strg1 =
"[init_hashes] >";
744 strg2 =
" set size NOT EQUAL to hash max. size "+strm1.str();
745 strg3 =
" hash max "+strm2.str();
754 std::cout <<
"TTOnlineID::" << strg1 << std::endl;
755 std::cout <<
"Error" << strg2 << std::endl;
756 std::cout << strg3 << std::endl;
762 std::set<HWIdentifier>::const_iterator
first =
ids.begin();
763 std::set<HWIdentifier>::const_iterator last =
ids.end();