20x = ROOT.RooRealVar(
"x",
"x", -10, 10)
21y = ROOT.RooRealVar(
"y",
"y", -10, 10)
24gx = ROOT.RooGaussian(
"gx",
"gx", x, -2.0, 3.0)
25gy = ROOT.RooGaussian(
"gy",
"gy", y, +2.0, 2.0)
28gxy = ROOT.RooProdPdf(
"gxy",
"gxy", [gx, gy])
34print(
"gxy = ", gxy.getVal())
38print(
"gx_Norm[x,y] = ", gxy.getVal(nset_xy))
43igxy = gxy.createIntegral(x_and_y)
44print(
"gx_Int[x,y] = ", igxy.getVal())
51print(
"gx_Norm[x] = ", gxy.getVal(nset_x))
56print(
"gx_Norm[y] = ", gxy.getVal(nset_y))
62x.setRange(
"signal", -5, 5)
63y.setRange(
"signal", -3, 3)
69igxy_sig = gxy.createIntegral(x_and_y, NormSet=x_and_y, Range=
"signal")
70print(
"gx_Int[x,y|signal]_Norm[x,y] = ", igxy_sig.getVal())
77gxy_cdf = gxy.createCdf({x, y})
80hh_cdf = gxy_cdf.createHistogram(
"hh_cdf", x, Binning=40, YVar=dict(var=y, Binning=40))
81hh_cdf.SetLineColor(ROOT.kBlue)
83c = ROOT.TCanvas(
"rf308_normintegration2d",
"rf308_normintegration2d", 600, 600)
84ROOT.gPad.SetLeftMargin(0.15)
85hh_cdf.GetZaxis().SetTitleOffset(1.8)
88c.SaveAs(
"rf308_normintegration2d.png")