59 template <
typename SpectrumType>
62 if (spectrum.empty())
return;
69 if (method_ ==
"to_one")
71 divisor = spectrum.begin()->getIntensity();
72 for (ConstIterator it = spectrum.begin(); it != spectrum.end(); ++it)
74 if (divisor < it->getIntensity()) divisor = it->getIntensity();
77 else if (method_ ==
"to_TIC")
79 for (ConstIterator it = spectrum.begin(); it != spectrum.end(); ++it)
81 divisor += it->getIntensity();
91 for (
Iterator it = spectrum.begin(); it != spectrum.end(); ++it)
93 it->setIntensity(it->getIntensity() / divisor);
A base class for all classes handling default parameters.
Definition: DefaultParamHandler.h:66
Invalid value exception.
Definition: Exception.h:305
In-Memory representation of a mass spectrometry run.
Definition: MSExperiment.h:45
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
ContainerType::const_iterator ConstIterator
Non-mutable iterator.
Definition: MSSpectrum.h:110
ContainerType::iterator Iterator
Mutable iterator.
Definition: MSSpectrum.h:108
Normalizes the peak intensities spectrum-wise.
Definition: Normalizer.h:33
~Normalizer() override
destructor
Normalizer(const Normalizer &source)
copy constructor
Normalizer()
default constructor
String method_
Definition: Normalizer.h:110
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:60
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:34
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19