Beispiel #1
0
        if (gmet.GetBinContent(iBin) < 0.):
            gmet.SetBinContent(iBin, 0.)

    outputFile.cd()
    dmet.Write()
    bmet.Write()
    gmet.Write()
    mcmet.Write()

    dmets.append(dmet)
    bmets.append(bmet)
    gmets.append(gmet)
    mcmets.append(mcmet)

    canvas.cd()
    canvas.Clear()
    canvas.legend.Clear()

    canvas.ylimits = (0.002, 2500)

    canvas.SetLogy(True)

    canvas.legend.setPosition(0.6, 0.7, 0.95, 0.9)

    canvas.addStacked(bmet,
                      title='Background',
                      color=r.TColor.GetColor(0x55, 0x44, 0xff),
                      idx=-1)

    canvas.addStacked(mcmet,
                      title='#gamma + jet MC',
Beispiel #2
0
            graphic = False

        if not plotDir and graphic:
            # nothing to do
            continue

        print ' ', plotdef.name

        if graphic:
            if plotdef.ndim() == 1:
                drawOpt = 'HIST'
            elif plotdef.ndim() == 2:
                drawOpt = 'LEGO4 F 0'

            # set up canvas
            canvas.Clear(full=True)

            isSensitive = plotdef.sensitive

        else:
            counters = {}
            isSensitive = True

        if isSensitive:
            canvas.lumi = effLumi
            # for data-driven background estimates under presence of prescales
            # multiply the yields by 1/postscale
            if effLumi != 0.:
                postscale = fullLumi / effLumi
            else:
                postscale = 1.