From ac706235f41647cc3a10e3f782ac77e63053e3c0 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 8 Jun 2026 16:47:41 +0200 Subject: [PATCH 1/2] Avoid computing the pVector of bachelor1 in the inner loop. --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index c53e4c32f59..6f7c67e441a 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -4131,6 +4131,12 @@ struct HfTrackIndexSkimCreatorLfCascades { continue; } + // bachelor1 momentum is invariant across the inner (bachelor2) loop; + // pVector() is a dynamic column with no caching (it recomputes + // sin/cos on every call), so evaluate it once here instead of on + // every bachelor2 iteration. + const std::array pVecCharmBachelor1 = trackCharmBachelor1.pVector(); + // second loop over tracks for (auto trackIdCharmBachelor2 = trackIdCharmBachelor1 + 1; trackIdCharmBachelor2 != groupedBachTrackIndices.end(); ++trackIdCharmBachelor2) { @@ -4154,7 +4160,7 @@ struct HfTrackIndexSkimCreatorLfCascades { continue; } - if (!isPreselectedCandidateXic(pVecCasc, trackCharmBachelor1.pVector(), trackCharmBachelor2.pVector())) { + if (!isPreselectedCandidateXic(pVecCasc, pVecCharmBachelor1, trackCharmBachelor2.pVector())) { continue; } From 0f0310cdf4f7f83b3968b0888e26b4a25f0039c0 Mon Sep 17 00:00:00 2001 From: Giulio Eulisse <10544+ktf@users.noreply.github.com> Date: Mon, 8 Jun 2026 20:17:17 +0200 Subject: [PATCH 2/2] Update trackIndexSkimCreator.cxx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Vít Kučera <26327373+vkucera@users.noreply.github.com> --- PWGHF/TableProducer/trackIndexSkimCreator.cxx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/PWGHF/TableProducer/trackIndexSkimCreator.cxx b/PWGHF/TableProducer/trackIndexSkimCreator.cxx index 6f7c67e441a..f65ee16a044 100644 --- a/PWGHF/TableProducer/trackIndexSkimCreator.cxx +++ b/PWGHF/TableProducer/trackIndexSkimCreator.cxx @@ -4131,11 +4131,7 @@ struct HfTrackIndexSkimCreatorLfCascades { continue; } - // bachelor1 momentum is invariant across the inner (bachelor2) loop; - // pVector() is a dynamic column with no caching (it recomputes - // sin/cos on every call), so evaluate it once here instead of on - // every bachelor2 iteration. - const std::array pVecCharmBachelor1 = trackCharmBachelor1.pVector(); + const auto pVecCharmBachelor1 = trackCharmBachelor1.pVector(); // second loop over tracks for (auto trackIdCharmBachelor2 = trackIdCharmBachelor1 + 1; trackIdCharmBachelor2 != groupedBachTrackIndices.end(); ++trackIdCharmBachelor2) {