17x = ROOT.RooRealVar(
"x",
"x", -10, 10)
18mean = ROOT.RooRealVar(
"mean",
"mean of gaussian", 1, -10, 10)
19sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 1, 0.1, 10)
22gauss = ROOT.RooGaussian(
"gauss",
"gaussian PDF", x, mean, sigma)
25xframe = x.frame(Title=
"Gaussian pdf")
36gauss.plotOn(xframe, LineColor=
"r")
41data = gauss.generate({x}, 10000)
45xframe2 = x.frame(Title=
"Gaussian pdf with data")
60c = ROOT.TCanvas(
"rf101_basics",
"rf101_basics", 800, 400)
63ROOT.gPad.SetLeftMargin(0.15)
64xframe.GetYaxis().SetTitleOffset(1.6)
67ROOT.gPad.SetLeftMargin(0.15)
68xframe2.GetYaxis().SetTitleOffset(1.6)
71c.SaveAs(
"rf101_basics.png")