19x = ROOT.RooRealVar(
"x",
"x", -10, 10)
20mean = ROOT.RooRealVar(
"mean",
"mean of gaussian", 1, -10, 10)
21sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 1, 0.1, 10)
24gauss = ROOT.RooGaussian(
"gauss",
"gaussian PDF", x, mean, sigma)
27xframe = x.frame(Title=
"Gaussian pdf")
38gauss.plotOn(xframe, LineColor=
"r")
43data = gauss.generate({x}, 10000)
47xframe2 = x.frame(Title=
"Gaussian pdf with data")
54gauss.fitTo(data, PrintLevel=-1)
62c = ROOT.TCanvas(
"rf101_basics",
"rf101_basics", 800, 400)
65ROOT.gPad.SetLeftMargin(0.15)
66xframe.GetYaxis().SetTitleOffset(1.6)
69ROOT.gPad.SetLeftMargin(0.15)
70xframe2.GetYaxis().SetTitleOffset(1.6)
73c.SaveAs(
"rf101_basics.png")