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