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.16 by peller, Tue Oct 9 21:17:34 2012 UTC vs.
Revision 1.19 by peller, Thu Nov 8 12:47:20 2012 UTC

# Line 17 | Line 17 | def getScale(job,path,config,rescale,sub
17      #print lumi*xsecs[i]/hist.GetBinContent(1)
18      
19      if subsample>-1:
20 <        xsec=float(job.xsec[subsample])
20 >        if type(job.xsec[subsample]) == str: xsec=float(eval(job.xsec[subsample]))
21 >        else: xsec=float(job.xsec[subsample])
22          sf=float(job.sf[subsample])
23      else:
24 <        xsec=float(job.xsec)
24 >        if type(job.xsec) == str: xsec=float(eval(job.xsec))
25 >        else: xsec=float(job.xsec)
26          sf=float(job.sf)
27      
28      
# Line 50 | Line 52 | def getHistoFromTree(job,path,config,opt
52      #addOverFlow=eval(config.get('Plot_general','addOverFlow'))
53      addOverFlow = False
54  
55 +    TrainFlag = eval(config.get('Analysis','TrainFlag'))
56 +    if TrainFlag: traincut = " & EventForTraining == 0"
57 +    if not TrainFlag: traincut=""
58 +
59      if job.type != 'DATA':
60      
61          if type(options[7])==str:
# Line 59 | Line 65 | def getHistoFromTree(job,path,config,opt
65              cutcut=cutcut.replace(options[7][1],options[7][2])
66              #print cutcut
67          if subsample>-1:
68 <            treeCut='%s & %s & EventForTraining == 0'%(cutcut,job.subcuts[subsample])        
68 >            treeCut='%s & %s%s'%(cutcut,job.subcuts[subsample],traincut)        
69          else:
70 <            treeCut='%s & EventForTraining == 0'%(cutcut)
70 >            treeCut='%s%s'%(cutcut,traincut)
71  
72      elif job.type == 'DATA':
73          cutcut=config.get('Cuts',options[8])
# Line 141 | Line 147 | def orderandadd(histos,typs,setup):
147      num=[0]*len(setup)
148      for i in range(0,len(setup)):
149          for j in range(0,len(histos)):
150 <            if typs[j] in setup[i]:
150 >            if typs[j] == setup[i]:
151                  num[i]+=1
152                  ordnung.append(histos[j])
153                  ordnungtyp.append(typs[j])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines