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

Comparing UserCode/VHbb/python/evaluateMVA.py (file contents):
Revision 1.19 by bortigno, Fri Jan 11 13:47:24 2013 UTC vs.
Revision 1.20 by peller, Wed Jan 16 07:46:03 2013 UTC

# Line 11 | Line 11 | warnings.filterwarnings( action='ignore'
11   from optparse import OptionParser
12   from BetterConfigParser import BetterConfigParser
13   import pickle
14 + from myutils import parse_info
15  
16   #CONFIGURE
17   ROOT.gROOT.SetBatch(True)
# Line 33 | Line 34 | parser.add_option("-C", "--config", dest
34                        help="configuration file")
35   (opts, args) = parser.parse_args(argv)
36  
37 < from samplesclass import sample
37 > #from samplesclass import sample
38   from mvainfos import mvainfo
39   from progbar import progbar
40   from printcolor import printc
# Line 56 | Line 57 | samplesinfo=config.get('Directories','sa
57   INpath = config.get('Directories','MVAin')
58   OUTpath = config.get('Directories','MVAout')
59  
60 < infofile = open(samplesinfo,'r')
61 < info = pickle.load(infofile)
62 < infofile.close()
60 > info = parse_info(samplesinfo,INpath)
61 >
62 > #infofile = open(samplesinfo,'r')
63 > #info = pickle.load(infofile)
64 > #infofile.close()
65   arglist=opts.discr #RTight_blavla,bsbsb
66  
67   namelistIN=opts.names
68   namelist=namelistIN.split(',')
69  
70 < doinfo=bool(int(opts.update))
70 > #doinfo=bool(int(opts.update))
71  
72   MVAlist=arglist.split(',')
73  
# Line 91 | Line 94 | workdir=ROOT.gDirectory.GetPath()
94  
95  
96   #Apply samples
97 < infofile = open(samplesinfo,'r')
98 < Ainfo = pickle.load(infofile)
99 < infofile.close()
97 > #infofile = open(samplesinfo,'r')
98 > #Ainfo = pickle.load(infofile)
99 > #infofile.close()
100  
101  
102   class MvaEvaluater:
# Line 140 | Line 143 | for mva in MVAinfos:
143  
144  
145   #eval
146 < for job in Ainfo:
146 > for job in info:
147      if eval(job.active):
148          if job.name in namelist:
149              #get trees:
# Line 205 | Line 208 | for job in Ainfo:
208   print '\n'
209  
210   #Update Info:
211 < if doinfo:
212 <    for job in Ainfo:        
213 <        for MVAinfo in MVAinfos:
214 <            job.addcomment('Added MVA %s'%MVAinfo.MVAname)
215 <        job.addpath(MVAdir)
216 <    infofile = open(samplesinfo,'w')
217 <    pickle.dump(Ainfo,infofile)
218 <    infofile.close()
216 <
217 <
211 > #if doinfo:
212 > #    for job in Ainfo:        
213 > #        for MVAinfo in MVAinfos:
214 > #            job.addcomment('Added MVA %s'%MVAinfo.MVAname)
215 > #        job.addpath(MVAdir)
216 > #    infofile = open(samplesinfo,'w')
217 > #    pickle.dump(Ainfo,infofile)
218 > #    infofile.close()

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines