4242
4343from o2dpg_workflow_utils import createTask , createGlobalInitTask , dump_workflow , adjust_RECO_environment , isActive , activate_detector , deactivate_detector , compute_n_workers , merge_dicts
4444from o2dpg_qc_finalization_workflow import include_all_QC_finalization
45- from o2dpg_sim_config import create_sim_config , create_geant_config , constructConfigKeyArg , option_if_available
45+ from o2dpg_sim_config import create_sim_config , create_geant_config , constructConfigKeyArg , option_if_available , overwrite_config
4646from o2dpg_dpl_config_tools import parse_command_string , modify_dpl_command , dpl_option_from_config , TaskFinalizer
4747
4848parser = argparse .ArgumentParser (description = 'Create an ALICE (Run3) MC simulation workflow' )
@@ -219,6 +219,19 @@ def load_external_config(configfile):
219219 # merge the dictionaries into anchorConfig, the latter takes precedence
220220 merge_dicts (anchorConfig , config_overwrite )
221221
222+ # We still may need adjust configurations manually for consistency:
223+ #
224+ # * Force simpler TPC digitization of if TPC reco does not have the mc-time-gain option:
225+ tpc_envfile = 'env_async.env' if environ .get ('ALIEN_JDL_O2DPG_ASYNC_RECO_TAG' ) is not None else None
226+ tpcreco_mctimegain = option_if_available ('o2-tpc-reco-workflow' , '--tpc-mc-time-gain' , envfile = tpc_envfile )
227+ if tpcreco_mctimegain == '' :
228+ # this was communicated by Jens Wiechula@TPC; avoids dEdX issue https://its.cern.ch/jira/browse/O2-5486 for the 2tag mechanism
229+ print ("TPC reco does not support --tpc-mc-time-gain. Adjusting some config for TPC digitization" )
230+ overwrite_config (anchorConfig ['ConfigParams' ],'TPCGasParam' ,'OxygenCont' ,5e-5 )
231+ overwrite_config (anchorConfig ['ConfigParams' ],'TPCGEMParam' ,'TotalGainStack' ,2000 )
232+ overwrite_config (anchorConfig ['ConfigParams' ],'GPU_global' ,'dEdxDisableResidualGain' ,1 )
233+ # TODO: put into it's own function for better modularity
234+
222235# with the config, we'll create a task_finalizer functor
223236# this object takes care of customizing/finishing task command with externally given (anchor) config
224237task_finalizer = TaskFinalizer (anchorConfig , logger = "o2dpg_config_replacements.log" )
@@ -1169,7 +1182,6 @@ def getDigiTaskName(det):
11691182 # tpc_corr_scaling_options = ('--lumi-type 1', '')[tpcDistortionType != 0]
11701183
11711184 #<--------- TPC reco task
1172- tpc_envfile = 'env_async.env' if environ .get ('ALIEN_JDL_O2DPG_ASYNC_RECO_TAG' ) is not None else None
11731185 TPCRECOtask = createTask (name = 'tpcreco_' + str (tf ), needs = tpcreconeeds , tf = tf , cwd = timeframeworkdir , lab = ["RECO" ], relative_cpu = 3 / 8 , mem = '16000' )
11741186 TPCRECOtask ['cmd' ] = task_finalizer ([
11751187 '${O2_ROOT}/bin/o2-tpc-reco-workflow' ,
@@ -1185,7 +1197,7 @@ def getDigiTaskName(det):
11851197 ('' ,' --disable-mc' )[args .no_mc_labels ],
11861198 tpc_corr_scaling_options ,
11871199 tpc_corr_options_mc ,
1188- option_if_available ( 'o2-tpc-reco-workflow' , '--tpc-mc-time-gain' , envfile = tpc_envfile ) ])
1200+ tpcreco_mctimegain ])
11891201 workflow ['stages' ].append (TPCRECOtask )
11901202
11911203 #<--------- ITS reco task
0 commit comments