Skip to content
Snippets Groups Projects
Commit fcc38ea4 authored by Mintu Kumar's avatar Mintu Kumar
Browse files

chage bweight name in weight function to keep the saprate record of the weight

parent ed2d7bfe
No related branches found
No related tags found
1 merge request!278B weigth normalization for central and systematic variation
Pipeline #8132023 passed
...@@ -810,9 +810,9 @@ def bTagShapeSF(events, weights, is_correction=True, year="2017", **kwargs): ...@@ -810,9 +810,9 @@ def bTagShapeSF(events, weights, is_correction=True, year="2017", **kwargs):
counts = ak.num(jet_hFlav) counts = ak.num(jet_hFlav)
logger.info("Warning: you have to normalise b-tag weights afterwards so that they do not change the yield!") logger.info("Warning: you have to normalise b-tag weights afterwards so that they do not change the yield!")
Weight_Name = ""
if is_correction: if is_correction:
Weight_Name = "bTagSF"
_sf = [] _sf = []
# Evluate the scale factore per jet and unflatten the scale fatores in original structure # Evluate the scale factore per jet and unflatten the scale fatores in original structure
_sf = ak.unflatten( _sf = ak.unflatten(
...@@ -832,6 +832,7 @@ def bTagShapeSF(events, weights, is_correction=True, year="2017", **kwargs): ...@@ -832,6 +832,7 @@ def bTagShapeSF(events, weights, is_correction=True, year="2017", **kwargs):
sfs_down = [None for _ in btag_systematics] sfs_down = [None for _ in btag_systematics]
else: else:
Weight_Name = "bTagSF_sys"
# only calculate correction to nominal weight # only calculate correction to nominal weight
# replace by accessing partial weight! # replace by accessing partial weight!
_sf = [] _sf = []
...@@ -957,7 +958,7 @@ def bTagShapeSF(events, weights, is_correction=True, year="2017", **kwargs): ...@@ -957,7 +958,7 @@ def bTagShapeSF(events, weights, is_correction=True, year="2017", **kwargs):
sfs_down = [variations[syst_name]["down"] / sf_central for syst_name in btag_systematics] sfs_down = [variations[syst_name]["down"] / sf_central for syst_name in btag_systematics]
weights.add_multivariation( weights.add_multivariation(
name="bTagSF", name=Weight_Name,
weight=sf, weight=sf,
modifierNames=btag_systematics, modifierNames=btag_systematics,
weightsUp=sfs_up, weightsUp=sfs_up,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment