Example #1
0
                histos[channel][sample].Draw("esame")

    if args.stacks:
        if args.logy:
            minmin = 999999999.
            for s in allSamples:
                if histos[channel][s].GetMinimum() > 0 and histos[channel][s].GetMinimum() < minmin:
                    minmin = histos[channel][s].GetMinimum()
            stackB.SetMinimum(0.5 * minmin)
        # Have to draw before we can get axes, for some reason
        stackB.Draw()
        stackB.GetYaxis().SetTitle("%s \\:\\text{Events}"%channelName)
        for i in range(stackB.GetHistogram().GetNbinsX()):
            stackB.GetXaxis().SetBinLabel(i+1, histos[channel][allSamples[0]].GetXaxis().GetBinLabel(i+1))
        stackB.GetXaxis().SetLabelSize(0.04)
        c.SetRightMargin(0.04)
        stackB.Draw("HIST")
        stackS.Draw("HISTSAMENOCLEAR")
        for s in reversed(sigs+bkgs):
            leg.AddEntry(histos[channel][s], sampleInfo[s]["prettyName"], "F")

    ROOT.gStyle.SetLineWidth(3)

    leg.Draw("same")

    style.setCMSStyle(c, '',intLumi=args.intLumi)
    
    outFile = "%s/cutSummary_%s.png"%(outdir, channel)
    c.Print(outFile)

Example #2
0
            hOr.drawstyle = 'LPE'
            hOr.legendstyle = "LPE"
            hLeg.color = 'r'
            hLeg.drawstyle = 'LPE'
            hLeg.legendstyle = "LPE"

            hNew.color = 'b'
            hNew.drawstyle = 'hist'

            cCompare = Canvas(1000,1200)
            (xaxis, yaxis), axisRanges = draw([hOr, hLeg], cCompare, ytitle='arb.', xtitle=xTitles[v])
            legCompare = Legend([hOr, hLeg], **legPlacement[v])
            legCompare.Draw("SAME")
            cCompare = addRatio(cCompare, hOr, hLeg, mainXAxis=xaxis, 
                                mainYAxis=yaxis, xRange=axisRanges[:2])
            style.setCMSStyle(cCompare, "", True, "Preliminary Simulation", 13, -1)
            cCompare.Print(path.join(outdir, 'compare', '{}_m{}_{}.png'.format(v,m,c)))


            cNew = Canvas(1000,1000)
            draw(hNew, cNew, ytitle='arb', xtitle=xTitles[v])
            style.setCMSStyle(cNew, "", True, "Preliminary Simulation", 13, -1)
            cNew.Print(path.join(outdir, 'rescued', '{}_m{}_{}.png'.format(v,m,c)))
        
        
        hOrQQ = Hist(*binning['sm'][v], title='\\text{qq} \\!\\! \\rightarrow \\!\\! \\text{ZZ New ID}')
        hOrGG = Hist(*binning['sm'][v], title='\\text{gg} \\!\\! \\rightarrow \\!\\! \\text{ZZ New ID}')
        hLegQQ = Hist(*binning['sm'][v], title='\\text{qq} \\!\\! \\rightarrow \\!\\! \\text{ZZ Legacy ID}')
        hLegGG = Hist(*binning['sm'][v], title='\\text{gg} \\!\\! \\rightarrow \\!\\! \\text{ZZ Legacy ID}')

        for i, expr in enumerate(vars[c][v]):