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.13 by nmohr, Thu Sep 20 15:57:22 2012 UTC vs.
Revision 1.16 by nmohr, Thu Oct 18 14:02:33 2012 UTC

# Line 37 | Line 37 | parser.add_option("-C", "--config", dest
37   if opts.config =="":
38          opts.config = "config"
39   config = BetterConfigParser()
40 + #config.read('./config7TeV_ZZ')
41   config.read(opts.config)
42   anaTag = config.get("Analysis","tag")
43  
44   #get locations:
45   Wdir=config.get('Directories','Wdir')
46   MVASubdir=config.get('Directories','MVAdir')
47 + samplesinfo=config.get('Directories','samplesinfo')
48  
49   #systematics
50   systematics=config.get('systematics','systematics')
# Line 58 | Line 60 | systematics=systematics.split(' ')
60   #Evaluate multi: Must Have same treeVars!!!
61  
62   Apath=opts.path
63 < infofile = open(Apath+'/samples.info','r')
63 > infofile = open(samplesinfo,'r')
64   info = pickle.load(infofile)
65   infofile.close()
66   arglist=opts.discr #RTight_blavla,bsbsb
# Line 126 | Line 128 | for i in range(0,len(readers)):
128   #--> Now the MVA is booked
129  
130   #Apply samples
131 < infofile = open(Apath+'/samples.info','r')
131 > infofile = open(samplesinfo,'r')
132   Ainfo = pickle.load(infofile)
133   infofile.close()
134  
# Line 170 | Line 172 | for job in Ainfo:
172                  MVAbranches=[]
173                  MVAbranches4=[]
174                  for i in range(0,len(readers)):
175 <                    MVAbranches.append(array('f',[0]*9))
176 <                    MVAbranches4.append(array('f',[0]*9))
177 <                    newtree.Branch(MVAinfos[i].MVAname,MVAbranches[i],'nominal:JER_up:JER_down:JES_up:JES_down:beff_up:beff_down:bmis_up:bmis_down/F')
178 <                    newtree.Branch(MVAinfos[i].MVAname+'_4',MVAbranches4[i],'nominal:JER_up:JER_down:JES_up:JES_down:beff_up:beff_down:bmis_up:bmis_down/F')
175 >                    MVAbranches.append(array('f',[0]*11))
176 >                    MVAbranches4.append(array('f',[0]*11))
177 >                    newtree.Branch(MVAinfos[i].MVAname,MVAbranches[i],'nominal:JER_up:JER_down:JES_up:JES_down:beff_up:beff_down:bmis_up:bmis_down:beff1_up:beff1_down/F')
178 >                    newtree.Branch(MVAinfos[i].MVAname+'_4',MVAbranches4[i],'nominal:JER_up:JER_down:JES_up:JES_down:beff_up:beff_down:bmis_up:bmis_down:beff1_up:beff1_down/F')
179                  print '\n--> ' + job.name +':'
180                  #progbar setup
181                  if nEntries >= longe:
# Line 252 | Line 254 | if doinfo:
254          for MVAinfo in MVAinfos:
255              job.addcomment('Added MVA %s'%MVAinfo.MVAname)
256          job.addpath(MVAdir)
257 <    infofile = open(Apath+MVAdir+'/samples.info','w')
257 >    infofile = open(samplesinfo,'w')
258      pickle.dump(Ainfo,infofile)
259      infofile.close()
260  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines