20ROOT.RooAbsPdf.defaultIntegratorConfig().setEpsRel(1e-8)
21ROOT.RooAbsPdf.defaultIntegratorConfig().setEpsAbs(1e-8)
24x = ROOT.RooRealVar(
"x",
"x", -5, 5)
25y = ROOT.RooRealVar(
"y",
"y", -2, 2)
28a0 = ROOT.RooRealVar(
"a0",
"a0", 0)
29a1 = ROOT.RooRealVar(
"a1",
"a1", -1.5, -3, 1)
30fy = ROOT.RooPolyVar(
"fy",
"fy", y, ROOT.RooArgList(a0, a1))
33sigmax = ROOT.RooRealVar(
"sigmax",
"width of gaussian", 0.5)
34gaussx = ROOT.RooGaussian(
35 "gaussx",
"Gaussian in x with shifting mean in y", x, fy, sigmax)
38gaussy = ROOT.RooGaussian(
42 ROOT.RooFit.RooConst(0),
43 ROOT.RooFit.RooConst(2))
46model = ROOT.RooProdPdf(
48 "gaussx(x|y)*gaussy(y)",
49 ROOT.RooArgSet(gaussy),
50 ROOT.RooFit.Conditional(
51 ROOT.RooArgSet(gaussx),
58modelx = model.createProjection(ROOT.RooArgSet(y))
64data = modelx.generateBinned(ROOT.RooArgSet(x), 1000)
67modelx.fitTo(data, ROOT.RooFit.Verbose())
75hh = model.createHistogram(
"x,y")
76hh.SetLineColor(ROOT.kBlue)
78c = ROOT.TCanvas(
"rf315_projectpdf",
"rf315_projectpdf", 800, 400)
81ROOT.gPad.SetLeftMargin(0.15)
82frame.GetYaxis().SetTitleOffset(1.4)
85ROOT.gPad.SetLeftMargin(0.20)
86hh.GetZaxis().SetTitleOffset(2.5)
88c.SaveAs(
"rf315_projectpdf.png")