Skip to content

Commit dd27365

Browse files
committed
add bkg configuration option
1 parent 2f3a6d2 commit dd27365

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
parser.add_argument('-nb',help='number of background events / timeframe', default=20)
5454
parser.add_argument('-genBkg',help='embedding background generator', default='pythia8hi')
5555
parser.add_argument('-iniBkg',help='embedding background generator init parameters file', default='${O2DPG_ROOT}/MC/config/common/ini/basic.ini')
56+
parser.add_argument('-confKeyBkg',help='embedding background configuration key values, for example: GeneratorPythia8.config=pythia8.cfg', default='')
5657
parser.add_argument('-colBkg',help='embedding background collision system', default='PbPb')
5758

5859
parser.add_argument('-e',help='simengine', default='TGeant4')
@@ -129,11 +130,18 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
129130
print('o2dpg_sim_workflow: Error! embedding background generator name not provided')
130131
exit(1)
131132

132-
INIBKG=args.iniBkg
133+
INIBKG=''
134+
if args.iniBkg!= '':
135+
INIBKG=' --configFile ' + args.iniBkg
136+
137+
CONFKEYBKG=''
138+
if args.confKeyBkg!= '':
139+
CONFKEYBKG=' --configKeyValues ' + args.CONFKEYBKG
140+
133141
BKGtask=createTask(name='bkgsim', lab=["GEANT"], cpu=NWORKERS)
134-
BKGtask['cmd']='o2-sim -e ' + SIMENGINE + ' -j ' + str(NWORKERS) + ' -n ' + str(NBKGEVENTS) \
135-
+ ' -g ' + str(GENBKG) + ' ' + str(MODULES) + ' -o bkg --configFile ' + str(INIBKG) \
136-
+ ' --field ' + str(BFIELD)
142+
BKGtask['cmd']='o2-sim -e ' + SIMENGINE + ' -j ' + str(NWORKERS) + ' -n ' + str(NBKGEVENTS) \
143+
+ ' -g ' + str(GENBKG) + ' ' + str(MODULES) + ' -o bkg ' + str(INIBKG) \
144+
+ ' --field ' + str(BFIELD) + ' ' + str(CONFKEYBKG)
137145
workflow['stages'].append(BKGtask)
138146

139147
# check if we should upload background event

0 commit comments

Comments
 (0)