Skip to content

Commit

Permalink
style: pre-commit fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pre-commit-ci[bot] committed May 23, 2024
1 parent cd971b3 commit aadaf46
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 31 deletions.
9 changes: 8 additions & 1 deletion src/HH4b/postprocessing/CombineTemplates.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
54 changes: 30 additions & 24 deletions src/HH4b/postprocessing/CreateDatacard.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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:
Expand Down
10 changes: 4 additions & 6 deletions src/HH4b/postprocessing/postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
)


Expand Down

0 comments on commit aadaf46

Please sign in to comment.