Skip to content

Commit a883150

Browse files
benedikt-voelkelBenedikt Volkel
andauthored
[AnchorMC] Allow for any additional option for sim WF (#1463)
Use as ALIEN_JDL_ANCHOR_SIM_OPTIONS="-ini <ini_file> -confKey "key=value;otherKey=otherValue" -trigger <trigger_file> -productionTag myTag" Build the final remainingargs by prepending it. The last argument wins, hence in this case -productionTag would not be overwritten with this user choice Co-authored-by: Benedikt Volkel <benedikt.volkel@cern.ch>
1 parent e996e47 commit a883150

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

MC/bin/o2dpg_sim_workflow_anchored.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ def main():
409409
effTrigger = 28.0 # this is ZDC
410410
else:
411411
effTrigger = 0.759
412-
412+
413413
# time needs to be converted to seconds ==> timestamp / 1000
414414
rate = retrieve_MinBias_CTPScaler_Rate(ctp_scalers, timestamp/1000., effTrigger, grplhcif.getBunchFilling().getNBunches(), ColSystem)
415415

@@ -424,6 +424,7 @@ def main():
424424

425425
# we finally pass forward to the unanchored MC workflow creation
426426
# TODO: this needs to be done in a pythonic way clearly
427+
# 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.
427428
forwardargs += " -tf " + str(args.tf) + " --sor " + str(sor) + " --timestamp " + str(timestamp) + " --production-offset " + str(prod_offset) + " -run " + str(args.run_number) + " --run-anchored --first-orbit " \
428429
+ str(first_orbit) + " -field ccdb -bcPatternFile ccdb" + " --orbitsPerTF " + str(GLOparams["OrbitsPerTF"]) + " -col " + str(ColSystem) + " -eCM " + str(eCM) + ' --readoutDets ' + GLOparams['detList']
429430
print ("forward args ", forwardargs)

MC/run/ANCHOR/anchorMC.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,12 @@ done
7676

7777
# Allow for both "ALIEN_JDL_LPM<KEY>" as well as "KEY"
7878

79-
# the only two where there is a real default for
79+
# the only four where there is a real default for
8080
export ALIEN_JDL_CPULIMIT=${ALIEN_JDL_CPULIMIT:-${CPULIMIT:-8}}
8181
export ALIEN_JDL_SIMENGINE=${ALIEN_JDL_SIMENGINE:-${SIMENGINE:-TGeant4}}
8282
export ALIEN_JDL_WORKFLOWDETECTORS=${ALIEN_JDL_WORKFLOWDETECTORS:-ITS,TPC,TOF,FV0,FT0,FDD,MID,MFT,MCH,TRD,EMC,PHS,CPV,HMP,CTP}
83+
# can be passed to contain additional options that will be passed to o2dpg_sim_workflow_anchored.py and eventually to o2dpg_sim_workflow.py
84+
export ALIEN_JDL_ANCHOR_SIM_OPTIONS=${ALIEN_JDL_ANCHOR_SIM_OPTIONS:--gen pythia8}
8385
# all others MUST be set by the user/on the outside
8486
export ALIEN_JDL_LPMANCHORPASSNAME=${ALIEN_JDL_LPMANCHORPASSNAME:-${ANCHORPASSNAME}}
8587
export ALIEN_JDL_MCANCHOR=${ALIEN_JDL_MCANCHOR:-${MCANCHOR}}
@@ -191,10 +193,12 @@ ALICEO2_CCDB_LOCALCACHE=${ALICEO2_CCDB_LOCALCACHE:-$(pwd)/ccdb}
191193
baseargs="-tf ${NTIMEFRAMES} --split-id ${SPLITID} --prod-split ${PRODSPLIT} --cycle ${CYCLE} --run-number ${ALIEN_JDL_LPMRUNNUMBER}"
192194

193195
# these arguments will be passed as well but only evetually be digested by o2dpg_sim_workflow.py which is called from o2dpg_sim_workflow_anchored.py
194-
remainingargs="-gen pythia8 -seed ${SEED} -ns ${NSIGEVENTS} --include-local-qc --pregenCollContext"
196+
remainingargs="-seed ${SEED} -ns ${NSIGEVENTS} --include-local-qc --pregenCollContext"
195197
remainingargs="${remainingargs} -e ${ALIEN_JDL_SIMENGINE} -j ${NWORKERS}"
196198
remainingargs="${remainingargs} -productionTag ${ALIEN_JDL_LPMPRODUCTIONTAG:-alibi_anchorTest_tmp}"
197-
remainingargs="${remainingargs} --anchor-config config-json.json"
199+
# prepend(!) ALIEN_JDL_ANCHOR_SIM_OPTIONS
200+
# since the last passed argument wins, e.g. -productionTag cannot be overwritten by the user
201+
remainingargs="${ALIEN_JDL_ANCHOR_SIM_OPTIONS} ${remainingargs} --anchor-config config-json.json"
198202

199203
echo "baseargs: ${baseargs}"
200204
echo "remainingargs: ${remainingargs}"

0 commit comments

Comments
 (0)