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