3131parser.add_argument('-ini',help='generator init parameters file, for example: ${O2DPG_ROOT}/MC/config/PWGHF/ini/GeneratorHF.ini', default='')
3232parser.add_argument('-confKey',help='generator or trigger configuration key values, for example: GeneratorPythia8.config=pythia8.cfg', default='')
3333
34+ parser.add_argument('-interactionRate',help='Interaction rate, used in digitization', default=-1)
3435parser.add_argument('-eCM',help='CMS energy', default=-1)
3536parser.add_argument('-eA',help='Beam A energy', default=6499.) #6369 PbPb, 2.510 pp 5 TeV, 4 pPb
3637parser.add_argument('-eB',help='Beam B energy', default=-1)
@@ -325,11 +326,22 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
325326 # ------------------
326327 CONTEXTFILE='collisioncontext.root'
327328
329+ INTRATE=int(args.interactionRate)
330+
331+ #it should be taken from CDB, meanwhile some default values
332+ if INTRATE < 0:
333+ if COLTYPE=="PbPb":
334+ INTRATE=50000 #Hz
335+ elif COLTYPE=="pp":
336+ INTRATE=400000 #Hz
337+ else: #pPb?
338+ INTRATE=200000 #Hz ???
339+
328340 simsoption=' --sims ' + ('bkg,'+signalprefix if doembedding else signalprefix)
329341
330342 ContextTask=createTask(name='digicontext_'+str(tf), needs=[SGNtask['name'], LinkGRPFileTask['name']], tf=tf,
331343 cwd=timeframeworkdir, lab=["DIGI"], cpu='1')
332- ContextTask['cmd'] = 'o2-sim-digitizer-workflow --only-context --interactionRate 50000 ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption
344+ ContextTask['cmd'] = 'o2-sim-digitizer-workflow --only-context --interactionRate ' + str(INTRATE) + ' ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption
333345 workflow['stages'].append(ContextTask)
334346
335347 tpcdigineeds=[ContextTask['name'], LinkGRPFileTask['name']]
@@ -339,7 +351,7 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
339351 TPCDigitask=createTask(name='tpcdigi_'+str(tf), needs=tpcdigineeds,
340352 tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu='8', mem='9000')
341353 TPCDigitask['cmd'] = ('','ln -nfs ../bkg_HitsTPC.root . ;')[doembedding]
342- TPCDigitask['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption + ' --onlyDet TPC --interactionRate 50000 --tpc-lanes ' + str(NWORKERS) + ' --incontext ' + str(CONTEXTFILE) + ' --tpc-chunked-writer'
354+ TPCDigitask['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption + ' --onlyDet TPC --interactionRate ' + str(INTRATE) + ' --tpc-lanes ' + str(NWORKERS) + ' --incontext ' + str(CONTEXTFILE) + ' --tpc-chunked-writer'
343355 workflow['stages'].append(TPCDigitask)
344356
345357 trddigineeds = [ContextTask['name']]
@@ -348,7 +360,7 @@ def getDPL_global_options(bigshm=False,nosmallrate=False):
348360 TRDDigitask=createTask(name='trddigi_'+str(tf), needs=trddigineeds,
349361 tf=tf, cwd=timeframeworkdir, lab=["DIGI"], cpu='8', mem='8000')
350362 TRDDigitask['cmd'] = ('','ln -nfs ../bkg_HitsTRD.root . ;')[doembedding]
351- TRDDigitask['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption + ' --onlyDet TRD --interactionRate 50000 --configKeyValues \"TRDSimParams.digithreads=' + str(NWORKERS) + '\" --incontext ' + str(CONTEXTFILE)
363+ TRDDigitask['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption + ' --onlyDet TRD --interactionRate ' + str(INTRATE) + ' --configKeyValues \"TRDSimParams.digithreads=' + str(NWORKERS) + '\" --incontext ' + str(CONTEXTFILE)
352364 workflow['stages'].append(TRDDigitask)
353365
354366 # these are digitizers which are single threaded
@@ -361,7 +373,7 @@ def createRestDigiTask(name, det='ALLSMALLER'):
361373 t = createTask(name=name, needs=tneeds,
362374 tf=tf, cwd=timeframeworkdir, lab=["DIGI","SMALLDIGI"], cpu='8')
363375 t['cmd'] = ('','ln -nfs ../bkg_Hits*.root . ;')[doembedding]
364- t['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options(nosmallrate=True) + ' -n ' + str(args.ns) + simsoption + ' --skipDet TPC,TRD --interactionRate 50000 --incontext ' + str(CONTEXTFILE)
376+ t['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options(nosmallrate=True) + ' -n ' + str(args.ns) + simsoption + ' --skipDet TPC,TRD --interactionRate ' + str(INTRATE) + ' --incontext ' + str(CONTEXTFILE)
365377 workflow['stages'].append(t)
366378 return t
367379
@@ -371,7 +383,7 @@ def createRestDigiTask(name, det='ALLSMALLER'):
371383 t = createTask(name=name, needs=tneeds,
372384 tf=tf, cwd=timeframeworkdir, lab=["DIGI","SMALLDIGI"], cpu='1')
373385 t['cmd'] = ('','ln -nfs ../bkg_Hits' + str(det) + '.root . ;')[doembedding]
374- t['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption + ' --onlyDet ' + str(det) + ' --interactionRate 50000 --incontext ' + str(CONTEXTFILE)
386+ t['cmd'] += 'o2-sim-digitizer-workflow ' + getDPL_global_options() + ' -n ' + str(args.ns) + simsoption + ' --onlyDet ' + str(det) + ' --interactionRate ' + str(INTRATE) + ' --incontext ' + str(CONTEXTFILE)
375387 workflow['stages'].append(t)
376388 return t
377389
0 commit comments