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) |
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 |
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 |
|
|
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: |
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: |
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() |