Belle II Software
release-08-01-10
plotting.py
1
# Include this only if running in a Jupyter notebook
2
# %matplotlib inline
3
4
import
matplotlib.pyplot
as
plt
5
import
uproot
6
7
var_list = [
'isContinuumEvent'
,
'ContProb'
]
8
df = uproot.open(
"ContinuumSuppression_applied.root:tree"
).arrays(var_list, library=
'pd'
)
9
10
fig, ax = plt.subplots()
11
12
signal_df = df.query(
"(isContinuumEvent == 0.0)"
)
13
continuum_df = df.query(
"(isContinuumEvent == 1.0)"
)
14
15
hist_kwargs = dict(bins=30, range=(0, 1), histtype=
"step"
)
16
ax.hist(signal_df[
"ContProb"
], label=
"Not Continuum"
, **hist_kwargs)
17
ax.hist(continuum_df[
"ContProb"
], label=
"Continuum"
, **hist_kwargs)
18
ax.set_xlabel(
"ContinuumProbability"
)
19
ax.set_ylabel(
"Total number of candidates"
)
20
ax.legend()
21
fig.savefig(
"ContinuumProbability.pdf"
)
online_book
basf2
cs
plotting.py
Generated on Mon Sep 23 2024 14:03:23 for Belle II Software by
1.9.1