Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions MC/bin/o2dpg_sim_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
parser.add_argument('-proc',help='process type: inel, dirgamma, jets, ccbar, ...', default='none')
parser.add_argument('-trigger',help='event selection: particle, external', default='')
parser.add_argument('-ini',help='generator init parameters file (full paths required), for example: ${O2DPG_ROOT}/MC/config/PWGHF/ini/GeneratorHF.ini', default='')
parser.add_argument('-confKey',help='generator or trigger configuration key values, for example: "GeneratorPythia8.config=pythia8.cfg;A.x=y"', default='')
parser.add_argument('-confKey',help='o2sim, generator or trigger configuration key values, for example: "GeneratorPythia8.config=pythia8.cfg;A.x=y"', default='')
parser.add_argument('--readoutDets',help='comma separated string of detectors readout (does not modify material budget - only hit creation)', default='all')
parser.add_argument('--make-evtpool', help='Generate workflow for event pool creation.', action='store_true')

Expand Down Expand Up @@ -234,8 +234,8 @@ def load_external_config(configfile):
# We still may need adjust configurations manually for consistency:
#
# * Force simpler TPC digitization of if TPC reco does not have the mc-time-gain option:
tpc_envfile = 'env_async.env' if environ.get('ALIEN_JDL_O2DPG_ASYNC_RECO_TAG') is not None else None
tpcreco_mctimegain = option_if_available('o2-tpc-reco-workflow', '--tpc-mc-time-gain', envfile=tpc_envfile)
async_envfile = 'env_async.env' if environ.get('ALIEN_JDL_O2DPG_ASYNC_RECO_TAG') is not None else None
tpcreco_mctimegain = option_if_available('o2-tpc-reco-workflow', '--tpc-mc-time-gain', envfile=async_envfile)
if tpcreco_mctimegain == '':
# this was communicated by Jens Wiechula@TPC; avoids dEdX issue https://its.cern.ch/jira/browse/O2-5486 for the 2tag mechanism
print ("TPC reco does not support --tpc-mc-time-gain. Adjusting some config for TPC digitization")
Expand Down Expand Up @@ -1596,10 +1596,15 @@ def getDigiTaskName(det):
aod_creator = f.getvalue().strip()
print (f"Determined GRID username {aod_creator}")

# this option might not be universally available
created_by_option = option_if_available('o2-aod-producer-workflow', '--created-by', envfile=async_envfile)
if created_by_option != '':
created_by_option += ' ' + aod_creator

AODtask = createTask(name='aod_'+str(tf), needs=aodneeds, tf=tf, cwd=timeframeworkdir, lab=["AOD"], mem='4000', cpu='1')
AODtask['cmd'] = ('','ln -nfs ../bkg_Kine.root . ;')[doembedding]
AODtask['cmd'] += '[ -f AO2D.root ] && rm AO2D.root; '
AODtask["cmd"] += task_finalizer([
AODtask['cmd'] += '[ -f AO2D.root ] && rm AO2D.root; '
AODtask['cmd'] += task_finalizer([
"${O2_ROOT}/bin/o2-aod-producer-workflow",
"--reco-mctracks-only 1",
"--aod-writer-keep dangling",
Expand All @@ -1611,13 +1616,14 @@ def getDigiTaskName(det):
f"--lpmp-prod-tag {args.productionTag}",
"--anchor-pass ${ALIEN_JDL_LPMANCHORPASSNAME:-unknown}",
"--anchor-prod ${ALIEN_JDL_LPMANCHORPRODUCTION:-unknown}",
f"--created-by {aod_creator}",
created_by_option,
"--combine-source-devices" if not args.no_combine_dpl_devices else "",
"--disable-mc" if args.no_mc_labels else "",
"--enable-truncation 0" if environ.get("O2DPG_AOD_NOTRUNCATE") or environ.get("ALIEN_JDL_O2DPG_AOD_NOTRUNCATE") else "",
"--disable-strangeness-tracker" if args.no_strangeness_tracking else "",
f"--aod-timeframe-id ${{ALIEN_PROC_ID}}{aod_df_id}" if not args.run_anchored else "",
])
# Consider in future: AODtask['disable_alternative_reco_software'] = True # do not apply reco software here (we prefer latest aod converter)
workflow['stages'].append(AODtask)

#
Expand Down
5 changes: 3 additions & 2 deletions MC/bin/o2dpg_workflow_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,9 @@ def matches_or_inherits_label(taskid, label, cache):
for taskid in range(len(workflowspec['stages'])):
if (matches_or_inherits_label(taskid, from_stage, matches_label)):
# now we do the final adjust (as annotation) in the workflow itself
if workflowspec['stages'][taskid].get("alternative_alienv_package") == None:
workflowspec['stages'][taskid]["alternative_alienv_package"] = package
if workflowspec['stages'][taskid].get('disable_alternative_reco_software', False) != True:
if workflowspec['stages'][taskid].get("alternative_alienv_package") == None:
workflowspec['stages'][taskid]["alternative_alienv_package"] = package

def merge_dicts(dict1, dict2):
"""
Expand Down