Skip to content

Commit 2504b49

Browse files
committed
Avoid slicing inside the inner loop
1 parent ddcbe3e commit 2504b49

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

PWGHF/TableProducer/trackIndexSkimCreator.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3938,6 +3938,11 @@ struct HfTrackIndexSkimCreatorLfCascades {
39383938
// cascade loop
39393939
const auto thisCollId = collision.globalIndex();
39403940
const auto groupedCascades = cascades.sliceBy(cascadesPerCollision, thisCollId);
3941+
// The bachelor track indices depend only on the collision, not on the
3942+
// cascade, so slice them once per collision. Each sliceBy on this Filtered
3943+
// join does a full arrow Table::Slice (per-column allocation) plus a
3944+
// selection-vector slice, so rebuilding it for every cascade is pure waste.
3945+
const auto groupedBachTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId);
39413946

39423947
for (const auto& casc : groupedCascades) {
39433948

@@ -3995,7 +4000,6 @@ struct HfTrackIndexSkimCreatorLfCascades {
39954000
trackParCovCascOmega.setPID(o2::track::PID::OmegaMinus);
39964001

39974002
//--------------combining cascade and pion tracks--------------
3998-
const auto groupedBachTrackIndices = trackIndices.sliceBy(trackIndicesPerCollision, thisCollId);
39994003
for (auto trackIdCharmBachelor1 = groupedBachTrackIndices.begin(); trackIdCharmBachelor1 != groupedBachTrackIndices.end(); ++trackIdCharmBachelor1) {
40004004

40014005
hfFlag = 0;

0 commit comments

Comments
 (0)