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, [a0, a1])
32sigmax = ROOT.RooRealVar(
"sigmax",
"width of gaussian", 0.5)
33gaussx = ROOT.RooGaussian(
"gaussx",
"Gaussian in x with shifting mean in y", x, fy, sigmax)
36gaussy = ROOT.RooGaussian(
"gaussy",
"Gaussian in y", y, ROOT.RooFit.RooConst(0), ROOT.RooFit.RooConst(2))
39model = ROOT.RooProdPdf(
41 "gaussx(x|y)*gaussy(y)",
43 Conditional=({gaussx}, {x}),
50modelx = model.createProjection({y})
56data = modelx.generateBinned({x}, 1000)
59modelx.fitTo(data, Verbose=
True)
67hh = model.createHistogram(
"x,y")
68hh.SetLineColor(ROOT.kBlue)
70c = ROOT.TCanvas(
"rf315_projectpdf",
"rf315_projectpdf", 800, 400)
73ROOT.gPad.SetLeftMargin(0.15)
74frame.GetYaxis().SetTitleOffset(1.4)
77ROOT.gPad.SetLeftMargin(0.20)
78hh.GetZaxis().SetTitleOffset(2.5)
80c.SaveAs(
"rf315_projectpdf.png")