18x = ROOT.RooRealVar(
"x",
"x", -5, 5)
19y = ROOT.RooRealVar(
"y",
"y", -5, 5)
22a0 = ROOT.RooRealVar(
"a0",
"a0", -3.5, -5, 5)
23a1 = ROOT.RooRealVar(
"a1",
"a1", -1.5, -1, 1)
24sigma = ROOT.RooRealVar(
"sigma",
"width of gaussian", 1.5)
27fy = ROOT.RooFormulaVar(
"fy",
"a0-a1*sqrt(10*abs(y))",
28 ROOT.RooArgList(y, a0, a1))
31model = ROOT.RooGaussian(
32 "model",
"Gaussian with shifting mean", x, fy, sigma)
35data = model.generate(ROOT.RooArgSet(x, y), 10000)
44hh_data = ROOT.RooAbsData.createHistogram(data,
"x,y", x, ROOT.RooFit.Binning(
45 20), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(20)))
49hh_pdf = model.createHistogram(
"x,y", 50, 50)
50hh_pdf.SetLineColor(ROOT.kBlue)
56z = ROOT.RooRealVar(
"z",
"z", -5, 5)
59 "gz",
"gz", z, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(2))
60model3 = ROOT.RooProdPdf(
"model3",
"model3", ROOT.RooArgList(model, gz))
62data3 = model3.generate(ROOT.RooArgSet(x, y, z), 10000)
69hh_data3 = ROOT.RooAbsData.createHistogram(
70 data3,
"hh_data3", x, ROOT.RooFit.Binning(8), ROOT.RooFit.YVar(
71 y, ROOT.RooFit.Binning(8)), ROOT.RooFit.ZVar(
72 z, ROOT.RooFit.Binning(8)))
75hh_pdf3 = model3.createHistogram(
76 "hh_model3", x, ROOT.RooFit.Binning(20), ROOT.RooFit.YVar(
77 y, ROOT.RooFit.Binning(20)), ROOT.RooFit.ZVar(
78 z, ROOT.RooFit.Binning(20)))
79hh_pdf3.SetFillColor(ROOT.kBlue)
81c1 = ROOT.TCanvas(
"rf309_2dimplot",
"rf309_2dimplot", 800, 800)
84ROOT.gPad.SetLeftMargin(0.15)
85hh_data.GetZaxis().SetTitleOffset(1.4)
88ROOT.gPad.SetLeftMargin(0.20)
89hh_pdf.GetZaxis().SetTitleOffset(2.5)
92ROOT.gPad.SetLeftMargin(0.15)
93hh_data.GetZaxis().SetTitleOffset(1.4)
96ROOT.gPad.SetLeftMargin(0.15)
97hh_pdf.GetZaxis().SetTitleOffset(2.5)
99c1.SaveAs(
"rf309_2dimplot.png")
101c2 = ROOT.TCanvas(
"rf309_3dimplot",
"rf309_3dimplot", 800, 400)
104ROOT.gPad.SetLeftMargin(0.15)
105hh_data3.GetZaxis().SetTitleOffset(1.4)
108ROOT.gPad.SetLeftMargin(0.15)
109hh_pdf3.GetZaxis().SetTitleOffset(1.4)
111c2.SaveAs(
"rf309_3dimplot.png")