Skip to content

Commit ac70623

Browse files
committed
Avoid computing the pVector of bachelor1 in the inner loop.
1 parent 473e398 commit ac70623

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

PWGHF/TableProducer/trackIndexSkimCreator.cxx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4131,6 +4131,12 @@ struct HfTrackIndexSkimCreatorLfCascades {
41314131
continue;
41324132
}
41334133

4134+
// bachelor1 momentum is invariant across the inner (bachelor2) loop;
4135+
// pVector() is a dynamic column with no caching (it recomputes
4136+
// sin/cos on every call), so evaluate it once here instead of on
4137+
// every bachelor2 iteration.
4138+
const std::array<float, 3> pVecCharmBachelor1 = trackCharmBachelor1.pVector();
4139+
41344140
// second loop over tracks
41354141
for (auto trackIdCharmBachelor2 = trackIdCharmBachelor1 + 1; trackIdCharmBachelor2 != groupedBachTrackIndices.end(); ++trackIdCharmBachelor2) {
41364142

@@ -4154,7 +4160,7 @@ struct HfTrackIndexSkimCreatorLfCascades {
41544160
continue;
41554161
}
41564162

4157-
if (!isPreselectedCandidateXic(pVecCasc, trackCharmBachelor1.pVector(), trackCharmBachelor2.pVector())) {
4163+
if (!isPreselectedCandidateXic(pVecCasc, pVecCharmBachelor1, trackCharmBachelor2.pVector())) {
41584164
continue;
41594165
}
41604166

0 commit comments

Comments
 (0)