GeneticAlgoithm
Implementation of the genetic algorithm
Public Member Functions | Protected Attributes | List of all members
ParametricModel Class Reference

Class representing a model defined by a parametric function. More...

#include <ParametricModel.h>

Inheritance diagram for ParametricModel:
Inheritance graph
[legend]
Collaboration diagram for ParametricModel:
Collaboration graph
[legend]

Public Member Functions

 ParametricModel ()
 
virtual ~ParametricModel ()
 
void setFormula (TF1 *formula)
 
TF1 * getFormula ()
 
const TF1 * getFormula () const
 
- Public Member Functions inherited from IModel
 IModel ()
 
virtual ~IModel ()=0
 
double getScore () const
 
void setScore (double score)
 

Protected Attributes

TF1 * m_formula
 Holds the formula for this model.
 
- Protected Attributes inherited from IModel
double m_score
 Holds the score for this model.
 

Detailed Description

Class representing a model defined by a parametric function.

The implementation of this parametric model is a simple wrapper around ROOT's powerful TF1 formula class which allows to describe any function in any number of dimensions and depending on any number of parameters.

Another desired feature of TF1, is that it allows plotting 1D and 2D formulas with little extra code.

Definition at line 19 of file ParametricModel.h.

Constructor & Destructor Documentation

◆ ParametricModel()

ParametricModel::ParametricModel ( )

Default Constructor

Definition at line 6 of file ParametricModel.cxx.

◆ ~ParametricModel()

ParametricModel::~ParametricModel ( )
virtual

Destructor

Definition at line 12 of file ParametricModel.cxx.

Member Function Documentation

◆ setFormula()

void ParametricModel::setFormula ( TF1 *  formula)

Sets the formula for this model.

Parameters
formulaA TF1 formula.

This function keeps a clone of the formula in order to make sure that modifying it later does not affect other instances that might share the same original formula.

Definition at line 24 of file ParametricModel.cxx.

◆ getFormula() [1/2]

TF1 * ParametricModel::getFormula ( )

Returns the formula for this model.

Returns
a pointer to the TF1 formula for this model.

Definition at line 35 of file ParametricModel.cxx.

◆ getFormula() [2/2]

const TF1 * ParametricModel::getFormula ( ) const

Returns the formula for this model.

Returns
a const pointer to the TF1 formula for this model.

Definition at line 45 of file ParametricModel.cxx.


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