19x = ROOT.RooRealVar(
"x",
"x", -10, 10)
22sigma = ROOT.RooRealVar(
"sigma",
"sigma", 3, 0.1, 10)
23mean = ROOT.RooRealVar(
"mean",
"mean", -3, -10, 10)
24gauss = ROOT.RooGaussian(
"gauss",
"gauss", x, mean, sigma)
27data = gauss.generate(ROOT.RooArgSet(x), 100)
36frame1 = x.frame(ROOT.RooFit.Name(
"xframe"), ROOT.RooFit.Title(
37 "Red Curve / SumW2 Histo errors"), ROOT.RooFit.Bins(20))
38frame2 = x.frame(ROOT.RooFit.Name(
"xframe"), ROOT.RooFit.Title(
39 "Dashed Curve / No XError bars"), ROOT.RooFit.Bins(20))
40frame3 = x.frame(ROOT.RooFit.Name(
"xframe"), ROOT.RooFit.Title(
41 "Filled Curve / Blue Histo"), ROOT.RooFit.Bins(20))
42frame4 = x.frame(ROOT.RooFit.Name(
"xframe"), ROOT.RooFit.Title(
43 "Partial Range / Filled Bar chart"), ROOT.RooFit.Bins(20))
49data.plotOn(frame1, ROOT.RooFit.DataError(ROOT.RooAbsData.SumW2))
52data.plotOn(frame2, ROOT.RooFit.XErrorSize(0))
55data.plotOn(frame3, ROOT.RooFit.MarkerColor(
56 ROOT.kBlue), ROOT.RooFit.LineColor(ROOT.kBlue))
61 ROOT.RooFit.DrawOption(
"B"),
62 ROOT.RooFit.DataError(
63 ROOT.RooAbsData.ErrorType(2)),
64 ROOT.RooFit.XErrorSize(0),
65 ROOT.RooFit.FillColor(
72gauss.plotOn(frame1, ROOT.RooFit.LineColor(ROOT.kRed))
75gauss.plotOn(frame2, ROOT.RooFit.LineStyle(ROOT.kDashed))
78gauss.plotOn(frame3, ROOT.RooFit.DrawOption(
"F"),
79 ROOT.RooFit.FillColor(ROOT.kOrange), ROOT.RooFit.MoveToBack())
82gauss.plotOn(frame4, ROOT.RooFit.Range(-8, 3),
83 ROOT.RooFit.LineColor(ROOT.kMagenta))
85c = ROOT.TCanvas(
"rf107_plotstyles",
"rf107_plotstyles", 800, 800)
88ROOT.gPad.SetLeftMargin(0.15)
89frame1.GetYaxis().SetTitleOffset(1.6)
92ROOT.gPad.SetLeftMargin(0.15)
93frame2.GetYaxis().SetTitleOffset(1.6)
96ROOT.gPad.SetLeftMargin(0.15)
97frame3.GetYaxis().SetTitleOffset(1.6)
100ROOT.gPad.SetLeftMargin(0.15)
101frame4.GetYaxis().SetTitleOffset(1.6)
104c.SaveAs(
"rf107_plotstyles.png")