Skip to content

Commit 3493d41

Browse files
committed
Add new MC process function for mixing
1 parent a5c2353 commit 3493d41

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

PWGLF/Tasks/Strangeness/lambdaspincorrderived.cxx

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,44 +1215,26 @@ struct lambdaspincorrderived {
12151215
if (ptB < 0 || etaB < 0 || phiB < 0 || mB < 0)
12161216
continue;
12171217

1218+
// Collect partners from nominal key, plus wrapped neighbor only for φ-edge bins
12181219
std::vector<MatchRef> matches;
1219-
const int maxKeep = maxMatchesPerPair.value; // default 25
1220-
matches.reserve(std::max(64, maxKeep > 0 ? maxKeep : 64));
1221-
1220+
matches.reserve(128); // or keep binVec.size() if you prefer
12221221
const int64_t curColIdx = static_cast<int64_t>(collision1.index());
1223-
std::unordered_set<int64_t> seenRow;
1224-
seenRow.reserve(static_cast<size_t>(std::max(256, 4 * (maxKeep > 0 ? maxKeep : 64))));
1225-
1226-
auto collectFrom = [&](int ptUse, int etaUse, int phiUse) {
1227-
if (maxKeep > 0 && static_cast<int>(matches.size()) >= maxKeep) {
1228-
return; // early stop
1229-
}
12301222

1231-
const size_t keyUse = linearKey(colBin, status, ptUse, etaUse, phiUse, mB,
1223+
auto collectFrom = [&](int phiBinUse) {
1224+
const size_t keyUse = linearKey(colBin, status, ptB, etaB, phiBinUse, mB,
12321225
nStat, nPt, nEta, nPhi, nM);
12331226
auto const& vec = buffer[keyUse];
1234-
12351227
for (const auto& bc : vec) {
1236-
if (maxKeep > 0 && static_cast<int>(matches.size()) >= maxKeep) {
1237-
break;
1238-
}
12391228
if (bc.collisionIdx == curColIdx) {
12401229
continue; // must be from different event
12411230
}
1242-
1243-
// dedupe first
1244-
if (!seenRow.insert(bc.rowIndex).second) {
1245-
continue;
1246-
}
1247-
12481231
auto tX = V0s.iteratorAt(static_cast<uint64_t>(bc.rowIndex));
12491232
if (!selectionV0(tX)) {
12501233
continue;
12511234
}
12521235
if (!checkKinematics(t1, tX)) {
12531236
continue;
12541237
}
1255-
12561238
matches.push_back(MatchRef{bc.collisionIdx, bc.rowIndex});
12571239
}
12581240
};

0 commit comments

Comments
 (0)