41 #include <Eigen/Sparse> 78 static constexpr
const float MIN_MZ_ = 1.0;
97 static constexpr
const float DEFAULT_BIN_WIDTH_LOWRES = 1.0005;
100 static constexpr
const float DEFAULT_BIN_WIDTH_HIRES = 0.02;
161 return (MIN_MZ_ * pow(1.0 + bin_size_ * 1e-6, i));
165 return (i * bin_size_);
176 const SparseVectorType& getBins()
const;
179 SparseVectorType& getBins();
182 const std::vector<Precursor>& getPrecursors()
const;
185 std::vector<Precursor>& getPrecursors();
float getBinSize() const
get the bin size
Definition: BinnedSpectrum.h:170
float bin_size_
the size of each bin
Definition: BinnedSpectrum.h:196
bool unit_ppm_
absolute bin size or relative bin size
Definition: BinnedSpectrum.h:199
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
SparseVectorIndexType getBinIndex(float mz) const
return the bin index of a given m/z position
Definition: BinnedSpectrum.h:139
BinnedSpectrum()
default constructor
Definition: BinnedSpectrum.h:115
Eigen::SparseVector< float > SparseVectorType
typedef for the underlying sparse vector
Definition: BinnedSpectrum.h:102
bool operator==(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:806
UInt bin_spread_
the spread to left or right
Definition: BinnedSpectrum.h:193
std::vector< Precursor > precursors_
precursor information
Definition: BinnedSpectrum.h:208
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
Eigen::SparseVector< float >::Index SparseVectorIndexType
typedef for the index into the sparse vector
Definition: BinnedSpectrum.h:105
The representation of a 1D spectrum.
Definition: MSSpectrum.h:66
float getBinIntensity(double mz)
returns the bin intensity at a given m/z position
Definition: BinnedSpectrum.h:136
Eigen::SparseVector< float >::InnerIterator SparseVectorIteratorType
typedef for the index into the sparse vector
Definition: BinnedSpectrum.h:108
static const SparseVectorType EmptySparseVector
the empty SparseVector
Definition: BinnedSpectrum.h:111
float getBinLowerMZ(size_t i) const
return the lower m/z of a bin given its index
Definition: BinnedSpectrum.h:156
This is a binned representation of a PeakSpectrum.
Definition: BinnedSpectrum.h:75
bool operator!=(_Iterator< _Val, _Ref, _Ptr > const &, _Iterator< _Val, _Ref, _Ptr > const &)
Definition: KDTree.h:824
SparseVectorType bins_
bins
Definition: BinnedSpectrum.h:202
size_t getBinSpread() const
get the bin spread
Definition: BinnedSpectrum.h:173