35 #ifndef OPENMS_FILTERING_TRANSFORMERS_NEUTRALLOSSDIFFFILTER_H 36 #define OPENMS_FILTERING_TRANSFORMERS_NEUTRALLOSSDIFFFILTER_H 81 template <
typename SpectrumType>
84 double tolerance = (
double)param_.getValue(
"tolerance");
87 for (
int i = 0; i < (int)spectrum.size(); ++i)
89 for (
int j = 1; i - j >= 0; ++j)
91 double pos_diff = std::fabs(spectrum[i - j].getPosition()[0] - spectrum[i].getPosition()[0]);
92 if (std::fabs(pos_diff - 18) < tolerance || std::fabs(pos_diff - 17) < tolerance)
94 isodiff += spectrum[i - j].getIntensity() + spectrum[i].getIntensity();
98 if (pos_diff > 18 + tolerance)
112 return "NeutralLossDiffFilter";
119 #endif // OPENMS_FILTERING_TRANSFORMERS_NEUTRALLOSSDIFFFILTER_H 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:52
static FilterFunctor * create()
Definition: NeutralLossDiffFilter.h:78
double apply(SpectrumType &spectrum)
Definition: NeutralLossDiffFilter.h:82
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47
The representation of a 1D spectrum.
Definition: MSSpectrum.h:67
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:45
static const String getProductName()
Definition: NeutralLossDiffFilter.h:110