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 void setStepSize(unsigned int i, double size)
Sets the step size for parameter of the minimization.
Fitter(const Fitter &)
The copy constructor.
virtual ~Fitter()
The virtual destructor.
virtual void setFitCut(TupleCut *cut)
Sets the cut to limit range of fitting.
virtual Fitter * clone() const =0
Makes a copy of the receiving object.
StatedFCN * m_fcn
The objective function.
hippodraw::Fitter class interface
StatedFCN * getFCN()
Returns the objective function object.
unsigned int getParameterIndex(const std::string &name)
Returns the index to the model function parameters name.
bool needsIntegrated() const
Returns true if the Fitter needs integrated intervals.
void setDataSource(const DataSource *source)
Sets the source of data to be used.
void fillFreeParameters(std::vector< double > &) const
Fills the vector with the free parameters values.
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 double objectiveValue() const
Calculates the value of the objective function at the current set of parameters.
hippodraw::StatedFCN class interface
void setFunction(FunctionBase *function)
Sets the model function.
bool getUseErrors() const
Returns true if error data from the DataSource will be used if available.
intp size(numeric::array arr)
virtual int calcDegreesOfFreedom() const
Returns the number of degrees of freedom in the fit.
A derived class for FCNBase class.
virtual void setLimits(unsigned int i, double lower, double upper)
Sets the limits for the parameter of the model function indexed by i.
Base class for DataSource.
const std::string & name() const
Returns the name of the fitter.
bool isCompatible(const FunctionBase *) const
Returns true if the function is compatible with the objective function.
virtual void setFixedFlags(const std::vector< int > &flags)
Sets the parameters that are to be held fixed during objective function minimization.
virtual void setFitRange(bool yes=true)
Sets use of a fitting range on or off.
The base class for fitters.
virtual const std::vector< int > & getFixedFlags() const
Sets the limits of the model function parameter values.
A function that can be added to a DataRep and used in a fitter.
virtual void copyFrom(const Fitter *other)
Makes a copy of other.
std::string m_name
The name of the fitter.
The class expresses a cut on a DataSource, i.e.
virtual int calcCovariance(std::vector< std::vector< double > > &cov)
Calculates the covariance matrix.