85 template <
typename SpectrumType>
88 if (spectrum.empty())
return;
95 if (method_ ==
"to_one")
97 divisor = spectrum.begin()->getIntensity();
98 for (ConstIterator it = spectrum.begin(); it != spectrum.end(); ++it)
100 if (divisor < it->getIntensity()) divisor = it->getIntensity();
103 else if (method_ ==
"to_TIC")
105 for (ConstIterator it = spectrum.begin(); it != spectrum.end(); ++it)
107 divisor += it->getIntensity();
117 for (
Iterator it = spectrum.begin(); it != spectrum.end(); ++it)
119 it->setIntensity(it->getIntensity() / divisor);
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:93
Invalid value exception.
Definition: Exception.h:329
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:73
The representation of a 1D spectrum.
Definition: MSSpectrum.h:70
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:130
ContainerType::iterator Iterator
Mutable iterator.
Definition: MSSpectrum.h:128
Normalizes the peak intensities spectrum-wise.
Definition: Normalizer.h:59
~Normalizer() override
destructor
Normalizer(const Normalizer &source)
copy constructor
Normalizer()
default constructor
String method_
Definition: Normalizer.h:136
void filterPeakMap(PeakMap &exp) const
void filterPeakSpectrum(PeakSpectrum &spectrum) const
Normalizer & operator=(const Normalizer &source)
assignment operator
void filterSpectrum(SpectrumType &spectrum) const
Workhorse of this class.
Definition: Normalizer.h:86
void updateMembers_() override
This method is used to update extra member variables at the end of the setParameters() method.
A more convenient string class.
Definition: String.h:60
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47