double noiseLevel = parameters.getParameter(
ExactMassDetectorParameters.noiseLevel).getValue();
// Create a tree set of detected mzPeaks sorted by MZ in ascending order
TreeSet<ExactMzDataPoint> mzPeaks = new TreeSet<ExactMzDataPoint>(
new DataPointSorter(SortingProperty.MZ,
SortingDirection.Ascending));
// Create a tree set of candidate mzPeaks sorted by intensity in
// descending order.
TreeSet<ExactMzDataPoint> candidatePeaks = new TreeSet<ExactMzDataPoint>(
new DataPointSorter(SortingProperty.Intensity,
SortingDirection.Descending));
// First get all candidate peaks (local maximum)
getLocalMaxima(scan, candidatePeaks, noiseLevel);