14 #include "msdevstudio/MSconfig.h"
34 using namespace hippodraw;
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 );
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 ();
bool getIgnoreErrors() const
Get ignore errors.
void setParameters(const std::vector< double > ¶ms)
Set the parameter values by hand.
const std::vector< std::vector< double > > & covarianceMatrix() const
Returns the covariance matrix of the function to the target DataSource.
Part of an implementation of the Observable-Observer pattern based on the example in the GOF Patterns...
const std::vector< TupleCut > & getCuts() const
Returns a reference to the cut list.
std::string m_name
The name of the display as it might be displayed in a GUI.
void initializeFunction(ProjectorBase *projector)
Gives the function object initial values based on a given data projector.
virtual void setFixedFlags(const std::vector< int > &flags)
Set the parameters that are to be held fixed during a fit.
FunctionBase * getFunction() const
Returns the actual function, a FunctionBase derived class.
virtual void notifyObservers() const
Notifies Observer objects of a change.
void setCutRange(const Range &)
Sets the cut to limit range of fitting.
const std::vector< int > & getFixedFlags() const
Returns a set of flags indicating which function parameters are fixed during a fit.
bool m_in_composite
A flag which when set true indicates the receiving object is a member of a composite.
A derived class of PointRepBase class that draws a representation of a cut range. ...
virtual bool hasNTupleBindings() const
Returns false as this class does not have DataSource bindings.
const std::vector< double > & parameters() const
Returns the current function parameter values.
void restoreParameters()
Restores the saved parameters.
const std::string & name() const
Returns the name of the display.
bool isComposite() const
Returns true if represented function is a composite of two or more functions.
bool setFitter(Fitter *fitter)
Sets the Fitter to fitter.
void setRange(const Range &range)
Sets the range of the cut.
FunctionParameter class interface.
const std::string & getFitterName() const
Returns the name of the Fitter object.
void initializeWith(DataRep *)
Sets the target and Initializes the function with the projected values of the DataRep.
A derived class of DataRep which is a base class for displaying a function.
bool fitFunction()
Fits the contained function to the data points from the target projector.
A class to collect function parameters from a FunctionBase object but also the constraints and errors...
The class expresses a cut on a DataSource, i.e.
bool isInComposite() const
Returns true if receiving object is member of a composite.
double objectiveValue() const
Returns the objective value of the function to the target DataSource.
virtual void removeFromComposite(FunctionRep *frep)
Removes the function representation from composite if receiving object is a CompositeFunctionRep, otherwise does nothing.
void restoreParameters()
Restores the function's parameter values from the previously saved values.
virtual DataRep * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
DataRep * getTarget() const
Returns the DataRep object upon which the function is applied.
The base class for fitters.
const std::vector< double > & principleErrors() const
Returns the principle diagonal of the covariance matrix.
hippodraw::FunctionRep class interface
hippodraw::DataSource class interface.
const std::vector< double > & principleErrors() const
Returns the principle errors associated with the parameter values.
const std::vector< std::string > & parmNames() const
Returns the names of the parameters for the function represented by this object.
virtual const DataSource * getProjectedValues() const
Returns an DataSource representation of the projected data.
void removeObserver(Observer *)
Removes an Observer from the Observer list.
The base class for data representations.
void setTupleCut()
Sets up the region over which fitting will be done.
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.
void saveParameters()
Saves the function parameters in a cache so that they can be restored.
void setParameters(const std::vector< double > ¶ms)
Set the parameter values by hand.
CutRangeRep * m_cut_rep
The representation of the cut or highlighted range.
virtual void fillFunctionParameters(std::vector< FunctionParameter > &) const
Fills the vector with the parameters and constraints of the function.
bool hasCut() const
Returns true if the receiving object has one or more regional cuts.
bool fitFunction()
Fits the function.
void setInComposite(bool yes)
Informs receiving object that it is a member of a composite.
const std::string & functionName() const
Returns the name of the contained function.
hippodraw::Fitter class interface
Fitter * getFitter() const
Returns the Fitter object currently in use.
virtual ~FunctionRep()
The virtual destructor.
The base class for the Projector hierarchy.
A function that can be added to a DataRep and used in a fitter.
ProjectorBase * m_projector
A projector used to transform data to projected values that will be plotted.
bool hasZoomY() const
Returns true.
hippodraw::TupleCut class interface
hippodraw::FunctionProjector class interface
FunctionBase * function() const
Returns a pointer to the contained function.
void willDelete(const Observable *observed)
Implements Observer pattern by removing the DataRep from its target.
void removeCut()
Remove a region cut on the data representation.
void setPrincipleErrors(std::vector< double >::const_iterator begin, std::vector< double >::const_iterator end)
Sets the principle errors.
void setIgnoreError(bool ignore)
Set ignore errors.
int degreesOfFreedom() const
Returns the number of degrees of Freedom of the function fitting to the target DataSource.
DataRep * m_target
The target for the function.
void addCut()
Adds a cut to the data representation.
virtual void setDirty(bool yes=true)
Sets the dirty flag.
Expresses a range of values.
hippodraw::FunctionBase class interface
void removeCut()
Removes the cut region from the fitting.
void saveParameters()
Makes a copy of the function's parameter values.
bool isAxisBinned(Axes::Type axis) const
Returns true if the specified axis is binned, otherwise returns false.
void addObserver(Observer *)
Adds an Observer to the Observer list.
void setLabel(const std::string &label)
Sets the label for the cut.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
FunctionRep(FunctionBase *function, DataRep *rep)
The constructor taking the target DataRep object for the data.
void setTarget(DataRep *rep)
Sets the target for the FunctionRep.
CutRangeRep class interface.
A projector that plots one function.
Base class for DataSource.