12from __future__
import print_function
19x = ROOT.RooRealVar(
"x",
"x", -10, 10)
20y = ROOT.RooRealVar(
"y",
"y", -10, 10)
23gx = ROOT.RooGaussian(
"gx",
"gx", x, ROOT.RooFit.RooConst(-2), ROOT.RooFit.RooConst(3))
24gy = ROOT.RooGaussian(
"gy",
"gy", y, ROOT.RooFit.RooConst(+2), ROOT.RooFit.RooConst(2))
27gxy = ROOT.RooProdPdf(
"gxy",
"gxy", [gx, gy])
33print(
"gxy = ", gxy.getVal())
37print(
"gx_Norm[x,y] = ", gxy.getVal(nset_xy))
42igxy = gxy.createIntegral(x_and_y)
43print(
"gx_Int[x,y] = ", igxy.getVal())
50print(
"gx_Norm[x] = ", gxy.getVal(nset_x))
55print(
"gx_Norm[y] = ", gxy.getVal(nset_y))
61x.setRange(
"signal", -5, 5)
62y.setRange(
"signal", -3, 3)
68igxy_sig = gxy.createIntegral(x_and_y, NormSet=x_and_y, Range=
"signal")
69print(
"gx_Int[x,y|signal]_Norm[x,y] = ", igxy_sig.getVal())
76gxy_cdf = gxy.createCdf({x, y})
79hh_cdf = gxy_cdf.createHistogram(
"hh_cdf", x, Binning=40, YVar=dict(var=y, Binning=40))
80hh_cdf.SetLineColor(ROOT.kBlue)
82c = ROOT.TCanvas(
"rf308_normintegration2d",
"rf308_normintegration2d", 600, 600)
83ROOT.gPad.SetLeftMargin(0.15)
84hh_cdf.GetZaxis().SetTitleOffset(1.8)
87c.SaveAs(
"rf308_normintegration2d.png")