Skip to content

Commit 7b31984

Browse files
sawenzelalcaliva
authored andcommitted
Allow for fractional orbits_early
(cherry picked from commit 370602d)
1 parent 682889d commit 7b31984

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import random
2626
import json
2727
import itertools
28+
import math
2829
import requests, re
2930
pandas_available = True
3031
try:
@@ -119,7 +120,7 @@
119120
parser.add_argument('--combine-tpc-clusterization', action='store_true', help=argparse.SUPPRESS) #<--- useful for small productions (pp, low interaction rate, small number of events)
120121
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)
121122
# (consider doing this rather in O2 digitization code directly)
122-
parser.add_argument('--orbits-early', default=0, type=int, help=argparse.SUPPRESS) # number of orbits to start simulating earlier
123+
parser.add_argument('--orbits-early', default=0, type=float, help=argparse.SUPPRESS) # number of orbits to start simulating earlier
123124
# to reduce start of timeframe effects in MC --> affects collision context
124125
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)
125126
parser.add_argument('--run-anchored', action='store_true', help=argparse.SUPPRESS)
@@ -616,7 +617,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
616617
PreCollContextTask=createTask(name='precollcontext_' + str(tf), needs=precollneeds, tf=tf, cwd=timeframeworkdir, cpu='1')
617618
PreCollContextTask['cmd']='${O2_ROOT}/bin/o2-steer-colcontexttool -i ' + signalprefix + ',' + str(INTRATE) + ',' + str(args.ns) + ':' + str(args.ns) \
618619
+ ' --show-context ' + ' --timeframeID ' + str(tf-1 + int(args.production_offset)*NTIMEFRAMES) \
619-
+ ' --orbitsPerTF ' + str(orbitsPerTF) + ' --orbits ' + str(orbitsPerTF + args.orbits_early) \
620+
+ ' --orbitsPerTF ' + str(orbitsPerTF) + ' --orbits ' + str(orbitsPerTF + math.ceil(args.orbits_early)) \
620621
+ ' --seed ' + str(TFSEED) + ' --noEmptyTF --first-orbit ' + str(args.first_orbit - args.orbits_early)
621622
PreCollContextTask['cmd'] += ' --bcPatternFile ccdb' # <--- the object should have been set in (local) CCDB
622623
if includeQED:

0 commit comments

Comments
 (0)