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