14 #include "msdevstudio/MSconfig.h"
35 using namespace hippodraw;
43 m_target ( targetProjector ),
172 return Range ( 0, 0 );
236 const vector < int > & fixed =
m_fitter -> getFixedFlags ();
238 for(
int i = 0;
i < num_parms;
i++ ) {
239 if ( fixed [
i ] == 0 ) {
251 const vector < double > &
261 std::vector < double > :: const_iterator end )
263 unsigned int size = std::distance ( begin, end );
303 if ( myParams.size() == params.size() ) {
309 const vector < vector < double > > &
virtual bool calcBestFit()=0
Calculates the best fit.
void initializeFunction(ProjectorBase *projector)
Gives the function object initial values based on a given data projector.
int degreesOfFreedom() const
Returns the number of degrees of freedom in the fit.
AxisModelBase * m_x_axis
The AxisModel along the X axis.
virtual void setRange(hippodraw::Axes::Type, bool)
Sets the range of the selected axis.
virtual const std::string & getXLabel() const
Finds the X axis label of the plot.
ProjectorBase * m_target
The ProjectorBase object containing the data points for the function and fitter.
std::vector< double > m_principleErrors
The principle errors of the errors associated with the parameters of the function.
virtual void prepareValues()
Informs the projector to prepare its projected values for plotting.
virtual const Range & getRange(Axes::Type) const
Returns the Range along the specified axis.
void setFitter(Fitter *fitter)
Sets the Fitter to be used.
virtual void addPointReps()
Function to add the acceptable point reps.
virtual DataSource * createNTuple() const
Returns a null pointer.
bool hasSavedParameters() const
Returns true if the function's parameters have been saved.
virtual void fillProjectedValues(DataSource *ntuple, bool in_range=false) const
Does nothing.
virtual Range valueRange() const
virtual bool isEmpty() const
Implements ProjectorBase.
The class expresses a cut on a DataSource, i.e.
void restoreParameters()
Restores the function's parameter values from the previously saved values.
virtual void setDirty(bool value=true)
Sets the dirty flag to value.
const DataSource * getProjectedValues() const
Returns DataSource representation of projected values.
AxisModelBase * m_z_axis
The AxisModel along the Z axis.
The base class for fitters.
hippodraw::NTuple class interface.
const std::vector< double > & principleErrors() const
Returns the principle diagonal of the covariance matrix.
virtual Range dataRangeOn(hippodraw::Axes::Type) const
Returns the range of the raw data.
virtual void setFitRange(bool yes=true)
Sets use of a fitting range on or off.
int getOverflow() const
Returns the number of overflow.
std::vector< double > m_save_parms
A vector used to save parameters so that they can be restored.
int getNumberOfEntries() const
A call to this member function is meaningless.
const std::string & getZLabel() const
Is meaningless for this projector.
void setParameters(const std::vector< double > ¶ms)
Set the parameter values by hand.
std::vector< std::vector< double > > m_covariance
The error covariance matrix of the errors associated with the parameters of the function.
double objectiveValue() const
Returns the objective value (chi2 or likelihood) between the function and the data.
intp size(numeric::array arr)
FunctionProjector(FunctionBase *function, ProjectorBase *targetProjector)
This constructor takes a FunctionBase object and its target data projector.
static std::string s_x_label
An X label that might be used.
The AxisModelBase class maintains the Range and scaling of an axis.
bool fitFunction()
Fits the function.
hippodraw::Fitter class interface
virtual int calcDegreesOfFreedom() const
Returns the number of degrees of freedom in the fit.
virtual void setFitCut(TupleCut *cut)
Sets the cut to limit range of fitting.
const std::vector< std::vector< double > > & covariance() const
Returns the covariance matrix.
virtual ~FunctionProjector()
The virtual destructor.
virtual double getPosOn(hippodraw::Axes::Type) const
Returns the minimum positive value.
virtual void initialParameters(const FunctionHelper *helper)
Sets the FunctionHelper so that the function can calculate a reasonable set of initial parameter valu...
std::string m_z_label
Dummy member so getZLabel member can return reference.
The base class for the Projector hierarchy.
A function that can be added to a DataRep and used in a fitter.
virtual const std::vector< double > & getParameters() const
Returns the values of the parameters as a vector.
hippodraw::AxisModelBase class interface
hippodraw::FunctionProjector class interface
Fitter * m_fitter
A fitter object for the function.
FunctionBase * function() const
Returns a pointer to the contained function.
A concreate implementation of the FunctionHelper class.
virtual double objectiveValue() const
Calculates the value of the objective function at the current set of parameters.
virtual void setParameters(const std::vector< double > &incr)
Sets the parameter values.
Expresses a range of values.
hippodraw::FunctionBase class interface
Fitter * getFitter() const
Returns the Fitter that is in use.
AxisModelBase * m_y_axis
The AxisModel along the Y axis.
void saveParameters()
Makes a copy of the function's parameter values.
virtual const std::string & getTitle() const
Finds the title of the plot.
void setPrincipleErrors(std::vector< double >::const_iterator first, std::vector< double >::const_iterator last)
Sets the principle errors.
ProjectorHelper class interface.
int getUnderflow() const
Returns the number of underflow.
void calcPrincipleErrors() const
Calculates the principle errors from the fit.
virtual ProjectorBase * clone()
virtual const std::string & getYLabel(bool density=false) const
Finds the Y axis label of the plot.
const std::string & name() const
Returns the name of the function.
A projector that plots one function.
FunctionBase * m_function
The list of function objects to be projected.
Base class for DataSource.