Skip to content

Commit ef4d7ca

Browse files
sawenzelalcaliva
authored andcommitted
WIP: Allow to generate events before timeframe start (#1768)
Introducing --orbits-early <N> option in MC workflow generation. This, together with --pregenCollContext, will simulate events in the <N> orbits before each timeframe start, so that (in particular TPC) readout sees digits from the previous timeframe. For now, this just accepts multiple orbits. Finer granularity will come. (cherry picked from commit 1f7f0dd)
1 parent feccd0f commit ef4d7ca

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,8 @@
118118
parser.add_argument('--combine-tpc-clusterization', action='store_true', help=argparse.SUPPRESS) #<--- useful for small productions (pp, low interaction rate, small number of events)
119119
parser.add_argument('--first-orbit', default=0, type=int, help=argparse.SUPPRESS) # to set the first orbit number of the run for HBFUtils (only used when anchoring)
120120
# (consider doing this rather in O2 digitization code directly)
121+
parser.add_argument('--orbits-early', default=0, type=int, help=argparse.SUPPRESS) # number of orbits to start simulating earlier
122+
# to reduce start of timeframe effects in MC --> affects collision context
121123
parser.add_argument('--sor', default=-1, type=int, help=argparse.SUPPRESS) # may pass start of run with this (otherwise it is autodetermined from run number)
122124
parser.add_argument('--run-anchored', action='store_true', help=argparse.SUPPRESS)
123125
parser.add_argument('--alternative-reco-software', default="", help=argparse.SUPPRESS) # power feature to set CVFMS alienv software version for reco steps (different from default)
@@ -596,7 +598,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
596598
print('o2dpg_sim_workflow: Error! CM or Beam Energy not set!!!')
597599
exit(1)
598600

599-
# Determine interation rate
601+
# Determine interaction rate
600602
signalprefix='sgn_' + str(tf)
601603
INTRATE=int(args.interactionRate)
602604
if INTRATE <= 0:
@@ -611,7 +613,10 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
611613
PbPbXSec=8. # expected PbPb cross section
612614
QEDXSecExpected=35237.5 # expected magnitude of QED cross section
613615
PreCollContextTask=createTask(name='precollcontext_' + str(tf), needs=precollneeds, tf=tf, cwd=timeframeworkdir, cpu='1')
614-
PreCollContextTask['cmd']='${O2_ROOT}/bin/o2-steer-colcontexttool -i ' + signalprefix + ',' + str(INTRATE) + ',' + str(args.ns) + ':' + str(args.ns) + ' --show-context ' + ' --timeframeID ' + str(tf-1 + int(args.production_offset)*NTIMEFRAMES) + ' --orbitsPerTF ' + str(orbitsPerTF) + ' --orbits ' + str(orbitsPerTF) + ' --seed ' + str(TFSEED) + ' --noEmptyTF --first-orbit ' + str(args.first_orbit)
616+
PreCollContextTask['cmd']='${O2_ROOT}/bin/o2-steer-colcontexttool -i ' + signalprefix + ',' + str(INTRATE) + ',' + str(args.ns) + ':' + str(args.ns) \
617+
+ ' --show-context ' + ' --timeframeID ' + str(tf-1 + int(args.production_offset)*NTIMEFRAMES) \
618+
+ ' --orbitsPerTF ' + str(orbitsPerTF) + ' --orbits ' + str(orbitsPerTF + args.orbits_early) \
619+
+ ' --seed ' + str(TFSEED) + ' --noEmptyTF --first-orbit ' + str(args.first_orbit - args.orbits_early)
615620
PreCollContextTask['cmd'] += ' --bcPatternFile ccdb' # <--- the object should have been set in (local) CCDB
616621
if includeQED:
617622
qedrate = INTRATE * QEDXSecExpected / PbPbXSec # hadronic interaction rate * cross_section_ratio

0 commit comments

Comments
 (0)