Skip to content

Commit

Permalink
fix plotting variance (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmduarte authored Mar 1, 2025
1 parent a98aaf3 commit 7602989
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/HH4b/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,12 @@ def get_variances(bg_hist):
else "Stat. MC Uncertainty"
)

bg_tot = sum([hists[sample, :] for sample in bg_keys])
bg_err_tot_mcstat = np.sqrt(bg_tot.variances())
# this version has an issue:
# bg_tot no longer weighted, returns None for variances
# bg_tot = sum([hists[sample, :] for sample in bg_keys])
# bg_err_tot_mcstat = np.sqrt(bg_tot.variances())
# compute summed variance manually
bg_err_tot_mcstat = np.sqrt(sum([hists[sample, :].variances() for sample in bg_keys]))
# print("mcstat ",bg_err_tot_mcstat)

plot_shaded = False
Expand Down

0 comments on commit 7602989

Please sign in to comment.