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