11 |
|
|
12 |
|
def getScale(job,path,config,rescale,subsample=-1): |
13 |
|
anaTag=config.get('Analysis','tag') |
14 |
< |
input = TFile.Open(path+'/'+job.getpath()) |
15 |
< |
CountWithPU = input.Get("CountWithPU") |
16 |
< |
CountWithPU2011B = input.Get("CountWithPU2011B") |
14 |
> |
inputfile = TFile.Open(path+'/'+job.getpath()) |
15 |
> |
CountWithPU = inputfile.Get("CountWithPU") |
16 |
> |
CountWithPU2011B = inputfile.Get("CountWithPU2011B") |
17 |
|
#print lumi*xsecs[i]/hist.GetBinContent(1) |
18 |
|
|
19 |
|
if subsample>-1: |
31 |
|
theScale = float(job.lumi)*xsec*sf/(0.46502*CountWithPU.GetBinContent(1)+0.53498*CountWithPU2011B.GetBinContent(1))*rescale/float(job.split) |
32 |
|
elif anaTag == '8TeV': |
33 |
|
theScale = float(job.lumi)*xsec*sf/(CountWithPU.GetBinContent(1))*rescale/float(job.split) |
34 |
< |
input.Close() |
34 |
> |
inputfile.Close() |
35 |
|
return theScale |
36 |
|
|
37 |
|
def getHistoFromTree(job,path,config,options,rescale=1,subsample=-1,which_weightF='weightF'): |