56 template <
typename SpectrumType>
60 std::multimap<double, Size> band_intensity;
61 double parentmass = 0.0;
64 for (
Size i = 0; i < bands; ++i)
70 while (j < spectrum.size() && spectrum[j].getPosition()[0] < (parentmass - 300) / bands * (i + 1) + 300)
72 intensity += spectrum[j++].getIntensity();
74 band_intensity.insert(std::make_pair(intensity, i));
77 double total_intensity = 0;
78 double twobiggest = 0;
79 double sevensmallest = 0;
80 for (std::multimap<double, Size>::reverse_iterator mmrit = band_intensity.rbegin(); mmrit != band_intensity.rend(); ++mmrit, ++j)
82 total_intensity += mmrit->first;
86 twobiggest += mmrit->first;
91 sevensmallest += mmrit->first;
95 return (twobiggest - sevensmallest) / total_intensity;
101 return "IntensityBalanceFilter";
A FilterFunctor extracts some spectrum characteristics for quality assessment.
Definition: FilterFunctor.h:20
IntensityBalanceFilter divides the m/z-range into ten regions and sums the intensity in these regions...
Definition: IntensityBalanceFilter.h:28
IntensityBalanceFilter()
default constructor
static FilterFunctor * create()
Definition: IntensityBalanceFilter.h:53
~IntensityBalanceFilter() override
destructor
IntensityBalanceFilter & operator=(const IntensityBalanceFilter &source)
assignment operator
double apply(SpectrumType &spectrum)
Definition: IntensityBalanceFilter.h:57
IntensityBalanceFilter(const IntensityBalanceFilter &source)
copy constructor
static const String getProductName()
Definition: IntensityBalanceFilter.h:99
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
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
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22