Skip to content

Add helper functions to compute UL b-tagging scale factors and corrections

Sebastien Wertz requested to merge swertz/bamboo:feat-btv_sf_corrlib into master

B-tagging scale factors for UL analyses and later can now be read using correctionlib, and the CSV reader is not supported by the POG anymore. However, properly configuring the systematic variations and combining the scale factors into an event weight is not always trivial. This PR adds helper to load the scale factors and build full usable event weights from them. For fixed working point scale factors, it is left to the user to build the b-tagging efficiencies needed to compute the event weight.

Example:

from bamboo.scalefactors import get_bTagSF_fixWP, makeBtagWeightMeth1a
btvSF = lambda wp, flav: get_bTagSF_fixWP("btv.json", "deepJet", wp, flav, ...)
btvEff = {"M": get_correction("my_btag_eff.json", ...)}
btvWeight = makeBtagWeightMeth1a(tree.jet, "btagDeepFlavB", ["M"], {"M": 0.2783},
                                  btvSF, btvEff)
sel_btag = sel.refine("btag", cut=..., weight=btvWeight)

Also, add depreciation warnings to all scale factor utilities not based on correctionlib. As soon as pre-UL analyses are over, these will be removed from bamboo.

Merge request reports