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.18 by peller, Fri Oct 19 15:44:07 2012 UTC vs.
Revision 1.21 by peller, Wed Dec 5 15:00:20 2012 UTC

# Line 11 | Line 11 | import sys
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:
# Line 31 | Line 31 | def getScale(job,path,config,rescale,sub
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'):
# Line 63 | Line 64 | def getHistoFromTree(job,path,config,opt
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:
# Line 147 | Line 148 | def orderandadd(histos,typs,setup):
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])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines