Skip to content

MC: store the MC truth in the TPC residuals whenever MC labels are on - #2503

Merged
jackal1-66 merged 1 commit into
AliceO2Group:masterfrom
matthias-kleiner:tpc-residuals-mc
Oct 20, 2026
Merged

jackal1-66 merged 1 commit into
AliceO2Group:masterfrom
matthias-kleiner:tpc-residuals-mc

Conversation

@matthias-kleiner

@matthias-kleiner matthias-kleiner commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

When ALIEN_JDL_DOTPCRESIDUALEXTRACTION=1, the residual extraction (o2-tpc-scdcalib-interpolation-workflow) and aggregation (o2-calibration-residual-aggregator) tasks now run with --enable-mc. This stores the MC truth of the residual tracks (labels, ITS/TPC/TRD truth parameters, origin) as branch trkMC of the trackData tree.

The option follows --no-mc-labels instead of a separate variable, since the MC truth needs the MC labels of the ITS, TPC and ITS-TPC tracks.
It is passed only if the O2 version used for the reconstruction provides it (option_if_available, which also respects the async reco tag), so older O2 tags are unaffected.
The MC truth needs an O2 version with the residual MC truth commits plus #15943, which writes and reads it through the ROOT files.
Cost on PbPb TFs: interpolation peak RSS about 2.8 GB vs 1.1 GB without MC, within the declared 4 GB; output size about +5 %.
Tested with pp, 2 TFs × 50 events, up to tpcresidmerge:

With current O2 dev, --enable-mc is set on both tasks and every residual track has its MC truth (743 tracks, 743 trkMC entries). With --no-mc-labels it is not set.
With an older O2 that lacks the option, --enable-mc is not set and workflow creation succeeds.

@github-actions

Copy link
Copy Markdown

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1
async-2024-PbPb-apass2
async-2023-PbPb-apass5

@jackal1-66

Copy link
Copy Markdown
Collaborator

I thought a bit about this: the o2dpg_sim_workflow.py is supposed to work only with Monte Carlo simulations, meaning that --enable-mc should always be enabled. However it seems this is not the case as that flag will work only if MC labels are enabled, right @matthias-kleiner? I would propose to use args.no_mc_labels as if condition for the flag instead of adding an additional environment variable, given that ALIEN_JDL_DOTPCRESIDUALEXTRACTION already exists.

With ALIEN_JDL_DOTPCRESIDUALEXTRACTION=1 the residual extraction and aggregation tasks run with --enable-mc unless
--no-mc-labels is given, since the MC truth needs the MC labels of the ITS, TPC and ITS-TPC tracks. It stores the MC truth
of the residual tracks as branch trkMC of the trackData tree. The option is passed only if the O2 version used for the
reconstruction provides it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matthias-kleiner matthias-kleiner changed the title MC: optional MC truth in the TPC residuals MC: store the MC truth in the TPC residuals whenever MC labels are on Oct 20, 2026
@matthias-kleiner

Copy link
Copy Markdown
Contributor Author

I thought a bit about this: the o2dpg_sim_workflow.py is supposed to work only with Monte Carlo simulations, meaning that --enable-mc should always be enabled. However it seems this is not the case as that flag will work only if MC labels are enabled, right @matthias-kleiner? I would propose to use args.no_mc_labels as if condition for the flag instead of adding an additional environment variable, given that ALIEN_JDL_DOTPCRESIDUALEXTRACTION already exists.

Thanks for the suggestion! I updated the PR: --enable-mc is now set automatically whenever MC labels are on (i.e. without --no-mc-labels) and the extra environment variable is removed. It is only added if the O2 version provides the option, so older tags are unaffected.

@jackal1-66
jackal1-66 merged commit 4aebb44 into AliceO2Group:master Oct 20, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants