def produce2DPlots(processes, selections, variables2D, colors, intLumi, pdir, lt, rt, logZ, hfile): print '' print 'Preparing 2D plots ...' gROOT.SetBatch(True) intLumiab = intLumi/1e+06 ff = "eps" logstr = '' if logZ: logstr = 'log' else: logstr = 'lin' nsel = 0 for s in selections: selstr = 'sel{}'.format(int(nsel)) nsel += 1 for v in variables2D.keys() : i = 0 for p in processes: filename = '{}_{}_{}_{}'.format(p, v, selstr, logstr) filename = formatted(filename) hname = '{}_{}_{}'.format(p, selstr, v) h = hfile.Get(hname) hh = TH2D.Clone(h) hh.Scale(intLumi) draw2D(filename, lt, rt, ff, pdir, logZ, hh) print 'DONE.'
def produce2DHackedPlots(processes, selections, variables2D, colors, intLumi, pdir, lt, rt, logZ, hfile): print '' print 'Preparing 2D plots ...' gROOT.SetBatch(True) intLumiab = intLumi / 1e+06 ff = FORMAT logstr = '' if logZ: logstr = 'log' else: logstr = 'lin' nsel = 0 for s in selections: selstr = 'sel{}'.format(int(nsel)) nsel += 1 for v in variables2D.keys(): i = 0 for p in processes: filename = '{}_{}_{}_{}'.format(p, v, selstr, logstr) filename = formatted(filename) hname = '{}_{}_{}'.format(p, selstr, v) h = hfile.Get(hname) hh = TH2D.Clone(h) hh.Scale(intLumi) ## fill in empty bins for i in range(hh.GetNbinsX() + 1): for j in range(hh.GetNbinsY() + 1): #if 'j#gamma + Jets' in p and 'bdth_bdtqcd' in hname and 'sel0' in hname: #if '#gamma#gamma + Jets' in p and 'bdth_bdtqcd' in hname and 'sel0' in hname: # print i, j , hh.GetBinContent(i,j) if hh.GetBinContent(i, j) == 0: hh.SetBinContent(i, j, 1) draw2D(filename, lt, rt, ff, pdir, logZ, hh) print 'DONE.'
def produce2DPlots(processes, selections, variables2D, colors, intLumi, pdir, delphesVersion, logZ, hfile): print '' print 'Preparing 2D plots ...' myStyle() gROOT.SetBatch(True) intLumiab = intLumi / 1e+06 rt = "RECO: Delphes-{}".format(delphesVersion) lt = "#sqrt{{s}} = 100 TeV, L = {} ab^{{-1}}".format(intLumiab) ff = "png" logstr = '' if logZ: logstr = 'log' else: logstr = 'lin' nsel = 0 for s in selections: selstr = 'sel{}'.format(int(nsel)) nsel += 1 for v in variables2D.keys(): i = 0 for p in processes: filename = '{}_{}_{}_{}'.format(p, v, selstr, logstr) filename = formatted(filename) hname = '{}_{}_{}'.format(p, selstr, v) h = hfile.Get(hname) hh = TH2D.Clone(h) hh.Scale(intLumi) draw2D(filename, lt, rt, ff, pdir, logZ, hh) print 'DONE.'