72 BaseType::clearRanges();
73 ms_level_ranges_.clear();
84 ms_level == 0 ? BaseType::extend(other) : ms_level_ranges_[ms_level].extend(other);
96 if (
auto it = ms_level_ranges_.find(ms_level); it != ms_level_ranges_.end())
110 std::set<UInt> ms_levels;
111 for (
const auto& [level, _] : ms_level_ranges_)
113 ms_levels.insert(level);
126 ms_level == 0 ? BaseType::extendRT(rt) : ms_level_ranges_[ms_level].extendRT(rt);
137 ms_level == 0 ? BaseType::extendMZ(mz) : ms_level_ranges_[ms_level].extendMZ(mz);
148 ms_level == 0 ? BaseType::extendUnsafe(spectrum.
getRange()) : ms_level_ranges_[ms_level].extendUnsafe(spectrum.
getRange());
Invalid value exception.
Definition: Exception.h:305
The representation of a 1D spectrum.
Definition: MSSpectrum.h:44
const ThisRangeType & getRange() const
get range of current data (call updateRanges() before to ensure the range is accurate)
Definition: RangeManager.h:901
Handles the management of a multidimensional range, e.g. RangeMZ and RangeIntensity for spectra.
Definition: RangeManager.h:568
Advanced range manager for MS spectra with separate ranges for each MS level.
Definition: SpectrumRangeManager.h:44
void extendMZ(double mz, UInt ms_level=0)
Extends the m/z range with an MS level parameter.
Definition: SpectrumRangeManager.h:135
void extend(const BaseType &other, UInt ms_level=0)
Extends the ranges with the ranges of another range manager.
Definition: SpectrumRangeManager.h:82
SpectrumRangeManager(const SpectrumRangeManager &source)=default
Copy constructor.
std::set< UInt > getMSLevels() const
Gets all MS levels for which specific ranges exist.
Definition: SpectrumRangeManager.h:108
SpectrumRangeManager & operator=(SpectrumRangeManager &&source)=default
Move assignment operator.
~SpectrumRangeManager()=default
Destructor.
void extendUnsafe(const MSSpectrum &spectrum, UInt ms_level=0)
Extends the ranges with the ranges of a spectrum using an MS level parameter.
Definition: SpectrumRangeManager.h:146
SpectrumRangeManager(SpectrumRangeManager &&source)=default
Move constructor.
SpectrumRangeManager()=default
Default constructor.
void clearRanges()
Clears all ranges (global and MS level-specific)
Definition: SpectrumRangeManager.h:70
std::map< UInt, BaseType > ms_level_ranges_
MS level-specific ranges.
Definition: SpectrumRangeManager.h:153
void extendRT(double rt, UInt ms_level=0)
Extends the RT range with an MS level parameter.
Definition: SpectrumRangeManager.h:124
SpectrumRangeManager & operator=(const SpectrumRangeManager &source)=default
Assignment operator.
const BaseType & byMSLevel(UInt ms_level=0) const
Gets the ranges for a specific MS level.
Definition: SpectrumRangeManager.h:94
A more convenient string class.
Definition: String.h:34
unsigned int UInt
Unsigned integer type.
Definition: Types.h:64
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19