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.15 by nmohr, Thu Oct 4 13:02:23 2012 UTC vs.
Revision 1.18 by peller, Fri Oct 19 15:44:07 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 47 | Line 49 | def getHistoFromTree(job,path,config,opt
49      nBins=int(options[3])
50      xMin=float(options[4])
51      xMax=float(options[5])
52 <    addOverFlow=eval(config.get('Plot_general','addOverFlow'))
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      
# Line 56 | Line 63 | def getHistoFromTree(job,path,config,opt
63          elif type(options[7])==list:
64              cutcut=config.get('Cuts',options[7][0])
65              cutcut=cutcut.replace(options[7][1],options[7][2])
66 <            #print cutcut
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])

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines