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 02381b3 commit e40a1f3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 4 additions & 3 deletions src/HH4b/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,6 @@ def subtractedHistPlot(
plot_significance (bool): plot Asimov significance below ratio plot
"""


# copy hists and bg_keys so input objects are not changed
hists, bg_keys = deepcopy(hists), deepcopy(bg_keys)

Expand Down Expand Up @@ -959,8 +958,10 @@ def subtractedHistPlot(
if bg_err is not None:
bg_tot = hists["qcd", :] / hists_fail["qcd", :]
if len(np.array(bg_err).shape) == 1:
bg_errs = [bg_tot - bg_err / hists_fail["qcd", :],
bg_tot + bg_err / hists_fail["qcd", :]]
bg_errs = [
bg_tot - bg_err / hists_fail["qcd", :],
bg_tot + bg_err / hists_fail["qcd", :],
]

if bg_err_type == "shaded":
ax.fill_between(
Expand Down
9 changes: 4 additions & 5 deletions src/HH4b/postprocessing/PlotFitsSubtracted.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@
"outputs": [],
"source": [
"cards_dir = \"run3-bdt-may9-msd40-v2-ntf012\"\n",
"file = uproot.open(\n",
" f\"src/HH4b/cards/{cards_dir}/FitShapes.root\"\n",
")"
"file = uproot.open(f\"src/HH4b/cards/{cards_dir}/FitShapes.root\")"
]
},
{
Expand Down Expand Up @@ -111,7 +109,7 @@
"outputs": [],
"source": [
"shapes = {\n",
" #\"prefit\": \"Pre-Fit\",\n",
" # \"prefit\": \"Pre-Fit\",\n",
" \"postfit\": \"B-only Post-Fit\",\n",
"}\n",
"\n",
Expand Down Expand Up @@ -206,7 +204,8 @@
"for shape, shape_label in shapes.items():\n",
" for region, region_label in selection_regions.items():\n",
" pass_region = region.startswith(\"pass\")\n",
" if not pass_region: continue\n",
" if not pass_region:\n",
" continue\n",
" for shape_var in shape_vars:\n",
" plot_params = {\n",
" \"hists\": hists[shape][region],\n",
Expand Down

0 comments on commit e40a1f3

Please sign in to comment.