Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

PeakShape.h

Go to the documentation of this file.
00001 // --------------------------------------------------------------------------
00002 //                   OpenMS -- Open-Source Mass Spectrometry
00003 // --------------------------------------------------------------------------
00004 // Copyright The OpenMS Team -- Eberhard Karls University Tuebingen,
00005 // ETH Zurich, and Freie Universitaet Berlin 2002-2012.
00006 //
00007 // This software is released under a three-clause BSD license:
00008 //  * Redistributions of source code must retain the above copyright
00009 //    notice, this list of conditions and the following disclaimer.
00010 //  * Redistributions in binary form must reproduce the above copyright
00011 //    notice, this list of conditions and the following disclaimer in the
00012 //    documentation and/or other materials provided with the distribution.
00013 //  * Neither the name of any author or any participating institution
00014 //    may be used to endorse or promote products derived from this software
00015 //    without specific prior written permission.
00016 // For a full list of authors, refer to the file AUTHORS.
00017 // --------------------------------------------------------------------------
00018 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00019 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00020 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00021 // ARE DISCLAIMED. IN NO EVENT SHALL ANY OF THE AUTHORS OR THE CONTRIBUTING
00022 // INSTITUTIONS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00024 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
00025 // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
00026 // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
00027 // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
00028 // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00029 //
00030 // --------------------------------------------------------------------------
00031 // $Maintainer: Alexandra Zerck $
00032 // $Authors: Eva Lange $
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     //Equality operator
00112     bool operator==(const PeakShape & rhs) const;
00113     //Equality operator
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 } // namespace OpenMS
00177 
00178 #endif

OpenMS / TOPP release 1.10.0 Documentation generated on Thu Mar 7 2013 09:42:43 using doxygen 1.7.1