Skip to content

Commit 8e4f242

Browse files
committed
tableReader: only reserve ditracks table size for assocs passing cuts
1 parent 484d8f0 commit 8e4f242

1 file changed

Lines changed: 13 additions & 8 deletions

File tree

‎PWGDQ/Tasks/tableReader_withAssoc.h‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,16 +3574,21 @@ struct AnalysisAsymmetricPairing {
35743574
// Reserve capacity for the output tables
35753575
int64_t reserveSize = 0;
35763576
for (auto const& event : events) {
3577-
if (!event.isEventSelected_bit(0)) {
3578-
continue;
3579-
}
3580-
if (fConfigRemoveCollSplittingCandidates.value && event.isEventSelected_bit(2)) {
3581-
continue;
3582-
}
35833577
auto groupedLegAAssocs = legACandidateAssocs.sliceBy(preslice, event.globalIndex());
35843578
auto groupedLegBAssocs = legBCandidateAssocs.sliceBy(preslice, event.globalIndex());
3585-
reserveSize += static_cast<int64_t>(groupedLegAAssocs.size()) *
3586-
static_cast<int64_t>(groupedLegBAssocs.size());
3579+
size_t nGoodA = 0;
3580+
size_t nGoodB = 0;
3581+
for (auto const& t : groupedLegAAssocs) {
3582+
if (t.isBarrelSelected_raw()) {
3583+
nGoodA++;
3584+
}
3585+
}
3586+
for (auto const& t : groupedLegBAssocs) {
3587+
if (t.isBarrelSelected_raw()) {
3588+
nGoodB++;
3589+
}
3590+
}
3591+
reserveSize += nGoodA * nGoodB;
35873592
}
35883593
ditrackList.reserve(reserveSize);
35893594
ditrackExtraList.reserve(reserveSize);

0 commit comments

Comments
 (0)