Skip to content

[PWGLF] Add ML-based track index skim creator for tracks from double omega - #18656

Merged
romainschotter merged 22 commits into
AliceO2Group:masterfrom
GiorgioAlbertoLucia:omegaomega
Nov 12, 2026
Merged

romainschotter merged 22 commits into
AliceO2Group:masterfrom
GiorgioAlbertoLucia:omegaomega

Conversation

@GiorgioAlbertoLucia

Copy link
Copy Markdown
Contributor

This PR adds a track-level BDT preselection for the double-Omega (ΩΩ → Ω Λ K) search and extends the event mixing of doubleOmegaTreeCreator.

doubleOmegaTrackIndexSkimCreator(o2-analysis-lf-double-omega-track-index-skim-creator, tables in LFDoubleOmegaTrackTables.h)

  • processMC: writes tracks with their MC role to DOmegaTrackTrain, the training sample of a multiclass track BDT. The roles are p, π, K from the Λ and Ω of a ΩΩ decay, other Λ/Ω daughters, and background. Signal is always kept; background and other daughters are downsampled.
  • processCandidates: runs the BDT (ONNX, local or CCDB) on the tracks. It pairs the selected p, π and K into Λ and Ω candidates within loose mass windows and stores their track indices in DOmegaV0s and DOmegaCascades, analogous to aod::V0s and aod::Cascades.
  • The BDT inputs (computeTrackFeatures) are in doubleOmegaBuilderHelper.h and are computed as in the training.

doubleOmegaTreeCreator

  • New processFindableTracksWithSkim: like processFindableTracks, but it also checks whether the findable ΩΩ is found in the skim tables. The result goes to a new bin of MC/generatedAndFindable, "Findable skim cascade + V0", which compares directly with "Findable cascade + V0 + selections" from the standard tables.
  • Event mixing now takes the magnetic field into account:
    • Kaons are mixed between collisions with the same or opposite field (charge mirrored for opposite fields).
    • Ω and Λ are only mixed between collisions with the same field.
    • Mixed combinations are built grouped by the field of the reference collision, to minimise field switches.

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

O2 linter results: ❌ 0 errors, ⚠️ 28 warnings, 🔕 9 disabled

lhusova
lhusova previously approved these changes Nov 9, 2026
for (const auto& proton : protons) {
for (const auto& pion : pions) {
const auto momentum = RecoDecay::pVec(proton.momentum, pion.momentum);
const float mass = RecoDecay::m(std::array{proton.momentum, pion.momentum}, std::array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @GiorgioAlbertoLucia ! If I understand correctly, you build pair of tracks which were propagated to the primary vertex, and then calculate the invariant mass under the Lambda mass hypothesis (or Omega mass hypothesis below).
However, the invariant mass should be calculated at the production vertex of the daughter tracks (i.e. the decay vertex) in order to have an invariant mass peak.
If you don't propagate the tracks to the decay point, it is unlikely to have an invariant mass peak.
Could you please clarify? Maybe I am missing something.
Thank you very much!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao @romainschotter,

You are correct in pointing out that the mass variable does not provide a proper evaluation of the Lambda invariant mass. However, in this particular case, an accurate mass reconstruction is not our goal, as this quantity is only used to build candidate pairs that are subsequently refitted.

The purpose of this operation is to reduce the combinatorial background before performing the refit, thereby avoiding the significant computational cost associated with it. The idea is to apply a very loose cut on this approximate invariant mass (e.g. 50 MeV/c²), which is wide enough to retain the signal while still rejecting a substantial fraction of the background.

Regarding your concern about the peak reconstruction, although it is true that the approximation does not reproduce the peak as accurately as the propagator-based calculation, the effect is not as large as one might expect. Here is a comparison of the two distributions, with the fit performed using the propagator (blue) and my approximation (red):

Screenshot 2026-11-09 at 18 44 10

Moreover, given the relatively large mass window, the resulting loss in efficiency is negligible (and will, in any case, be properly accounted for in the analysis). The following plot shows the comparison between the propagator-based calculation (fit) and my approximation (IU):

Screenshot 2026-11-09 at 18 45 57

I hope this clarifies the reasoning behind that line of code!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao @GiorgioAlbertoLucia !
I understand now that the mass selection is rather loose. However, propagating the tracks to the decay vertex before calculating the invariant mass would allow you to apply a tighter selection, thereby further reducing the combinatorial background and the computational cost.
Nevertheless, if the motivation for this approach is to reduce computational cost, an even more significant improvement could be achieved by not rebuilding the V0s and cascades, but instead using those already produced by the strangeness builder.
Of course, there may well be a valid reason for not using the strangeness builder. However, if that is the case, I think it should be clearly explained and demonstrated. This point was already raised three months ago and still needs to be explicitly addressed.
I am happy to approve the PR once the remaining errors are fixed. However, I want to stress that the question regarding the use of the strangeness builder needs to be addressed.
Thank you very much!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao @romainschotter, indeed there is a motivation for not going with the strangeness-builder. The analysis we are carrying out is statistics hungry, and one of the main challenges is improving the reconstruction efficiency. In an efficiency study that Francesco made, we discovered that an important part of the efficiency loss comes directly from using the SVertexer outputs, which is the starting point for the strangeness builder, as far as I understand.

The ML TISC that we propose here bypasses this, by pairing together all the tracks and applying ML cuts to reduce the statistics without affecting the efficiency. In order to reduce the combinatorics further, the mass cut is applied, with the caveat that the loose cut should be sufficient and that reconstructing the vertex each time would increase too much the cpu cost.

I think at this point I can just schedule a pag presentation and show you a couple of these plots. If you will have a better solution, I will be happy to implement that in a future version!

@romainschotter romainschotter Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao @GiorgioAlbertoLucia !
Indeed, this would be very helpful to show a few plots highlighting the loss of cascades with respect to the SVertexer. Again, it is possible that we loose candidates in the SVertexer but, if so, we need to identify at which step the candidates are lost, such that it is fixed for everyone.
In any case, once the PR passes the formatting requirements, I will approve and merge it.
Thank you very much!

Please consider the following formatting changes to AliceO2Group#18656
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 5812f37 at 2026-11-10 09:48:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1670:57: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 5812f37 at 2026-11-10 09:50:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1670:57: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

alibuild commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 5812f37 at 2026-11-10 14:09:

## sw/BUILD/lhapdf-latest/log
collect2: error: ld returned 1 exit status


## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'To reproduce the results below locally, run: '\''aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'\''.'
To reproduce the results below locally, run: 'aliBuild build O2Physics-code-check -e ALIBUILD_BASE_HASH=upstream/master'.
++ echo 'To apply all automatic fixes, add the '\''-e O2PHYSICS_CHECKER_FIX=1'\'' option.'
To apply all automatic fixes, add the '-e O2PHYSICS_CHECKER_FIX=1' option.
++ echo 'See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.'
See the documentation for more details at: <https://aliceo2group.github.io/analysis-framework/docs/tools/#running-with-o2physics-code-check>.
++ echo 'Found 5 errors and 2 warnings.'
Found 5 errors and 2 warnings.
++ [[ 5 -gt 0 ]]
++ cat /sw/BUILD/dc2c20b07904850ba5bcc4fd52d852642582c99c/O2Physics-code-check/errors.txt
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:49:1: error: included header Cartesian.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:455:69: error: no header providing "o2::math_utils::Point3D" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1670:32: error: & has lower precedence than !=; != will be evaluated first [clang-diagnostic-parentheses,-warnings-as-errors]
PWGLF/Utils/doubleOmegaBuilderHelper.h:31:1: error: included header Cartesian.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/doubleOmegaBuilderHelper.h:298:27: error: no header providing "o2::math_utils::Point3D" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 2 -gt 0 ]]
++ cat /sw/BUILD/dc2c20b07904850ba5bcc4fd52d852642582c99c/O2Physics-code-check/warnings.txt
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1670:9: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1670:34: warning: implicit conversion 'bool' -> 'int' [readability-implicit-bool-conversion]
++ [[ 5 -gt 0 ]]
++ exit 1
--

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 9f52d58 at 2026-11-10 11:41:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1670:57: error: suggest parentheses around comparison in operand of '&' [-Werror=parentheses]
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 018ae47 at 2026-11-10 12:02:

## sw/BUILD/lhapdf-latest/log
collect2: error: ld returned 1 exit status


## sw/BUILD/O2-latest/log
2026-11-10T12:02:11.072+0100 [41817:128179452840000] [executioncontext.cpp:739] [ERROR] Failed to download output blob d994727067293738d46e5f11069eb81e9846aa046cd9fdce848840afb9348588: 13: Blob absent from sink after replication: Object not found
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 018ae47 at 2026-11-10 13:47:

## sw/BUILD/lhapdf-latest/log
collect2: error: ld returned 1 exit status


## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1431:42: error: 'mixingType' was not declared in this scope; did you mean 'o2::aod::DoubleOmegaTables::mixingType'?
ninja: build stopped: subcommand failed.

Full log here.

Please consider the following formatting changes to AliceO2Group#18656
@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 018ae47 at 2026-11-10 15:16:

## sw/BUILD/lhapdf-latest/log
collect2: error: ld returned 1 exit status


## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1431:42: error: 'mixingType' was not declared in this scope; did you mean 'o2::aod::DoubleOmegaTables::mixingType'?
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/o2 for 979ee6a at 2026-11-10 18:29:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1431:42: error: 'mixingType' was not declared in this scope; did you mean 'o2::aod::DoubleOmegaTables::mixingType'?
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/staging for 979ee6a at 2026-11-10 20:19:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1431:42: error: 'mixingType' was not declared in this scope; did you mean 'o2::aod::DoubleOmegaTables::mixingType'?
ninja: build stopped: subcommand failed.

Full log here.

@alibuild

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 979ee6a at 2026-11-10 21:12:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/slc9_x86-64-slc9_x86-64/0/PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1431:42: error: 'mixingType' was not declared in this scope; did you mean 'o2::aod::DoubleOmegaTables::mixingType'?
ninja: build stopped: subcommand failed.

Full log here.

@vkucera
vkucera marked this pull request as draft November 10, 2026 20:26
@GiorgioAlbertoLucia
GiorgioAlbertoLucia marked this pull request as ready for review November 11, 2026 16:00
@mpuccio

mpuccio commented Nov 11, 2026

Copy link
Copy Markdown
Collaborator

Hello @GiorgioAlbertoLucia, sorry to jump in, but why is this in the strangeness folder? The analysis is under NUSPEX ...

@GiorgioAlbertoLucia

Copy link
Copy Markdown
Contributor Author

Hello @GiorgioAlbertoLucia, sorry to jump in, but why is this in the strangeness folder? The analysis is under NUSPEX ...

Ciao @mpuccio, the task started as OmegaOmega correlations, it is a good point to move it to nuspex. I will update this PR

@romainschotter
romainschotter merged commit 23d82c4 into AliceO2Group:master Nov 12, 2026
23 of 26 checks passed
@mpuccio

mpuccio commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

hi @GiorgioAlbertoLucia, thanks! I guess you can move it in the next PR as this was merged by @romainschotter

@GiorgioAlbertoLucia
GiorgioAlbertoLucia deleted the omegaomega branch November 12, 2026 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants