ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/VHbb/python/gethistofromtree.py
(Generate patch)

Comparing UserCode/VHbb/python/gethistofromtree.py (file contents):
Revision 1.19 by peller, Thu Nov 8 12:47:20 2012 UTC vs.
Revision 1.22 by peller, Wed Jan 16 16:22:46 2013 UTC

# Line 1 | Line 1
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:
# Line 31 | Line 28 | def getScale(job,path,config,rescale,sub
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'):

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines