Skip to content

Commit

Permalink
Merge pull request #31555 from mrodozov/fix-fittrack-comparison-order
Browse files Browse the repository at this point in the history
Fix failure in L1Trigger/TrackFindingTracklet reported in ASAN
  • Loading branch information
cmsbuild committed Sep 25, 2020
2 parents 96b916c + fec21a8 commit ef16fc8
Showing 1 changed file with 16 additions and 24 deletions.
40 changes: 16 additions & 24 deletions L1Trigger/TrackFindingTracklet/src/FitTrack.cc
Expand Up @@ -933,48 +933,40 @@ void FitTrack::execute() {
int nMatchesUniq = 0;
bool match = false;

if (indexArray[0] < matches1.size()) {
while (matches1[indexArray[0]] == bestTracklet && indexArray[0] < matches1.size()) {
indexArray[0]++;
nMatches++;
match = true;
}
while (indexArray[0] < matches1.size() && matches1[indexArray[0]] == bestTracklet) {
indexArray[0]++;
nMatches++;
match = true;
}

if (match)
nMatchesUniq++;
match = false;

if (indexArray[1] < matches2.size()) {
while (matches2[indexArray[1]] == bestTracklet && indexArray[1] < matches2.size()) {
indexArray[1]++;
nMatches++;
match = true;
}
while (indexArray[1] < matches2.size() && matches2[indexArray[1]] == bestTracklet) {
indexArray[1]++;
nMatches++;
match = true;
}

if (match)
nMatchesUniq++;
match = false;

if (indexArray[2] < matches3.size()) {
while (matches3[indexArray[2]] == bestTracklet && indexArray[2] < matches3.size()) {
indexArray[2]++;
nMatches++;
match = true;
}
while (indexArray[2] < matches3.size() && matches3[indexArray[2]] == bestTracklet) {
indexArray[2]++;
nMatches++;
match = true;
}

if (match)
nMatchesUniq++;
match = false;

if (indexArray[3] < matches4.size()) {
while (matches4[indexArray[3]] == bestTracklet && indexArray[3] < matches4.size()) {
indexArray[3]++;
nMatches++;
match = true;
}
while (indexArray[3] < matches4.size() && matches4[indexArray[3]] == bestTracklet) {
indexArray[3]++;
nMatches++;
match = true;
}

if (match)
Expand Down

0 comments on commit ef16fc8

Please sign in to comment.