54 template <
typename SpectrumType>
57 double tolerance = (double)param_.getValue(
"tolerance");
60 for (
int i = 0; i < (int)spectrum.size(); ++i)
62 for (
int j = 1; i - j >= 0; ++j)
64 double pos_diff = std::fabs(spectrum[i - j].getPosition()[0] - spectrum[i].getPosition()[0]);
65 if (std::fabs(pos_diff - 18) < tolerance || std::fabs(pos_diff - 17) < tolerance)
67 isodiff += spectrum[i - j].getIntensity() + spectrum[i].getIntensity();
71 if (pos_diff > 18 + tolerance)
85 return "NeutralLossDiffFilter";
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:20
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
NeutralLossDiffFilter returns the total intensity ob peak pairs whose m/z difference can be explained...
Definition: NeutralLossDiffFilter.h:27
NeutralLossDiffFilter(const NeutralLossDiffFilter &source)
copy constructor
static FilterFunctor * create()
Definition: NeutralLossDiffFilter.h:51
~NeutralLossDiffFilter() override
destructor
NeutralLossDiffFilter & operator=(const NeutralLossDiffFilter &source)
assignment operator
double apply(SpectrumType &spectrum)
Definition: NeutralLossDiffFilter.h:55
NeutralLossDiffFilter()
default constructor
static const String getProductName()
Definition: NeutralLossDiffFilter.h:83
A more convenient string class.
Definition: String.h:34
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22