18x = ROOT.RooRealVar(
"x",
"x", -10, 10)
21sigma = ROOT.RooRealVar(
"sigma",
"sigma", 3, 0.1, 10)
22mean = ROOT.RooRealVar(
"mean",
"mean", -3, -10, 10)
23gauss = ROOT.RooGaussian(
"gauss",
"gauss", x, mean, sigma)
26data = gauss.generate({x}, 100)
35frame1 = x.frame(Name=
"xframe", Title=
"Red Curve / SumW2 Histo errors", Bins=20)
36frame2 = x.frame(Name=
"xframe", Title=
"Dashed Curve / No XError bars", Bins=20)
37frame3 = x.frame(Name=
"xframe", Title=
"Filled Curve / Blue Histo", Bins=20)
38frame4 = x.frame(Name=
"xframe", Title=
"Partial Range / Filled Bar chart", Bins=20)
44data.plotOn(frame1, DataError=
"SumW2")
47data.plotOn(frame2, XErrorSize=0)
50data.plotOn(frame3, MarkerColor=
"b", LineColor=
"b")
53data.plotOn(frame4, DrawOption=
"B", DataError=
None, XErrorSize=0, FillColor=
"kGray")
59gauss.plotOn(frame1, LineColor=
"r")
62gauss.plotOn(frame2, LineStyle=
"--")
65gauss.plotOn(frame3, MoveToBack=
True, DrawOption=
"F", FillColor=
"kOrange")
68gauss.plotOn(frame4, Range=(-8, 3), LineColor=
"m")
70c = ROOT.TCanvas(
"rf107_plotstyles",
"rf107_plotstyles", 800, 800)
73ROOT.gPad.SetLeftMargin(0.15)
74frame1.GetYaxis().SetTitleOffset(1.6)
77ROOT.gPad.SetLeftMargin(0.15)
78frame2.GetYaxis().SetTitleOffset(1.6)
81ROOT.gPad.SetLeftMargin(0.15)
82frame3.GetYaxis().SetTitleOffset(1.6)
85ROOT.gPad.SetLeftMargin(0.15)
86frame4.GetYaxis().SetTitleOffset(1.6)
89c.SaveAs(
"rf107_plotstyles.png")