Skip to content

Commit

Permalink
update dist
Browse files Browse the repository at this point in the history
  • Loading branch information
rkansal47 committed Dec 18, 2024
1 parent 9f2dafd commit d2db426
Show file tree
Hide file tree
Showing 5 changed files with 199 additions and 11 deletions.
Binary file not shown.
176 changes: 173 additions & 3 deletions src/HHbbVV/postprocessing/TopAnalysis.ipynb

Large diffs are not rendered by default.

21 changes: 18 additions & 3 deletions src/HHbbVV/postprocessing/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1275,15 +1275,25 @@ def cutsLinePlot(


def plot_lund_plane(
h: np.ndarray, title: str = "", ax=None, fig=None, name: str = "", show: bool = False
h: np.ndarray,
title: str = "",
ax=None,
fig=None,
name: str = "",
log: bool = False,
show: bool = False,
):
from matplotlib.colors import LogNorm

if ax is None:
fig, ax = plt.subplots(figsize=(10, 8))
else:
assert fig is not None, "Must provide fig if providing ax."

extent = [-1, 8, -5, 7]
im = ax.imshow(h.T, origin="lower", extent=extent, cmap="viridis")
im = ax.imshow(
h.T, origin="lower", extent=extent, cmap="viridis", norm=LogNorm() if log else None
)
ax.set_aspect("auto")
fig.colorbar(im, ax=ax)
# cbar.set_label('Density')
Expand All @@ -1307,7 +1317,11 @@ def plot_lund_plane(


def plot_lund_plane_six(
hists: np.ndarray, edges: np.ndarray = None, name: str = "", show: bool = False
hists: np.ndarray,
edges: np.ndarray = None,
name: str = "",
log: bool = False,
show: bool = False,
):
if isinstance(hists, Hist):
hists = hists.values()
Expand All @@ -1323,6 +1337,7 @@ def plot_lund_plane_six(
),
ax=ax,
fig=fig,
log=log,
)

if len(name):
Expand Down
9 changes: 6 additions & 3 deletions src/HHbbVV/processors/corrections.py
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,14 @@ def _get_lund_lookups(
sig_tot = np.sum(sig_lp_hist.values(), axis=(1, 2), keepdims=True)
mc_tot = np.sum(mc_nom, axis=(1, 2), keepdims=True)

# 0s -> 1 in the ratio
mc_sig_ratio = np.nan_to_num((mc_nom / mc_tot) / (sig_lp_hist.values() / sig_tot), nan=1.0)
mc_sig_ratio[mc_sig_ratio == 0] = 1.0

mc_sig_ratio = np.clip(mc_sig_ratio, 0.5, 2.0)
# ignore differences because of too low stats
mc_sig_ratio[mc_sig_ratio <= 0.5] = 1.0
mc_sig_ratio[mc_sig_ratio >= 2] = 1.0

# mc_sig_ratio[mc_sig_ratio == 0] = 1.0
# mc_sig_ratio = np.clip(mc_sig_ratio, 0.5, 2.0)

ratio_dist = dense_lookup(mc_sig_ratio, ratio_edges)
else:
Expand Down
4 changes: 2 additions & 2 deletions src/condor/submit_configs/ttsfs_24_12_15_lp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
{
"TTbar":
{
"files_per_job": 2,
"max_files": 80,
"files_per_job": 20,
# "max_files": 80,
"chunksize": 80000,
"subsamples": ["TTToSemiLeptonic"],
},
Expand Down

0 comments on commit d2db426

Please sign in to comment.