From 83cef72c9c6afe15ae3cc5dd398cf42c13038e14 Mon Sep 17 00:00:00 2001 From: swenzel Date: Tue, 5 Aug 2025 00:07:00 +0200 Subject: [PATCH 1/2] Improve help message --- MC/bin/o2dpg_sim_workflow.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MC/bin/o2dpg_sim_workflow.py b/MC/bin/o2dpg_sim_workflow.py index 7636763c4..2ed348de0 100755 --- a/MC/bin/o2dpg_sim_workflow.py +++ b/MC/bin/o2dpg_sim_workflow.py @@ -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') From cc58d97ce1e7c11fa98018cae9c21dc735a7d21a Mon Sep 17 00:00:00 2001 From: swenzel Date: Tue, 5 Aug 2025 00:08:05 +0200 Subject: [PATCH 2/2] AOD conversion: Check if --created-by option is available --- MC/bin/o2dpg_sim_workflow.py | 16 +++++++++++----- MC/bin/o2dpg_workflow_utils.py | 5 +++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/MC/bin/o2dpg_sim_workflow.py b/MC/bin/o2dpg_sim_workflow.py index 2ed348de0..89bdd4653 100755 --- a/MC/bin/o2dpg_sim_workflow.py +++ b/MC/bin/o2dpg_sim_workflow.py @@ -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") @@ -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", @@ -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) # diff --git a/MC/bin/o2dpg_workflow_utils.py b/MC/bin/o2dpg_workflow_utils.py index c15d9633b..31860856a 100755 --- a/MC/bin/o2dpg_workflow_utils.py +++ b/MC/bin/o2dpg_workflow_utils.py @@ -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): """