diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h index 203fc5117367d20f1bed70ae54e5015018a8aee3..4b10ee02af45c70b46cc2ae0b55311a8a6b8f0a5 100644 --- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h +++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThrExtraInfo.h @@ -19,6 +19,7 @@ namespace TrigConf { class L1ThrExtraInfo_JETLegacy; class L1ThrExtraInfo_XSLegacy; class L1ThrExtraInfo_eEMTAU; + class L1ThrExtraInfo_eTAU; class L1ThrExtraInfo_jJ; class L1ThrExtraInfo_jTAU; class L1ThrExtraInfo_gXE; @@ -35,7 +36,7 @@ namespace TrigConf { const L1ThrExtraInfo_JETLegacy & JET() const; const L1ThrExtraInfo_XSLegacy & XS() const; const L1ThrExtraInfo_eEMTAU & eEM() const; - const L1ThrExtraInfo_eEMTAU & eTAU() const; + const L1ThrExtraInfo_eTAU & eTAU() const; const L1ThrExtraInfo_jJ & jJ() const; const L1ThrExtraInfo_jTAU & jTAU() const; const L1ThrExtraInfo_gXE & gXE() const; @@ -132,8 +133,8 @@ namespace TrigConf { float ptMinToTopo() const { return m_ptMinToTopoMeV/1000.0f; } unsigned int ptMinToTopoMeV() const { return m_ptMinToTopoMeV; } unsigned int ptMinToTopoCounts() const { return energyInCounts( m_ptMinToTopoMeV, resolutionMeV() ); } - const TrigConf::Isolation & isolation(TrigConf::Isolation::WP wp, int eta) const; - const ValueWithEtaDependence<TrigConf::Isolation> & isolation(TrigConf::Isolation::WP wp) const; + const TrigConf::Isolation & isolation(TrigConf::Isolation::WP wp, int eta) const { return m_isolation.at(wp).at(eta); } + const ValueWithEtaDependence<TrigConf::Isolation> & isolation(TrigConf::Isolation::WP wp) const { return m_isolation.at(wp); } private: /** Update the internal members */ void load(); @@ -142,6 +143,33 @@ namespace TrigConf { std::map<TrigConf::Isolation::WP, ValueWithEtaDependence<Isolation>> m_isolation{}; }; + class L1ThrExtraInfo_eTAU final : public L1ThrExtraInfoBase { + public: + class Isolation { + public: + Isolation( const boost::property_tree::ptree & ); + int isolation() const { return m_isolation; } + float isolation_f() const { return m_isolation/100.; } + private: + int m_isolation {0}; + unsigned int m_maxEt { 0 }; + }; + L1ThrExtraInfo_eTAU(const std::string & thrTypeName, const ptree & data) : + L1ThrExtraInfoBase(thrTypeName, data) { load(); } + virtual ~L1ThrExtraInfo_eTAU() = default; + virtual std::string className() const { return "L1ThrExtraInfo_eTAU"; } + float ptMinToTopo() const { return m_ptMinToTopoMeV/1000.0f; } + unsigned int ptMinToTopoMeV() const { return m_ptMinToTopoMeV; } + unsigned int ptMinToTopoCounts() const { return energyInCounts( m_ptMinToTopoMeV, resolutionMeV() ); } + const Isolation & isolation(TrigConf::Isolation::WP wp, int eta) const; + const ValueWithEtaDependence<TrigConf::Isolation> & isolation(TrigConf::Isolation::WP wp) const; + private: + /** Update the internal members */ + void load(); + /** eEM specific data */ + unsigned int m_ptMinToTopoMeV{0}; + std::map<TrigConf::Isolation::WP, ValueWithEtaDependence<Isolation>> m_isolation{}; + }; class L1ThrExtraInfo_jJ final : public L1ThrExtraInfoBase { public: @@ -161,8 +189,6 @@ namespace TrigConf { /** jJ specific data */ ValueWithEtaDependence<unsigned int> m_ptMinToTopoSmallMeV{"jJptMinTopoLarge"}; ValueWithEtaDependence<unsigned int> m_ptMinToTopoLargeMeV{"jJptMinTopoSmall"}; - //std::map<std::pair<int,int>,unsigned int> m_ptMinToTopoSmallMeV{}; - //std::map<std::pair<int,int>,unsigned int> m_ptMinToTopoLargeMeV{}; }; diff --git a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h index 0e9c5088b8099d82169236e02ea6207acc4a2577..2af1a9f53da62968ed839138ea3088d5be2ca31e 100644 --- a/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h +++ b/Trigger/TrigConfiguration/TrigConfData/TrigConfData/L1ThresholdBase.h @@ -291,12 +291,18 @@ namespace TrigConf { bool isDefined() const { return m_isDefined; } int reta() const { return m_reta; } int wstot() const { return m_wstot; } - int had() const { return m_had; } + int rhad() const { return m_rhad; } + int had() const { return m_rhad; } + int maxEt() const { return m_maxEt; } + float reta_f() const { return m_reta/100.; } + float wstot_f() const { return m_wstot/100.; } + float rhad_f() const { return m_rhad/100.; } private: bool m_isDefined { false }; int m_reta { 0 }; int m_wstot { 0 }; - int m_had { 0 }; + int m_rhad { 0 }; + unsigned int m_maxEt { 0 }; }; std::ostream & operator<<(std::ostream & os, const TrigConf::Isolation & iso); diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx index 03e03f08807aedb6837b2e0c6946cb8d5b530ff8..3a5cf6f72e77a97140c184718801a30ee2d23e68 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1ThrExtraInfo.cxx @@ -28,9 +28,12 @@ TrigConf::L1ThrExtraInfo::createExtraInfo(const std::string & thrTypeName, const if( thrTypeName == "MU" ) return std::make_unique<L1ThrExtraInfo_MU>(thrTypeName, data); - if( thrTypeName == "eEM" or thrTypeName == "eTAU" ) + if( thrTypeName == "eEM" ) return std::make_unique<L1ThrExtraInfo_eEMTAU>(thrTypeName, data); + if( thrTypeName == "eTAU" ) + return std::make_unique<L1ThrExtraInfo_eTAU>(thrTypeName, data); + if( thrTypeName == "jJ" ) return std::make_unique<L1ThrExtraInfo_jJ>(thrTypeName, data); @@ -84,9 +87,9 @@ TrigConf::L1ThrExtraInfo::eEM() const { return dynamic_cast<const TrigConf::L1ThrExtraInfo_eEMTAU&>( * m_thrExtraInfo.at("eEM") ); } -const TrigConf::L1ThrExtraInfo_eEMTAU & +const TrigConf::L1ThrExtraInfo_eTAU & TrigConf::L1ThrExtraInfo::eTAU() const { - return dynamic_cast<const TrigConf::L1ThrExtraInfo_eEMTAU&>( * m_thrExtraInfo.at("eTAU") ); + return dynamic_cast<const TrigConf::L1ThrExtraInfo_eTAU&>( * m_thrExtraInfo.at("eTAU") ); } const TrigConf::L1ThrExtraInfo_jJ & @@ -197,28 +200,45 @@ TrigConf::L1ThrExtraInfo_JETLegacy::load() /******* * eEM *******/ -const TrigConf::Isolation & -TrigConf::L1ThrExtraInfo_eEMTAU::isolation(TrigConf::Isolation::WP wp, int eta) const +void +TrigConf::L1ThrExtraInfo_eEMTAU::load() { - return m_isolation.at(wp).at(eta); + for( auto & x : m_extraInfo ) { + if( x.first == "ptMinToTopo" ) { + m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>()); + } else if( x.first == "workingPoints" ) { + for( auto & y : x.second.data() ) { + auto wp = (y.first == "Loose") ? Isolation::WP::LOOSE : ( (y.first == "Medium") ? Isolation::WP::MEDIUM : Isolation::WP::TIGHT ); + auto & iso = m_isolation.emplace(wp, string("eEM_WP_" + y.first)).first->second; + for(auto & c : y.second ) { + int etamin = c.second.get_optional<int>("etamin").get_value_or(-49); + int etamax = c.second.get_optional<int>("etamax").get_value_or(49); + unsigned int priority = c.second.get_optional<unsigned int>("priority").get_value_or(0); + iso.addRangeValue(Isolation(c.second), etamin, etamax, priority, /*symmetric=*/ false); + } + } + } + } } -const TrigConf::ValueWithEtaDependence<TrigConf::Isolation> & -TrigConf::L1ThrExtraInfo_eEMTAU::isolation(TrigConf::Isolation::WP wp) const -{ - return m_isolation.at(wp); -} +/******* + * eTAU + *******/ +TrigConf::L1ThrExtraInfo_eTAU::Isolation::Isolation( const boost::property_tree::ptree & pt ) { + m_isolation = lround(100 * pt.get_optional<float>("isolation").get_value_or(0)); +} void -TrigConf::L1ThrExtraInfo_eEMTAU::load() +TrigConf::L1ThrExtraInfo_eTAU::load() { for( auto & x : m_extraInfo ) { if( x.first == "ptMinToTopo" ) { m_ptMinToTopoMeV = lround(1000 * x.second.getValue<float>()); } else if( x.first == "workingPoints" ) { for( auto & y : x.second.data() ) { - auto wp = (y.first == "Loose") ? Isolation::WP::LOOSE : ( (y.first == "Medium") ? Isolation::WP::MEDIUM : Isolation::WP::TIGHT ); + auto wp = (y.first == "Loose") ? TrigConf::Isolation::WP::LOOSE : + ( (y.first == "Medium") ? TrigConf::Isolation::WP::MEDIUM : TrigConf::Isolation::WP::TIGHT ); auto & iso = m_isolation.emplace(wp, string("eEM_WP_" + y.first)).first->second; for(auto & c : y.second ) { int etamin = c.second.get_optional<int>("etamin").get_value_or(-49); @@ -232,6 +252,9 @@ TrigConf::L1ThrExtraInfo_eEMTAU::load() } + + + /******* * jJ *******/ diff --git a/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx b/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx index d279f1c7d894aac9d5a7167dab72036657770bff..a8c997dad10cf4dcf01079e51575a85e89b796e5 100644 --- a/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx +++ b/Trigger/TrigConfiguration/TrigConfData/src/L1ThresholdBase.cxx @@ -282,14 +282,15 @@ TrigConf::operator<<(std::ostream & os, const TrigConf::IsolationLegacy & iso) { TrigConf::Isolation::Isolation( const boost::property_tree::ptree & pt ) { m_isDefined = true; - m_reta = pt.get_child("reta").get_value<int>(); - m_wstot = pt.get_child("wstot").get_value<int>(); - m_had = pt.get_child("had").get_value<int>(); + m_reta = lround(100 * pt.get_optional<float>("reta").get_value_or(0)); + m_wstot = lround(100 * pt.get_optional<float>("wstot").get_value_or(0)); + m_rhad = lround(100 * pt.get_optional<float>("rhad").get_value_or(0)); + m_maxEt = pt.get_optional<unsigned int>("rhad").get_value_or(0); } std::ostream & TrigConf::operator<<(std::ostream & os, const TrigConf::Isolation & iso) { - os << "reta=" << iso.reta() << ", wstot=" << iso.wstot() << ", had=" << iso.had(); + os << "reta=" << iso.reta() << ", wstot=" << iso.wstot() << ", rhad=" << iso.rhad(); return os; } diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py index 1609bb0130d1da8eb24b97f098db924eeeb76a8a..0fe451494a081dece84f43723913021bae7e3f3c 100644 --- a/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py +++ b/Trigger/TriggerCommon/TriggerMenuMT/python/L1/Config/TypeWideThresholdConfig.py @@ -48,16 +48,13 @@ def getConfig_eEM(): confObj = odict() confObj["workingPoints"] = odict() confObj["workingPoints"]["Loose"] = [ - odict([("etamin",0),("etamax",21), ("reta", 16), ("wstot", 15), ("had", 30)]), - odict([("etamin",21),("etamax",49), ("reta", 20), ("wstot", 25), ("had", 35)]) + odict([("reta", 0.12), ("wstot", 0.79), ("rhad", 0.31), ("maxEt", 60)]), ] confObj["workingPoints"]["Medium"] = [ - odict([("etamin",0),("etamax",21), ("reta", 17), ("wstot", 20), ("had", 30)]), - odict([("etamin",21),("etamax",49), ("reta", 21), ("wstot", 25), ("had", 35)]) + odict([("reta", 0.09), ("wstot", 0.65), ("rhad", 0.20), ("maxEt", 60)]), ] confObj["workingPoints"]["Tight"] = [ - odict([("etamin",0),("etamax",21), ("reta", 18), ("wstot", 22), ("had", 30)]), - odict([("etamin",21),("etamax",49), ("reta", 22), ("wstot", 25), ("had", 35)]) + odict([("reta", 0.08), ("wstot", 0.52), ("rhad", 0.19), ("maxEt", 60)]), ] confObj["ptMinToTopo"] = 3 confObj["resolutionMeV"] = 100 @@ -68,16 +65,13 @@ def getConfig_eTAU(): confObj = odict() confObj["workingPoints"] = odict() confObj["workingPoints"]["Loose"] = [ - odict([("etamin",0),("etamax",21), ("reta", 16), ("wstot", 15), ("had", 30)]), - odict([("etamin",21),("etamax",49), ("reta", 20), ("wstot", 25), ("had", 35)]) + odict([("isolation", 16), ("maxEt", 25)]), ] confObj["workingPoints"]["Medium"] = [ - odict([("etamin",0),("etamax",21), ("reta", 17), ("wstot", 20), ("had", 30)]), - odict([("etamin",21),("etamax",49), ("reta", 21), ("wstot", 25), ("had", 35)]) + odict([("isolation", 17), ("maxEt", 25)]), ] confObj["workingPoints"]["Tight"] = [ - odict([("etamin",0),("etamax",21), ("reta", 18), ("wstot", 22), ("had", 30)]), - odict([("etamin",21),("etamax",49), ("reta", 22), ("wstot", 25), ("had", 35)]) + odict([("isolation", 18), ("maxEt", 25)]), ] confObj["ptMinToTopo"] = 6 confObj["resolutionMeV"] = 100