80 template <
typename SpectrumType>
84 double marks = (
double)param_.getValue(
"marks");
85 double tolerance = (
double)param_.getValue(
"tolerance");
86 std::map<double, SignedSize> ions_w_neutrallosses;
88 for (
Size i = 0; i < spectrum.size(); ++i)
90 double mz = spectrum[i].getPosition()[0];
91 double intensity = spectrum[i].getIntensity();
95 double curmz = spectrum[j].getPosition()[0];
96 double curIntensity = spectrum[j].getIntensity();
99 if (std::fabs(mz - curmz - 17) < tolerance || std::fabs(mz - curmz - 18) < tolerance)
102 if (curIntensity < intensity)
104 ions_w_neutrallosses[mz]++;
111 if (mz - curmz > 18.3)
120 for (std::map<double, SignedSize>::const_iterator cmit = ions_w_neutrallosses.begin(); cmit != ions_w_neutrallosses.end(); ++cmit)
122 if (cmit->second >= marks)
124 marked.insert(std::pair<double, bool>(cmit->first,
true));
133 return "NeutralLossMarker";