OpenMS
ProductModel< 2 > Class Reference

The class template is only implemented for D=2 because we use Peak2D here. More...

#include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/ProductModel.h>

Inheritance diagram for ProductModel< 2 >:
[legend]
Collaboration diagram for ProductModel< 2 >:
[legend]

Public Types

enum  { D = 2 }
 Number of dimensions. More...
 
typedef double IntensityType
 
typedef DPosition< DPositionType
 
typedef BaseModel< D >::SamplesType SamplesType
 
- Public Types inherited from BaseModel< 2 >
typedef double IntensityType
 
typedef double CoordinateType
 
typedef DPosition< D > PositionType
 
typedef DPeak< D >::Type PeakType
 
typedef std::vector< PeakTypeSamplesType
 

Public Member Functions

 ProductModel ()
 Default constructor. More...
 
 ProductModel (const ProductModel &source)
 copy constructor More...
 
 ~ProductModel () override
 destructor More...
 
virtual ProductModeloperator= (const ProductModel &source)
 assignment operator More...
 
IntensityType getIntensity (const PositionType &pos) const override
 intensity equals product of intensities in each dimension More...
 
ProductModelsetModel (UInt dim, BaseModel< 1 > *dist)
 set model dist for dimension dim More...
 
BaseModel< 1 > * getModel (UInt dim) const
 
IntensityType getScale () const
 return the intensity scaling factor More...
 
void setScale (IntensityType scale)
 set the intensity scaling factor More...
 
void getSamples (SamplesType &cont) const override
 get reasonable set of samples from the model (i.e. for printing) More...
 
- Public Member Functions inherited from BaseModel< 2 >
 BaseModel ()
 Default constructor. More...
 
 BaseModel (const BaseModel &source)
 copy constructor More...
 
 ~BaseModel () override
 Destructor. More...
 
BaseModeloperator= (const BaseModel &source)
 assignment operator More...
 
void registerChildren ()
 
void registerChildren ()
 
virtual bool isContained (const PositionType &pos) const
 check if position pos is part of the model regarding the models cut-off. More...
 
void fillIntensity (PeakType &peak) const
 Convenience function to set the intensity of a peak to the predicted intensity at its current position, calling virtual void getIntensity(). More...
 
void fillIntensities (PeakIterator begin, PeakIterator end) const
 Convenience function that applies fillIntensity() to an iterator range. More...
 
virtual IntensityType getCutOff () const
 get cutoff value More...
 
virtual void setCutOff (IntensityType cut_off)
 set cutoff value More...
 
virtual void getSamples (std::ostream &os)
 fill stream with reasonable set of samples from the model (i.e. for printing) More...
 
- Public Member Functions inherited from DefaultParamHandler
 DefaultParamHandler (const String &name)
 Constructor with name that is displayed in error messages. More...
 
 DefaultParamHandler (const DefaultParamHandler &rhs)
 Copy constructor. More...
 
virtual ~DefaultParamHandler ()
 Destructor. More...
 
DefaultParamHandleroperator= (const DefaultParamHandler &rhs)
 Assignment operator. More...
 
virtual bool operator== (const DefaultParamHandler &rhs) const
 Equality operator. More...
 
void setParameters (const Param &param)
 Sets the parameters. More...
 
const ParamgetParameters () const
 Non-mutable access to the parameters. More...
 
const ParamgetDefaults () const
 Non-mutable access to the default parameters. More...
 
const StringgetName () const
 Non-mutable access to the name. More...
 
void setName (const String &name)
 Mutable access to the name. More...
 
const std::vector< String > & getSubsections () const
 Non-mutable access to the registered subsections. More...
 

Static Public Member Functions

static BaseModel< D > * create ()
 create new ProductModel object (needed by Factory) More...
 
static const String getProductName ()
 Returns the name of the model. More...
 
- Static Public Member Functions inherited from BaseModel< 2 >
static void registerChildren ()
 register all derived classes here (implemented in file BaseModel_impl.h) More...
 
- Static Public Member Functions inherited from DefaultParamHandler
static void writeParametersToMetaValues (const Param &write_this, MetaInfoInterface &write_here, const String &key_prefix="")
 Writes all parameters to meta values. More...
 

Protected Member Functions

void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
- Protected Member Functions inherited from BaseModel< 2 >
void updateMembers_ () override
 This method is used to update extra member variables at the end of the setParameters() method. More...
 
- Protected Member Functions inherited from DefaultParamHandler
void defaultsToParam_ ()
 Updates the parameters after the defaults have been set in the constructor. More...
 

Protected Attributes

std::vector< BaseModel< 1 > * > distributions_
 
IntensityType scale_
 
- Protected Attributes inherited from BaseModel< 2 >
IntensityType cut_off_
 
- Protected Attributes inherited from DefaultParamHandler
Param param_
 Container for current parameters. More...
 
Param defaults_
 Container for default parameters. This member should be filled in the constructor of derived classes! More...
 
std::vector< Stringsubsections_
 Container for registered subsections. This member should be filled in the constructor of derived classes! More...
 
String error_name_
 Name that is displayed in error messages during the parameter checking. More...
 
bool check_defaults_
 If this member is set to false no checking if parameters in done;. More...
 
bool warn_empty_defaults_
 If this member is set to false no warning is emitted when defaults are empty;. More...
 

Detailed Description

The class template is only implemented for D=2 because we use Peak2D here.

Member Typedef Documentation

◆ IntensityType

typedef double IntensityType

◆ PositionType

◆ SamplesType

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Number of dimensions.

Enumerator

Constructor & Destructor Documentation

◆ ProductModel() [1/2]

ProductModel ( )
inline

Default constructor.

References Peak2D::shortDimensionName().

◆ ProductModel() [2/2]

ProductModel ( const ProductModel< 2 > &  source)
inline

copy constructor

References ModelDescription< D >::createModel().

◆ ~ProductModel()

~ProductModel ( )
inlineoverride

destructor

Member Function Documentation

◆ create()

static BaseModel<D>* create ( )
inlinestatic

create new ProductModel object (needed by Factory)

◆ getIntensity()

IntensityType getIntensity ( const PositionType pos) const
inlineoverridevirtual

intensity equals product of intensities in each dimension

Implements BaseModel< 2 >.

◆ getModel()

BaseModel<1>* getModel ( UInt  dim) const
inline

References OPENMS_PRECONDITION.

◆ getProductName()

static const String getProductName ( )
inlinestatic

Returns the name of the model.

◆ getSamples()

void getSamples ( SamplesType cont) const
inlineoverridevirtual

get reasonable set of samples from the model (i.e. for printing)

Implements BaseModel< 2 >.

◆ getScale()

IntensityType getScale ( ) const
inline

return the intensity scaling factor

◆ operator=()

virtual ProductModel& operator= ( const ProductModel< 2 > &  source)
inlinevirtual

◆ setModel()

ProductModel& setModel ( UInt  dim,
BaseModel< 1 > *  dist 
)
inline

set model dist for dimension dim

dist is supposed to be allocated by new because it will be freed if ProductModel is destroyed or the model for that dimensions changes. For that reason no model dist should be assigned to multiple ProductModels.
ProductModel parameters are set when calling ProductModel::getParameters().

References OPENMS_PRECONDITION, and Peak2D::shortDimensionName().

◆ setScale()

void setScale ( IntensityType  scale)
inline

set the intensity scaling factor

◆ updateMembers_()

void updateMembers_ ( )
inlineoverrideprotectedvirtual

This method is used to update extra member variables at the end of the setParameters() method.

Also call it at the end of the derived classes' copy constructor and assignment operator.

The default implementation is empty.

Reimplemented from DefaultParamHandler.

References Param::copy(), IsotopeModel::getFormula(), OpenMS::StringUtils::hasSubstring(), Peak2D::shortDimensionName(), and BaseModel< D >::updateMembers_().

Member Data Documentation

◆ distributions_

std::vector<BaseModel<1> *> distributions_
protected

◆ scale_

IntensityType scale_
protected