From 02fa1bc2a83a399194cdc494f4cf7ab81468a1ba Mon Sep 17 00:00:00 2001 From: Sandro Wenzel Date: Thu, 2 Oct 2025 13:26:34 +0200 Subject: [PATCH] AnchorMC: Allow more option overwrites --- MC/bin/o2dpg_sim_workflow.py | 2 +- MC/bin/o2dpg_sim_workflow_anchored.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/MC/bin/o2dpg_sim_workflow.py b/MC/bin/o2dpg_sim_workflow.py index e5e7a65b1..e11a2a120 100755 --- a/MC/bin/o2dpg_sim_workflow.py +++ b/MC/bin/o2dpg_sim_workflow.py @@ -567,7 +567,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True): GRP_TASK = createTask(name='grpcreate', needs=["geomprefetch"], cpu='0') GRP_TASK['cmd'] = 'o2-grp-simgrp-tool createGRPs --timestamp ' + str(args.timestamp) + ' --run ' + str(args.run) + ' --publishto ${ALICEO2_CCDB_LOCALCACHE:-.ccdb} -o grp --hbfpertf ' + str(orbitsPerTF) + ' --field ' + args.field GRP_TASK['cmd'] += ' --detectorList ' + args.detectorList + ' --readoutDets ' + " ".join(activeDetectors) + ' --print ' + ('','--lhcif-CCDB')[args.run_anchored] -if (not args.run_anchored == True) and len(args.bcPatternFile) > 0: +if len(args.bcPatternFile) > 0: GRP_TASK['cmd'] += ' --bcPatternFile ' + str(args.bcPatternFile) if len(CONFKEYMV) > 0: # this is allowing the possibility to setup/use a different MeanVertex object than the one from CCDB diff --git a/MC/bin/o2dpg_sim_workflow_anchored.py b/MC/bin/o2dpg_sim_workflow_anchored.py index 5d60450f3..57e6676b6 100755 --- a/MC/bin/o2dpg_sim_workflow_anchored.py +++ b/MC/bin/o2dpg_sim_workflow_anchored.py @@ -582,13 +582,19 @@ def main(): forwardargs += ' --ctp-scaler ' + str(ctp_local_rate_raw) # we finally pass forward to the unanchored MC workflow creation - # TODO: this needs to be done in a pythonic way clearly - # NOTE: forwardargs can - in principle - contain some of the arguments that are appended here. However, the last passed argument wins, so they would be overwritten. + # NOTE: forwardargs can - in principle - contain some of the arguments that are appended here. + # However, the last passed argument wins, so they would be overwritten. If this should not happen, the option + # needs to be handled as further below: energyarg = (" -eCM " + str(eCM)) if A1 == A2 else (" -eA " + str(eA) + " -eB " + str(eB)) forwardargs += " -tf " + str(args.tf) + " --sor " + str(run_start) + " --timestamp " + str(timestamp) + " --production-offset " + str(prod_offset) + " -run " + str(args.run_number) + " --run-anchored --first-orbit " \ - + str(GLOparams["FirstOrbit"]) + " -field ccdb -bcPatternFile ccdb" + " --orbitsPerTF " + str(GLOparams["OrbitsPerTF"]) + " -col " + str(ColSystem) + str(energyarg) + + str(GLOparams["FirstOrbit"]) + " --orbitsPerTF " + str(GLOparams["OrbitsPerTF"]) + " -col " + str(ColSystem) + str(energyarg) + # the following options can be overwritten/influence from the outside if not '--readoutDets' in forwardargs: forwardargs += ' --readoutDets ' + GLOparams['detList'] + if not '-field' in forwardargs: + forwardargs += ' -field ccdb ' + if not '-bcPatternFile' in forwardargs: + forwardargs += ' -bcPatternFile ccdb ' print ("forward args ", forwardargs) cmd = "${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py " + forwardargs