14from __future__ 
import print_function
 
   21x = ROOT.RooRealVar(
"x", 
"x", -10, 10)
 
   22y = ROOT.RooRealVar(
"y", 
"y", -10, 10)
 
   25gx = ROOT.RooGaussian(
"gx", 
"gx", x, ROOT.RooFit.RooConst(-2), ROOT.RooFit.RooConst(3))
 
   26gy = ROOT.RooGaussian(
"gy", 
"gy", y, ROOT.RooFit.RooConst(+2), ROOT.RooFit.RooConst(2))
 
   29gxy = ROOT.RooProdPdf(
"gxy", 
"gxy", [gx, gy])
 
   35print(
"gxy = ", gxy.getVal())
 
   39print(
"gx_Norm[x,y] = ", gxy.getVal(nset_xy))
 
   44igxy = gxy.createIntegral(x_and_y)
 
   45print(
"gx_Int[x,y] = ", igxy.getVal())
 
   52print(
"gx_Norm[x] = ", gxy.getVal(nset_x))
 
   57print(
"gx_Norm[y] = ", gxy.getVal(nset_y))
 
   63x.setRange(
"signal", -5, 5)
 
   64y.setRange(
"signal", -3, 3)
 
   70igxy_sig = gxy.createIntegral(x_and_y, NormSet=x_and_y, Range=
"signal")
 
   71print(
"gx_Int[x,y|signal]_Norm[x,y] = ", igxy_sig.getVal())
 
   78gxy_cdf = gxy.createCdf({x, y})
 
   81hh_cdf = gxy_cdf.createHistogram(
"hh_cdf", x, Binning=40, YVar=dict(var=y, Binning=40))
 
   82hh_cdf.SetLineColor(ROOT.kBlue)
 
   84c = ROOT.TCanvas(
"rf308_normintegration2d", 
"rf308_normintegration2d", 600, 600)
 
   85ROOT.gPad.SetLeftMargin(0.15)
 
   86hh_cdf.GetZaxis().SetTitleOffset(1.8)
 
   89c.SaveAs(
"rf308_normintegration2d.png")