16 x = ROOT.RooRealVar(
"x",
"x", -10, 10)
19 sigma = ROOT.RooRealVar(
"sigma",
"sigma", 1, 0.1, 10)
20 mean = ROOT.RooRealVar(
"mean",
"mean", -3, -10, 10)
21 gauss = ROOT.RooGaussian(
"gauss",
"gauss", x, mean, sigma)
24 data = gauss.generate(ROOT.RooArgSet(x), 1000)
33 frame = x.frame(ROOT.RooFit.Name(
"xframe"), ROOT.RooFit.Title(
34 "RooPlot with decorations"), ROOT.RooFit.Bins(40))
42 gauss.paramOn(frame, ROOT.RooFit.Layout(0.55))
49 data.statOn(frame, ROOT.RooFit.Layout(0.55, 0.99, 0.8))
55 txt = ROOT.TText(2, 100,
"Signal")
57 txt.SetTextColor(ROOT.kRed)
61 arrow = ROOT.TArrow(2, 100, -1, 50, 0.01,
"|>")
62 arrow.SetLineColor(ROOT.kRed)
63 arrow.SetFillColor(ROOT.kRed)
65 frame.addObject(arrow)
70 f = ROOT.TFile(
"rf106_plotdecoration.root",
"RECREATE")
78 c = ROOT.TCanvas(
"rf106_plotdecoration",
"rf106_plotdecoration", 600, 600)
79 ROOT.gPad.SetLeftMargin(0.15)
80 frame.GetYaxis().SetTitleOffset(1.6)
83 c.SaveAs(
"rf106_plotdecoration.png")