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(ROOT.RooFit.Title(
"Gaussian p.d.f."))
36gauss.plotOn(xframe, ROOT.RooFit.LineColor(ROOT.kRed))
41data = gauss.generate(ROOT.RooArgSet(x), 10000)
45xframe2 = x.frame(ROOT.RooFit.Title(
46 "Gaussian p.d.f. with data"))
61c = ROOT.TCanvas(
"rf101_basics",
"rf101_basics", 800, 400)
64ROOT.gPad.SetLeftMargin(0.15)
65xframe.GetYaxis().SetTitleOffset(1.6)
68ROOT.gPad.SetLeftMargin(0.15)
69xframe2.GetYaxis().SetTitleOffset(1.6)
72c.SaveAs(
"rf101_basics.png")