Skip to content

Commit 840501a

Browse files
authored
Common: Adding a protection in the collisionAssociator task (#3592)
1 parent bcc3597 commit 840501a

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Common/Core/CollisionAssociation.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ class CollisionAssociation
133133
for (const auto& ambTrack : ambiguousTracks) {
134134
if constexpr (isCentralBarrel) { // FIXME: to be removed as soon as it is possible to use getId<Table>() for joined tables
135135
if (ambTrack.trackId() == track.globalIndex()) {
136+
if (!ambTrack.has_bc() || ambTrack.bc().size() == 0) {
137+
globalBC.push_back(-1);
138+
break;
139+
}
136140
globalBC.push_back(ambTrack.bc().begin().globalBC());
137141
break;
138142
}
@@ -163,6 +167,9 @@ class CollisionAssociation
163167
}
164168

165169
float trackTime = track.trackTime();
170+
if (globalBC[track.filteredIndex()] < 0) {
171+
continue;
172+
}
166173
const int64_t bcOffsetWindow = (int64_t)globalBC[track.filteredIndex()] + trackTime / o2::constants::lhc::LHCBunchSpacingNS - (int64_t)collBC;
167174
if (std::abs(bcOffsetWindow) > bOffsetMax) {
168175
continue;

0 commit comments

Comments
 (0)