Skip to content

Dataset stitching: W, TT, DY flavor+m_ll, DY→ττ (#169) - #289

Merged
kandrosov merged 18 commits into
cms-flaf:mainfrom
kandrosov:issue-169-dataset-stitching
Aug 9, 2026
Merged

Dataset stitching: W, TT, DY flavor+m_ll, DY→ττ (#169)#289
kandrosov merged 18 commits into
cms-flaf:mainfrom
kandrosov:issue-169-dataset-stitching

Conversation

@kandrosov

@kandrosov kandrosov commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Implements four of the remaining dataset-stitching items from #169 on top of the generic
MCStitcher. Each new item is a small MCStitcher subclass that defines one
generator-level variable plus a bin config; the per-analysis wiring lives in the analysis
processes.yaml (separate PRs).

New stitchers / configs

  • Wconfig/Processors/stitching_W_amcatnlo_Vpt_NpNLO.yaml, a direct analog of the DY
    config on native LHE_Vpt/LHE_NpNLO. Validated: bins positive, k-factor 0.9216, stitched
    total = the 3-flavor NNLO cross-section exactly.
  • TT decay modeMCStitchingTT.TTStitcher counts leptonically-decaying W's from
    GenPart (TT_n_leptonic_W, direct W-daughter to avoid copy double-counting); 3 exhaustive
    bins with cross-sections TTto2L2Nu/TTtoLNu2Q/TTto4Q (sum = inclusive TT).
  • DY flavor + m_ll (H_mumu) — MCStitchingDYMll.DYMllStitcher computes the LHE dilepton
    flavor and mass; the all-flavor DY is split into e/μ/τ and the μμ bins by the 105–160 window
    so DYto2Mu_MLL_105to160 is stitched in as a single DY background (52 bins, sum = all-flavor total).
  • DY Z→ττ filter (HH_bbtautau) — MCStitchingDYtautau.DYtautauStitcher reproduces the
    sample's gen filter (ElHad/ElMu/HadHad/MuHad, |η|<3) via GenLepton; DYto2Tau bins are split
    by filter pass with the per-n-jet efficiency (15.7/20.7/21.6%).

Testing

  • TT and DY→ττ validated end-to-end on real anaTuple runs (AnaTupleFileTask, Run3_2022):
    the stitcher defines weight_xs and the full event loop completes with no unmatched bins.
  • W / flavor+m_ll / ττ configs validated offline (all bins positive, totals preserved); every
    subclass compiles under cling (incl. the GenLepton-based ττ filter); test_setup_loading.py
    passes for all wired eras.

Dependency

Requires cms-flaf/Corrections#124 (adds prepareStitchingVariables — the anaTuple-stage
cross-section/denominator expressions need the stitcher's derived variables defined first;
only native-branch DY worked before). Merge together.

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.

🔵 Human review recommended

It introduces multiple new stitching axes implemented via runtime-compiled C++ helpers plus large binning configurations, where subtle physics/selection edge cases could materially affect normalization if not manually validated in-repo.

Pull request overview

This pull request extends FLAF’s dataset-stitching infrastructure by adding new MCStitcher subclasses and corresponding processor YAML configurations to support W stitching, TT decay-mode stitching, DY flavor+mll stitching, and DY→ττ filter stitching (as described in #169). These components provide the generator-/LHE-level derived variables and bin definitions needed to compute consistent per-event weight_xs / denominators during the AnaTuple and AnaTupleMerge stages, with per-analysis wiring intended to land in follow-up PRs.

Changes:

  • Add three new MCStitcher subclasses that define derived stitching axes (TT_n_leptonic_W, DY_tautau_filter, LHE_dilep_flavor + LHE_mll) via ROOT.gInterpreter.Declare helpers.
  • Add new processor stitching YAMLs for W (Vpt/NpNLO), TT decay mode, DY Vpt/NpNLO + ττ filter, and DY Vpt/NpNLO + (flavor × mll) binning.
  • Keep the stitching implementation consistent with the existing MCStitcher config schema (bins, optional totalCrossSection check, and totalCrossSectionScaling).
File summaries
File Description
Processors/MCStitchingTT.py Adds TTStitcher deriving TT_n_leptonic_W from GenPart ancestry for decay-mode stitching.
Processors/MCStitchingDYtautau.py Adds DYtautauStitcher deriving a DY→ττ gen-filter pass/fail flag using GenLepton.
Processors/MCStitchingDYMll.py Adds DYMllStitcher deriving LHE dilepton flavor and mass for DY flavor × mll stitching.
config/Processors/stitching_W_amcatnlo_Vpt_NpNLO.yaml Defines W stitching bins in (LHE_Vpt, LHE_NpNLO) with a normalization scaling to NNLO(+EW).
config/Processors/stitching_TT_decayMode.yaml Defines three TT decay-mode bins keyed off TT_n_leptonic_W.
config/Processors/stitching_DY_amcatnlo_Vpt_NpNLO_ttFilter.yaml Defines DY stitching bins split by DY_tautau_filter to stitch filtered DY→ττ samples.
config/Processors/stitching_DY_amcatnlo_Vpt_NpNLO_flavor_mll.yaml Defines DY stitching bins split by LHE flavor and μμ mass window to stitch DYto2Mu_MLL_105to160.
Review details
  • Files reviewed: 7/7 changed files
  • Comments generated: 0
  • Review effort level: Lite

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

…; wire subclasses to GenProcess headers; drop GenProcess.h
…lassification (robust to shower taus/conversions)
…ust on full-gen HLepRare skims); test_DY reads Events+EventsNotSelected
…r efficiency (self-consistent stitching f; fixes 1J ~10% high)
…tching

# Conflicts:
#	Analysis/HistPlotter.py
#	Analysis/tasks.py
…w xsec lives only in _allFlavors; singleFlavor/Filtered reference it)
…es (ttau filter is single-flavor only); filtered singleFlavor references DYto2L singleFlavor directly
Comment thread include/GenProcess/DY.h Outdated
@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15489733 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15489733 failed

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15489963 started

@cms-flaf-bot

Copy link
Copy Markdown
Collaborator

pipeline#15489963 passed

@kandrosov
kandrosov merged commit d4dc8b9 into cms-flaf:main Aug 9, 2026
5 checks passed
@kandrosov
kandrosov deleted the issue-169-dataset-stitching branch August 9, 2026 02:26
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.

3 participants