if not (yields[v1].GetName() == 'nDiboson') \
                   and not (yields[v2].GetName() == 'nDiboson'):
                sig2 += covMatrix(v1, v2)
            sig2All += covMatrix(v1, v2)

from plotMjjFit import plot2BodyDist

if (opts.Err >= 0) and (opts.Err < 1):
    opts.Err = sqrt(sig2)

leftLegend = True #(not opts.btag)
PrefixString = "Diboson"
if opts.btag:
    PrefixString += "_btag"
(plots, cans) = plot2BodyDist(theFitter, fitterPars, chi2, ndf,
                              opts.Err, Prefix = PrefixString,
                              Left = leftLegend)

h_total = plots[0].getCurve('h_total')
theData = plots[0].getHist('theData')

## mass.setRange('signal', fitterPars.minTrunc, fitterPars.maxTrunc)
## sigInt = theFitter.makeFitter().createIntegral(iset, 'signal')
## sigFullInt = theFitter.makeFitter().createIntegral(iset)
## dibosonInt = theFitter.makeDibosonPdf().createIntegral(iset, 'signal')
## dibosonFullInt = theFitter.makeDibosonPdf().createIntegral(iset)
## WpJInt = theFitter.makeWpJPdf().createIntegral(iset, 'signal')
## WpJFullInt = theFitter.makeWpJPdf().createIntegral(iset)
## ttbarInt = theFitter.makettbarPdf().createIntegral(iset, 'signal')
## ttbarFullInt = theFitter.makettbarPdf().createIntegral(iset)
## SingleTopInt = theFitter.makeSingleTopPdf().createIntegral(iset, 'signal')
covMatrix = TMatrixDSym(fr.covarianceMatrix())

sig2 = 0.
for v1 in range(0, covMatrix.GetNrows()):
    for v2 in range(0, covMatrix.GetNcols()):
        if ((yields[v1].GetName())[0] == 'n') and \
               ((yields[v2].GetName())[0] == 'n'):
            #print v1, yields[v1].GetName(),',', v2, yields[v2].GetName()
            sig2 += covMatrix(v1, v2)

from plotMjjFit import plot2BodyDist

if (opts.Err >= 0) and (opts.Err < 1):
    opts.Err = sqrt(sig2)*1.37

(plots, cans) = plot2BodyDist(theFitter, fitterPars, chi2, ndf,
                              opts.Err, opts.NP)

h_total = plots[0].getCurve('h_total')
theData = plots[0].getHist('theData')

mass.setRange('signal', fitterPars.minTrunc, fitterPars.maxTrunc)
sigInt = theFitter.makeFitter().createIntegral(iset,iset,'signal')
sigFullInt = theFitter.makeFitter().createIntegral(iset,iset)
dibosonInt = theFitter.makeDibosonPdf().createIntegral(iset,iset,'signal')
dibosonFullInt = theFitter.makeDibosonPdf().createIntegral(iset,iset)
WpJInt = theFitter.makeWpJPdf().createIntegral(iset,iset,'signal')
WpJFullInt = theFitter.makeWpJPdf().createIntegral(iset,iset)
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)