Skip to content

Commit 1df490d

Browse files
committed
Add TPC residuals merging stage for tfs of a job
1 parent e03a513 commit 1df490d

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

MC/bin/o2dpg_sim_workflow.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,6 +1971,14 @@ def remove_json_prefix(path):
19711971
POOL_merge_task['cmd'] += '; RC=$?; root -l -q -b -e "auto f=TFile::Open(\\\"evtpool.root\\\"); auto t=(TTree*)f->Get(\\\"o2sim\\\"); int n=t->GetEntries(); std::ofstream((\\\"0_0_0_\\\"+std::to_string(n)+\\\".stat\\\").c_str()) << \\\"# MonaLisa stat file for event pools\\\";" ; [[ ${RC} == 0 ]]'
19721972
workflow['stages'].append(POOL_merge_task)
19731973

1974+
# if TPC residuals extraction was requested, we have to merge per-tf trees
1975+
tpcResidMergingNeeds = ['scdaggreg_' + str(tf) for tf in range(1, NTIMEFRAMES + 1)]
1976+
TPCResid_merge_task = createTask(name='tpcresidmerge', needs = tpcResidMergingNeeds, lab=["CALIB"], mem='2000', cpu='1')
1977+
TPCResid_merge_task['cmd'] = ' set -e ; [ -f tpcresidmerge_input.txt ] && rm tpcresidmerge_input.txt; '
1978+
TPCResid_merge_task['cmd'] += ' for i in `seq 1 ' + str(NTIMEFRAMES) + '`; do find tf${i} -name "o2tpc_residuals_*.root" >> tpcresidmerge_input.txt; done; '
1979+
TPCResid_merge_task['cmd'] += '${O2DPG_ROOT}/UTILS/root_merger.py -o o2tpc_residuals.root -i $(grep -v \"^$\" tpcresidmerge_input.txt | paste -sd, -)'
1980+
workflow['stages'].append(TPCResid_merge_task)
1981+
19741982
# adjust for alternate (RECO) software environments
19751983
adjust_RECO_environment(workflow, args.alternative_reco_software)
19761984

MC/run/ANCHOR/anchorMC.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,8 @@ if [[ "${MCRC}" == "0" && "${ALIEN_JDL_ADDTIMESERIESINMC}" != "0" ]]; then
394394
fi
395395

396396
if [[ "${MCRC}" == "0" && "${ALIEN_JDL_DOTPCRESIDUALEXTRACTION}" = "1" ]]; then
397-
echo_info "Running TPC residuals extraction and aggregation"
398-
${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json -tt scdaggreg
397+
echo_info "Running TPC residuals extraction, aggregation and merging"
398+
${O2DPG_ROOT}/MC/bin/o2_dpg_workflow_runner.py -f workflow.json -tt tpcresidmerge
399399
fi
400400

401401
[[ -n "${DISABLE_QC}" ]] && echo_info "QC is disabled, skip it."

0 commit comments

Comments
 (0)