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";