19x = ROOT.RooRealVar(
"x",
"x", -5, 5)
20y = ROOT.RooRealVar(
"y",
"y", -5, 5)
23a0 = ROOT.RooRealVar(
"a0",
"a0", -0.5, -5, 5)
24a1 = ROOT.RooRealVar(
"a1",
"a1", -0.5, -1, 1)
25fy = ROOT.RooPolyVar(
"fy",
"fy", y, ROOT.RooArgList(a0, a1))
28sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
29model = ROOT.RooGaussian(
30 "model",
"Gaussian with shifting mean", x, fy, sigma)
36data = model.generate(ROOT.RooArgSet(x, y), 10000)
51hh_model = model.createHistogram(
"hh_model", x, ROOT.RooFit.Binning(
52 50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
53hh_model.SetLineColor(ROOT.kBlue)
56c = ROOT.TCanvas(
"rf301_composition",
"rf301_composition", 1200, 400)
59ROOT.gPad.SetLeftMargin(0.15)
60xframe.GetYaxis().SetTitleOffset(1.4)
63ROOT.gPad.SetLeftMargin(0.15)
64yframe.GetYaxis().SetTitleOffset(1.4)
67ROOT.gPad.SetLeftMargin(0.20)
68hh_model.GetZaxis().SetTitleOffset(2.5)
71c.SaveAs(
"rf301_composition.png")