3import matplotlib.pyplot
as plt
5output_file = {
"Mbc": snakemake.output.mbc_plot,
"deltaE": snakemake.output.deltaE_plot}
6BBdata = snakemake.input.data_BB
7QQdata = snakemake.input.data_QQ
9treeName =
'BtoPiDtoKPiPi'
10some_variables = [
"Mbc",
"deltaE"]
11BBtuple = uproot.open(f
"{BBdata}:{treeName}")
12QQtuple = uproot.open(f
"{QQdata}:{treeName}")
14for 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)