-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun-data-local
executable file
·53 lines (42 loc) · 1.35 KB
/
run-data-local
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
import os
import time
import socket
import os, errno
import subprocess
from subprocess import call
import multiprocessing as mp
from higgstautau.datasets import Database
from higgstautau import samples
from systematics import iter_systematics
from rootpy.utils.path import mkdir_p
from argparse import ArgumentParser
parser = ArgumentParser()
parser.add_argument('--year', type=int, choices=(11, 12), default=11)
parser.add_argument('--student', default='hhskim.py')
parser.add_argument('--output-path',
default='./')
parser.add_argument('--db', default='datasets_hh')
args, student_args = parser.parse_known_args()
student = args.student
db = args.db
database = Database(db)
output_path = os.path.normpath(args.output_path)
if not os.path.exists(output_path):
mkdir_p(output_path)
CMD = "python run --output-path %s -s %s --db %s" % (
output_path, student, db)
print CMD
while len(datasets) > 0:
ds = datasets.pop(0)
print ds
output_name = os.path.splitext(student)[0] + '.' + ds
suffix = kwargs.get('suffix', None)
if suffix:
output_name += '_%s' % suffix
output_name += '.root'
output_name = os.path.join(output_path, output_name)
if os.path.exists(output_name):
print "Output %s already exists. Please delete it and resubmit." % (
output_name)
continue