3 import matplotlib.pyplot
as plt
5 output_file = {
"Mbc": snakemake.output.mbc_plot,
"deltaE": snakemake.output.deltaE_plot}
6 BBdata = snakemake.input.data_BB
7 QQdata = snakemake.input.data_QQ
9 treeName =
'BtoPiDtoKPiPi'
10 some_variables = [
"Mbc",
"deltaE"]
11 BBtuple = uproot.open(f
"{BBdata}:{treeName}")
12 QQtuple = uproot.open(f
"{QQdata}:{treeName}")
14 for var
in some_variables:
15 plt.hist([QQtuple[var].array(), BBtuple[var].array()], label=[
"uudd Continuum",
"mixed B mesons"], stacked=
True)
16 plt.legend(loc=
'best')
17 plt.xlabel(f
"{var} [GeV]")
18 plt.savefig(output_file[var], dpi=100)