7 #include <boost/lexical_cast.hpp>
12 std::unique_ptr<TrigConf::L1ThrExtraInfoBase>
14 std::unique_ptr<TrigConf::L1ThrExtraInfoBase> extraInfo(
nullptr);
16 if( thrTypeName ==
"EM" )
17 return std::make_unique<L1ThrExtraInfo_EMTAULegacy>(thrTypeName,
data);
19 if( thrTypeName ==
"TAU" )
20 return std::make_unique<L1ThrExtraInfo_EMTAULegacy>(thrTypeName,
data);
22 if( thrTypeName ==
"JET" )
23 return std::make_unique<L1ThrExtraInfo_JETLegacy>(thrTypeName,
data);
25 if( thrTypeName ==
"XS" )
26 return std::make_unique<L1ThrExtraInfo_XSLegacy>(thrTypeName,
data);
28 if( thrTypeName ==
"MU" )
29 return std::make_unique<L1ThrExtraInfo_MU>(thrTypeName,
data);
31 if( thrTypeName ==
"eEM" )
32 return std::make_unique<L1ThrExtraInfo_eEM>(thrTypeName,
data);
34 if( thrTypeName ==
"jEM" )
35 return std::make_unique<L1ThrExtraInfo_jEM>(thrTypeName,
data);
37 if( thrTypeName ==
"eTAU" )
38 return std::make_unique<L1ThrExtraInfo_eTAU>(thrTypeName,
data);
40 if( thrTypeName ==
"jTAU" )
41 return std::make_unique<L1ThrExtraInfo_jTAU>(thrTypeName,
data);
43 if( thrTypeName ==
"cTAU" )
44 return std::make_unique<L1ThrExtraInfo_cTAU>(thrTypeName,
data);
46 if( thrTypeName ==
"jJ" )
47 return std::make_unique<L1ThrExtraInfo_jJ>(thrTypeName,
data);
49 if( thrTypeName ==
"jLJ" )
50 return std::make_unique<L1ThrExtraInfo_jLJ>(thrTypeName,
data);
52 if( thrTypeName ==
"gJ" )
53 return std::make_unique<L1ThrExtraInfo_gJ>(thrTypeName,
data);
55 if( thrTypeName ==
"gLJ" )
56 return std::make_unique<L1ThrExtraInfo_gLJ>(thrTypeName,
data);
58 if( thrTypeName ==
"jXE" )
59 return std::make_unique<L1ThrExtraInfo_jXE>(thrTypeName,
data);
61 if( thrTypeName ==
"jTE" )
62 return std::make_unique<L1ThrExtraInfo_jTE>(thrTypeName,
data);
64 if( thrTypeName ==
"gXE" )
65 return std::make_unique<L1ThrExtraInfo_gXE>(thrTypeName,
data);
67 if( thrTypeName ==
"gTE" )
68 return std::make_unique<L1ThrExtraInfo_gTE>(thrTypeName,
data);
71 return std::make_unique<L1ThrExtraInfoBase>(thrTypeName,
data);
77 m_thrExtraInfo.clear();
81 std::weak_ptr<TrigConf::L1ThrExtraInfoBase>
84 if(
auto extraInfo = L1ThrExtraInfo::createExtraInfo( thrTypeName,
data) ) {
85 auto success = m_thrExtraInfo.emplace(thrTypeName, std::shared_ptr<TrigConf::L1ThrExtraInfoBase>(std::move(extraInfo)));
86 return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( success.first->second );
90 std::cerr <<
"L1ThrExtraInfo::addExtraInfo: exception occured when building extra info for " << thrTypeName << std::endl;
93 return std::weak_ptr<TrigConf::L1ThrExtraInfoBase>( m_emptyInfo );
99 return ( m_thrExtraInfo.find(
typeName) != m_thrExtraInfo.end() );
196 return * m_thrExtraInfo.at(thrTypeName);
199 std::cerr <<
"Threshold type " << thrTypeName <<
" does not have extra info defined" << endl;
211 throw std::out_of_range(
"When accessing the legacy L1Calo EM or TAU isolation bit must be between 1 and 5, but bit="
215 return m_isolation.at(thrType)[bit-1];
218 std::cerr <<
"Threshold type " <<
name() <<
" does not have isolation parameters for type " << thrType << endl;
226 for(
auto &
x : m_extraInfo ) {
227 if(
x.first ==
"ptMinToTopo" ) {
228 m_ptMinToTopoMeV = std::lround( 1000 *
x.second.getValue<
float>() );
229 }
else if(
x.first ==
"isolation" ) {
230 for(
auto &
y :
x.second.data() ) {
231 auto & isoV = m_isolation[
y.first] = std::vector<IsolationLegacy>(5);
232 for(
auto &
c :
y.second.get_child(
"Parametrization") ) {
234 isoV[iso.isobit()-1] = iso;
245 if( hasExtraInfo(
"significance") ) {
246 auto &
sig = m_extraInfo[
"significance"];
247 m_xeMin =
sig.getAttribute<
unsigned int>(
"xeMin");
248 m_xeMax =
sig.getAttribute<
unsigned int>(
"xeMax");
249 m_teSqrtMin =
sig.getAttribute<
unsigned int>(
"teSqrtMin");
250 m_teSqrtMax =
sig.getAttribute<
unsigned int>(
"teSqrtMax");
251 m_xsSigmaScale =
sig.getAttribute<
unsigned int>(
"xsSigmaScale");
252 m_xsSigmaOffset =
sig.getAttribute<
unsigned int>(
"xsSigmaOffset");
264 for(
auto &
x : m_extraInfo ) {
265 if(
x.first ==
"ptMinToTopoLargeWindow" ) {
266 m_ptMinToTopoLargeWindowMeV = std::lround( 1000 *
x.second.getValue<
float>() );
267 }
else if(
x.first ==
"ptMinToTopoSmallWindow" ) {
268 m_ptMinToTopoSmallWindowMeV = std::lround( 1000 *
x.second.getValue<
float>() );
285 m_reta_d =
pt.get_optional<
float>(
"reta").get_value_or(0);
286 m_wstot_d =
pt.get_optional<
float>(
"wstot").get_value_or(0);
287 m_rhad_d =
pt.get_optional<
float>(
"rhad").get_value_or(0);
288 m_reta_fw =
pt.get_optional<
int>(
"reta_fw").get_value_or(0);
289 m_wstot_fw =
pt.get_optional<
int>(
"wstot_fw").get_value_or(0);
290 m_rhad_fw =
pt.get_optional<
int>(
"rhad_fw").get_value_or(0);
302 for(
auto &
x : m_extraInfo ) {
303 if(
x.first ==
"maxEt" ){
304 m_maxEt = 1000*
x.second.getValue<
unsigned int>();
305 }
else if(
x.first ==
"ptMinToTopo" ) {
306 m_ptMinToTopoMeV = lround(1000 *
x.second.getValue<
float>());
307 }
else if(
x.first ==
"workingPoints" ) {
308 for(
auto &
y :
x.second.data() ) {
309 auto wp = Selection::stringToWP(
y.first);
310 auto & iso = m_isolation.emplace(
wp,
string(
"eEM_WP_" +
y.first)).first->second;
311 for(
auto &
c :
y.second ) {
312 int etamin =
c.second.get_optional<
int>(
"etamin").get_value_or(-49);
313 int etamax =
c.second.get_optional<
int>(
"etamax").get_value_or(49);
314 unsigned int priority =
c.second.get_optional<
unsigned int>(
"priority").get_value_or(0);
327 m_iso_d =
pt.get_optional<
float>(
"iso").get_value_or(0);
328 m_frac_d =
pt.get_optional<
float>(
"frac").get_value_or(0);
329 m_frac2_d =
pt.get_optional<
float>(
"frac2").get_value_or(0);
330 m_iso_fw =
pt.get_optional<
int>(
"iso_fw").get_value_or(0);
331 m_frac_fw =
pt.get_optional<
int>(
"frac_fw").get_value_or(0);
332 m_frac2_fw =
pt.get_optional<
int>(
"frac2_fw").get_value_or(0);
344 for(
auto &
x : m_extraInfo ) {
345 if(
x.first ==
"maxEt" ){
346 m_maxEt = 1000*
x.second.getValue<
unsigned int>();
347 }
else if(
x.first ==
"ptMinToTopo1" ) {
348 m_ptMinToTopoMeV1 = 1000*
x.second.getValue<
unsigned int>();
349 }
else if(
x.first ==
"ptMinToTopo2" ){
350 m_ptMinToTopoMeV2 = 1000*
x.second.getValue<
unsigned int>();
351 }
else if(
x.first ==
"ptMinToTopo3" ){
352 m_ptMinToTopoMeV3 = 1000*
x.second.getValue<
unsigned int>();
353 }
else if(
x.first ==
"ptMinxTOB1" ){
354 m_ptMinxTOBMeV1 = 1000*
x.second.getValue<
unsigned int>();
355 }
else if(
x.first ==
"ptMinxTOB2" ){
356 m_ptMinxTOBMeV2 = 1000*
x.second.getValue<
unsigned int>();
357 }
else if(
x.first ==
"ptMinxTOB3" ){
358 m_ptMinxTOBMeV3 = 1000*
x.second.getValue<
unsigned int>();
359 }
else if(
x.first ==
"workingPoints" ) {
360 for(
auto &
y :
x.second.data() ) {
361 auto wp = Selection::stringToWP(
y.first);
362 auto & iso = m_isolation.emplace(
wp,
string(
"jEM_WP_" +
y.first)).first->second;
363 for(
auto &
c :
y.second ) {
364 int etamin =
c.second.get_optional<
int>(
"etamin").get_value_or(-49);
365 int etamax =
c.second.get_optional<
int>(
"etamax").get_value_or(49);
366 unsigned int priority =
c.second.get_optional<
unsigned int>(
"priority").get_value_or(0);
379 m_rCore_d =
pt.get_optional<
float>(
"rCore").get_value_or(0);
380 m_rHad_d =
pt.get_optional<
float>(
"rHad").get_value_or(0);
381 m_rCore_fw =
pt.get_optional<
float>(
"rCore_fw").get_value_or(0);
382 m_rHad_fw =
pt.get_optional<
float>(
"rHad_fw").get_value_or(0);
394 for(
auto &
x : m_extraInfo ) {
395 if(
x.first ==
"maxEt" ){
396 m_maxEt = 1000*
x.second.getValue<
unsigned int>();
397 }
else if(
x.first ==
"minIsoEt" ){
398 m_minIsoEt = lround(1000 *
x.second.getValue<
float>());
399 }
else if(
x.first ==
"ptMinToTopo" ) {
400 m_ptMinToTopoMeV = lround(1000 *
x.second.getValue<
float>());
401 }
else if(
x.first ==
"workingPoints" ) {
402 for(
auto &
y :
x.second.data() ) {
404 auto & iso = m_isolation.emplace(
wp,
string(
"eTAU_WP_" +
y.first)).first->second;
405 for(
auto &
c :
y.second ) {
406 int etamin =
c.second.get_optional<
int>(
"etamin").get_value_or(-49);
407 int etamax =
c.second.get_optional<
int>(
"etamax").get_value_or(49);
408 unsigned int priority =
c.second.get_optional<
unsigned int>(
"priority").get_value_or(0);
412 }
else if (
x.first ==
"algoVersion") {
413 m_algoVersion =
x.second.getValue<
unsigned int>();
423 m_isolation_d =
pt.get_optional<
float>(
"isolation").get_value_or(0);
424 m_isolation_fw =
pt.get_optional<
float>(
"isolation_fw").get_value_or(0);
436 for(
auto &
x : m_extraInfo ) {
437 if(
x.first ==
"maxEt" ){
438 m_maxEt = 1000*
x.second.getValue<
unsigned int>();
439 }
else if(
x.first ==
"ptMinToTopo1" ) {
440 m_ptMinToTopoMeV1 = 1000*
x.second.getValue<
unsigned int>();
441 }
else if(
x.first ==
"ptMinToTopo2" ){
442 m_ptMinToTopoMeV2 = 1000*
x.second.getValue<
unsigned int>();
443 }
else if(
x.first ==
"ptMinToTopo3" ){
444 m_ptMinToTopoMeV3 = 1000*
x.second.getValue<
unsigned int>();
445 }
else if(
x.first ==
"ptMinxTOB1" ){
446 m_ptMinxTOBMeV1 = 1000*
x.second.getValue<
unsigned int>();
447 }
else if(
x.first ==
"ptMinxTOB2" ){
448 m_ptMinxTOBMeV2 = 1000*
x.second.getValue<
unsigned int>();
449 }
else if(
x.first ==
"ptMinxTOB3" ){
450 m_ptMinxTOBMeV3 = 1000*
x.second.getValue<
unsigned int>();
451 }
else if(
x.first ==
"workingPoints" ) {
452 for(
auto &
y :
x.second.data() ) {
454 auto & iso = m_isolation.emplace(
wp,
string(
"jTAU_WP_" +
y.first)).first->second;
455 for(
auto &
c :
y.second ) {
456 int etamin =
c.second.get_optional<
int>(
"etamin").get_value_or(-49);
457 int etamax =
c.second.get_optional<
int>(
"etamax").get_value_or(49);
458 unsigned int priority =
c.second.get_optional<
unsigned int>(
"priority").get_value_or(0);
471 m_isolation_d =
pt.get_optional<
float>(
"isolation").get_value_or(0);
472 m_isolation_fw =
pt.get_optional<
unsigned int>(
"isolation_fw").get_value_or(0);
473 m_isolation_jTAUCoreScale_d =
pt.get_optional<
float>(
"isolation_jTAUCoreScale").get_value_or(0);
474 m_isolation_jTAUCoreScale_fw =
pt.get_optional<
unsigned int>(
"isolation_jTAUCoreScale_fw").get_value_or(0);
475 m_eTAU_rCoreMin_WP_d =
pt.get_optional<
float>(
"eTAU_rCoreMin").get_value_or(0);
476 m_eTAU_rCoreMin_WP_fw =
pt.get_optional<
unsigned int>(
"eTAU_rCoreMin_WP_fw").get_value_or(0);
477 m_eTAU_rHadMin_WP_d =
pt.get_optional<
float>(
"eTAU_rHadMin").get_value_or(0);
478 m_eTAU_rHadMin_WP_fw =
pt.get_optional<
unsigned int>(
"eTAU_rHadMin_WP_fw").get_value_or(0);
491 for(
auto &
x : m_extraInfo ) {
492 if(
x.first ==
"workingPoints" ) {
493 for(
auto &
y :
x.second.data() ) {
495 auto & iso = m_isolation.emplace(
wp,
string(
"cTAU_WP_" +
y.first)).first->second;
496 for(
auto &
c :
y.second ) {
497 int etamin =
c.second.get_optional<
int>(
"etamin").get_value_or(-49);
498 int etamax =
c.second.get_optional<
int>(
"etamax").get_value_or(49);
499 unsigned int priority =
c.second.get_optional<
unsigned int>(
"priority").get_value_or(0);
514 for(
auto &
x : m_extraInfo ) {
515 if(
x.first ==
"ptMinToTopo1" ) {
516 m_ptMinToTopoMeV1 = 1000*
x.second.getValue<
unsigned int>();
517 }
else if(
x.first ==
"ptMinToTopo2" ){
518 m_ptMinToTopoMeV2 = 1000*
x.second.getValue<
unsigned int>();
519 }
else if(
x.first ==
"ptMinToTopo3" ){
520 m_ptMinToTopoMeV3 = 1000*
x.second.getValue<
unsigned int>();
521 }
else if(
x.first ==
"ptMinxTOB1" ){
522 m_ptMinxTOBMeV1 = 1000*
x.second.getValue<
unsigned int>();
523 }
else if(
x.first ==
"ptMinxTOB2" ){
524 m_ptMinxTOBMeV2 = 1000*
x.second.getValue<
unsigned int>();
525 }
else if(
x.first ==
"ptMinxTOB3" ){
526 m_ptMinxTOBMeV3 = 1000*
x.second.getValue<
unsigned int>();
527 }
else if(
x.first ==
"seedThreshold1" ){
528 m_seedThresholdMeV1 =
int(1000*
x.second.getValue<
float>());
529 }
else if(
x.first ==
"seedThreshold2" ){
530 m_seedThresholdMeV2 =
int(1000*
x.second.getValue<
float>());
531 }
else if(
x.first ==
"seedThreshold3" ){
532 m_seedThresholdMeV3 =
int(1000*
x.second.getValue<
float>());
543 for(
auto &
x : m_extraInfo ) {
544 if(
x.first ==
"ptMinToTopo1" ) {
545 m_ptMinToTopoMeV1 = 1000*
x.second.getValue<
unsigned int>();
546 }
else if(
x.first ==
"ptMinToTopo2" ){
547 m_ptMinToTopoMeV2 = 1000*
x.second.getValue<
unsigned int>();
548 }
else if(
x.first ==
"ptMinToTopo3" ){
549 m_ptMinToTopoMeV3 = 1000*
x.second.getValue<
unsigned int>();
550 }
else if(
x.first ==
"ptMinxTOB1" ){
551 m_ptMinxTOBMeV1 = 1000*
x.second.getValue<
unsigned int>();
552 }
else if(
x.first ==
"ptMinxTOB2" ){
553 m_ptMinxTOBMeV2 = 1000*
x.second.getValue<
unsigned int>();
554 }
else if(
x.first ==
"ptMinxTOB3" ){
555 m_ptMinxTOBMeV3 = 1000*
x.second.getValue<
unsigned int>();
566 for(
auto &
x : m_extraInfo ) {
567 if(
x.first ==
"ptMinToTopo1" ) {
568 m_ptMinToTopoMeV1 = 1000*
x.second.getValue<
unsigned int>();
569 }
else if(
x.first ==
"ptMinToTopo2" ){
570 m_ptMinToTopoMeV2 = 1000*
x.second.getValue<
unsigned int>();
581 for(
auto &
x : m_extraInfo ) {
582 if(
x.first ==
"ptMinToTopo1" ) {
583 m_ptMinToTopoMeV1 = 1000*
x.second.getValue<
unsigned int>();
584 }
else if(
x.first ==
"ptMinToTopo2" ){
585 m_ptMinToTopoMeV2 = 1000*
x.second.getValue<
unsigned int>();
586 }
else if(
x.first ==
"seedThrA" ){
587 m_seedThrMeVA = 1000*
x.second.getValue<
unsigned int>();
588 }
else if(
x.first ==
"seedThrB" ){
589 m_seedThrMeVB = 1000*
x.second.getValue<
unsigned int>();
590 }
else if(
x.first ==
"seedThrC" ){
591 m_seedThrMeVC = 1000*
x.second.getValue<
unsigned int>();
592 }
else if(
x.first ==
"rhoTowerMinA" ){
593 float rhoTower_tmp = 1000*
x.second.getValue<
float>();
594 if( (
int)rhoTower_tmp != rhoTower_tmp)
595 throw std::runtime_error(
"gLJ: rhoTower param " +
std::to_string(rhoTower_tmp/1000.) +
" cannot be converted in MeV" );
596 m_rhoTowerMinMeVA = (
int)rhoTower_tmp;
597 }
else if(
x.first ==
"rhoTowerMinB" ){
598 float rhoTower_tmp = 1000*
x.second.getValue<
float>();
599 if( (
int)rhoTower_tmp != rhoTower_tmp)
600 throw std::runtime_error(
"gLJ: rhoTower param " +
std::to_string(rhoTower_tmp/1000.) +
" cannot be converted in MeV" );
601 m_rhoTowerMinMeVB = (
int)rhoTower_tmp;
602 }
else if(
x.first ==
"rhoTowerMinC" ){
603 float rhoTower_tmp = 1000*
x.second.getValue<
float>();
604 if( (
int)rhoTower_tmp != rhoTower_tmp)
605 throw std::runtime_error(
"gLJ: rhoTower param " +
std::to_string(rhoTower_tmp/1000.) +
" cannot be converted in MeV" );
606 m_rhoTowerMinMeVC = (
int)rhoTower_tmp;
607 }
else if(
x.first ==
"rhoTowerMaxA" ){
608 float rhoTower_tmp = 1000*
x.second.getValue<
float>();
609 if( (
int)rhoTower_tmp != rhoTower_tmp)
610 throw std::runtime_error(
"gLJ: rhoTower param " +
std::to_string(rhoTower_tmp/1000.) +
" cannot be converted in MeV" );
611 m_rhoTowerMaxMeVA = (
int)rhoTower_tmp;
612 }
else if(
x.first ==
"rhoTowerMaxB" ){
613 float rhoTower_tmp = 1000*
x.second.getValue<
float>();
614 if( (
int)rhoTower_tmp != rhoTower_tmp)
615 throw std::runtime_error(
"gLJ: rhoTower param " +
std::to_string(rhoTower_tmp/1000.) +
" cannot be converted in MeV" );
616 m_rhoTowerMaxMeVB = (
int)rhoTower_tmp;
617 }
else if(
x.first ==
"rhoTowerMaxC" ){
618 float rhoTower_tmp = 1000*
x.second.getValue<
float>();
619 if( (
int)rhoTower_tmp != rhoTower_tmp)
620 throw std::runtime_error(
"gLJ: rhoTower param " +
std::to_string(rhoTower_tmp/1000.) +
" cannot be converted in MeV" );
621 m_rhoTowerMaxMeVC = (
int)rhoTower_tmp;
640 for(
auto &
x : m_extraInfo ) {
641 if(
x.first ==
"etaBoundary1" ) {
642 m_etaBoundary1 =
x.second.getValue<
unsigned int>();
643 }
else if(
x.first ==
"etaBoundary1_fw" ) {
644 m_etaBoundary1_fw =
x.second.getValue<
unsigned int>();
645 }
else if(
x.first ==
"etaBoundary2" ) {
646 m_etaBoundary2 =
x.second.getValue<
unsigned int>();
647 }
else if(
x.first ==
"etaBoundary2_fw" ) {
648 m_etaBoundary2_fw =
x.second.getValue<
unsigned int>();
649 }
else if(
x.first ==
"etaBoundary3" ) {
650 m_etaBoundary3 =
x.second.getValue<
unsigned int>();
651 }
else if(
x.first ==
"etaBoundary3_fw" ) {
652 m_etaBoundary3_fw =
x.second.getValue<
unsigned int>();
663 for(
auto &
x : m_extraInfo ) {
664 if(
x.first ==
"seedThrA" ){
665 m_seedThrMeVA = 200*
x.second.getValue<
unsigned int>();
666 }
else if(
x.first ==
"seedThrB" ){
667 m_seedThrMeVB = 200*
x.second.getValue<
unsigned int>();
668 }
else if(
x.first ==
"seedThrC" ){
669 m_seedThrMeVC = 200*
x.second.getValue<
unsigned int>();
670 }
else if(
x.first ==
"XERHO_sigmaPosA" ){
671 m_XERHO_sigmaPosA =
x.second.getValue<
unsigned int>();
672 }
else if(
x.first ==
"XERHO_sigmaPosB" ){
673 m_XERHO_sigmaPosB =
x.second.getValue<
unsigned int>();
674 }
else if(
x.first ==
"XERHO_sigmaPosC" ){
675 m_XERHO_sigmaPosC =
x.second.getValue<
unsigned int>();
676 }
else if(
x.first ==
"XERHO_sigmaNegA" ){
677 m_XERHO_sigmaNegA =
x.second.getValue<
unsigned int>();
678 }
else if(
x.first ==
"XERHO_sigmaNegB" ){
679 m_XERHO_sigmaNegB =
x.second.getValue<
unsigned int>();
680 }
else if(
x.first ==
"XERHO_sigmaNegC" ){
681 m_XERHO_sigmaNegC =
x.second.getValue<
unsigned int>();
682 }
else if(
x.first ==
"XEJWOJ_a_A" ){
683 m_XEJWOJ_a_A =
x.second.getValue<
unsigned int>();
684 }
else if(
x.first ==
"XEJWOJ_a_B" ){
685 m_XEJWOJ_a_B =
x.second.getValue<
unsigned int>();
686 }
else if(
x.first ==
"XEJWOJ_a_C" ){
687 m_XEJWOJ_a_C =
x.second.getValue<
unsigned int>();
688 }
else if(
x.first ==
"XEJWOJ_b_A" ){
689 m_XEJWOJ_b_A =
x.second.getValue<
unsigned int>();
690 }
else if(
x.first ==
"XEJWOJ_b_B" ){
691 m_XEJWOJ_b_B =
x.second.getValue<
unsigned int>();
692 }
else if(
x.first ==
"XEJWOJ_b_C" ){
693 m_XEJWOJ_b_C =
x.second.getValue<
unsigned int>();
694 }
else if(
x.first ==
"XEJWOJ_c_A" ){
695 m_XEJWOJ_c_A =
x.second.getValue<
unsigned int>();
696 }
else if(
x.first ==
"XEJWOJ_c_B" ){
697 m_XEJWOJ_c_B =
x.second.getValue<
unsigned int>();
698 }
else if(
x.first ==
"XEJWOJ_c_C" ){
699 m_XEJWOJ_c_C =
x.second.getValue<
unsigned int>();
719 return m_rpcPtMap.at(
pt);
722 std::cerr <<
"No RPC index defined for pt " <<
pt << endl;
732 return m_tgcPtMap.at(
pt);
735 std::cerr <<
"No TGC index defined for pt " <<
pt << endl;
744 for(
auto &
x : m_rpcPtMap){
745 if(
x.second==
idx)
return x.first;
747 throw std::runtime_error(
"index "+
std::to_string(
idx)+
" not found for RPC roads");
755 for(
auto &
x : m_tgcPtMap){
756 if(
x.second==
idx)
return x.first;
758 throw std::runtime_error(
"index "+
std::to_string(
idx)+
" not found for TGC roads");
766 int ptValue = ptForRpcIdx(rpcIdx);
767 return tgcIdxForPt(ptValue);
770 std::vector<unsigned int>
773 std::vector<unsigned int> ptValues;
774 for(
auto &
x : m_rpcPtMap ) {
775 ptValues.emplace_back(
x.first);
780 std::vector<unsigned int>
783 std::vector<unsigned int> ptValues;
784 for(
auto &
x : m_tgcPtMap ) {
785 ptValues.emplace_back(
x.first);
791 std::vector<std::string>
794 std::vector<std::string> listNames;
795 for(
auto &
x : m_roiExclusionLists ) {
796 listNames.emplace_back(
x.first);
802 const std::map<std::string, std::vector<unsigned int> > &
806 return m_roiExclusionLists.at(listName);
809 std::cerr <<
"No exclusion list '" << listName <<
"' defined in MU threshold exlusionLists" << endl;
819 for(
const auto &
x :
ds.data() ) {
820 m_rpcPtMap.emplace( boost::lexical_cast<unsigned int, std::string>(
x.first),
821 boost::lexical_cast<unsigned int, std::string>(
x.second.data()));
826 for(
auto &
x :
ds.data() ) {
827 m_tgcPtMap.emplace( boost::lexical_cast<unsigned int, std::string>(
x.first),
828 boost::lexical_cast<unsigned int, std::string>(
x.second.data()));
831 for(
auto &
x : m_extraInfo[
"exclusionLists"].
data() ) {
832 const std::string & listName =
x.first;
833 std::map<std::string, std::vector<unsigned int>> roisBySector;
834 for(
auto &
list :
x.second ) {
835 const std::string & sectorName =
list.second.get_child(
"sectorName").get_value<std::string>();
836 std::vector<unsigned int>
rois;
837 for(
auto & roi :
list.second.get_child(
"rois") ) {
838 rois.push_back( boost::lexical_cast<unsigned int, std::string>( roi.second.data() ) );
840 roisBySector.emplace(sectorName, std::move(
rois));
842 m_roiExclusionLists.emplace(listName, std::move(roisBySector));