24 using namespace hippodraw;
30 m_max_iterations ( 100 )
36 : m_name ( fitter.m_name ),
37 m_max_iterations ( fitter.m_max_iterations )
154 const vector < int > &
165 string what (
"The " );
167 what +=
" minimizer does not support limits on parameters";
168 throw std::runtime_error ( what );
175 unsigned int index = UINT_MAX;
176 const vector < string > & names =
m_fcn -> getParmNames ();
177 unsigned int size = names.size();
178 for (
unsigned int i = 0; i <
size; i++ ) {
179 const string & pname = names [i];
180 if ( pname == name ) {
185 if ( index == UINT_MAX ) {
186 string what (
"No parameter named `" );
188 what +=
"' for this function.";
189 throw std::runtime_error ( what );
197 setLimits (
const std::string & name,
double lower,
double upper )
207 string what (
"This " );
209 what +=
" minimizer does not support setting step size.";
210 throw std::runtime_error ( what );
231 return m_fcn -> degreesOfFreedom();
virtual double objectiveValue() const
Calculates the value of the objective function at the current set of parameters.
A derived class for FCNBase class.
StatedFCN * m_fcn
The objective function.
hippodraw::StatedFCN class interface
Base class for DataSource.
std::string m_name
The name of the fitter.
void fillFreeParameters(std::vector< double > &) const
Fills the vector with the free parameters values.
bool isCompatible(const FunctionBase *) const
Returns true if the function is compatible with the objective function.
virtual void setStepSize(unsigned int i, double size)
Sets the step size for parameter of the minimization.
virtual void setFitCut(TupleCut *cut)
Sets the cut to limit range of fitting.
StatedFCN * getFCN()
Returns the objective function object.
virtual Fitter * clone() const =0
Makes a copy of the receiving object.
void setUseErrors(bool yes=true)
Sets the fitter to use error data from the DataSource, if available.
virtual void setFCN(StatedFCN *fcn)
Sets the objective function object.
virtual void setFitRange(bool yes=true)
Sets use of a fitting range on or off.
The class expresses a cut on a DataSource, i.e.
virtual void setFixedFlags(const std::vector< int > &flags)
Sets the parameters that are to be held fixed during objective function minimization.
bool needsIntegrated() const
Returns true if the Fitter needs integrated intervals.
virtual ~Fitter()
The virtual destructor.
Fitter(const Fitter &)
The copy constructor.
intp size(numeric::array arr)
virtual const std::vector< int > & getFixedFlags() const
Sets the limits of the model function parameter values.
virtual void setLimits(unsigned int i, double lower, double upper)
Sets the limits for the parameter of the model function indexed by i.
virtual void copyFrom(const Fitter *other)
Makes a copy of other.
virtual int calcDegreesOfFreedom() const
Returns the number of degrees of freedom in the fit.
void setFunction(FunctionBase *function)
Sets the model function.
The base class for fitters.
virtual int calcCovariance(std::vector< std::vector< double > > &cov)
Calculates the covariance matrix.
hippodraw::Fitter class interface
bool getUseErrors() const
Returns true if error data from the DataSource will be used if available.
unsigned int getParameterIndex(const std::string &name)
Returns the index to the model function parameters name.
void setDataSource(const DataSource *source)
Sets the source of data to be used.
A function that can be added to a DataRep and used in a fitter.
const std::string & name() const
Returns the name of the fitter.