-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun.py
executable file
·47 lines (40 loc) · 1.35 KB
/
run.py
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
#!/usr/bin/env python3
import json
import argparse
import sys
import os
CONFIG_FILE = "Job/AlienJob.json"
with open(CONFIG_FILE) as f:
CONFIG = json.load(f)
print("[-] INFO - Read configuration file: " + CONFIG_FILE)
print(CONFIG.keys())
JOB_NAME = sys.argv[1]
JOB_MODE = sys.argv[2]
doDevPWG = int(CONFIG[JOB_NAME]["doDevPWG"])
doMult = int(CONFIG[JOB_NAME]["doMult"])
doEmcalCorrection = int(CONFIG[JOB_NAME]["doEmcalCorrection"])
doJetQA = int(CONFIG[JOB_NAME]["doJetQA"])
doJpsiQA = int(CONFIG[JOB_NAME]["doJpsiQA"])
doJpsiFilter = int(CONFIG[JOB_NAME]["doJpsiFilter"])
doPIDQA = int(CONFIG[JOB_NAME]["doPIDQA"])
doPhysAna = int(CONFIG[JOB_NAME]["doPhysAna"])
cmd = "aliroot -b -l -q -x \'runAnalysis.C(" \
+ repr(doDevPWG) + ',' \
+ repr(doMult) + ',' \
+ repr(doEmcalCorrection) + ',' \
+ repr(doJetQA) + ',' \
+ repr(doJpsiQA) + ',' \
+ repr(doJpsiFilter) + ',' \
+ repr(doPIDQA) + ',' \
+ repr(doPhysAna) + ',' \
+ '"' + JOB_MODE + '",' \
+ '"' + CONFIG[JOB_NAME]["datasets"] + '",' \
+ '"' + CONFIG[JOB_NAME]["data_dir"] + '",' \
+ '"' + CONFIG[JOB_NAME]["work_dir"] + '",' \
+ '"' + CONFIG[JOB_NAME]["task_name"] + '"' \
+ ")\'"
print("[-] INFO - Read job configuration: " + JOB_NAME)
print(CONFIG[JOB_NAME])
print("[-] INFO - Job running mode : " + JOB_MODE)
print("------> " + cmd)
os.system(cmd)