diff --git a/MC/bin/o2_dpg_workflow_runner.py b/MC/bin/o2_dpg_workflow_runner.py index 03d69a5bc..d6653b742 100755 --- a/MC/bin/o2_dpg_workflow_runner.py +++ b/MC/bin/o2_dpg_workflow_runner.py @@ -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,') @@ -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)