79 template <
typename SpectrumType>
82 if (spectrum.size() < 2)
86 double tolerance = (double)param_.getValue(
"tolerance");
87 double parentmass = 0.0;
94 Size j = spectrum.size() - 1;
95 for (
Size i = 0; i < spectrum.size() && i <= j; )
97 double sum = spectrum[i].getPosition()[0] + spectrum[j].getPosition()[0];
99 if (std::fabs(
sum - parentmass) < tolerance)
101 result += spectrum[i].getIntensity() + spectrum[j].getIntensity();
104 if (
sum < parentmass)
110 if (
sum > parentmass)
123 return "ComplementFilter";
total intensity of peak pairs that could result from complementing fragments of charge state 1
Definition: ComplementFilter.h:53
ComplementFilter(const ComplementFilter &source)
copy constructor
static FilterFunctor * create()
Definition: ComplementFilter.h:76
~ComplementFilter() override
destructor
double apply(SpectrumType &spectrum)
returns the total intensity of peak pairs which could result from complementing fragments
Definition: ComplementFilter.h:80
static const String getProductName()
returns the name for registration at the factory
Definition: ComplementFilter.h:121
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:46
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
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:60
size_t Size
Size type e.g. used as variable which can hold result of size()
Definition: Types.h:127
static double sum(IteratorType begin, IteratorType end)
Calculates the sum of a range of values.
Definition: StatisticFunctions.h:107
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48