1 |
– |
from samplesclass import sample |
2 |
– |
from printcolor import printc |
1 |
|
import pickle |
2 |
|
import ROOT |
3 |
|
from ROOT import TFile, TTree |
4 |
|
import ROOT |
5 |
|
from array import array |
8 |
– |
from BetterConfigParser import BetterConfigParser |
6 |
|
import sys |
7 |
< |
|
7 |
> |
from myutils import sample, printc |
8 |
|
|
9 |
|
def getScale(job,path,config,rescale,subsample=-1): |
10 |
|
anaTag=config.get('Analysis','tag') |
11 |
< |
input = TFile.Open(path+'/'+job.getpath()) |
12 |
< |
CountWithPU = input.Get("CountWithPU") |
13 |
< |
CountWithPU2011B = input.Get("CountWithPU2011B") |
11 |
> |
inputfile = TFile.Open(path+'/'+job.getpath()) |
12 |
> |
CountWithPU = inputfile.Get("CountWithPU") |
13 |
> |
CountWithPU2011B = inputfile.Get("CountWithPU2011B") |
14 |
|
#print lumi*xsecs[i]/hist.GetBinContent(1) |
15 |
|
|
16 |
|
if subsample>-1: |
28 |
|
theScale = float(job.lumi)*xsec*sf/(0.46502*CountWithPU.GetBinContent(1)+0.53498*CountWithPU2011B.GetBinContent(1))*rescale/float(job.split) |
29 |
|
elif anaTag == '8TeV': |
30 |
|
theScale = float(job.lumi)*xsec*sf/(CountWithPU.GetBinContent(1))*rescale/float(job.split) |
31 |
+ |
inputfile.Close() |
32 |
|
return theScale |
33 |
|
|
34 |
|
def getHistoFromTree(job,path,config,options,rescale=1,subsample=-1,which_weightF='weightF'): |