def showRatios(ratios, outUrl):
    """shows the ratio plots"""

    ROOT.gStyle.SetOptTitle(0)
    ROOT.gStyle.SetOptStat(0)
    ROOT.gROOT.SetBatch(True)

    os.system('rm %s' % outUrl)
    outDir = os.path.dirname(outUrl)

    COLOURS = [1, '#f4a582', '#bababa', '#abdda4']
    for key in ratios:
        p = Plot(key + '_ratio', com='13 TeV')
        p.doPoissonErrorBars = False
        p.ratiorange = (0.68, 1.34)
        p.spimposeWithErrors = True
        ic = 0
        for h in ratios[key]:
            p.add(h=h,
                  title=h.GetTitle(),
                  color=COLOURS[ic],
                  isData=False,
                  spImpose=True,
                  isSyst=False)
            ic += 1
        p.show(outDir=outDir,
               lumi=41400,
               noStack=False,
               saveTeX=False,
               noRatio=True)
        p.appendTo(outUrl)
        p.reset()
Example #2
0
    "mmiss >> hdy(50,0,3000)",
    "wgt*(mixType==1 && cat==169 && mmiss>0 && xangle==%d && bosonpt>40)" %
    xangle, "goff")
hdy = ROOT.gDirectory.Get('hdy').Clone()
hdy.SetDirectory(0)
hdy.Scale(5765.4 * lumi)
inF.Close()

#construct different scenarios
for f in [0.01, 0.1, 0.2, 0.5]:

    p = Plot('mix%d_mmiss_dysig_a%d_f%d' % (mass, xangle, f * 100),
             com='13 TeV')
    p.doPoissonErrorBars = False
    p.ratiorange = (0.6, 1.37)
    p.spimposeWithErrors = True
    p.frameMax = 1.3
    p.ratiotitle = '#frac{DY+mix.signal}{DY}'
    fhsig = hsig.Clone('sig')
    fhsig.Scale(hdy.Integral() / hsig.Integral())
    fhsig.Scale(f)

    fhsigmix = hsigmix.Clone('sigmix')
    fhsigmix.Scale(hdy.Integral() / hsigmix.Integral())
    fhsigmix.Scale(f * dilFactorSig)

    totalH = hdy.Clone('totalobs')
    totalH.Scale(1 - f)
    totalH.Add(fhsig)
    p.add(h=totalH,
          title='Pseudo-data',