Skip to content

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

Open
GiorgioAlbertoLucia wants to merge 8 commits into
AliceO2Group:masterfrom
GiorgioAlbertoLucia:omegaomega
Open

GiorgioAlbertoLucia wants to merge 8 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, ⚠️ 29 warnings, 🔕 9 disabled

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!

@alibuild

alibuild commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 83fa977 at 2026-11-09 12:01:

## 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 15 errors and 6 warnings.'
Found 15 errors and 6 warnings.
++ [[ 15 -gt 0 ]]
++ cat /sw/BUILD/9d80236548e968186e817fb4381603576d25fcca/O2Physics-code-check/errors.txt
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:24:1: error: included header EventSelectionParams.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:162:42: error: no header providing "o2::framework::OutputObjHandlingPolicy" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:191:16: error: no header providing "TH1" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:217:45: error: no header providing "std::pair" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:246:7: error: 'push_back' is called inside a loop; consider pre-allocating the container capacity before the loop [performance-inefficient-vector-operation,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:246:31: error: no header providing "Form" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:248:57: error: no header providing "o2::framework::LabeledArray" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:448:69: error: no header providing "o2::math_utils::Point3D" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTrackIndexSkimCreator.cxx:575:17: error: no header providing "std::size_t" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1470:22: error: std::move of the variable 'seed' of the trivially-copyable type 'std::tuple_element<1, std::pair<int, MixingSeed>>::type' (aka 'MixingSeed') has no effect [performance-move-const-arg,-warnings-as-errors]
PWGLF/Utils/doubleOmegaBuilderHelper.h:218:42: error: no header providing "o2::track::kSigQ2PtY" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/doubleOmegaBuilderHelper.h:218:64: error: no header providing "o2::track::kSigQ2PtZ" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/doubleOmegaBuilderHelper.h:218:86: error: no header providing "o2::track::kSigQ2PtSnp" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/doubleOmegaBuilderHelper.h:218:110: error: no header providing "o2::track::kSigQ2PtTgl" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGLF/Utils/doubleOmegaBuilderHelper.h:296:27: error: no header providing "o2::math_utils::Point3D" is directly included [misc-include-cleaner,-warnings-as-errors]
++ [[ 6 -gt 0 ]]
++ cat /sw/BUILD/9d80236548e968186e817fb4381603576d25fcca/O2Physics-code-check/warnings.txt
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:868:10: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1307:12: warning: use designated initializer list to initialize 'MixingSeed' [modernize-use-designated-initializers]
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1348:10: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1425:10: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGLF/TableProducer/Strangeness/doubleOmegaTreeCreator.cxx:1664:9: warning: implicit conversion 'int' -> 'bool' [readability-implicit-bool-conversion]
PWGLF/Utils/doubleOmegaBuilderHelper.h:620:100: warning: forwarding reference parameter 'onCandidate' is never forwarded inside the function body [cppcoreguidelines-missing-std-forward]
++ [[ 15 -gt 0 ]]
++ exit 1
--

Full log here.

@lhusova
lhusova disabled auto-merge November 9, 2026 11:11
@vkucera

vkucera commented Nov 9, 2026

Copy link
Copy Markdown
Collaborator

@GiorgioAlbertoLucia Please fix the errors.

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.

5 participants