41 #include <Eigen/Sparse>
78 static constexpr
const float MIN_MZ_ = 1.0;
96 static constexpr
const float DEFAULT_BIN_WIDTH_LOWRES = 1.0005f;
99 static constexpr
const float DEFAULT_BIN_WIDTH_HIRES = 0.02f;
102 static constexpr
const float DEFAULT_BIN_OFFSET_HIRES = 0.0f;
105 static constexpr
const float DEFAULT_BIN_OFFSET_LOWRES = 0.4f;
170 return (MIN_MZ_ * pow(1.0 + bin_size_ * 1e-6, i));
174 return ((
static_cast<float>(i) - offset_) * bin_size_);
This is a binned representation of a PeakSpectrum.
Definition: BinnedSpectrum.h:76
Eigen::SparseVector< float >::Index SparseVectorIndexType
typedef for the index into the sparse vector
Definition: BinnedSpectrum.h:111
float bin_size_
the size of each bin
Definition: BinnedSpectrum.h:208
size_t getBinSpread() const
get the bin spread
Definition: BinnedSpectrum.h:182
BinnedSpectrum & operator=(const BinnedSpectrum &)=default
assignment operator
float offset_
offset of bin start
Definition: BinnedSpectrum.h:214
static const SparseVectorType EmptySparseVector
the empty SparseVector
Definition: BinnedSpectrum.h:117
BinnedSpectrum()
default constructor
Definition: BinnedSpectrum.h:121
std::vector< Precursor > & getPrecursors()
mutable access to precursors
BinnedSpectrum(const BinnedSpectrum &)=default
copy constructor
bool operator!=(const BinnedSpectrum &rhs) const
inequality operator
float getBinLowerMZ(size_t i) const
return the lower m/z of a bin given its index
Definition: BinnedSpectrum.h:165
float getBinIntensity(double mz)
returns the bin intensity at a given m/z position
Definition: BinnedSpectrum.h:142
bool operator==(const BinnedSpectrum &rhs) const
equality operator
UInt bin_spread_
the spread to left or right
Definition: BinnedSpectrum.h:205
Eigen::SparseVector< float > SparseVectorType
typedef for the underlying sparse vector
Definition: BinnedSpectrum.h:108
const SparseVectorType & getBins() const
immutable access to the bin container
void binSpectrum_(const PeakSpectrum &ps)
calculate binning of peak spectrum
bool unit_ppm_
absolute bin size or relative bin size
Definition: BinnedSpectrum.h:211
const std::vector< Precursor > & getPrecursors() const
immutable access to precursors
float getOffset() const
return offset
Definition: BinnedSpectrum.h:191
Eigen::SparseVector< float >::InnerIterator SparseVectorIteratorType
typedef for the index into the sparse vector
Definition: BinnedSpectrum.h:114
std::vector< Precursor > precursors_
precursor information
Definition: BinnedSpectrum.h:223
static bool isCompatible(const BinnedSpectrum &a, const BinnedSpectrum &b)
Check if two BinnedSpectrum objects have equally sized bins and offset.
virtual ~BinnedSpectrum()
destructor
SparseVectorType bins_
bins
Definition: BinnedSpectrum.h:217
SparseVectorType & getBins()
mutable access to the bin container
BinnedSpectrum(const PeakSpectrum &ps, float size, bool unit_ppm, UInt spread, float offset)
detailed constructor
SparseVectorIndexType getBinIndex(float mz) const
return the bin index of a given m/z position
Definition: BinnedSpectrum.h:145
float getBinSize() const
get the bin size
Definition: BinnedSpectrum.h:179
The representation of a 1D spectrum.
Definition: MSSpectrum.h:71
unsigned int UInt
Unsigned integer type.
Definition: Types.h:94
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:47