Skip to content

Commit dbc276a

Browse files
SVertexer: fix V0 index of cascades when the V0 is cloned for other PVs (#16227)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 459eabd commit dbc276a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎Detectors/Vertexing/src/SVertexer.cxx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -837,9 +837,11 @@ bool SVertexer::checkV0(const TrackCand& seedP, const TrackCand& seedN, int iP,
837837
}
838838

839839
if (nV0Used) { // need to fix the index of V0 for the cascades using this v0
840+
// it is added below, after the clones of it which checkCascades added for cascades at other vertices
841+
const int v0ID = mV0sIdxTmp[ithread].size();
840842
for (unsigned int ic = nCascIni; ic < mCascadesIdxTmp[ithread].size(); ic++) {
841843
if (mCascadesIdxTmp[ithread][ic].getV0ID() == -1) {
842-
mCascadesIdxTmp[ithread][ic].setV0ID(nV0Ini);
844+
mCascadesIdxTmp[ithread][ic].setV0ID(v0ID);
843845
}
844846
}
845847
}
@@ -1012,7 +1014,7 @@ int SVertexer::checkCascades(const V0Index& v0Idx, const V0& v0, float rv0, std:
10121014
} else { // add V0 clone for this cascade (may be used also by other cascades)
10131015
const auto& pv = mPVertices[cascVtxID];
10141016
cascIdx.setV0ID(mV0sIdxTmp[ithread].size()); // set the new V0 index in the cascade
1015-
pvMap[cascVtxID] = mV0sTmp[ithread].size(); // add the new V0 index to the map
1017+
pvMap[cascVtxID] = mV0sIdxTmp[ithread].size(); // add the new V0 index to the map (mV0sTmp is filled only with createFullV0s)
10161018
mV0sIdxTmp[ithread].emplace_back(cascVtxID, v0Idx.getProngs());
10171019
if (mSVParams->createFullV0s) {
10181020
mV0sTmp[ithread].push_back(v0);

0 commit comments

Comments
 (0)