14 #include "msdevstudio/MSconfig.h" 38 : m_in_composite ( false )
121 return function->isComposite ();
142 if ( fitter -> needsIntegrated () ==
true ) {
144 if ( ! yes )
return false;
148 fitter -> setFunction (
function );
151 fitter -> setDataSource ( target );
177 return fitter ->
name ();
188 fp -> calcPrincipleErrors ();
203 const vector < vector < double > > &
210 return projector -> covariance ();
223 const vector< double > &
242 std::vector < double >::const_iterator end )
275 return function->parmNames ();
282 return function->getParameters ();
285 const vector < int > &
301 fitter -> setUseErrors ( ! ignore );
309 const DataRep * rep = dynamic_cast <
const DataRep * > ( observed );
325 yes = ! fitter -> getUseErrors ();
349 const TupleCut & c = cut_list.front();
353 const string & label = target -> getXLabel ();
359 assert ( projector != 0 );
361 projector -> setFitCut ( & cut );
362 projector -> setFitRange (
true );
373 assert ( projector != 0 );
375 projector -> setFitRange ( yes );
386 const TupleCut & temp = cut_list.front ();
391 assert ( projector != 0 );
393 projector -> setFitCut ( & cut );
394 projector -> setFitRange (
true );
404 projector -> setFitCut ( 0 );
405 projector -> setFitRange (
false );
423 function_parms.clear ();
424 const vector < string > & parm_names =
parmNames ();
425 const vector < double > & values =
parameters ();
429 unsigned int count = parm_names.size ();
430 for (
unsigned int i = 0; i < count; i++ ) {
439 function_parms.push_back ( fp );
463 return function ->
name ();
const std::string & functionName() const
Returns the name of the contained function.
const std::vector< std::vector< double > > & covarianceMatrix() const
Returns the covariance matrix of the function to the target DataSource.
hippodraw::FunctionBase class interface
void saveParameters()
Saves the function parameters in a cache so that they can be restored.
void setTupleCut()
Sets up the region over which fitting will be done.
void setRange(const Range &range)
Sets the range of the cut.
virtual void setFixedFlags(const std::vector< int > &flags)
Set the parameters that are to be held fixed during a fit.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
bool hasCut() const
Returns true if the receiving object has one or more regional cuts.
const std::string & getFitterName() const
Returns the name of the Fitter object.
bool getIgnoreErrors() const
Get ignore errors.
DataRep * getTarget() const
Returns the DataRep object upon which the function is applied.
void initializeFunction(ProjectorBase *projector)
Gives the function object initial values based on a given data projector.
virtual ~FunctionRep()
The virtual destructor.
void willDelete(const Observable *observed)
Implements Observer pattern by removing the DataRep from its target.
virtual void removeFromComposite(FunctionRep *frep)
Removes the function representation from composite if receiving object is a CompositeFunctionRep, otherwise does nothing.
double objectiveValue() const
Returns the objective value of the function to the target DataSource.
void removeCut()
Removes the cut region from the fitting.
virtual void fillFunctionParameters(std::vector< FunctionParameter > &) const
Fills the vector with the parameters and constraints of the function.
bool isAxisBinned(Axes::Type axis) const
Returns true if the specified axis is binned, otherwise returns false.
std::string m_name
The name of the display as it might be displayed in a GUI.
void initializeWith(DataRep *)
Sets the target and Initializes the function with the projected values of the DataRep.
A derived class of PointRepBase class that draws a representation of a cut range. ...
void setParameters(const std::vector< double > ¶ms)
Set the parameter values by hand.
bool m_in_composite
A flag which when set true indicates the receiving object is a member of a composite.
bool hasZoomY() const
Returns true.
virtual void notifyObservers() const
Notifies Observer objects of a change.
virtual const DataSource * getProjectedValues() const
Returns an DataSource representation of the projected data.
const std::vector< double > & principleErrors() const
Returns the principle diagonal of the covariance matrix.
void restoreParameters()
Restores the saved parameters.
hippodraw::FunctionRep class interface
const std::vector< double > & principleErrors() const
Returns the principle errors associated with the parameter values.
The base class for data representations.
Base class for DataSource.
FunctionBase * function() const
Returns a pointer to the contained function.
ProjectorBase * m_projector
A projector used to transform data to projected values that will be plotted.
bool isComposite() const
Returns true if represented function is a composite of two or more functions.
hippodraw::TupleCut class interface
void setCutRange(const Range &)
Sets the cut to limit range of fitting.
A class to collect function parameters from a FunctionBase object but also the constraints and errors...
FunctionBase * getFunction() const
Returns the actual function, a FunctionBase derived class.
void removeObserver(Observer *)
Removes an Observer from the Observer list.
const std::vector< double > & parameters() const
Returns the current function parameter values.
const std::string & name() const
Returns the name of the display.
void setInComposite(bool yes)
Informs receiving object that it is a member of a composite.
void removeCut()
Remove a region cut on the data representation.
Fitter * getFitter() const
Returns the Fitter object currently in use.
void setParameters(const std::vector< double > ¶ms)
Set the parameter values by hand.
Expresses a range of values.
bool fitFunction()
Fits the contained function to the data points from the target projector.
void setIgnoreError(bool ignore)
Set ignore errors.
const std::vector< int > & getFixedFlags() const
Returns a set of flags indicating which function parameters are fixed during a fit.
hippodraw::DataSource class interface.
FunctionParameter class interface.
void addObserver(Observer *)
Adds an Observer to the Observer list.
void setTarget(DataRep *rep)
Sets the target for the FunctionRep.
The base class for the Projector hierarchy.
int degreesOfFreedom() const
Returns the number of degrees of Freedom of the function fitting to the target DataSource.
A function that can be added to a DataRep and used in a fitter.
The base class for fitters.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
virtual void addToComposite(FunctionRep *frep)
Adds the function representation to composite if receiving object is a CompositeFunctionRep, otherwise does nothing.
virtual bool isTargetable() const
Returns false.
bool isInComposite() const
Returns true if receiving object is member of a composite.
void addCut()
Adds a cut to the data representation.
virtual bool hasNTupleBindings() const
Returns false as this class does not have DataSource bindings.
const std::vector< std::string > & parmNames() const
Returns the names of the parameters for the function represented by this object.
CutRangeRep * m_cut_rep
The representation of the cut or highlighted range.
CutRangeRep class interface.
virtual void setDirty(bool yes=true)
Sets the dirty flag.
bool setFitter(Fitter *fitter)
Sets the Fitter to fitter.
void saveParameters()
Makes a copy of the function's parameter values.
void restoreParameters()
Restores the function's parameter values from the previously saved values.
hippodraw::FunctionProjector class interface
bool fitFunction()
Fits the function.
void setPrincipleErrors(std::vector< double >::const_iterator begin, std::vector< double >::const_iterator end)
Sets the principle errors.
DataRep * m_target
The target for the function.
FunctionRep(FunctionBase *function, DataRep *rep)
The constructor taking the target DataRep object for the data.
virtual DataRep * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
A projector that plots one function.
const std::vector< TupleCut > & getCuts() const
Returns a reference to the cut list.
A derived class of DataRep which is a base class for displaying a function.
The class expresses a cut on a DataSource, i.e.
void setLabel(const std::string &label)
Sets the label for the cut.
hippodraw::Fitter class interface