41 #include <Eigen/Sparse> 78 static constexpr
const float MIN_MZ_ = 1.0;
96 static constexpr
const float DEFAULT_BIN_WIDTH_LOWRES = 1.0005;
99 static constexpr
const float DEFAULT_BIN_WIDTH_HIRES = 0.02;
102 static constexpr
const float DEFAULT_BIN_OFFSET_HIRES = 0.0;
105 static constexpr
const float DEFAULT_BIN_OFFSET_LOWRES = 0.4;
170 return (MIN_MZ_ * pow(1.0 + bin_size_ * 1e-6, i));
174 return ((static_cast<float>(i) - offset_) * bin_size_);
185 const SparseVectorType& getBins()
const;
188 SparseVectorType& getBins();
194 const std::vector<Precursor>& getPrecursors()
const;
197 std::vector<Precursor>& getPrecursors();
float getBinSize() const
get the bin size
Definition: BinnedSpectrum.h:179
float bin_size_
the size of each bin
Definition: BinnedSpectrum.h:208
bool unit_ppm_
absolute bin size or relative bin size
Definition: BinnedSpectrum.h:211
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:145
BinnedSpectrum()
default constructor
Definition: BinnedSpectrum.h:121
Eigen::SparseVector< float > SparseVectorType
typedef for the underlying sparse vector
Definition: BinnedSpectrum.h:108
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:205
std::vector< Precursor > precursors_
precursor information
Definition: BinnedSpectrum.h:223
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:46
float offset_
offset of bin start
Definition: BinnedSpectrum.h:214
Eigen::SparseVector< float >::Index SparseVectorIndexType
typedef for the index into the sparse vector
Definition: BinnedSpectrum.h:111
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:142
Eigen::SparseVector< float >::InnerIterator SparseVectorIteratorType
typedef for the index into the sparse vector
Definition: BinnedSpectrum.h:114
static const SparseVectorType EmptySparseVector
the empty SparseVector
Definition: BinnedSpectrum.h:117
float getBinLowerMZ(size_t i) const
return the lower m/z of a bin given its index
Definition: BinnedSpectrum.h:165
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:217
float getOffset() const
return offset
Definition: BinnedSpectrum.h:191
size_t getBinSpread() const
get the bin spread
Definition: BinnedSpectrum.h:182