19def submit_job(listArgs, logDir, myCmd):
22 filenameEnd =
'_'.join(listArgs)
27 ' -oo ' + logDir +
'/' +
'out_' + filenameEnd +
28 ' -eo ' + logDir +
'/' +
'err_' + filenameEnd +
31 ' ' + sys.argv[2].lower() +
' ' +
36 print(
'Submitted job for: ' +
' '.join(listArgs))
40 sys.exit(
'Need two arguments: 1) path of look up table, 2) mc or data')
45lookUpTablePath = sys.argv[1]
47mc_or_data = sys.argv[2].lower()
48isMC = {
"mc":
True,
"data":
False}.get(mc_or_data,
None)
51 'Second parameter must be "mc" or "data" to indicate whether we run on MC or real data')
55myCmd =
'./analysisJob.sh'
56logDir =
'./analysisLog'
59print(
'Jobs submission ..')
62with open(lookUpTablePath)
as f:
64 reader = csv.reader(f, delimiter=
'\t')
72 if expNo
in range(7, 28):
73 streamNoList = range(10, 20)
74 elif expNo
in range(31, 66):
75 streamNoList = range(0, 10)
77 for streamNo
in streamNoList:
81 row.append(str(streamNo))
82 submit_job(row, logDir, myCmd)
85 submit_job(row[:-1], logDir, myCmd)