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 FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
NeutralLossDiffFilter returns the total intensity ob peak pairs whose m/z difference can be explained...
Definition: NeutralLossDiffFilter.h:53
NeutralLossDiffFilter(const NeutralLossDiffFilter &source)
copy constructor
static FilterFunctor * create()
Definition: NeutralLossDiffFilter.h:77
~NeutralLossDiffFilter() override
destructor
NeutralLossDiffFilter & operator=(const NeutralLossDiffFilter &source)
assignment operator
double apply(SpectrumType &spectrum)
Definition: NeutralLossDiffFilter.h:81
NeutralLossDiffFilter()
default constructor
static const String getProductName()
Definition: NeutralLossDiffFilter.h:109
A more convenient string class.
Definition: String.h:60
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47