19x = ROOT.RooRealVar(
"x",
"x", 0, 20)
20p = ROOT.RooPolynomial(
"p",
"p", x, [0.01, -0.01, 0.0004])
27data1 = p.generate({x}, 500)
30hist1 = data1.binnedClone()
33histpdf1 = ROOT.RooHistPdf(
"histpdf1",
"histpdf1", {x}, hist1, 0)
36frame1 = x.frame(Title=
"Low statistics histogram pdf", Bins=100)
38histpdf1.plotOn(frame1)
45data2 = p.generate({x}, 100000)
48hist2 = data2.binnedClone()
51histpdf2 = ROOT.RooHistPdf(
"histpdf2",
"histpdf2", {x}, hist2, 2)
54frame2 = x.frame(Title=
"High stats histogram pdf with interpolation", Bins=100)
56histpdf2.plotOn(frame2)
58c = ROOT.TCanvas(
"rf706_histpdf",
"rf706_histpdf", 800, 400)
61ROOT.gPad.SetLeftMargin(0.15)
62frame1.GetYaxis().SetTitleOffset(1.4)
65ROOT.gPad.SetLeftMargin(0.15)
66frame2.GetYaxis().SetTitleOffset(1.8)
69c.SaveAs(
"rf706_histpdf.png")