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.12 by nmohr, Thu Sep 20 13:08:07 2012 UTC vs.
Revision 1.15 by nmohr, Thu Oct 11 16:53:25 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 < MVAdir=config.get('Directories','MVAdir')
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 136 | Line 138 | for job in Ainfo:
138          if job.name in namelist:
139              #get trees:
140              input = TFile.Open(Apath+'/'+job.getpath(),'read')
141 <            outfile = TFile.Open(job.path+'/'+MVAdir+job.prefix+job.identifier+'.root','recreate')
141 >            outfile = TFile.Open(Apath+'/'+MVASubdir+job.prefix+job.identifier+'.root','recreate')
142              input.cd()
143              obj = ROOT.TObject
144              for key in ROOT.gDirectory.GetListOfKeys():
# 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