Skip to content

Commit 5948fee

Browse files
[PWGLF] Add safety against ambiguous tracks when moving TPC-only tracks to another collision (#14580)
1 parent f174488 commit 5948fee

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

PWGLF/Utils/strangenessBuilderModule.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,8 @@ class BuilderModule
13841384
negTrackPar.setPID(o2::track::PID::Electron);
13851385

13861386
auto const& collision = collisions.rawIteratorAt(v0.collisionId);
1387-
if (!mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, posTrack, posTrackPar)) {
1387+
// if track cannot be uniquely identified with a collision or cannot be assigned to a collision at all (collisionId = -1), do not attempt to move the TPC track and move on
1388+
if (!posTrack.has_collision() || !mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, posTrack, posTrackPar)) {
13881389
products.v0dataLink(-1, -1);
13891390
continue;
13901391
}
@@ -1397,7 +1398,8 @@ class BuilderModule
13971398
negTrackPar.setPID(o2::track::PID::Electron);
13981399

13991400
auto const& collision = collisions.rawIteratorAt(v0.collisionId);
1400-
if (!mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, negTrack, negTrackPar)) {
1401+
// if track cannot be uniquely identified with a collision or cannot be assigned to a collision at all (collisionId = -1), do not attempt to move the TPC track and move on
1402+
if (!negTrack.has_collision() || !mVDriftMgr.moveTPCTrack<TBCs, TCollisions>(collision, negTrack, negTrackPar)) {
14011403
products.v0dataLink(-1, -1);
14021404
continue;
14031405
}

0 commit comments

Comments
 (0)