libpappsomspp
Library for mass spectrometry
pappso::FilterResampleKeepGreater Class Reference

#include <filterresample.h>

Inheritance diagram for pappso::FilterResampleKeepGreater:
pappso::FilterInterface

Public Member Functions

 FilterResampleKeepGreater (double x_value)
 
 FilterResampleKeepGreater (const FilterResampleKeepGreater &other)
 
virtual ~FilterResampleKeepGreater ()
 
FilterResampleKeepGreateroperator= (const FilterResampleKeepGreater &other)
 
Tracefilter (Trace &trace) const override
 
double getThresholdX () const
 
- Public Member Functions inherited from pappso::FilterInterface
virtual ~FilterInterface ()
 

Private Attributes

double m_value
 

Detailed Description

Definition at line 52 of file filterresample.h.

Constructor & Destructor Documentation

◆ FilterResampleKeepGreater() [1/2]

pappso::FilterResampleKeepGreater::FilterResampleKeepGreater ( double  x_value)

Definition at line 57 of file filterresample.cpp.

58  : m_value(x_value)
59 {
60 }

◆ FilterResampleKeepGreater() [2/2]

pappso::FilterResampleKeepGreater::FilterResampleKeepGreater ( const FilterResampleKeepGreater other)

Definition at line 62 of file filterresample.cpp.

64  : FilterResampleKeepGreater(other.m_value)
65 {
66 }

◆ ~FilterResampleKeepGreater()

virtual pappso::FilterResampleKeepGreater::~FilterResampleKeepGreater ( )
inlinevirtual

Definition at line 60 of file filterresample.h.

60 {};

Member Function Documentation

◆ filter()

Trace & pappso::FilterResampleKeepGreater::filter ( Trace trace) const
overridevirtual

Implements pappso::FilterInterface.

Definition at line 84 of file filterresample.cpp.

85 {
86  // qDebug() << " spectrum.size()=" << spectrum.size();
87 
88  auto last_it = findFirstGreaterX(spectrum.begin(), spectrum.end(), m_value);
89  spectrum.erase(spectrum.begin(), last_it);
90 
91  // qDebug() << " spectrum.size()=" << spectrum.size();
92 
93  return spectrum;
94 }
std::vector< DataPoint >::iterator findFirstGreaterX(std::vector< DataPoint >::iterator begin, std::vector< DataPoint >::iterator end, const double &value)
find the first element in which X is greater than the value searched important : it implies that Trac...
Definition: trace.cpp:97

References pappso::findFirstGreaterX(), and m_value.

Referenced by pappso::XtandemSpectrumProcess::process().

◆ getThresholdX()

double pappso::FilterResampleKeepGreater::getThresholdX ( ) const

Definition at line 70 of file filterresample.cpp.

71 {
72  return m_value;
73 }

References m_value.

Referenced by pappso::XtandemSpectrumProcess::getMinimumMz().

◆ operator=()

FilterResampleKeepGreater & pappso::FilterResampleKeepGreater::operator= ( const FilterResampleKeepGreater other)

Definition at line 76 of file filterresample.cpp.

77 {
78  m_value = other.m_value;
79 
80  return *this;
81 }

References m_value.

Member Data Documentation

◆ m_value

double pappso::FilterResampleKeepGreater::m_value
private

Definition at line 55 of file filterresample.h.

Referenced by filter(), getThresholdX(), and operator=().


The documentation for this class was generated from the following files: