Skip to content

Fix btag efficiency hist chunk overwrite and introduce possibility for more working points - #128

Open
tomohr10 wants to merge 2 commits into
GhentAnalysis/masterfrom
fix/btag-efficiency-hist-chunk-overwrite
Open

Fix btag efficiency hist chunk overwrite and introduce possibility for more working points#128
tomohr10 wants to merge 2 commits into
GhentAnalysis/masterfrom
fix/btag-efficiency-hist-chunk-overwrite

Conversation

@tomohr10

Copy link
Copy Markdown
Collaborator

This pul request introduces two things:

  • fix that histograms get overwritten for each new chunk
  • more flexibility for different working points.

The main change is the introduction of a new BTagWorkingPointConfig dataclass, which allows the set of working points (e.g., "L", "M", "T") to be specified dynamically.
The fix of overwriting histograms is done by just checking whether the hists already have a key with the same name.

Torben Mohr added 2 commits August 13, 2026 14:28
hists is created once per branch in SelectEvents and passed by
reference into the selector for every chunk of a file. This producer
unconditionally recreated and overwrote hists["btag_efficiencies"] on
each call, discarding all fills from previous chunks of the same
branch. Guard the creation so later chunks fill into the existing
histogram instead, matching the pattern already used by
trigger_efficiency_hists.
Introduces BTagWorkingPointConfig, a small Ghent-local TAFConfig
holding the ordered list of working-point names (default ("L", "M",
"T")). setup_btag, fixed_wp_btag_weights, and jet_btag now read this
list instead of hardcoding the string "LMT", so taggers with extra
tiers (e.g. UParT's XT/XXT) can be supported by setting
config.x.btag_wp_config accordingly. The threshold values themselves
are still looked up live from correctionlib in setup_btag, unchanged.

Also fixes jet_btag's produces declaration: the static
optional_column("Jet.btag_{LMT}") never actually brace-expanded (law's
brace_expand only splits on commas, so it declared a single bogus
column "Jet.btag_LMT" instead of Jet.btag_L/M/T). It's now built
dynamically in jet_btag_init from the configured working points, which
also makes it correct for configs with more than three.
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.

1 participant