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.10 by nmohr, Thu Aug 9 13:52:04 2012 UTC vs.
Revision 1.12 by nmohr, Thu Sep 20 13:08:07 2012 UTC

# Line 31 | Line 31 | parser.add_option("-P", "--path", dest="
31                        help="path to samples")
32   parser.add_option("-S", "--samples", dest="names", default="",
33                        help="samples you want to run on")
34 < parser.add_option("-C", "--config", dest="config", default="",
34 > parser.add_option("-C", "--config", dest="config", default=[], action="append",
35                        help="configuration file")
36   (opts, args) = parser.parse_args(argv)
37   if opts.config =="":
# Line 42 | Line 42 | anaTag = config.get("Analysis","tag")
42  
43   #get locations:
44   Wdir=config.get('Directories','Wdir')
45
45   MVAdir=config.get('Directories','MVAdir')
46  
47   #systematics
# Line 70 | Line 69 | namelist=namelistIN.split(',')
69   doinfo=bool(int(opts.update))
70  
71   MVAlist=arglist.split(',')
72 + MVAdir=config.get('Directories','vhbbpath')
73  
74   #CONFIG
75   #factory
# Line 83 | Line 83 | factoryname=config.get('factory','factor
83   #MVAinfofiles=[]
84   MVAinfos=[]
85   for MVAname in MVAlist:
86 <    MVAinfofile = open(Wdir+'/weights/'+factoryname+'_'+MVAname+'.info','r')
86 >    MVAinfofile = open(MVAdir+'/data/'+factoryname+'_'+MVAname+'.info','r')
87      MVAinfos.append(pickle.load(MVAinfofile))
88      MVAinfofile.close()
89      
# Line 122 | Line 122 | for i in range(len( MVA_Vars['Nominal'])
122   #        reader.AddSpectator(spectators[i],MVA_spectator_buffer[i])
123   #Load raeder
124   for i in range(0,len(readers)):
125 <    readers[i].BookMVA(MVAinfos[i].MVAname,MVAinfos[i].getweightfile())
125 >    readers[i].BookMVA(MVAinfos[i].MVAname,MVAdir+'/data/'+MVAinfos[i].getweightfile())
126   #--> Now the MVA is booked
127  
128   #Apply samples
# Line 135 | Line 135 | for job in Ainfo:
135      if eval(job.active):
136          if job.name in namelist:
137              #get trees:
138 <            input = TFile.Open(job.getpath(),'read')
138 >            input = TFile.Open(Apath+'/'+job.getpath(),'read')
139              outfile = TFile.Open(job.path+'/'+MVAdir+job.prefix+job.identifier+'.root','recreate')
140              input.cd()
141              obj = ROOT.TObject

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines