Skip to content

Commit

Permalink
Created flag for .root Kinematics input file.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackal1-66 committed Oct 7, 2024
1 parent c219b9a commit a3e0e9a
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions MC/bin/o2_dpg_workflow_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
parser.add_argument('--cpu-limit', help='Set CPU limit (core count)', default=8, type=float)
parser.add_argument('--cgroup', help='Execute pipeline under a given cgroup (e.g., 8coregrid) emulating resource constraints. This m\
ust exist and the tasks file must be writable to with the current user.')
parser.add_argument('--kine-input', help='Use pre-existent event generation.', default="", type=str)

# run control, webhooks
parser.add_argument('--stdout-on-failure', action='store_true', help='Print log files of failing tasks to stdout,')
Expand Down Expand Up @@ -880,6 +881,19 @@ def __init__(self, workflowfile, args, jmax=100):
exit (0)
print ('Workflow is empty. Nothing to do')
exit (0)

# Gets the .root kinematic file path and passes it to the event simulation step
# the string appended to the filename is to take account of the current timeframe
# and to skip events accordingly
if args.kine_input:
kine_fn = args.kine_input
if os.path.isfile(kine_fn):
for stage in self.workflowspec['stages']:
if "sgngen" in stage['name']:
stage['cmd'] = stage['cmd'][:-1] + " --kine-input " + kine_fn + ':' + stage['name'][-1] + stage['cmd'][-1]
else:
print("Input kinematic file does not exist.")
exit(2)

# construct the DAG, compute task weights
workflow = build_dag_properties(self.workflowspec)
Expand Down

0 comments on commit a3e0e9a

Please sign in to comment.