82 template <
typename SpectrumType>
86 std::multimap<double, Size> band_intensity;
87 double parentmass = 0.0;
90 for (
Size i = 0; i < bands; ++i)
96 while (j < spectrum.size() && spectrum[j].getPosition()[0] < (parentmass - 300) / bands * (i + 1) + 300)
98 intensity += spectrum[j++].getIntensity();
100 band_intensity.insert(std::make_pair(intensity, i));
103 double total_intensity = 0;
104 double twobiggest = 0;
105 double sevensmallest = 0;
106 for (std::multimap<double, Size>::reverse_iterator mmrit = band_intensity.rbegin(); mmrit != band_intensity.rend(); ++mmrit, ++j)
108 total_intensity += mmrit->first;
112 twobiggest += mmrit->first;
117 sevensmallest += mmrit->first;
121 return (twobiggest - sevensmallest) / total_intensity;
127 return "IntensityBalanceFilter";
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:46
IntensityBalanceFilter divides the m/z-range into ten regions and sums the intensity in these regions...
Definition: IntensityBalanceFilter.h:54
IntensityBalanceFilter()
default constructor
static FilterFunctor * create()
Definition: IntensityBalanceFilter.h:79
~IntensityBalanceFilter() override
destructor
IntensityBalanceFilter & operator=(const IntensityBalanceFilter &source)
assignment operator
double apply(SpectrumType &spectrum)
Definition: IntensityBalanceFilter.h:83
IntensityBalanceFilter(const IntensityBalanceFilter &source)
copy constructor
static const String getProductName()
Definition: IntensityBalanceFilter.h:125
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
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
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48