18 |
|
from printcolor import printc |
19 |
|
|
20 |
|
#CONFIGURE |
21 |
< |
|
21 |
> |
print 'hello' |
22 |
|
#load config |
23 |
|
#os.mkdir(path+'/sys') |
24 |
|
argv = sys.argv |
27 |
|
help="update infofile") |
28 |
|
parser.add_option("-D", "--discr", dest="discr", default="", |
29 |
|
help="discriminators to be added") |
30 |
< |
parser.add_option("-P", "--path", dest="path", default="", |
31 |
< |
help="path to samples") |
30 |
> |
#parser.add_option("-I", "--inpath", dest="inpath", default="", |
31 |
> |
# help="path to samples") |
32 |
> |
#parser.add_option("-O", "--outpath", dest="outpath", default="", |
33 |
> |
# help="path where to store output samples") |
34 |
|
parser.add_option("-S", "--samples", dest="names", default="", |
35 |
|
help="samples you want to run on") |
36 |
|
parser.add_option("-C", "--config", dest="config", default=[], action="append", |
61 |
|
###################### |
62 |
|
#Evaluate multi: Must Have same treeVars!!! |
63 |
|
|
64 |
< |
Apath=opts.path |
64 |
> |
#OUTpath=opts.outpath |
65 |
> |
#INpath=opts.inpath |
66 |
> |
INpath = config.get('Directories','MVAin') |
67 |
> |
OUTpath = config.get('Directories','MVAout') |
68 |
> |
|
69 |
|
infofile = open(samplesinfo,'r') |
70 |
|
info = pickle.load(infofile) |
71 |
|
infofile.close() |
143 |
|
if eval(job.active): |
144 |
|
if job.name in namelist: |
145 |
|
#get trees: |
146 |
< |
input = TFile.Open(Apath+'/'+job.getpath(),'read') |
147 |
< |
outfile = TFile.Open(Apath+'/'+MVASubdir+job.prefix+job.identifier+'.root','recreate') |
146 |
> |
print INpath+'/'+job.prefix+job.identifier+'.root' |
147 |
> |
input = TFile.Open(INpath+'/'+job.prefix+job.identifier+'.root','read') |
148 |
> |
print OUTpath+'/'+job.prefix+job.identifier+'.root' |
149 |
> |
outfile = TFile.Open(OUTpath+'/'+job.prefix+job.identifier+'.root','recreate') |
150 |
|
input.cd() |
151 |
|
obj = ROOT.TObject |
152 |
|
for key in ROOT.gDirectory.GetListOfKeys(): |
162 |
|
nEntries = tree.GetEntries() |
163 |
|
outfile.cd() |
164 |
|
newtree = tree.CloneTree(0) |
165 |
+ |
#input.Close() |
166 |
|
|
167 |
|
#MCs: |
168 |
|
if job.type != 'DATA': |