53 template <
typename SpectrumType>
56 double tolerance = (double)param_.getValue(
"tolerance");
60 for (
Size i = 0; i < spectrum.size(); ++i)
62 for (
Size j = 1; i + j < spectrum.size(); ++j)
64 double pos_ij = spectrum[i + j].getPosition()[0];
65 double pos_i = spectrum[i].getPosition()[0];
66 if (std::fabs(pos_ij - pos_i + 1) < tolerance)
68 isodiff += spectrum[i].getIntensity() + spectrum[i + j].getIntensity();
72 if (std::fabs(spectrum[i + j].getPosition()[0] - spectrum[i].getPosition()[0]) > 1 + tolerance)
85 return "IsotopeDiffFilter";
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:20
IsotopeDiffFilter returns total intensity of peak pairs that could result from isotope peaks.
Definition: IsotopeDiffFilter.h:25
~IsotopeDiffFilter() override
destructor
IsotopeDiffFilter()
default constructor
IsotopeDiffFilter & operator=(const IsotopeDiffFilter &source)
assignment operator
static FilterFunctor * create()
Definition: IsotopeDiffFilter.h:50
IsotopeDiffFilter(const IsotopeDiffFilter &source)
copy constructor
double apply(SpectrumType &spectrum)
Definition: IsotopeDiffFilter.h:54
static const String getProductName()
Definition: IsotopeDiffFilter.h:83
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
A more convenient string class.
Definition: String.h:34
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:101
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22