17x = ROOT.RooRealVar(
"x",
"x", 0, 20)
18p = ROOT.RooPolynomial(
"p",
"p", x, [0.01, -0.01, 0.0004])
25data1 = p.generate({x}, 500)
28hist1 = data1.binnedClone()
31histpdf1 = ROOT.RooHistPdf(
"histpdf1",
"histpdf1", {x}, hist1, 0)
34frame1 = x.frame(Title=
"Low statistics histogram pdf", Bins=100)
36histpdf1.plotOn(frame1)
43data2 = p.generate({x}, 100000)
46hist2 = data2.binnedClone()
49histpdf2 = ROOT.RooHistPdf(
"histpdf2",
"histpdf2", {x}, hist2, 2)
52frame2 = x.frame(Title=
"High stats histogram pdf with interpolation", Bins=100)
54histpdf2.plotOn(frame2)
56c = ROOT.TCanvas(
"rf706_histpdf",
"rf706_histpdf", 800, 400)
59ROOT.gPad.SetLeftMargin(0.15)
60frame1.GetYaxis().SetTitleOffset(1.4)
63ROOT.gPad.SetLeftMargin(0.15)
64frame2.GetYaxis().SetTitleOffset(1.8)
67c.SaveAs(
"rf706_histpdf.png")