Skip to content

Commit 7989801

Browse files
committed
Cleaner --skipModules treatment / remove deprecated -mod
Remove usage of old `-mod` usage, which in fact didn't have any effect. Now offer a --skipModules option to explicitely disable modules in material budget of o2-sim as a more clear solution. (This will not influence the material budget LUT, so be careful)
1 parent f483261 commit 7989801

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
parser.add_argument('--force-n-workers', dest='force_n_workers', action='store_true', help='by default, number of workers is re-computed '
109109
'for given interaction rate; '
110110
'pass this to avoid that')
111-
parser.add_argument('-mod',help='Active modules (deprecated)', default='--skipModules ZDC')
111+
parser.add_argument('--skipModules',nargs="*", help="List of modules to skip in geometry budget (and therefore processing)", default=["ZDC"])
112112
parser.add_argument('--with-ZDC', action='store_true', help='Enable ZDC in workflow')
113113
parser.add_argument('-seed',help='random seed number', default=None)
114114
parser.add_argument('-o',help='output workflow file', default='workflow.json')
@@ -408,7 +408,21 @@ def extractVertexArgs(configKeyValuesStr, finalDiamondDict):
408408

409409
NTIMEFRAMES=int(args.tf)
410410
NWORKERS=args.n_workers
411-
MODULES = "--skipModules ZDC" if not isActive("ZDC") else ""
411+
412+
# Processing skipped material budget (modules):
413+
# - If user did NOT specify --with-ZDC
414+
# - AND ZDC is not already in the list
415+
# --> append ZDC automatically
416+
if args.with_ZDC:
417+
# User wants ZDC to *not* be skipped → ensure it's removed
418+
args.skipModules = [m for m in args.skipModules if m != "ZDC"]
419+
else:
420+
# If user did not request --with-ZDC,
421+
# auto-append ZDC unless already present
422+
if "ZDC" not in args.skipModules:
423+
args.skipModules.append("ZDC")
424+
425+
SKIPMODULES = " ".join(["--skipModules"] + args.skipModules) if len(args.skipModules) > 0 else ""
412426
SIMENGINE=args.e
413427
BFIELD=args.field
414428
RNDSEED=args.seed # typically the argument should be the jobid, but if we get None the current time is used for the initialisation
@@ -716,7 +730,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True, runcommand=True):
716730
bkgsimneeds = [BKG_CONFIG_task['name'], GRP_TASK['name'], PreCollContextTask['name']]
717731
BKGtask=createTask(name='bkgsim', lab=["GEANT"], needs=bkgsimneeds, cpu=NWORKERS)
718732
BKGtask['cmd']='${O2_ROOT}/bin/o2-sim -e ' + SIMENGINE + ' -j ' + str(NWORKERS) + ' -n ' + str(NBKGEVENTS) \
719-
+ ' -g ' + str(GENBKG) + ' ' + str(MODULES) + ' -o bkg ' + str(INIBKG) \
733+
+ ' -g ' + str(GENBKG) + ' ' + str(SKIPMODULES) + ' -o bkg ' + str(INIBKG) \
720734
+ ' --field ccdb ' + str(CONFKEYBKG) \
721735
+ ('',' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run) \
722736
+ ' --vertexMode ' + vtxmode_sgngen \
@@ -947,7 +961,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True, runcommand=True):
947961
sgnmem = 6000 if COLTYPE == 'PbPb' else 4000
948962
SGNtask=createTask(name='sgnsim_'+str(tf), needs=signalneeds, tf=tf, cwd='tf'+str(tf), lab=["GEANT"],
949963
relative_cpu=7/8, n_workers=NWORKERS_TF, mem=str(sgnmem))
950-
sgncmdbase = '${O2_ROOT}/bin/o2-sim -e ' + str(SIMENGINE) + ' ' + str(MODULES) + ' -n ' + str(NSIGEVENTS) + ' --seed ' + str(TFSEED) \
964+
sgncmdbase = '${O2_ROOT}/bin/o2-sim -e ' + str(SIMENGINE) + ' ' + str(SKIPMODULES) + ' -n ' + str(NSIGEVENTS) + ' --seed ' + str(TFSEED) \
951965
+ ' --field ccdb -j ' + str(NWORKERS_TF) + ' ' + str(CONFKEY) + ' ' + str(INIFILE) + ' -o ' + signalprefix + ' ' + embeddinto \
952966
+ ' --detectorList ' + args.detectorList \
953967
+ ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run)

MC/run/PWGDQ/runBeautyToMuons_fwd_pp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ NWORKERS=${NWORKERS:-8}
1616
NTIMEFRAMES=${NTIMEFRAMES:-1}
1717

1818

19-
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM 13600 -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -e TGeant4 -mod "MCH MFT MID ITS" \
19+
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM 13600 -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -e TGeant4 \
2020
-trigger "external" -ini $O2DPG_ROOT/MC/config/PWGDQ/ini/GeneratorHF_bbbarToMuonsSemileptonic_fwdy.ini \
2121
-genBkg pythia8 -procBkg cdiff -colBkg pp --embedding -nb ${NBKGEVENTS} \
2222
-confKeyBkg "Diamond.width[2]=6" -interactionRate 2000 --mft-assessment-full --fwdmatching-assessment-full

MC/run/PWGDQ/runBeautyToMuons_noForce_fwd_pp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ NWORKERS=${NWORKERS:-8}
1616
NTIMEFRAMES=${NTIMEFRAMES:-1}
1717

1818

19-
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM 13600 -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -e TGeant4 -mod "MCH MFT MID ITS" \
19+
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM 13600 -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -e TGeant4 \
2020
-trigger "external" -ini $O2DPG_ROOT/MC/config/PWGDQ/ini/GeneratorHF_bbbarToDDbarToMuons_fwdy.ini \
2121
-genBkg pythia8 -procBkg cdiff -colBkg pp --embedding -nb ${NBKGEVENTS} \
2222
-confKeyBkg "Diamond.width[2]=6" -interactionRate 2000 --mft-assessment-full --fwdmatching-assessment-full

MC/run/PWGDQ/runCharmToMuons_fwd_pp.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ NWORKERS=${NWORKERS:-8}
1616
NTIMEFRAMES=${NTIMEFRAMES:-1}
1717

1818

19-
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM 13600 -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -e TGeant4 -mod "MCH MFT MID ITS" \
19+
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM 13600 -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -e TGeant4 \
2020
-trigger "external" -ini $O2DPG_ROOT/MC/config/PWGDQ/ini/GeneratorHF_ccbarToMuonsSemileptonic_fwdy.ini \
2121
-genBkg pythia8 -procBkg cdiff -colBkg pp --embedding -nb ${NBKGEVENTS} \
2222
-confKeyBkg "Diamond.width[2]=6" -interactionRate 2000 --mft-assessment-full --fwdmatching-assessment-full

MC/run/PWGLF/runLFInjector.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
# The following variables can be set from the outside:
88
# - NWORKERS: number of workers to use (default 8)
9-
# - MODULES: modules to be run (default "--skipModules ZDC")
109
# - SIMENGINE: simulation engine (default TGeant4)
1110
# - NSIGEVENTS: number of signal events (default 1)
1211
# - NBKGEVENTS: number of background events (default 1)
@@ -40,7 +39,6 @@ export IGNORE_VALIDITYCHECK_OF_CCDB_LOCALCACHE=1
4039
# ----------- START ACTUAL JOB -------------------------------
4140

4241
NWORKERS=${NWORKERS:-8}
43-
MODULES=${MODULES:---skipModules ZDC}
4442
SIMENGINE=${SIMENGINE:-TGeant4}
4543
NSIGEVENTS=${NSIGEVENTS:-1}
4644
NBKGEVENTS=${NBKGEVENTS:-1}
@@ -63,9 +61,9 @@ echo "ENERGY = $ENERGY"
6361
echo "CFGINIFILE = $CFGINIFILE"
6462

6563
# create workflow
66-
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${ENERGY} -col ${SYSTEM} -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -interactionRate ${INTRATE} -confKey "Diamond.width[2]=6." -e ${SIMENGINE} ${SEED} -mod "${MODULES}" \
64+
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py -eCM ${ENERGY} -col ${SYSTEM} -gen external -j ${NWORKERS} -ns ${NSIGEVENTS} -tf ${NTIMEFRAMES} -interactionRate ${INTRATE} -confKey "Diamond.width[2]=6." -e ${SIMENGINE} ${SEED} \
6765
-ini ${CFGINIFILE}
6866

6967
# run workflow
7068
O2_SIM_WORKFLOW_RUNNER=${O2_SIM_WORKFLOW_RUNNER:-"${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py"}
71-
$O2_SIM_WORKFLOW_RUNNER -f workflow.json -tt aod --cpu-limit $NWORKERS
69+
$O2_SIM_WORKFLOW_RUNNER -f workflow.json -tt aod --cpu-limit $NWORKERS

MC/run/PWGUD/runDiffEvents.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ DVX=0.01
2626
DVY=0.01
2727
DVZ=6.00
2828

29-
MODULES="--skipModules ZDC"
3029

3130
# create workflow
3231
${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py \
@@ -37,7 +36,6 @@ ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py \
3736
-ns ${NSIGPTF} \
3837
-tf ${NTIMEFRAMES} \
3938
-e TGeant4 \
40-
-mod "${MODULES}" \
4139
-interactionRate ${SIGINTRATE} \
4240
-confKey "HepMC.fileName="${FHEPMC}";HepMC.version=3;Diamond.width[0]="${DVX}";Diamond.width[1]="${DVY}";Diamond.width[2]="${DVZ}""
4341

MC/run/PWGUD/runPythiaAndDiffEvents.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ DVX=0.01
2727
DVY=0.01
2828
DVZ=6.00
2929

30-
MODULES="--skipModules ZDC"
31-
3230
# create workflow
3331
SIGINTRATE=`echo "${BKGINTRATE}*${NSIGPTF}/${NBKGPTF}" | bc`
3432
NBKG=`echo "${NBKGPTF}*${NTIMEFRAMES}" | bc`
@@ -38,7 +36,6 @@ ${O2DPG_ROOT}/MC/bin/o2dpg_sim_workflow.py \
3836
-eCM ${ECM} \
3937
-j ${NWORKERS} \
4038
-e TGeant4 \
41-
-mod "${MODULES}" \
4239
-tf ${NTIMEFRAMES} \
4340
-interactionRate ${BKGINTRATE} \
4441
-gen hepmc \

0 commit comments

Comments
 (0)