From 2504b49239eecd6bc6ab9bdfe960ecd637b68b11 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 9 Jun 2026 08:57:33 +0200 Subject: [PATCH 1/2] Avoid slicing inside the inner loop --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index f65ee16a044..61a410e10ab 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -3938,6 +3938,11 @@ struct HfTrackIndexSkimCreatorLfCascades { // cascade loop const auto thisCollId = collision.globalIndex(); const auto groupedCascades = cascades.sliceBy(cascadesPerCollision, thisCollId); + // The bachelor track indices depend only on the collision, not on the + // cascade, so slice them once per collision. Each sliceBy on this Filtered + // join does a full arrow Table::Slice (per-column allocation) plus a + // selection-vector slice, so rebuilding it for every cascade is pure waste. + const auto groupedBachTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); for (const auto& casc : groupedCascades) { @@ -3995,7 +4000,6 @@ struct HfTrackIndexSkimCreatorLfCascades { trackParCovCascOmega.setPID(o2::track::PID::OmegaMinus); //--------------combining cascade and pion tracks-------------- - const auto groupedBachTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); for (auto trackIdCharmBachelor1 = groupedBachTrackIndices.begin(); trackIdCharmBachelor1 != groupedBachTrackIndices.end(); ++trackIdCharmBachelor1) { hfFlag = 0; From 53ca3c7b6932fdc1ec05a7ca6ce724f9222bdc12 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:03:39 +0200 Subject: [PATCH 2/2] Apply suggestion from @ktf --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 61a410e10ab..aead29025a9 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -3938,10 +3938,6 @@ struct HfTrackIndexSkimCreatorLfCascades { // cascade loop const auto thisCollId = collision.globalIndex(); const auto groupedCascades = cascades.sliceBy(cascadesPerCollision, thisCollId); - // The bachelor track indices depend only on the collision, not on the - // cascade, so slice them once per collision. Each sliceBy on this Filtered - // join does a full arrow Table::Slice (per-column allocation) plus a - // selection-vector slice, so rebuilding it for every cascade is pure waste. const auto groupedBachTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId); for (const auto& casc : groupedCascades) {