Skip to content

Commit 1502a4d

Browse files
committed
AOD conversion: Check if --created-by option is available
1 parent cf85984 commit 1502a4d

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,8 @@ def load_external_config(configfile):
234234
# We still may need adjust configurations manually for consistency:
235235
#
236236
# * Force simpler TPC digitization of if TPC reco does not have the mc-time-gain option:
237-
tpc_envfile = 'env_async.env' if environ.get('ALIEN_JDL_O2DPG_ASYNC_RECO_TAG') is not None else None
238-
tpcreco_mctimegain = option_if_available('o2-tpc-reco-workflow', '--tpc-mc-time-gain', envfile=tpc_envfile)
237+
async_envfile = 'env_async.env' if environ.get('ALIEN_JDL_O2DPG_ASYNC_RECO_TAG') is not None else None
238+
tpcreco_mctimegain = option_if_available('o2-tpc-reco-workflow', '--tpc-mc-time-gain', envfile=async_envfile)
239239
if tpcreco_mctimegain == '':
240240
# this was communicated by Jens Wiechula@TPC; avoids dEdX issue https://its.cern.ch/jira/browse/O2-5486 for the 2tag mechanism
241241
print ("TPC reco does not support --tpc-mc-time-gain. Adjusting some config for TPC digitization")
@@ -1599,10 +1599,15 @@ def getDigiTaskName(det):
15991599
aod_creator = f.getvalue().strip()
16001600
print (f"Determined GRID username {aod_creator}")
16011601

1602+
# this option might not be universally available
1603+
created_by_option = option_if_available('o2-aod-producer-workflow', '--created-by', envfile=async_envfile)
1604+
if created_by_option != '':
1605+
created_by_option += ' ' + aod_creator
1606+
16021607
AODtask = createTask(name='aod_'+str(tf), needs=aodneeds, tf=tf, cwd=timeframeworkdir, lab=["AOD"], mem='4000', cpu='1')
16031608
AODtask['cmd'] = ('','ln -nfs ../bkg_Kine.root . ;')[doembedding]
1604-
AODtask['cmd'] += '[ -f AO2D.root ] && rm AO2D.root; '
1605-
AODtask["cmd"] += task_finalizer([
1609+
AODtask['cmd'] += '[ -f AO2D.root ] && rm AO2D.root; '
1610+
AODtask['cmd'] += task_finalizer([
16061611
"${O2_ROOT}/bin/o2-aod-producer-workflow",
16071612
"--reco-mctracks-only 1",
16081613
"--aod-writer-keep dangling",
@@ -1614,13 +1619,14 @@ def getDigiTaskName(det):
16141619
f"--lpmp-prod-tag {args.productionTag}",
16151620
"--anchor-pass ${ALIEN_JDL_LPMANCHORPASSNAME:-unknown}",
16161621
"--anchor-prod ${ALIEN_JDL_LPMANCHORPRODUCTION:-unknown}",
1617-
f"--created-by {aod_creator}",
1622+
created_by_option,
16181623
"--combine-source-devices" if not args.no_combine_dpl_devices else "",
16191624
"--disable-mc" if args.no_mc_labels else "",
16201625
"--enable-truncation 0" if environ.get("O2DPG_AOD_NOTRUNCATE") or environ.get("ALIEN_JDL_O2DPG_AOD_NOTRUNCATE") else "",
16211626
"--disable-strangeness-tracker" if args.no_strangeness_tracking else "",
16221627
f"--aod-timeframe-id ${{ALIEN_PROC_ID}}{aod_df_id}" if not args.run_anchored else "",
16231628
])
1629+
# Consider in future: AODtask['disable_alternative_reco_software'] = True # do not apply reco software here (we prefer latest aod converter)
16241630
workflow['stages'].append(AODtask)
16251631

16261632
#

MC/bin/o2dpg_workflow_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,9 @@ def matches_or_inherits_label(taskid, label, cache):
315315
for taskid in range(len(workflowspec['stages'])):
316316
if (matches_or_inherits_label(taskid, from_stage, matches_label)):
317317
# now we do the final adjust (as annotation) in the workflow itself
318-
if workflowspec['stages'][taskid].get("alternative_alienv_package") == None:
319-
workflowspec['stages'][taskid]["alternative_alienv_package"] = package
318+
if workflowspec['stages'][taskid].get('disable_alternative_reco_software', False) != True:
319+
if workflowspec['stages'][taskid].get("alternative_alienv_package") == None:
320+
workflowspec['stages'][taskid]["alternative_alienv_package"] = package
320321

321322
def merge_dicts(dict1, dict2):
322323
"""

0 commit comments

Comments
 (0)