53 template <
typename SpectrumType>
56 if (spectrum.size() < 2)
60 double tolerance = (double)param_.getValue(
"tolerance");
61 double parentmass = 0.0;
68 Size j = spectrum.size() - 1;
69 for (
Size i = 0; i < spectrum.size() && i <= j; )
71 double sum = spectrum[i].getPosition()[0] + spectrum[j].getPosition()[0];
73 if (std::fabs(
sum - parentmass) < tolerance)
75 result += spectrum[i].getIntensity() + spectrum[j].getIntensity();
97 return "ComplementFilter";
total intensity of peak pairs that could result from complementing fragments of charge state 1
Definition: ComplementFilter.h:27
ComplementFilter(const ComplementFilter &source)
copy constructor
static FilterFunctor * create()
Definition: ComplementFilter.h:50
~ComplementFilter() override
destructor
double apply(SpectrumType &spectrum)
returns the total intensity of peak pairs which could result from complementing fragments
Definition: ComplementFilter.h:54
static const String getProductName()
returns the name for registration at the factory
Definition: ComplementFilter.h:95
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:20
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
void sortByPosition()
Lexicographically sorts the peaks by their position.
const std::vector< Precursor > & getPrecursors() const
returns a const reference to the precursors
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
static double sum(IteratorType begin, IteratorType end)
Calculates the sum of a range of values.
Definition: StatisticFunctions.h:81
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22