Skip to content

Commit

Permalink
Merge pull request columnflow#426 from columnflow/fix/btag_weight_cferr
Browse files Browse the repository at this point in the history
multiply cferr columns with nominal btag weight
  • Loading branch information
mafrahm authored May 8, 2024
2 parents 39e031e + e01e357 commit f8a1606
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions columnflow/production/cms/btag.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,14 @@ def add_weight(syst_name, syst_direction, column_name):
direction,
f"btag_weight_{name}_{direction}",
)
if syst_name in ["cferr1", "cferr2"]:
# for c flavor uncertainties, multiply the uncertainty with the nominal btag weight
events = set_ak_column(
events,
f"btag_weight_{name}_{direction}",
events.btag_weight * events[f"btag_weight_{name}_{direction}"],
value_type=np.float32,
)
elif self.shift_is_known_jec_source:
# TODO: year dependent jec variations fully covered?
events = add_weight(
Expand Down

0 comments on commit f8a1606

Please sign in to comment.