Skip to content

fixed jer smearing for all eras (2022-2024)#104

Merged
kandrosov merged 10 commits intocms-flaf:mainfrom
valeriadamante:fix_jerc_application_alleras
Mar 25, 2026
Merged

fixed jer smearing for all eras (2022-2024)#104
kandrosov merged 10 commits intocms-flaf:mainfrom
valeriadamante:fix_jerc_application_alleras

Conversation

@valeriadamante
Copy link
Copy Markdown
Contributor

This PR is intended to fix bugs in JERC application for 2022, 2023, 2024.

jet.h Outdated
Comment on lines +162 to +171
pt_after = 30.;
}
if (isdata_ && require_run_number) {
cRes = corr_l2l3res_->evaluate({float(run),eta,pt_after});
// }
} else {
cRes = corr_l2l3res_->evaluate({eta,pt_after});
}

pt_after *= cRes;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look right - pt_after will be set to 30 * cRes(30), for pt < 30, while I think it should be pt_after * cRes(30).

jet.h Outdated
Jet_pt[i] *= 1.0 - Jet_rawFactor[i];
Jet_mass[i] *= 1.0 - Jet_rawFactor[i];
float jec_sf = 1.;
bool is2024Eta2To2p5 = (year_ == "2024" && Jet_eta[i] > 2 && Jet_eta[i] < 2.5);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
bool is2024Eta2To2p5 = (year_ == "2024" && Jet_eta[i] > 2 && Jet_eta[i] < 2.5);
bool is2024Eta2To2p5 = (year_ == "2024" && std::abs(Jet_eta[i]) > 2 && std::abs(Jet_eta[i]) < 2.5);

jet.h Outdated
is2024Eta2To2p5
);
}
Jet_pt[i] *= jec_sf;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic doesn't seem right: you apply JEC on Jet_pt, while Jet_pt already contains the old JEC. On the other hand jet_pt_corr is never used. Keep Jet_pt argument as const, define jet_pt_corr in the beginning as raw pt, and then use only it everywhere below.

jet.h Outdated
float jec_sf = 1.;
bool is2024Eta2To2p5 = (year_ == "2024" && std::abs(Jet_eta[i]) > 2 && std::abs(Jet_eta[i]) < 2.5);
if (apply_cmpd_ && !(is2024Eta2To2p5)){
jec_sf = evaluateJECCompound(Jet_pt[i],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apply_cmpd_ name is misleading, rename apply_jec_. So nano -> pt conversion should be done for both compound and split JEC. Also, since it should be applied here, don't repeat it inside evaluate functions, pass raw pt directly.
Same comments for fat jets.

Copy link
Copy Markdown
Contributor

@kandrosov kandrosov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kandrosov kandrosov merged commit e7525a5 into cms-flaf:main Mar 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants