diff --git a/src/HH4b/postprocessing/CombineTemplates.ipynb b/src/HH4b/postprocessing/CombineTemplates.ipynb index dc66563a..469aa391 100644 --- a/src/HH4b/postprocessing/CombineTemplates.ipynb +++ b/src/HH4b/postprocessing/CombineTemplates.ipynb @@ -813,7 +813,14 @@ " plot_dir = main_plot_dir / year / \"wshifts\"\n", " plot_dir.mkdir(exist_ok=True, parents=True)\n", " # for wshift in list((jecs).keys()):\n", - " for wshift in [\"ttbarSF_Xbb_bin_0_0.8\",\"ttbarSF_Xbb_bin_0.8_0.94\",\"ttbarSF_Xbb_bin_0.94_0.99\", \"ttbarSF_Xbb_bin_0.99_1\", \"ttbarSF_pTjj\", \"ttbarSF_tau32\"]:\n", + " for wshift in [\n", + " \"ttbarSF_Xbb_bin_0_0.8\",\n", + " \"ttbarSF_Xbb_bin_0.8_0.94\",\n", + " \"ttbarSF_Xbb_bin_0.94_0.99\",\n", + " \"ttbarSF_Xbb_bin_0.99_1\",\n", + " \"ttbarSF_pTjj\",\n", + " \"ttbarSF_tau32\",\n", + " ]:\n", " if wshift in jecs:\n", " # adding jshift-ed histograms into the same histogram\n", " cjshift_templates = [templates[rname]]\n", diff --git a/src/HH4b/postprocessing/CreateDatacard.py b/src/HH4b/postprocessing/CreateDatacard.py index 3ab7ced8..7ce795fc 100644 --- a/src/HH4b/postprocessing/CreateDatacard.py +++ b/src/HH4b/postprocessing/CreateDatacard.py @@ -235,15 +235,17 @@ # TODO: separate into individual "JES": Syst(name="CMS_scale_j", prior="shape", samples=sig_keys), # TODO: update to all_mc "ttbarSF_pTjj": Syst( - name=f"{CMS_PARAMS_LABEL}_ttbar_sf_ptjj", - prior="shape", - samples=["ttbar"], - convert_shape_to_lnN=True), + name=f"{CMS_PARAMS_LABEL}_ttbar_sf_ptjj", + prior="shape", + samples=["ttbar"], + convert_shape_to_lnN=True, + ), "ttbarSF_tau32": Syst( - name=f"{CMS_PARAMS_LABEL}_ttbar_sf_tau32", - prior="shape", - samples=["ttbar"], - convert_shape_to_lnN=True), + name=f"{CMS_PARAMS_LABEL}_ttbar_sf_tau32", + prior="shape", + samples=["ttbar"], + convert_shape_to_lnN=True, + ), # "trigger": Syst(name=f"{CMS_PARAMS_LABEL}_trigger", prior="shape", samples=all_mc), # TODO: fix # "txbb": Syst( # name=f"{CMS_PARAMS_LABEL}_PNetHbbScaleFactors_correlated", @@ -260,25 +262,29 @@ "JMS": Syst(name=f"{CMS_PARAMS_LABEL}_jms", prior="shape", samples=all_mc), "JMR": Syst(name=f"{CMS_PARAMS_LABEL}_jmr", prior="shape", samples=all_mc), "ttbarSF_Xbb_bin_0_0.8": Syst( - name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0_0p8", - prior="shape", - samples=["ttbar"], - convert_shape_to_lnN=True), + name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0_0p8", + prior="shape", + samples=["ttbar"], + convert_shape_to_lnN=True, + ), "ttbarSF_Xbb_bin_0.8_0.94": Syst( - name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0p8_0p94", - prior="shape", - samples=["ttbar"], - convert_shape_to_lnN=True), + name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0p8_0p94", + prior="shape", + samples=["ttbar"], + convert_shape_to_lnN=True, + ), "ttbarSF_Xbb_bin_0.94_0.99": Syst( - name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0p94_0p99", - prior="shape", - samples=["ttbar"], - convert_shape_to_lnN=True), + name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0p94_0p99", + prior="shape", + samples=["ttbar"], + convert_shape_to_lnN=True, + ), "ttbarSF_Xbb_bin_0.99_1": Syst( - name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0p99_1", - prior="shape", - samples=["ttbar"], - convert_shape_to_lnN=True), + name=f"{CMS_PARAMS_LABEL}_ttbar_sf_xbb_bin_0p99_1", + prior="shape", + samples=["ttbar"], + convert_shape_to_lnN=True, + ), } if not args.do_jshifts: diff --git a/src/HH4b/postprocessing/postprocessing.py b/src/HH4b/postprocessing/postprocessing.py index f1b1dad4..d278b676 100644 --- a/src/HH4b/postprocessing/postprocessing.py +++ b/src/HH4b/postprocessing/postprocessing.py @@ -150,12 +150,10 @@ class Region: decorr_txbb_bins = [0, 0.8, 0.94, 0.99, 1] for i in range(len(decorr_txbb_bins) - 1): - weight_shifts[f"ttbarSF_Xbb_bin_{decorr_txbb_bins[i]}_{decorr_txbb_bins[i+1]}"] = ( - Syst( - samples=["ttbar"], - label=f"ttbar SF Xbb bin [{decorr_txbb_bins[i]}, {decorr_txbb_bins[i+1]}]", - years=years + ["2022-2023"], - ) + weight_shifts[f"ttbarSF_Xbb_bin_{decorr_txbb_bins[i]}_{decorr_txbb_bins[i+1]}"] = Syst( + samples=["ttbar"], + label=f"ttbar SF Xbb bin [{decorr_txbb_bins[i]}, {decorr_txbb_bins[i+1]}]", + years=years + ["2022-2023"], )