Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKSHAPE_H
00037 #define OPENMS_TRANSFORMATIONS_RAW2PEAK_PEAKSHAPE_H
00038
00039 #include <cmath>
00040
00041 #include <OpenMS/CONCEPT/Types.h>
00042 #include <OpenMS/KERNEL/MSSpectrum.h>
00043
00044 namespace OpenMS
00045 {
00051 struct OPENMS_DLLAPI PeakShape
00052 {
00068 enum Type
00069 {
00070 LORENTZ_PEAK,
00071 SECH_PEAK,
00072 UNDEFINED
00073 };
00074
00076 typedef MSSpectrum<>::const_iterator PeakIterator;
00077
00079 PeakShape() :
00080 height(0),
00081 mz_position(0),
00082 left_width(0),
00083 right_width(0),
00084 area(0),
00085 r_value(0),
00086 signal_to_noise(0.),
00087 type(UNDEFINED)
00088 {
00089 left_endpoint_ = exp_.end();
00090 right_endpoint_ = exp_.end();
00091 }
00092
00094 PeakShape(DoubleReal height_, DoubleReal mz_position_, DoubleReal left_width_, DoubleReal right_width_, DoubleReal area_, PeakIterator left_, PeakIterator right_, Type type_);
00095
00097 PeakShape(DoubleReal height_, DoubleReal mz_position_, DoubleReal left_width_, DoubleReal right_width_, DoubleReal area_, Type type_);
00098
00099
00101 PeakShape(const PeakShape & rhs);
00102
00104 virtual ~PeakShape()
00105 {
00106 }
00107
00109 PeakShape & operator=(const PeakShape & rhs);
00110
00111
00112 bool operator==(const PeakShape & rhs) const;
00113
00114 bool operator!=(const PeakShape & rhs) const;
00115
00117 DoubleReal operator()(DoubleReal x) const;
00119 DoubleReal getSymmetricMeasure() const;
00121 DoubleReal getFWHM() const;
00123 bool iteratorsSet() const;
00124
00125 PeakIterator getLeftEndpoint() const;
00126 void setLeftEndpoint(PeakIterator left_endpoint);
00127
00128 PeakIterator getRightEndpoint() const;
00129 void setRightEndpoint(PeakIterator right_endpoint);
00131 DoubleReal height;
00133 DoubleReal mz_position;
00135 DoubleReal left_width;
00137 DoubleReal right_width;
00139 DoubleReal area;
00144 DoubleReal r_value;
00146 DoubleReal signal_to_noise;
00147
00149 Type type;
00150
00154 class OPENMS_DLLAPI PositionLess
00155 {
00156 public:
00157
00158 inline bool operator()(const PeakShape & a, const PeakShape & b)
00159 {
00160 return a.mz_position < b.mz_position;
00161 }
00162
00163 };
00164 protected:
00166 PeakIterator left_endpoint_;
00168 PeakIterator right_endpoint_;
00170 MSSpectrum<> exp_;
00172 bool left_iterator_set_;
00174 bool right_iterator_set_;
00175 };
00176 }
00177
00178 #endif