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.8 by peller, Fri Aug 10 09:36:16 2012 UTC vs.
Revision 1.9 by nmohr, Mon Sep 17 18:23:58 2012 UTC

# Line 19 | Line 19 | anaTag=config.get('Analysis','tag')
19  
20  
21  
22 < def getScale(job,rescale,subsample=-1):
23 <    input = TFile.Open(job.getpath())
22 > def getScale(job,path,rescale,subsample=-1):
23 >    input = TFile.Open(path+'/'+job.getpath())
24      CountWithPU = input.Get("CountWithPU")
25      CountWithPU2011B = input.Get("CountWithPU2011B")
26      #print lumi*xsecs[i]/hist.GetBinContent(1)
# Line 40 | Line 40 | def getScale(job,rescale,subsample=-1):
40          theScale = float(job.lumi)*xsec*sf/(CountWithPU.GetBinContent(1))*rescale/float(job.split)
41      return theScale
42  
43 < def getHistoFromTree(job,options,rescale=1,subsample=-1):
43 > def getHistoFromTree(job,path,options,rescale=1,subsample=-1):
44  
45      #print job.getpath()
46      #print options
# Line 69 | Line 69 | def getHistoFromTree(job,options,rescale
69          treeCut='%s'%(cutcut)
70  
71  
72 <    input = TFile.Open(job.getpath(),'read')
72 >    input = TFile.Open(path+'/'+job.getpath(),'read')
73  
74      Tree = input.Get(job.tree)
75      #Tree=tmpTree.CloneTree()
# Line 106 | Line 106 | def getHistoFromTree(job,options,rescale
106      #print job.name + ' Sumw2', hTree.GetEntries()
107  
108      if job.type != 'DATA':
109 <        ScaleFactor = getScale(job,rescale,subsample)
109 >        ScaleFactor = getScale(job,path,rescale,subsample)
110          if ScaleFactor != 0:
111              hTree.Scale(ScaleFactor)
112              

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines