17x = ROOT.RooRealVar(
"x",
"x", -5, 5)
18y = ROOT.RooRealVar(
"y",
"y", -5, 5)
21a0 = ROOT.RooRealVar(
"a0",
"a0", -3.5, -5, 5)
22a1 = ROOT.RooRealVar(
"a1",
"a1", -1.5, -1, 1)
23sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 1.5)
26fy = ROOT.RooFormulaVar(
"fy",
"a0-a1*sqrt(10*abs(y))",
27 ROOT.RooArgList(y, a0, a1))
30model = ROOT.RooGaussian(
31 "model",
"Gaussian with shifting mean", x, fy, sigma)
34data = model.generate(ROOT.RooArgSet(x, y), 10000)
43hh_data = ROOT.RooAbsData.createHistogram(data,
"x,y", x, ROOT.RooFit.Binning(
44 20), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(20)))
48hh_pdf = model.createHistogram(
"x,y", 50, 50)
49hh_pdf.SetLineColor(ROOT.kBlue)
55z = ROOT.RooRealVar(
"z",
"z", -5, 5)
58 "gz",
"gz", z, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(2))
59model3 = ROOT.RooProdPdf(
"model3",
"model3", ROOT.RooArgList(model, gz))
61data3 = model3.generate(ROOT.RooArgSet(x, y, z), 10000)
68hh_data3 = ROOT.RooAbsData.createHistogram(
69 data3,
"hh_data3", x, ROOT.RooFit.Binning(8), ROOT.RooFit.YVar(
70 y, ROOT.RooFit.Binning(8)), ROOT.RooFit.ZVar(
71 z, ROOT.RooFit.Binning(8)))
74hh_pdf3 = model3.createHistogram(
75 "hh_model3", x, ROOT.RooFit.Binning(20), ROOT.RooFit.YVar(
76 y, ROOT.RooFit.Binning(20)), ROOT.RooFit.ZVar(
77 z, ROOT.RooFit.Binning(20)))
78hh_pdf3.SetFillColor(ROOT.kBlue)
80c1 = ROOT.TCanvas(
"rf309_2dimplot",
"rf309_2dimplot", 800, 800)
83ROOT.gPad.SetLeftMargin(0.15)
84hh_data.GetZaxis().SetTitleOffset(1.4)
87ROOT.gPad.SetLeftMargin(0.20)
88hh_pdf.GetZaxis().SetTitleOffset(2.5)
91ROOT.gPad.SetLeftMargin(0.15)
92hh_data.GetZaxis().SetTitleOffset(1.4)
95ROOT.gPad.SetLeftMargin(0.15)
96hh_pdf.GetZaxis().SetTitleOffset(2.5)
98c1.SaveAs(
"rf309_2dimplot.png")
100c2 = ROOT.TCanvas(
"rf309_3dimplot",
"rf309_3dimplot", 800, 400)
103ROOT.gPad.SetLeftMargin(0.15)
104hh_data3.GetZaxis().SetTitleOffset(1.4)
107ROOT.gPad.SetLeftMargin(0.15)
108hh_pdf3.GetZaxis().SetTitleOffset(1.4)
110c2.SaveAs(
"rf309_3dimplot.png")