Skip to content

Commit

Permalink
Use incremental peak ID's
Browse files Browse the repository at this point in the history
  • Loading branch information
fred3m committed Jun 22, 2022
1 parent 1f6fc4c commit 6301ca7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/detection/FootprintMerge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class FootprintMerge {
PeakCatalog newPeaks(currentPeaks.getTable());
float minNewPeakDist2 = minNewPeakDist * minNewPeakDist;
float maxSamePeakDist2 = maxSamePeakDist * maxSamePeakDist;
int lastPeakId = getMergedFootprint()->getPeaks().back().getId();
for (PeakCatalog::const_iterator otherIter = otherPeaks.begin(); otherIter != otherPeaks.end();
++otherIter) {
float minDist2 = std::numeric_limits<float>::infinity();
Expand Down Expand Up @@ -187,9 +188,10 @@ class FootprintMerge {
} else {
newPeaks.push_back(otherIter);
}
// Keep the peak ID's in numerical order and ensure that they are unique.
newPeaks.back().setId(++lastPeakId);
}
}

getMergedFootprint()->getPeaks().insert(getMergedFootprint()->getPeaks().end(), newPeaks.begin(),
newPeaks.end(),
true // deep-copy
Expand Down

0 comments on commit 6301ca7

Please sign in to comment.