80 template <
typename SpectrumType>
83 double tolerance = (
double)param_.getValue(
"tolerance");
86 for (
int i = 0; i < (int)spectrum.size(); ++i)
88 for (
int j = 1; i - j >= 0; ++j)
90 double pos_diff = std::fabs(spectrum[i - j].getPosition()[0] - spectrum[i].getPosition()[0]);
91 if (std::fabs(pos_diff - 18) < tolerance || std::fabs(pos_diff - 17) < tolerance)
93 isodiff += spectrum[i - j].getIntensity() + spectrum[i].getIntensity();
97 if (pos_diff > 18 + tolerance)
111 return "NeutralLossDiffFilter";
A more convenient string class.
Definition: String.h:57
NeutralLossDiffFilter returns the total intensity ob peak pairs whose m/z difference can be explained...
Definition: NeutralLossDiffFilter.h:51
static FilterFunctor * create()
Definition: NeutralLossDiffFilter.h:77
double apply(SpectrumType &spectrum)
Definition: NeutralLossDiffFilter.h:81
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:44
static const String getProductName()
Definition: NeutralLossDiffFilter.h:109