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 |
+ |
inputfile.Close() |
35 |
|
return theScale |
36 |
|
|
37 |
|
def getHistoFromTree(job,path,config,options,rescale=1,subsample=-1,which_weightF='weightF'): |
64 |
|
elif type(options[7])==list: |
65 |
|
cutcut=config.get('Cuts',options[7][0]) |
66 |
|
cutcut=cutcut.replace(options[7][1],options[7][2]) |
67 |
< |
print cutcut |
67 |
> |
#print cutcut |
68 |
|
if subsample>-1: |
69 |
|
treeCut='%s & %s%s'%(cutcut,job.subcuts[subsample],traincut) |
70 |
|
else: |
148 |
|
num=[0]*len(setup) |
149 |
|
for i in range(0,len(setup)): |
150 |
|
for j in range(0,len(histos)): |
151 |
< |
if typs[j] in setup[i]: |
151 |
> |
if typs[j] == setup[i]: |
152 |
|
num[i]+=1 |
153 |
|
ordnung.append(histos[j]) |
154 |
|
ordnungtyp.append(typs[j]) |