print '**DANGER** The fit probability is low **DANGER**'
    if opts.debug:
        assert(False)

#assert(False)

mass.setRange('signal', fitterPars.minTrunc, fitterPars.maxTrunc)
#yields = theFitter.makeFitter().coefList()
finalPars = fr.floatParsFinal()
yields = RooArgList(finalPars)
yields.add(fr.constPars())
sigInt = theFitter.makeFitter().createIntegral(iset,iset,'signal')
sigFullInt = theFitter.makeFitter().createIntegral(iset,iset)
print "allBkg","sigInt",sigInt.getVal(),"fullInt",sigFullInt.getVal(),\
      "ratio",sigInt.getVal()/sigFullInt.getVal()
dibosonInt = theFitter.makeDibosonPdf().createIntegral(iset,iset,'signal')
dibosonFullInt = theFitter.makeDibosonPdf().createIntegral(iset,iset)
WpJPdf = theFitter.makeWpJPdf()
WpJInt = WpJPdf.createIntegral(iset, iset, 'signal')
WpJFullInt = WpJPdf.createIntegral(iset, iset)
#WpJPdf.Print("v")
print "WpJ","sigInt",WpJInt.getVal(),"fullInt",WpJFullInt.getVal(),\
      "ratio",WpJInt.getVal()/WpJFullInt.getVal()
ttbarInt = theFitter.makettbarPdf().createIntegral(iset, iset, 'signal')
ttbarFullInt = theFitter.makettbarPdf().createIntegral(iset, iset)
SingleTopInt = theFitter.makeSingleTopPdf().createIntegral(iset, iset, 'signal')
SingleTopFullInt = theFitter.makeSingleTopPdf().createIntegral(iset, iset)
QCDInt = theFitter.makeQCDPdf().createIntegral(iset, iset, 'signal')
QCDFullInt = theFitter.makeQCDPdf().createIntegral(iset, iset)
ZpJInt = theFitter.makeZpJPdf().createIntegral(iset, iset, 'signal')
ZpJFullInt = theFitter.makeZpJPdf().createIntegral(iset, iset)
    print '**DANGER** The fit probability is low **DANGER**'
    if opts.debug:
        assert(False)

#assert(False)

mass.setRange('signal', fitterPars.minTrunc, fitterPars.maxTrunc)
#yields = theFitter.makeFitter().coefList()
finalPars = fr.floatParsFinal()
yields = RooArgList(finalPars)
yields.add(fr.constPars())
sigInt = theFitter.makeFitter().createIntegral(iset,iset,'signal')
sigFullInt = theFitter.makeFitter().createIntegral(iset,iset)
print "allBkg","sigInt",sigInt.getVal(),"fullInt",sigFullInt.getVal(),\
      "ratio",sigInt.getVal()/sigFullInt.getVal()
dibosonInt = theFitter.makeDibosonPdf().createIntegral(iset,iset,'signal')
dibosonFullInt = theFitter.makeDibosonPdf().createIntegral(iset,iset)
WpJPdf = theFitter.makeWpJPdf()
WpJInt = WpJPdf.createIntegral(iset, iset, 'signal')
WpJFullInt = WpJPdf.createIntegral(iset, iset)
#WpJPdf.Print("v")
print "WpJ","sigInt",WpJInt.getVal(),"fullInt",WpJFullInt.getVal(),\
      "ratio",WpJInt.getVal()/WpJFullInt.getVal()
ttbarInt = theFitter.makettbarPdf().createIntegral(iset, iset, 'signal')
ttbarFullInt = theFitter.makettbarPdf().createIntegral(iset, iset)
SingleTopInt = theFitter.makeSingleTopPdf().createIntegral(iset, iset, 'signal')
SingleTopFullInt = theFitter.makeSingleTopPdf().createIntegral(iset, iset)
QCDInt = theFitter.makeQCDPdf().createIntegral(iset, iset, 'signal')
QCDFullInt = theFitter.makeQCDPdf().createIntegral(iset, iset)
ZpJInt = theFitter.makeZpJPdf().createIntegral(iset, iset, 'signal')
ZpJFullInt = theFitter.makeZpJPdf().createIntegral(iset, iset)
elif fitterPars.includeMuons:
    modeString = 'Muon'
elif fitterPars.includeElectrons:
    modeString = 'Electron'
else:
    modeString = ''

dibosonParameterize = 0
if opts.btag:
    dibosonParameterize = 2
    fitterPars.constrainWpJShape = True
    fitterPars.constrainDibosonShape = True

theFitter = RooWjjMjjFitter(fitterPars)

theFitter.makeDibosonPdf(dibosonParameterize)
theFitter.makeFitter((opts.ParamWpJ>=0))

#theFitter.getWorkSpace().Print()
fr = theFitter.fit()

# chi2 = Double(0.)
#ndf = Long(2)
extraNdf = 0
if not opts.btag:
    extraNdf = 2
## if (fitterPars.doNewPhysics):
##     extraNdf += 1
## if not fitterPars.constrainDiboson:
##     extraNdf += 1
## ndf = Long(3+extraNdf)