18x = ROOT.RooRealVar(
"x",
"x", -10, 10)
21sigma = ROOT.RooRealVar(
"sigma",
"sigma", 1, 0.1, 10)
22mean = ROOT.RooRealVar(
"mean",
"mean", -3, -10, 10)
23gauss = ROOT.RooGaussian(
"gauss",
"gauss", x, mean, sigma)
26data = gauss.generate({x}, 1000)
29gauss.fitTo(data, PrintLevel=-1)
35frame = x.frame(Name=
"xframe", Title=
"RooPlot with decorations", Bins=40)
43gauss.paramOn(frame, Layout=0.55)
50data.statOn(frame, Layout=(0.55, 0.99, 0.8))
56txt = ROOT.TText(2, 100,
"Signal")
58txt.SetTextColor(ROOT.kRed)
62arrow = ROOT.TArrow(2, 100, -1, 50, 0.01,
"|>")
63arrow.SetLineColor(ROOT.kRed)
64arrow.SetFillColor(ROOT.kRed)
71f = ROOT.TFile(
"rf106_plotdecoration.root",
"RECREATE")
79c = ROOT.TCanvas(
"rf106_plotdecoration",
"rf106_plotdecoration", 600, 600)
80ROOT.gPad.SetLeftMargin(0.15)
81frame.GetYaxis().SetTitleOffset(1.6)
84c.SaveAs(
"rf106_plotdecoration.png")