@@ -1192,44 +1192,26 @@ struct lambdaspincorrderived {
11921192 if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0 )
11931193 continue ;
11941194
1195+ // Collect partners from nominal key, plus wrapped neighbor only for φ-edge bins
11951196 std::vector<MatchRef> matches;
1196- const int maxKeep = maxMatchesPerPair.value ; // default 25
1197- matches.reserve (std::max (64 , maxKeep > 0 ? maxKeep : 64 ));
1198-
1197+ matches.reserve (128 ); // or keep binVec.size() if you prefer
11991198 const int64_t curColIdx = static_cast <int64_t >(collision1.index ());
1200- std::unordered_set<int64_t > seenRow;
1201- seenRow.reserve (static_cast <size_t >(std::max (256 , 4 * (maxKeep > 0 ? maxKeep : 64 ))));
1202-
1203- auto collectFrom = [&](int ptUse, int etaUse, int phiUse) {
1204- if (maxKeep > 0 && static_cast <int >(matches.size ()) >= maxKeep) {
1205- return ; // early stop
1206- }
12071199
1208- const size_t keyUse = linearKey (colBin, status, ptUse, etaUse, phiUse, mB ,
1200+ auto collectFrom = [&](int phiBinUse) {
1201+ const size_t keyUse = linearKey (colBin, status, ptB, etaB, phiBinUse, mB ,
12091202 nStat, nPt, nEta, nPhi, nM);
12101203 auto const & vec = buffer[keyUse];
1211-
12121204 for (const auto & bc : vec) {
1213- if (maxKeep > 0 && static_cast <int >(matches.size ()) >= maxKeep) {
1214- break ;
1215- }
12161205 if (bc.collisionIdx == curColIdx) {
12171206 continue ; // must be from different event
12181207 }
1219-
1220- // dedupe first
1221- if (!seenRow.insert (bc.rowIndex ).second ) {
1222- continue ;
1223- }
1224-
12251208 auto tX = V0s.iteratorAt (static_cast <uint64_t >(bc.rowIndex ));
12261209 if (!selectionV0 (tX)) {
12271210 continue ;
12281211 }
12291212 if (!checkKinematics (t1, tX)) {
12301213 continue ;
12311214 }
1232-
12331215 matches.push_back (MatchRef{bc.collisionIdx , bc.rowIndex });
12341216 }
12351217 };
0 commit comments