import pandas as pd
import seaborn as sns
from nnfwtbn import Variable, Process, Cut, hist, McStack, DataStack, Stack
from nnfwtbn import toydata
df = toydata.get()
df
jet_1_pt | jet_1_eta | jet_1_phi | jet_2_pt | jet_2_eta | jet_2_phi | met_phi | met_pt | tau_phi | tau_eta | tau_pt | lep_phi | lep_eta | lep_pt | higgs_pt | higgs_eta | higgs_phi | higgs_m | m_jj | lep_centrality | tau_centrality | random | fpid | weight | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
npartitions=1 | ||||||||||||||||||||||||
float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | float64 | int64 | int64 | |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
p_ztt = Process(r"$Z\rightarrow\tau\tau$", range=(0, 0))
p_sig = Process(r"Signal", range=(1, 1))
p_asimov = Process(r"Asimov", selection=lambda d: d.fpid >= 0)
colors = ["windows blue", "amber", "greyish", "faded green", "dusty purple"]
palette = sns.xkcd_palette(colors)
s_bkg = McStack(p_ztt, p_sig, palette=palette)
s_data = DataStack(p_asimov)
v_higgs_m = Variable(r"$m^H$", "higgs_m", "GeV")
c_vbf = Cut(lambda d: d.dijet_p4__M > 400) & \
Cut(lambda d: d.jet_1_p4__Pt >= 30) & \
Cut(lambda d: d.is_dijet_centrality == 1) & \
Cut(lambda d: d.jet_0_p4__Eta * df.jet_1_p4__Eta < 0) & \
Cut(lambda d: (d.jet_0_p4__Eta - df.jet_1_p4__Eta).abs() > 3)
hist(df, v_higgs_m, 20, [s_bkg, s_data], range=(0, 200), selection=None,
weight="weight", ratio_label="Data / SM")
None
hist(df, v_higgs_m, 22, [s_bkg, s_data], range=(75, 130), selection=None,
weight="weight", ratio_label="Data / SM", include_outside=True)
None
hist(df, v_higgs_m, 20, [s_bkg, s_data], range=(0, 200), selection=None,
weight="weight", ratio_label="Data / SM", y_log=True, numerator=None)
None
hist(df, v_higgs_m, 20, [s_bkg, s_data], range=(0, 200), selection=None,
weight="weight", ratio_label="MC / Data", y_log=True, y_min=1e-1,
vlines=[80, {'x': 100, 'color': 'b'}])
None
s_sig = McStack(p_sig, color=palette[1], histtype='step')
s_ztt = McStack(p_ztt, color=palette[0], histtype='step')
hist(df, v_higgs_m, 20, [s_bkg, s_data], range=(40, 120), selection=None,
weight="weight", ratio_label="Signal / Bkg", y_log=True, y_min=1e-1,
vlines=[80, {'x': 100, 'color': 'b'}], numerator=s_sig, denominator=s_ztt)
None
hist(df, v_higgs_m, 20, [s_bkg, s_data], range=(0, 200), selection=None,
weight="weight", ratio_label="Data - Bkg", y_log=True, y_min=1e-1, diff=True,
enlarge=1.5,
vlines=[80, {'x': 100, 'color': 'b'}], numerator=s_data, denominator=s_ztt)
None
hist(df, v_higgs_m, 20, [s_bkg, s_data], range=(0, 200), selection=None,
weight="weight", ratio_label="Data / SM", info=False, atlas="Work in progress")
None
import nnfwtbn.plot as nnp
nnp.INFO = "$\sqrt{s} = 13\,\mathrm{TeV}$, $140\,\mathrm{fb}^{-1}$"
hist(df, v_higgs_m, 20, [s_bkg, s_data], range=(0, 200), selection=None,
weight="weight", ratio_label="Data / SM")
None
s_sig = McStack(p_sig, color=palette[1], histtype='step')
s_ztt = McStack(p_ztt, color=palette[0], histtype='step')
hist(df, v_higgs_m, 20, [s_sig, s_ztt], range=(0, 200), selection=None,
weight="weight", numerator=None, density=True)
None
hist(df, v_higgs_m, 30, [s_bkg, s_data], range=(25, 175),
selection=None, numerator=[s_ztt, s_sig], denominator=s_data,
weight="weight", ratio_label="Process / Asimov")
None