Skip to content

Commit a899ce0

Browse files
authored
[DPG] Skip ambiguous tracks with an empty BC slice in the event selection QA (#18019)
1 parent 8e92d10 commit a899ce0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

DPG/Tasks/AOTEvent/eventSelectionQa.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,8 +1009,12 @@ struct EventSelectionQaTask {
10091009

10101010
// special check to avoid crashes (in particular, on some MC Pb-Pb datasets)
10111011
// (related to shifts in ambiguous tracks association to bc slices (off by 1) - see https://mattermost.web.cern.ch/alice/pl/g9yaaf3tn3g4pgn7c1yex9copy
1012-
if (ambTrId >= 0 && (ambTracks.iteratorAt(ambTrId).bcIds()[0] >= bcs.size()))
1013-
continue;
1012+
// an empty slice (-1, -1) passes the upper check, so test it as well
1013+
if (ambTrId >= 0) {
1014+
const auto& ambTrack = ambTracks.iteratorAt(ambTrId);
1015+
if (!ambTrack.has_bc() || ambTrack.bcIds()[0] >= bcs.size() || ambTrack.bcIds()[1] >= bcs.size())
1016+
continue;
1017+
}
10141018

10151019
int indexBc = ambTrId < 0 ? track.collision_as<ColEvSels>().bc_as<BCsRun3>().globalIndex() : ambTracks.iteratorAt(ambTrId).bc_as<BCsRun3>().begin().globalIndex();
10161020
auto bc = bcs.iteratorAt(indexBc);

0 commit comments

Comments
 (0)