19ROOT.RooAbsPdf.defaultIntegratorConfig().setEpsRel(1e-8)
20ROOT.RooAbsPdf.defaultIntegratorConfig().setEpsAbs(1e-8)
23x = ROOT.RooRealVar(
"x",
"x", -5, 5)
24y = ROOT.RooRealVar(
"y",
"y", -2, 2)
27a0 = ROOT.RooRealVar(
"a0",
"a0", 0)
28a1 = ROOT.RooRealVar(
"a1",
"a1", -1.5, -3, 1)
29fy = ROOT.RooPolyVar(
"fy",
"fy", y, ROOT.RooArgList(a0, a1))
32sigmax = ROOT.RooRealVar(
"sigmax",
"width of gaussian", 0.5)
33gaussx = ROOT.RooGaussian(
34 "gaussx",
"Gaussian in x with shifting mean in y", x, fy, sigmax)
37gaussy = ROOT.RooGaussian(
41 ROOT.RooFit.RooConst(0),
42 ROOT.RooFit.RooConst(2))
45model = ROOT.RooProdPdf(
47 "gaussx(x|y)*gaussy(y)",
48 ROOT.RooArgSet(gaussy),
49 ROOT.RooFit.Conditional(
50 ROOT.RooArgSet(gaussx),
57modelx = model.createProjection(ROOT.RooArgSet(y))
63data = modelx.generateBinned(ROOT.RooArgSet(x), 1000)
66modelx.fitTo(data, ROOT.RooFit.Verbose())
74hh = model.createHistogram(
"x,y")
75hh.SetLineColor(ROOT.kBlue)
77c = ROOT.TCanvas(
"rf315_projectpdf",
"rf315_projectpdf", 800, 400)
80ROOT.gPad.SetLeftMargin(0.15)
81frame.GetYaxis().SetTitleOffset(1.4)
84ROOT.gPad.SetLeftMargin(0.20)
85hh.GetZaxis().SetTitleOffset(2.5)
87c.SaveAs(
"rf315_projectpdf.png")