Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
FunctionController Class Reference

A singleton class is the interface between an application and the list of FunctionRep objects contained in a PlotterBase. More...

#include <FunctionController.h>

Collaboration diagram for FunctionController:
Collaboration graph
[legend]

Public Member Functions

void addDataRep (PlotterBase *plotter, DataRep *rep)
 Adds DataRep rep to the PlotterBase plotter.
FunctionBaseaddFunction (PlotterBase *plotter, const std::string &name)
 Adds a function to the first DataRep object of the plotter.
FunctionRepaddFunction (PlotterBase *plotter, const std::string &name, FunctionRep *frep, DataRep *data_rep)
 Adds the function named by the string to the designated DataRep data_rep contained in the plotter.
void addFunction (PlotterBase *plotter, FunctionRep *func_rep)
 Adds the func_rep to the plotter.
FunctionRepaddFunctionRep (PlotterBase *plotter, DataRep *, FunctionRep *frep, FunctionRep *func_rep)
 Adds the func_rep to the DataRep contained by the plotter.
bool changeFitter (const PlotterBase *plotter, const DataRep *datarep, const std::string &name)
 Changes the fitter.
FunctionRepcreateFunctionRep (const std::string &name, DataRep *rep)
 Returns a newly created FunctionRep object with function of type name and target rep.
FunctionRepcreateFunctionRep (FunctionBase *function, DataRep *rep)
 Returns a newly created FunctionRep object with FunctionBase pointer function and target rep.
ViewBasecreateFuncView (const ViewFactory *factory, PlotterBase *plotter, const std::string &type)
 Creates a textual view of function of type type.
PlotterBasecreateNewEllipsoidDisplay (PlotterBase *plotter, FunctionRep *rep)
 Returns a new Ellipsoid display.
NTuplecreateNTuple (const PlotterBase *plotter, const FunctionRep *rep)
 Returns an NTuple from the FunctionRep and its target DataRep.
PlotterBasecreateResidualsDisplay (PlotterBase *plotter, const FunctionRep *)
 Returns residuals display.
NTupleellipse (const std::vector< double > &xbar, std::vector< std::vector< double > > &SigmaInv, double Csq)
 Given an @ SigmaInv this function returns the coordinates of an ellipse (in 2 dimension) centered at xbar.
void ellipsoidNTuple (PlotterBase *plotter, FunctionRep *, NTuple *nt, int n, double &xmin, double &xmax, double &ymin, double &ymax)
 This returns in nt the percentage distribution of the confidence in a rectangle bounded by xmin, ymin, xmax and ymax.
void fillTopLevelFunctionReps (std::vector< FunctionRep * > &reps, const PlotterBase *plotter, const DataRep *data_rep) const
 Clears and fills the vector with the top level FunctionRep objects that target data_rep and are contained in plotter.
bool fitFunction (PlotterBase *plotter, FunctionRep *rep)
 Attempts to fit the function contained by the plotter.
bool fitFunction (PlotterBase *plotter, unsigned int)
 Attempts to fit the function to the data in the DataRep of the plotter.
bool functionExists (const std::string &name)
 Returns true if function with name name is available.
const std::vector< std::string > & functionNames (PlotterBase *, DataRep *rep)
 Returns function names on the plotter.
double getChiSquared (const PlotterBase *)
 Returns the Chi-Squared.
FunctionRepgetComposite (const PlotterBase *plotter, FunctionRep *rep)
 Returns the CompositeFunctionRep for which rep is a member if it is one, otherwise returns rep.
const std::vector< std::vector
< double > > & 
getCovarianceMatrix (const PlotterBase *)
 Returns the covariance matrix of the objective function.
const std::string & getDefaultFitter () const
 Returns the name of the default Fitter object.
int getDegreesOfFreedom (const PlotterBase *)
 Returns the degrees of freedom.
FittergetFitter (const PlotterBase *plotter)
 Returns the Fitter object used by the plotter.
const std::string & getFitterName (const PlotterBase *plotter)
 Returns the name of the Fitter object as known by the FitterFactory.
const std::vector< std::string > & getFitterNames () const
 Returns the list of Fitter names.
const std::vector< std::string > & getFunctionNames () const
 Returns the list of available functions.
FunctionRepgetFunctionRep (const PlotterBase *plotter) const
 Returns the FunctionRep.
FunctionRepgetFunctionRep (const PlotterBase *plotter, const DataRep *data) const
 Returns the FunctionRep.
double getObjectiveValue (const PlotterBase *, const DataRep *)
 Returns the value of the objective function.
int getUniqueNonFunctionIndex (const PlotterBase *plotter) const
 Returns the index to an unique DataRep object that is not a FunctionRep.
bool hasFunction (const PlotterBase *plotter, const DataRep *rep)
 Returns true if rep contained by plotter has a function attached.
bool isCompatible (const std::string &function, const std::string &fitter)
 Returns true if the function is compatible with the fitter.
PlotterBaserefreshEllipsoidDisplay (PlotterBase *plotter, FunctionRep *)
 Returns a new Ellipsoid display.
void removeFunction (PlotterBase *plotter, FunctionRep *function)
 Removes the designated function from the plotter.
void removeTupleCut (const PlotterBase *plotter, DataRep *data_rep)
 Removes the region cut from both the target and function.
void restoreParameters (PlotterBase *plotter)
 Restores the parameters from previously stored values.
void saveParameters (PlotterBase *plotter)
 Saves the parameters so they can be restored.
void setDefaultFitter (const std::string &name)
 Sets the default Fitter object that will be used for newly created FunctionRep objects.
int setEllpsoidParamIndex (Axes::Type axes, int index)
 Sets the which parameter shall be bound to which axes while plotting the error / confidence ellipsoids.
void setFitRange (PlotterBase *plotter, const Range &range)
 Sets the range used for fitting.
void setFitRange (PlotterBase *plotter, double low, double high)
 Sets the range used for fitting.
bool setFitter (const PlotterBase *plotter, const std::string &name)
 Sets the Fitter.
bool setFitter (FunctionRep *frep, const std::string &name)
 Sets the Fitter.
void setTupleCut (FunctionRep *rep)
 Sets the function representation up to obey TupleCut on target, if any.
void setTupleCut (const PlotterBase *plotter, DataRep *data_rep)
 Sets the TupleCut, if any for the FunctionRep contained by plotter whose target is data_rep.
bool tryFitFunction (PlotterBase *plotter, FunctionRep *)
 Attempts to fit the function.
 ~FunctionController ()
 The destructor.

Static Public Member Functions

static FunctionControllerinstance ()
 Returns the pointer to the singleton instance.

Private Member Functions

void fillFunctionReps (std::vector< FunctionRep * > &freps, const PlotterBase *plotter, const DataRep *data_rep) const
 Clears and fills the vector the FunctionRep objects contained by the plotter that target the data_rep.
void findFunctions (const PlotterBase *plotter) const
 Finds the FunctionRep objects contained by the plotter.
 FunctionController ()
 A private default constructor for avoiding creation.
 FunctionController (const FunctionController &)
 A private copy constructor to avoid copying.
void setErrorsFromComposite (const PlotterBase *plotter, const FunctionRep *composite)
 Sets the errors from the composite.

Private Attributes

unsigned int m_confid_count
 A count of number of confidence contour plots created.
std::vector< double > m_deltaXSq
 delta chi squared values for 99.99% confidence ellipsoids for mu = 1,2,3,4,5,6
std::vector< std::string > m_f_names
 The list of function names attached to the plotter.
std::vector< FunctionRep * > m_func_reps
 The list of FunctionRep objects for the current plotter.
PlotterBasem_plotter
 The current PlotterBase object.
int m_x
 Index of the parameter that shall be bound to X axes while plotting the error / confidence ellipsoids.
int m_y
 Index of the parameter that shall be bound to Y axes while plotting the error / confidence ellipsoids.

Static Private Attributes

static FunctionControllers_instance = 0
 A pointer to the singleton object.

Detailed Description

A singleton class is the interface between an application and the list of FunctionRep objects contained in a PlotterBase.

Author
Kaustuv kaust.nosp@m.uv@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du
Paul F. Kunz Paul_.nosp@m.Kunz.nosp@m.@slac.nosp@m..sta.nosp@m.nford.nosp@m..edu
Sanket B. Malde sanke.nosp@m.t@st.nosp@m.anfor.nosp@m.d.ed.nosp@m.u

Definition at line 49 of file FunctionController.h.

Constructor & Destructor Documentation

FunctionController ( )
private

A private default constructor for avoiding creation.

Definition at line 76 of file FunctionController.cxx.

References FunctionController::m_deltaXSq.

Referenced by FunctionController::instance().

FunctionController ( const FunctionController )
private

A private copy constructor to avoid copying.

The destructor.

Definition at line 92 of file FunctionController.cxx.

Member Function Documentation

void addDataRep ( PlotterBase plotter,
DataRep rep 
)

Adds DataRep rep to the PlotterBase plotter.

If rep is not a FunctionRep, then just add the rep to the plotter. If rep is a FunctionRep object, then add it to the plotter if it is not a composite function.

Note
This function is intended to be use as part of the document reading.

Definition at line 264 of file FunctionController.cxx.

References FunctionController::addFunctionRep(), and FunctionController::instance().

Referenced by FunctionController::addFunctionRep(), and PlotterBaseXML::getObject().

FunctionBase * addFunction ( PlotterBase plotter,
const std::string &  name 
)

Adds a function to the first DataRep object of the plotter.

Deprecated:
This function is here to maintain compatibility with Python programs using the SIP interface.

Definition at line 211 of file FunctionController.cxx.

References FunctionController::getFunctionRep().

Referenced by PyFunctionRep::addTo(), and Inspector::functionAdd().

FunctionRep * addFunction ( PlotterBase plotter,
const std::string &  name,
FunctionRep frep,
DataRep rep 
)

Adds the function named by the string to the designated DataRep data_rep contained in the plotter.

If frep is not a null pointer, then the newly created function and frep become part of the same CompositeFunctionRep, otherwise the newly created function is stand-a-lone. Returns either the CompositeFunctionRep or the stand-a-lone FunctionRep.

Requests:
Check that previously set fixed flags and/or limits get propagated to new linear sum function.

Definition at line 227 of file FunctionController.cxx.

References FunctionController::addFunctionRep(), and FunctionController::createFunctionRep().

void addFunction ( PlotterBase plotter,
FunctionRep func_rep 
)
FunctionRep * addFunctionRep ( PlotterBase plotter,
DataRep drep,
FunctionRep frep,
FunctionRep func_rep 
)

Adds the func_rep to the DataRep contained by the plotter.

If frep is not a null pointer, then func_rep and frep become part of of a CompositeFunctionRep which is created if one doesn't already exist. Otherwise, func_rep because a standalone object.

Returns either the CompositeFunctionRep or the standalone FunctionRep.

Definition at line 310 of file FunctionController.cxx.

References FunctionController::addDataRep(), PlotterBase::addDataRep(), FunctionController::createFunctionRep(), FunctionController::fillFunctionReps(), FunctionController::instance(), FunctionController::m_func_reps, Observable::notifyObservers(), FunctionController::setFitter(), and FunctionController::setTupleCut().

Referenced by FunctionController::addDataRep(), and FunctionController::addFunction().

bool changeFitter ( const PlotterBase plotter,
const DataRep datarep,
const std::string &  name 
)
FunctionRep * createFunctionRep ( const std::string &  name,
DataRep rep 
)

Returns a newly created FunctionRep object with function of type name and target rep.

Definition at line 158 of file FunctionController.cxx.

References FunctionController::instance().

Referenced by FunctionController::addFunction(), QtDisplay::addFunction(), FunctionController::addFunctionRep(), and FunctionProjectorXML::createFunctionRep().

FunctionRep * createFunctionRep ( FunctionBase function,
DataRep rep 
)

Returns a newly created FunctionRep object with FunctionBase pointer function and target rep.

Definition at line 175 of file FunctionController.cxx.

References FunctionController::instance(), and FunctionController::setFitter().

ViewBase * createFuncView ( const ViewFactory factory,
PlotterBase plotter,
const std::string &  type 
)

Creates a textual view of function of type type.

Definition at line 672 of file FunctionController.cxx.

References DisplayController::createTextView(), FunctionController::getFunctionRep(), and FunctionController::instance().

Referenced by CanvasView::addFuncDisplay().

PlotterBase * createNewEllipsoidDisplay ( PlotterBase plotter,
FunctionRep rep 
)

Returns a new Ellipsoid display.

Creates and returns a PlotterBase object displaying the ellipsoids of the function parameters of the function representation rep in plotter.

Definition at line 878 of file FunctionController.cxx.

References FunctionController::ellipsoidNTuple(), and FunctionController::instance().

NTuple * createNTuple ( const PlotterBase plotter,
const FunctionRep rep 
)
PlotterBase * createResidualsDisplay ( PlotterBase plotter,
const FunctionRep frep 
)

Returns residuals display.

Creates and returns a PlotterBase object displaying the residuals of the function to its target.

Requests:
@ If target is histogram, then scale of residuals should take into account the bin width to make labels in counts.

Definition at line 842 of file FunctionController.cxx.

References FunctionController::createNTuple(), FunctionController::instance(), DisplayController::setLog(), and hippodraw::Axes::Y.

NTuple * ellipse ( const std::vector< double > &  xbar,
std::vector< std::vector< double > > &  SigmaInv,
double  Csq 
)

Given an @ SigmaInv this function returns the coordinates of an ellipse (in 2 dimension) centered at xbar.

Equation of ellipse is (x-xbar)' * SigmaInv * (x-xbar) = Csquare

Definition at line 1043 of file FunctionController.cxx.

References num_util::size().

Referenced by FunctionController::ellipsoidNTuple().

void ellipsoidNTuple ( PlotterBase plotter,
FunctionRep frep,
NTuple nt,
int  n,
double &  xmin,
double &  xmax,
double &  ymin,
double &  ymax 
)

This returns in nt the percentage distribution of the confidence in a rectangle bounded by xmin, ymin, xmax and ymax.

This bounding rectangle is just large enough that is captures 99.9% confidence ellipsoid between the two selected parameters (whose indexes are given by m_x and m_y.

Requests:
@@ Make sure they are being calculated correctly by hold one parameter constant and refitting.

Definition at line 920 of file FunctionController.cxx.

References hippodraw::Axes::convert(), FunctionController::ellipse(), hippodraw::Numeric::gammq(), FunctionController::getFitter(), FunctionController::instance(), hippodraw::Numeric::invertMatrix(), FunctionController::m_confid_count, FunctionController::m_deltaXSq, FunctionController::m_x, FunctionController::m_y, and hippodraw::Numeric::quadraticProduct().

Referenced by FunctionController::createNewEllipsoidDisplay(), and FunctionController::refreshEllipsoidDisplay().

void fillFunctionReps ( std::vector< FunctionRep * > &  freps,
const PlotterBase plotter,
const DataRep data_rep 
) const
private
void fillTopLevelFunctionReps ( std::vector< FunctionRep * > &  reps,
const PlotterBase plotter,
const DataRep data_rep 
) const

Clears and fills the vector with the top level FunctionRep objects that target data_rep and are contained in plotter.

A top level FunctionRep object is one that is not a member of a CompositeFunctionRep.

Definition at line 474 of file FunctionController.cxx.

References FunctionController::fillFunctionReps(), FunctionController::m_func_reps, and num_util::size().

void findFunctions ( const PlotterBase plotter) const
private

Finds the FunctionRep objects contained by the plotter.

Finds the FunctionRep objects contained by the plotter and inserts the list m_functions. If there are no functions contained, then the list will be empty.

Definition at line 143 of file FunctionController.cxx.

References PlotterBase::getDataRep(), PlotterBase::getNumDataReps(), and FunctionController::m_func_reps.

Referenced by FunctionController::restoreParameters(), and FunctionController::saveParameters().

bool fitFunction ( PlotterBase plotter,
FunctionRep rep 
)

Attempts to fit the function contained by the plotter.

If a composite function exists, the fit is done to the composite. Otherwise, the fit is done the function contained by rep.

Note
This is the member function that implements the application logic.

Definition at line 547 of file FunctionController.cxx.

References FunctionController::getComposite(), and FunctionController::setErrorsFromComposite().

Referenced by FunctionController::fitFunction(), and FunctionController::tryFitFunction().

bool fitFunction ( PlotterBase plotter,
unsigned  int 
)

Attempts to fit the function to the data in the DataRep of the plotter.

The int parameter is not used.

Deprecated:
This member function is maintained only for existing programs written in Python and using the SIP interface.

Definition at line 516 of file FunctionController.cxx.

References FunctionController::fitFunction(), and FunctionController::getFunctionRep().

bool functionExists ( const std::string &  name)

Returns true if function with name name is available.

Definition at line 1129 of file FunctionController.cxx.

References FunctionController::instance().

const vector< string > & functionNames ( PlotterBase plotter,
DataRep rep 
)

Returns function names on the plotter.

Returns a reference to a vector of function names on the designated plotter that are applied to the DataRep rep. If rep is a null pointer, returns all functions, otherwise returns only those whose target is rep.

Definition at line 430 of file FunctionController.cxx.

References FunctionController::fillFunctionReps(), FunctionRep::getFunction(), FunctionRep::getTarget(), FunctionController::m_f_names, FunctionController::m_func_reps, and FunctionBase::name().

double getChiSquared ( const PlotterBase plotter)

Returns the Chi-Squared.

Uses getObjectiveValue to return the Chi-Squared. This is only meaningful if the objective function, class derived from FCNBase, is a Chi-Squared calculator.

Deprecated:
This function will only work correctly if there is only one DataRep contained by the plotter. It remain here for backward compatibility with the SIP interface.

Definition at line 782 of file FunctionController.cxx.

References FunctionController::getObjectiveValue().

FunctionRep * getComposite ( const PlotterBase plotter,
FunctionRep rep 
)

Returns the CompositeFunctionRep for which rep is a member if it is one, otherwise returns rep.

Definition at line 525 of file FunctionController.cxx.

References FunctionController::fillFunctionReps(), and FunctionController::m_func_reps.

Referenced by FunctionController::fitFunction(), and PyFunctionRep::operator()().

const vector< vector< double > > & getCovarianceMatrix ( const PlotterBase plotter)

Returns the covariance matrix of the objective function.

Definition at line 769 of file FunctionController.cxx.

References FunctionController::getFunctionRep().

const std::string & getDefaultFitter ( ) const

Returns the name of the default Fitter object.

Definition at line 115 of file FunctionController.cxx.

References FunctionController::instance().

int getDegreesOfFreedom ( const PlotterBase plotter)

Returns the degrees of freedom.

Returns the degrees of freedom of the function with the DataRep using the current function parameters.

Definition at line 791 of file FunctionController.cxx.

References FunctionController::getFunctionRep().

Referenced by PyFunctionRep::degreesOfFreedom().

Fitter * getFitter ( const PlotterBase plotter)
const string & getFitterName ( const PlotterBase plotter)

Returns the name of the Fitter object as known by the FitterFactory.

Definition at line 700 of file FunctionController.cxx.

References FunctionController::getFitter(), and FunctionController::getFunctionRep().

const vector< string > & getFitterNames ( ) const

Returns the list of Fitter names.

Definition at line 106 of file FunctionController.cxx.

References FunctionController::instance().

const vector< string > & getFunctionNames ( ) const

Returns the list of available functions.

Definition at line 1156 of file FunctionController.cxx.

References FunctionController::instance().

FunctionRep * getFunctionRep ( const PlotterBase plotter) const

Returns the FunctionRep.

Returns a FunctionRep object contained by the plotter. If more than one exists, returns the FunctionRep corresponding the the composite function. If none exists, return a null pointer.

Bug:
If multiple DataRep exists, each with its own functions, then this function will probably not return the right one. Use datareps.py to demonstrate this. The only use of this function is Inspector itself, thus should be possible to remove this function altogether.

Definition at line 625 of file FunctionController.cxx.

References PlotterBase::activePlotIndex().

Referenced by FunctionController::addFunction(), FunctionController::changeFitter(), FunctionController::createFuncView(), FunctionController::createNTuple(), FunctionController::fitFunction(), FunctionController::getCovarianceMatrix(), FunctionController::getDegreesOfFreedom(), FunctionController::getFitter(), FunctionController::getFitterName(), FunctionController::getObjectiveValue(), FunctionController::removeTupleCut(), FunctionController::setFitRange(), FunctionController::setFitter(), and FunctionController::setTupleCut().

FunctionRep * getFunctionRep ( const PlotterBase plotter,
const DataRep datarep 
) const

Returns the FunctionRep.

Returns the FunctionRep object contained by the plotter whose target is data. If more than one FunctionRep object has data as target, then return the one which holds the composite function, or if no composite is found, then return the last FunctionRep object.

Bug:
@@@ When multiple independent functions are allowed, this method will fail.

Definition at line 654 of file FunctionController.cxx.

References FunctionController::fillFunctionReps(), and FunctionController::m_func_reps.

double getObjectiveValue ( const PlotterBase plotter,
const DataRep datarep 
)

Returns the value of the objective function.

Returns the value of the objective function, one derived from FCNBase, for the function whose target is the DataRep.

Definition at line 760 of file FunctionController.cxx.

References FunctionController::getFunctionRep().

Referenced by FunctionController::getChiSquared(), and PyFunctionRep::objectiveValue().

int getUniqueNonFunctionIndex ( const PlotterBase plotter) const

Returns the index to an unique DataRep object that is not a FunctionRep.

Returns the index to the DataRep object contained by the plotter if only one is not a FunctionRep, otherwise returns -1

Definition at line 123 of file FunctionController.cxx.

References PlotterBase::getDataRep(), and PlotterBase::getNumDataReps().

Referenced by DisplayController::activeDataRepIndex(), FunctionController::addFunction(), FunctionController::createNTuple(), and DisplayController::isAxisBinned().

bool hasFunction ( const PlotterBase plotter,
const DataRep rep 
)

Returns true if rep contained by plotter has a function attached.

If rep is non-zero, returns true if the rep contained by plotter is a target of a function, otherwise returns false. If rep is a null pointer, returns true, if plotter contains at least one DataRep object that is a target of a function, otherwise returns false.

Definition at line 417 of file FunctionController.cxx.

References FunctionController::fillFunctionReps(), and FunctionController::m_func_reps.

Referenced by FunctionController::setFitRange(), and Inspector::updateSummaryTab().

FunctionController * instance ( )
static

Returns the pointer to the singleton instance.

Definition at line 96 of file FunctionController.cxx.

References FunctionController::FunctionController(), and FunctionController::s_instance.

Referenced by FunctionController::addDataRep(), CanvasView::addFuncDisplay(), QtDisplay::addFunction(), FunctionController::addFunctionRep(), PyCanvas::addTextRep(), FunctionController::changeFitter(), QtDisplay::createDataArray(), FunctionProjectorXML::createFunctionRep(), FunctionController::createFunctionRep(), FunctionController::createFuncView(), FunctionController::createNewEllipsoidDisplay(), QtDisplay::createNTuple(), Inspector::createResiduals(), FunctionController::createResidualsDisplay(), Inspector::cutNew(), Inspector::cutRemovePushButton_clicked(), Inspector::dataCreateNTuple(), FunctionController::ellipsoidNTuple(), Inspector::fitterNamesActivated(), Inspector::functionAdd(), FunctionController::functionExists(), Inspector::functionParamsCheckBoxToggled(), Inspector::functionParamsLineEditReturnPressed(), Inspector::functionParamsSliderSliderMoved(), Inspector::functionParamsSliderSliderPressed(), Inspector::functionsFitToDataButton_clicked(), Inspector::functionsRemoveButton_clicked(), Inspector::functionsResetButton_clicked(), FunctionController::getDefaultFitter(), FunctionController::getFitterNames(), FunctionController::getFunctionNames(), PlotterBaseXML::getObject(), Inspector::ignoreErrorCheckBoxToggled(), CanvasView::initFitterMenu(), Inspector::Inspector(), FunctionController::isCompatible(), Inspector::pushButtonNewErrorPlotClicked(), FunctionController::setDefaultFitter(), FunctionController::setFitter(), CanvasView::setFitterDefault(), Inspector::setParameters(), Inspector::setSelectedFitter(), Inspector::summaryNew(), Inspector::updateFunctionsTab(), and Inspector::updateSummaryTab().

bool isCompatible ( const std::string &  function,
const std::string &  fitter 
)

Returns true if the function is compatible with the fitter.

Checks if the function is compatible with the fitter and return true if so, otherwise returns false. A function maybe incompatible with the fitter, for example, if the fitter needs the partial derivatives from the function, but the function is not capable of supplying them.

Definition at line 1138 of file FunctionController.cxx.

References FunctionController::instance().

Referenced by FunctionController::changeFitter().

PlotterBase * refreshEllipsoidDisplay ( PlotterBase plotter,
FunctionRep frep 
)

Returns a new Ellipsoid display.

Creates and returns a PlotterBase object displaying the ellipsoids of the function parameters in plotter.

Definition at line 1004 of file FunctionController.cxx.

References FunctionController::ellipsoidNTuple(), and PlotterBase::getParentPlotter().

void removeFunction ( PlotterBase plotter,
FunctionRep function 
)

Removes the designated function from the plotter.

Definition at line 349 of file FunctionController.cxx.

References FunctionController::fillFunctionReps(), FunctionController::m_func_reps, PlotterBase::removeDataRep(), and num_util::size().

void removeTupleCut ( const PlotterBase plotter,
DataRep data_rep 
)

Removes the region cut from both the target and function.

Definition at line 300 of file FunctionController.cxx.

References FunctionController::getFunctionRep().

void restoreParameters ( PlotterBase plotter)

Restores the parameters from previously stored values.

With the exception of cases in which they contain a composite function, the message is forwarded to all FunctionProjector objects.

Definition at line 609 of file FunctionController.cxx.

References FunctionController::findFunctions(), FunctionRep::getFunction(), FunctionController::m_func_reps, and FunctionRep::restoreParameters().

Referenced by FunctionController::tryFitFunction().

void saveParameters ( PlotterBase plotter)

Saves the parameters so they can be restored.

With the exception of cases in which they contain a composite function, the message is forwarded to all FunctionProjector objects.

Requests:
@@ Should save parameters in a stack, so that more than one set can be saved and restored.

Definition at line 596 of file FunctionController.cxx.

References FunctionController::findFunctions(), FunctionRep::getFunction(), FunctionController::m_func_reps, and FunctionRep::saveParameters().

Referenced by Inspector::functionAdd(), and FunctionController::tryFitFunction().

void setDefaultFitter ( const std::string &  name)

Sets the default Fitter object that will be used for newly created FunctionRep objects.

Definition at line 731 of file FunctionController.cxx.

References FunctionController::instance().

int setEllpsoidParamIndex ( Axes::Type  axes,
int  index 
)

Sets the which parameter shall be bound to which axes while plotting the error / confidence ellipsoids.

Definition at line 1113 of file FunctionController.cxx.

References FunctionController::m_x, FunctionController::m_y, hippodraw::Axes::X, and hippodraw::Axes::Y.

void setErrorsFromComposite ( const PlotterBase plotter,
const FunctionRep composite 
)
private

Sets the errors from the composite.

Sets the errors or each of the contained functions in the composite.

Definition at line 491 of file FunctionController.cxx.

References FunctionController::fillFunctionReps(), FunctionController::m_func_reps, and FunctionRep::setPrincipleErrors().

Referenced by FunctionController::fitFunction().

void setFitRange ( PlotterBase plotter,
const Range range 
)

Sets the range used for fitting.

Definition at line 579 of file FunctionController.cxx.

References FunctionController::getFunctionRep(), and FunctionController::hasFunction().

Referenced by FunctionController::setFitRange().

void setFitRange ( PlotterBase plotter,
double  low,
double  high 
)

Sets the range used for fitting.

Definition at line 590 of file FunctionController.cxx.

References FunctionController::setFitRange().

bool setFitter ( const PlotterBase plotter,
const std::string &  name 
)

Sets the Fitter.

Sets the Fitter object for the function contained by the plotter. The fitter is created from the FitterFactory using the name name. Returns true if the fitter is compatible with the target plotter, otherwise returns false.

Definition at line 687 of file FunctionController.cxx.

References FunctionController::getFunctionRep().

Referenced by FunctionController::addFunctionRep(), FunctionController::changeFitter(), FunctionController::createFunctionRep(), and FunctionController::setFitter().

bool setFitter ( FunctionRep frep,
const std::string &  name 
)

Sets the Fitter.

Sets the Fitter for FunctionRep frep to a fitter in the FitterFactory with name name. Returns true if the fitter is compatible with the target of the FunctionRep, otherwise returns false.

See Also
setFitter ( FunctionRep *, Fitter * )

Definition at line 721 of file FunctionController.cxx.

References FunctionController::instance(), and FunctionController::setFitter().

void setTupleCut ( FunctionRep rep)

Sets the function representation up to obey TupleCut on target, if any.

Definition at line 281 of file FunctionController.cxx.

Referenced by FunctionController::addFunctionRep(), and FunctionController::setTupleCut().

void setTupleCut ( const PlotterBase plotter,
DataRep data_rep 
)

Sets the TupleCut, if any for the FunctionRep contained by plotter whose target is data_rep.

Definition at line 289 of file FunctionController.cxx.

References FunctionController::getFunctionRep(), and FunctionController::setTupleCut().

bool tryFitFunction ( PlotterBase plotter,
FunctionRep func_rep 
)

Attempts to fit the function.

If function converges and the resulting chi squared is smaller than that of the starting point, keeps the functions parameters at the fitted value. Otherwise, restore the function parameters to their initial value. Returns true if the function converged, otherwise returns false.

Definition at line 560 of file FunctionController.cxx.

References FunctionController::fitFunction(), FunctionController::restoreParameters(), and FunctionController::saveParameters().

Member Data Documentation

unsigned int m_confid_count
private

A count of number of confidence contour plots created.

Definition at line 83 of file FunctionController.h.

Referenced by FunctionController::ellipsoidNTuple().

std::vector< double > m_deltaXSq
private

delta chi squared values for 99.99% confidence ellipsoids for mu = 1,2,3,4,5,6

Definition at line 63 of file FunctionController.h.

Referenced by FunctionController::ellipsoidNTuple(), and FunctionController::FunctionController().

std::vector< std::string > m_f_names
private

The list of function names attached to the plotter.

Definition at line 59 of file FunctionController.h.

Referenced by FunctionController::functionNames().

std::vector< FunctionRep * > m_func_reps
mutableprivate
PlotterBase* m_plotter
private

The current PlotterBase object.

Definition at line 69 of file FunctionController.h.

int m_x
mutableprivate

Index of the parameter that shall be bound to X axes while plotting the error / confidence ellipsoids.

NOTE: m_x = n is the index of nth FREE parameter and NOT of nth parameter.

Definition at line 74 of file FunctionController.h.

Referenced by FunctionController::ellipsoidNTuple(), and FunctionController::setEllpsoidParamIndex().

int m_y
mutableprivate

Index of the parameter that shall be bound to Y axes while plotting the error / confidence ellipsoids.

NOTE: m_y = n is the index of nth FREE parameter and NOT of nth parameter.

Definition at line 79 of file FunctionController.h.

Referenced by FunctionController::ellipsoidNTuple(), and FunctionController::setEllpsoidParamIndex().

FunctionController * s_instance = 0
staticprivate

A pointer to the singleton object.

Definition at line 66 of file FunctionController.h.

Referenced by FunctionController::instance().


The documentation for this class was generated from the following files:

Generated for HippoDraw Class Library by doxygen