Skip to content

Commit

Permalink
fix unlimited scale factor evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyuanlcern committed May 27, 2024
1 parent 0e7b1e0 commit d69b4d9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/scalefactors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,9 @@ ROOT::RDF::RNode id(ROOT::RDF::RNode df, const std::string &pt,
// preventing muons with default values due to tau energy correction
// shifts below good tau pt selection
// current 2022 Muon SF only supports muon with pt 15--200 GeVf
if (pt >= 0.0 && std::abs(eta) < 2.5 ) {
if (pt >= 23.0 && std::abs(eta) < 2.5 ) {
if (pt >=200) tmp_pt = 199.9;
else tmp_pt = pt;
if (pt <= 15) tmp_pt = 15.0;
else tmp_pt = pt;
sf = evaluator->evaluate(
{ std::abs(eta), tmp_pt, variation});
}
Expand Down Expand Up @@ -169,8 +167,8 @@ ROOT::RDF::RNode iso(ROOT::RDF::RNode df, const std::string &pt,
// preventing muons with default values due to tau energy correction
// shifts below good tau pt selection
// current 2022 Muon SF only supports muon with pt 15--200 GeVf
if (pt >= 0.0 && std::abs(eta) < 2.5) {
if (pt >=200) tmp_pt = 199.0;
if (pt >= 23.0 && std::abs(eta) < 2.5) {
if (pt >=200) tmp_pt = 199.9;
else tmp_pt = pt;
sf = evaluator->evaluate(
{ std::abs(eta), tmp_pt, variation});
Expand Down Expand Up @@ -834,7 +832,7 @@ ROOT::RDF::RNode id(ROOT::RDF::RNode df, const std::string &pt,
Logger::get("electronIDSF")->debug("ID - pt {}, eta {}", pt, eta);
double sf = 1.;
// in 2022 the order of input is year_id, variation, wp, eta, pt
if (pt >= 0.0) {
if (pt >= 25.0) {
sf = evaluator->evaluate({year_id, variation, wp, eta, pt});
}
Logger::get("electronIDSF")->debug("Scale Factor {}", sf);
Expand Down

0 comments on commit d69b4d9

Please sign in to comment.