Skip to content

Commit 8ca8e84

Browse files
committed
Make precollcontext task outside-configurable
streamline with other tasks in terms of configurability. Allows to customize the task via --overwrite-config custom.json mechanism. Can be used to ask for non-uniform mu(bc) distribution which is not yet default.
1 parent 4c4bdca commit 8ca8e84

File tree

1 file changed

+22
-16
lines changed

1 file changed

+22
-16
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -630,20 +630,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True, runcommand=True):
630630
if doembedding:
631631
interactionspecification = 'bkg,' + str(INTRATE) + ',' + str(NTIMEFRAMES*args.ns) + ':' + str(args.nb) + ' ' + signalprefix + ',' + args.embeddPattern
632632

633-
PreCollContextTask['cmd']='${O2_ROOT}/bin/o2-steer-colcontexttool -i ' + interactionspecification \
634-
+ ' --show-context ' \
635-
+ ' --timeframeID ' + str(int(args.production_offset)*NTIMEFRAMES) \
636-
+ ' --orbitsPerTF ' + str(orbitsPerTF) \
637-
+ ' --orbits ' + str(NTIMEFRAMES * (orbitsPerTF)) \
638-
+ ' --seed ' + str(RNDSEED) \
639-
+ ' --noEmptyTF --first-orbit ' + str(args.first_orbit) \
640-
+ ' --extract-per-timeframe tf:sgn' \
641-
+ ' --with-vertices ' + vtxmode_precoll \
642-
+ ' --maxCollsPerTF ' + str(args.ns) \
643-
+ ' --orbitsEarly ' + str(args.orbits_early) \
644-
+ ('',f" --import-external {args.data_anchoring}")[len(args.data_anchoring) > 0]
645-
646-
PreCollContextTask['cmd'] += ' --bcPatternFile ccdb' # <--- the object should have been set in (local) CCDB
633+
qedspec=""
647634
if includeQED:
648635
if PDGA==2212 or PDGB==2212:
649636
# QED is not enabled for pp and pA collisions
@@ -652,9 +639,28 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True, runcommand=True):
652639
else:
653640
qedrate = INTRATE * QEDXSecExpected[COLTYPE] / XSecSys[COLTYPE] # hadronic interaction rate * cross_section_ratio
654641
qedspec = 'qed' + ',' + str(qedrate) + ',10000000:' + str(NEventsQED)
655-
PreCollContextTask['cmd'] += ' --QEDinteraction ' + qedspec
656-
workflow['stages'].append(PreCollContextTask)
657642

643+
PreCollContextTask['cmd'] = task_finalizer([
644+
'${O2_ROOT}/bin/o2-steer-colcontexttool',
645+
f'-i {interactionspecification}',
646+
'--show-context',
647+
f'--timeframeID {int(args.production_offset)*NTIMEFRAMES}',
648+
f'--orbitsPerTF {orbitsPerTF}',
649+
f'--orbits {NTIMEFRAMES * (orbitsPerTF)}',
650+
f'--seed {RNDSEED}',
651+
'--noEmptyTF',
652+
f'--first-orbit {args.first_orbit}',
653+
'--extract-per-timeframe tf:sgn',
654+
f'--with-vertices {vtxmode_precoll}',
655+
f'--maxCollsPerTF {args.ns}',
656+
f'--orbitsEarly {args.orbits_early}',
657+
f'--timestamp {args.timestamp}',
658+
f'--import-external {args.data_anchoring}' if len(args.data_anchoring) > 0 else None,
659+
'--bcPatternFile ccdb',
660+
f'--QEDinteraction {qedspec}' if includeQED else None
661+
], configname = 'precollcontext')
662+
workflow['stages'].append(PreCollContextTask)
663+
#TODO: in future add standard ' --nontrivial-mu-distribution ccdb://http://ccdb-test.cern.ch:8080/GLO/CALIB/EVSELQA/HBCTVX'
658664

659665
if doembedding:
660666
if not usebkgcache:

0 commit comments

Comments
 (0)