Skip to content

Bosonic Recoil Corrections#110

Open
akhter-towsifa wants to merge 24 commits into
cms-flaf:mainfrom
akhter-towsifa:recoil
Open

Bosonic Recoil Corrections#110
akhter-towsifa wants to merge 24 commits into
cms-flaf:mainfrom
akhter-towsifa:recoil

Conversation

@akhter-towsifa

@akhter-towsifa akhter-towsifa commented May 6, 2026

Copy link
Copy Markdown
Contributor

Following the HLepRare recommendation, applying Bosonic Recoil Corrections

Adding version 5 of the CorrectionLib recoil files.

Related issue: https://github.com/cms-flaf/HH_bbtautau_planning/issues/81

Edit:
Konstantin said we don't need the GenPart_* objects, we can instead do the following:

  1. use LHEPart_* objects instead of GenPart_* objects in this recoil correction.
  2. use LHE_Vpt for ptll (or pt_ll)
  3. for njet, use number of reconstructed b jets and VBF jets. use appropriate pT cuts on reco b jets and VBF jets when using njet.

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14905862 started

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14905862 passed

@akhter-towsifa

akhter-towsifa commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Hi @kandrosov , this PR is ready for review.
I will be making the plots next to check the effect of this correction.

Copilot AI left a comment

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.

Pull request overview

This PR introduces bosonic recoil corrections (HLepRare recommended V-recoil) into the Corrections submodule by adding a new recoil correction provider (C++/ROOT JIT) and wiring it into Corrections.py, along with adding v5 correctionlib recoil payloads under Corrections/data/hleprare/recoil.

Changes:

  • Add a new recoil correction module (recoil.py) that loads the appropriate v5 recoil JSON (per era) and initializes a C++ provider via ROOT JIT.
  • Add a C++ recoil provider implementation (recoil.h) that builds LHE boson/visible boson 4-vectors, derives an njet category from reco jets, and evaluates correctionlib recoil corrections + uncertainties.
  • Integrate recoil correction application into Corrections.py and add the required v5 recoil JSON payloads (Git LFS pointers).

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
Corrections.py Adds recoil property and applyRecoilCorrections() to define corrected MET and (optionally) systematic variations in the dataframe.
recoil.py New Python-side initializer that locates the recoil JSON under ANALYSIS_PATH and ROOT-JIT includes/initializes the C++ provider.
recoil.h New C++ correctionlib provider implementing recoil correction evaluation and uncertainty propagation.
data/hleprare/recoil/Recoil_corrections_v5.json.gz Adds v5 recoil payload (LFS pointer).
data/hleprare/recoil/Recoil_corrections_2022preEE_v5.json.gz Adds 2022 preEE v5 payload (LFS pointer).
data/hleprare/recoil/Recoil_corrections_2022postEE_v5.json.gz Adds 2022 postEE v5 payload (LFS pointer).
data/hleprare/recoil/Recoil_corrections_2023preBPix_v5.json.gz Adds 2023 preBPix v5 payload (LFS pointer).
data/hleprare/recoil/Recoil_corrections_2023postBPix_v5.json.gz Adds 2023 postBPix v5 payload (LFS pointer).
data/hleprare/recoil/Recoil_corrections_2024_v5.json.gz Adds 2024 v5 payload (LFS pointer).

Comment thread bosonicRecoil.py
Comment thread bosonicRecoil.h Outdated
Comment thread bosonicRecoil.h Outdated
Comment thread bosonicRecoil.h Outdated
Comment thread bosonicRecoil.h Outdated
Comment on lines +214 to +219
if (method == "QuantileMapFit") {
if (std::abs(val) > 150.) {
return safeEvaluate(corr_rescaling_, order, njet, ptll, var, val);
}
throw std::runtime_error("QuantileMapFit not implemented in the current setup");
}
Comment thread recoil.h Outdated
Comment thread recoil.h Outdated
Comment thread Corrections.py Outdated
Comment on lines +396 to +399
print(f"Applying bosonic recoil corrections with order {recoil_order}.")
recoil_method = self.to_apply["recoil"].get("method", "QuantileMapHist")
apply_systematics = self.to_apply["recoil"].get("apply_systematics", True)

Comment thread Corrections.py Outdated
Comment thread Corrections.py Outdated
@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14925448 started

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14925448 failed

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14928063 started

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14928063 failed

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14928348 started

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14928348 passed

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

Hi @kandrosov , this PR is ready for review

Comment thread bosonicRecoil.h Outdated
return p4;
}

static LorentzVectorM GetLHEBosonVisP4(const RVecF& pt,

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.

What do you mean by visible p4 of LHE boson? It can't be computed based on LHE information.

Comment thread bosonicRecoil.h Outdated
return apdg == 11 || apdg == 13 || apdg == 15;
}

static bool PassLHEBosonParticleSelection(const int pdgId,

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.

Why do you work with LHE Particles? I don't see where it is required as an input for corrections.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@kandrosov you said to switch from GenPart_* to LHEPart_* objects.
Our anaTuples in bbtautau do not save GenPart_* objects at the moment. But you said LHEPart_* objects are sufficient and asked me to switch to them.

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14978977 started

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14978977 failed

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14984820 started

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14984820 failed

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14985885 started

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14985885 passed

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot test please

  • HH_bbtautau_version=PR_61

@cms-flaf-bot

Copy link
Copy Markdown

pipeline#14989838 started

@akhter-towsifa

Copy link
Copy Markdown
Contributor Author

@cms-flaf-bot please test

  • HH_bbtautau_version=PR_61

@akhter-towsifa akhter-towsifa requested a review from kandrosov June 10, 2026 17:07
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.

4 participants