Skip to content

Commit c170533

Browse files
committed
MC: allow to specify detector list
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent ec128f3 commit c170533

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
@@ -71,6 +71,7 @@
7171
parser.add_argument('-trigger',help='event selection: particle, external', default='')
7272
parser.add_argument('-ini',help='generator init parameters file (full paths required), for example: ${O2DPG_ROOT}/MC/config/PWGHF/ini/GeneratorHF.ini', default='')
7373
parser.add_argument('-confKey',help='o2sim, generator or trigger configuration key values, for example: "GeneratorPythia8.config=pythia8.cfg;A.x=y"', default='')
74+
parser.add_argument('--detectorList',help='pick which version of ALICE should be simulated', default='ALICE2')
7475
parser.add_argument('--readoutDets',help='comma separated string of detectors readout (does not modify material budget - only hit creation)', default='all')
7576
parser.add_argument('--make-evtpool', help='Generate workflow for event pool creation.', action='store_true')
7677

@@ -515,7 +516,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
515516
orbitsPerTF=int(args.orbitsPerTF)
516517
GRP_TASK = createTask(name='grpcreate', cpu='0')
517518
GRP_TASK['cmd'] = 'o2-grp-simgrp-tool createGRPs --timestamp ' + str(args.timestamp) + ' --run ' + str(args.run) + ' --publishto ${ALICEO2_CCDB_LOCALCACHE:-.ccdb} -o grp --hbfpertf ' + str(orbitsPerTF) + ' --field ' + args.field
518-
GRP_TASK['cmd'] += ' --readoutDets ' + " ".join(activeDetectors) + ' --print ' + ('','--lhcif-CCDB')[args.run_anchored]
519+
GRP_TASK['cmd'] += ' --detectorList ' + args.detectorList + ' --readoutDets ' + " ".join(activeDetectors) + ' --print ' + ('','--lhcif-CCDB')[args.run_anchored]
519520
if (not args.run_anchored == True) and len(args.bcPatternFile) > 0:
520521
GRP_TASK['cmd'] += ' --bcPatternFile ' + str(args.bcPatternFile)
521522
if len(CONFKEYMV) > 0:
@@ -664,7 +665,8 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
664665
+ ' --field ccdb ' + str(CONFKEYBKG) \
665666
+ ('',' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run) \
666667
+ ' --vertexMode kCCDB' \
667-
+ ' --fromCollContext collisioncontext.root:bkg'
668+
+ ' --fromCollContext collisioncontext.root:bkg ' \
669+
+ ' --detectorList ' + args.detectorList
668670

669671
if not isActive('all'):
670672
BKGtask['cmd'] += ' --readoutDetectors ' + " ".join(activeDetectors)
@@ -761,6 +763,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
761763
+ ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run) \
762764
+ ' --seed ' + str(TFSEED) \
763765
+ ' -g extgen ' \
766+
+ ' --detectorList ' + args.detectorList \
764767
+ QEDCONFKEY
765768
QED_task['cmd'] += '; RC=$?; QEDXSecCheck=`grep xSectionQED qedgenparam.ini | sed \'s/xSectionQED=//\'`'
766769
QED_task['cmd'] += '; echo "CheckXSection ' + str(QEDXSecExpected[COLTYPE]) + ' = $QEDXSecCheck"; [[ ${RC} == 0 ]]'
@@ -864,6 +867,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
864867
+ ' -g ' + str(GENERATOR) + ' ' + str(INIFILE) + ' -o genevents ' + embeddinto \
865868
+ ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] \
866869
+ ' --seed ' + str(TFSEED) + ' -n ' + str(NSIGEVENTS) \
870+
+ ' --detectorList ' + args.detectorList \
867871
+ ' --fromCollContext collisioncontext.root:' + signalprefix
868872
if GENERATOR=="hepmc":
869873
SGNGENtask['cmd'] += "; RC=$?; ${O2DPG_ROOT}/UTILS/UpdateHepMCEventSkip.sh ../HepMCEventSkip.json " + str(tf) + '; [[ ${RC} == 0 ]]'
@@ -885,6 +889,7 @@ def getDPL_global_options(bigshm=False, ccdbbackend=True):
885889
relative_cpu=7/8, n_workers=NWORKERS_TF, mem=str(sgnmem))
886890
sgncmdbase = '${O2_ROOT}/bin/o2-sim -e ' + str(SIMENGINE) + ' ' + str(MODULES) + ' -n ' + str(NSIGEVENTS) + ' --seed ' + str(TFSEED) \
887891
+ ' --field ccdb -j ' + str(NWORKERS_TF) + ' ' + str(CONFKEY) + ' ' + str(INIFILE) + ' -o ' + signalprefix + ' ' + embeddinto \
892+
+ ' --detectorList ' + args.detectorList \
888893
+ ('', ' --timestamp ' + str(args.timestamp))[args.timestamp!=-1] + ' --run ' + str(args.run)
889894
if sep_event_mode:
890895
SGNtask['cmd'] = sgncmdbase + ' -g extkinO2 --extKinFile genevents_Kine.root ' + ' --vertexMode kNoVertex'

0 commit comments

Comments
 (0)