Fix btag efficiency hist chunk overwrite and introduce possibility for more working points - #128
Open
tomohr10 wants to merge 2 commits into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pul request introduces two things:
The main change is the introduction of a new
BTagWorkingPointConfigdataclass, 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
histsalready have a key with the same name.