Skip to content

Commit 4362e2f

Browse files
committed
Remap TPC time gain objects for MC anchored to 2023, where --tpc-mc-time-gain option does not exist
1 parent 9e08029 commit 4362e2f

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@
174174
O2_ROOT=environ.get('O2_ROOT')
175175
QUALITYCONTROL_ROOT=environ.get('QUALITYCONTROL_ROOT')
176176
O2PHYSICS_ROOT=environ.get('O2PHYSICS_ROOT')
177+
ccdbRemap = environ.get('ALIEN_JDL_REMAPPINGS')
177178

178179
if O2DPG_ROOT == None:
179180
print('Error: This needs O2DPG loaded')
@@ -237,15 +238,25 @@ def load_external_config(configfile):
237238

238239
# We still may need adjust configurations manually for consistency:
239240
#
240-
# * Force simpler TPC digitization of if TPC reco does not have the mc-time-gain option:
241+
# * Force simpler TPC digitization of if TPC reco does not have the mc-time-gain option or remap to a different CCDB object if we are anchored to 2023:
241242
async_envfile = 'env_async.env' if environ.get('ALIEN_JDL_O2DPG_ASYNC_RECO_TAG') is not None else None
242243
tpcreco_mctimegain = option_if_available('o2-tpc-reco-workflow', '--tpc-mc-time-gain', envfile=async_envfile)
243244
if tpcreco_mctimegain == '':
244-
# this was communicated by Jens Wiechula@TPC; avoids dEdX issue https://its.cern.ch/jira/browse/O2-5486 for the 2tag mechanism
245-
print ("TPC reco does not support --tpc-mc-time-gain. Adjusting some config for TPC digitization")
246-
overwrite_config(anchorConfig['ConfigParams'],'TPCGasParam','OxygenCont',5e-6)
247-
overwrite_config(anchorConfig['ConfigParams'],'TPCGEMParam','TotalGainStack',2000)
248-
overwrite_config(anchorConfig['ConfigParams'],'GPU_global','dEdxDisableResidualGain',1)
245+
# TODO: Upload all MC time gain objects to TestReco and remove year dependence
246+
year = environ.get('ALIEN_JDL_LPMANCHORYEAR') if environ.get('ALIEN_JDL_LPMANCHORYEAR') is not None else environ.get('ANCHORYEAR')
247+
if year == '2023':
248+
print("TPC reco does not support --tpc-mc-time-gain. Remapping time gain objects for 2023 MC")
249+
# Year dependent workaround for MC anchored to 2023, solving the issue with 2tag mechanism
250+
extra = 'https://alice-ccdb.cern.ch/TestReco/=TPC/Calib/TimeGain'
251+
environ['ALIEN_JDL_REMAPPINGS'] = (ccdbRemap + ';' + extra) if ccdbRemap else extra
252+
# Keep the cached variable in sync, since getDPL_global_options uses it
253+
ccdbRemap = environ.get('ALIEN_JDL_REMAPPINGS')
254+
else:
255+
# this was communicated by Jens Wiechula@TPC; avoids dEdX issue https://its.cern.ch/jira/browse/O2-5486 for the 2tag mechanism
256+
print ("TPC reco does not support --tpc-mc-time-gain. Adjusting some config for TPC digitization")
257+
overwrite_config(anchorConfig['ConfigParams'],'TPCGasParam','OxygenCont',5e-6)
258+
overwrite_config(anchorConfig['ConfigParams'],'TPCGEMParam','TotalGainStack',2000)
259+
overwrite_config(anchorConfig['ConfigParams'],'GPU_global','dEdxDisableResidualGain',1)
249260
# TODO: put into it's own function for better modularity
250261

251262
# with the config, we'll create a task_finalizer functor
@@ -511,7 +522,6 @@ def extractVertexArgs(configKeyValuesStr, finalDiamondDict):
511522
includeAnalysis = args.include_analysis
512523
includeTPCResiduals=True if environ.get('ALIEN_JDL_DOTPCRESIDUALEXTRACTION') == '1' else False
513524
includeTPCSyncMode=True if environ.get('ALIEN_JDL_DOTPCSYNCMODE') == '1' else False
514-
ccdbRemap = environ.get('ALIEN_JDL_REMAPPINGS')
515525

516526
qcdir = "QC"
517527
if (includeLocalQC or includeFullQC) and not isdir(qcdir):

0 commit comments

Comments
 (0)