25 |
|
print "Please provide a task.\n-J prep:\tpreparation of Trees\n-J sys:\t\twrite regression and systematics\n-J eval:\tcreate MVA output\n-J plot:\tproduce Plots\n-J dc:\t\twrite workspaces and datacards" |
26 |
|
sys.exit(123) |
27 |
|
|
28 |
< |
#create the dictionary with the samples to run over |
29 |
< |
samplesDict=opts.samples.split(",") |
28 |
> |
#create the list with the samples to run over |
29 |
> |
samplesList=opts.samples.split(",") |
30 |
|
|
31 |
|
en = opts.tag |
32 |
|
configs = ['config%s'%(en),'pathConfig%s'%(en)] |
43 |
|
shutil.copyfile('/scratch/%s/%s'%(getpass.getuser(),os.path.basename(btagLibrary)),btagLibrary) |
44 |
|
os.chdir(submitDir) |
45 |
|
logPath = config.get("Directories","logpath") |
46 |
< |
repDict = {'en':en,'logpath':logPath,'job':''} |
46 |
> |
repDict = {'en':en,'logpath':logPath,'job':'','task':opts.task} |
47 |
|
def submit(job,repDict): |
48 |
|
repDict['job'] = job |
49 |
< |
command = 'qsub -V -cwd -q all.q -N %(job)s_%(en)s -o %(logpath)s/%(job)s_%(en)s.out -e %(logpath)s/%(job)s_%(en)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task |
49 |
> |
command = 'qsub -V -cwd -q all.q -N %(job)s_%(en)s -o %(logpath)s/%(job)s_%(en)s_%(task)s.out -e %(logpath)s/%(job)s_%(en)s_%(task)s.err runAll.sh %(job)s %(en)s ' %(repDict) + opts.task |
50 |
|
print command |
51 |
|
subprocess.call([command], shell=True) |
52 |
|
|
55 |
|
if opts.task == 'plot': |
56 |
|
Plot_vars= config.items('Plot') |
57 |
|
|
58 |
< |
path = config.get("Directories","samplepath") |
59 |
< |
infofile = open(path+'/env/samples.info','r') |
60 |
< |
info = pickle.load(infofile) |
61 |
< |
infofile.close() |
58 |
> |
if not opts.task == 'prep': |
59 |
> |
path = config.get("Directories","samplepath") |
60 |
> |
infofile = open(path+'/env/samples.info','r') |
61 |
> |
info = pickle.load(infofile) |
62 |
> |
infofile.close() |
63 |
|
|
64 |
|
|
65 |
|
if opts.task == 'plot': |
83 |
|
for job in info: |
84 |
|
submit(job.name,repDict) |
85 |
|
else: |
86 |
< |
for sample in samplesDict: |
86 |
> |
for sample in samplesList: |
87 |
|
submit(sample,repDict) |
88 |
|
|