20x = ROOT.RooRealVar(
"x",
"x", -5, 5)
21y = ROOT.RooRealVar(
"y",
"y", -5, 5)
24a0 = ROOT.RooRealVar(
"a0",
"a0", -0.5, -5, 5)
25a1 = ROOT.RooRealVar(
"a1",
"a1", -0.5, -1, 1)
26fy = ROOT.RooPolyVar(
"fy",
"fy", y, ROOT.RooArgList(a0, a1))
29sigmax = ROOT.RooRealVar(
"sigma",
"width of gaussian", 0.5)
30gaussx = ROOT.RooGaussian(
31 "gaussx",
"Gaussian in x with shifting mean in y", x, fy, sigmax)
37gaussy = ROOT.RooGaussian(
41 ROOT.RooFit.RooConst(0),
42 ROOT.RooFit.RooConst(3))
48model = ROOT.RooProdPdf(
50 "gaussx(x|y)*gaussy(y)",
51 ROOT.RooArgSet(gaussy),
52 ROOT.RooFit.Conditional(
53 ROOT.RooArgSet(gaussx),
60data = model.generate(ROOT.RooArgSet(x, y), 10000)
75hh_model = model.createHistogram(
"hh_model", x, ROOT.RooFit.Binning(
76 50), ROOT.RooFit.YVar(y, ROOT.RooFit.Binning(50)))
77hh_model.SetLineColor(ROOT.kBlue)
80c = ROOT.TCanvas(
"rf305_condcorrprod",
"rf05_condcorrprod", 1200, 400)
83ROOT.gPad.SetLeftMargin(0.15)
84xframe.GetYaxis().SetTitleOffset(1.6)
87ROOT.gPad.SetLeftMargin(0.15)
88yframe.GetYaxis().SetTitleOffset(1.6)
91ROOT.gPad.SetLeftMargin(0.20)
92hh_model.GetZaxis().SetTitleOffset(2.5)
95c.SaveAs(
"rf305_condcorrprod.png")