Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
FunctionProjector Class Reference

A projector that plots one function. More...

#include <FunctionProjector.h>

Inheritance diagram for FunctionProjector:
Inheritance graph
[legend]
Collaboration diagram for FunctionProjector:
Collaboration graph
[legend]

Public Types

typedef void(Observer::* Action )(const Observable *)
 The member function of the Observer that is called.
typedef std::list< Observer * > ObserverList_t
 The type of STL container to maintain list of Observer objects.

Public Member Functions

void addObserver (Observer *)
 Adds an Observer to the Observer list.
virtual void addValues (const std::vector< double > &v)
 Add values to the projection.
void calcPrincipleErrors () const
 Calculates the principle errors from the fit.
virtual void checkScaling ()
 Checks for scaling the display of the axis range.
virtual ProjectorBaseclone ()
const std::vector< std::vector
< double > > & 
covariance () const
 Returns the covariance matrix.
virtual DataSourcecreateNTuple () const
 Returns a null pointer.
virtual NTuplecreateNTupleWith (const std::vector< TupleCut > &cut_list) const
 Creates a NTuple from the projector's DataSource object using cut_list for not including rows that do not pass the cuts.
virtual const DataSourcecreateOldStyleNTuple () const
virtual Range dataRangeOn (hippodraw::Axes::Type) const
 Returns the range of the raw data.
int degreesOfFreedom () const
 Returns the number of degrees of freedom in the fit.
virtual void fillColumnAfterCuts (const std::string &column, std::vector< double > &columnData) const
 Fill the vector with values from named column with the present set of cuts applied.
bool fitFunction ()
 Fits the function.
FunctionBasefunction () const
 Returns a pointer to the contained function.
 FunctionProjector (FunctionBase *function, ProjectorBase *targetProjector)
 This constructor takes a FunctionBase object and its target data projector.
 FunctionProjector (const FunctionProjector &)
 The copy constructor.
virtual double getAverage (Axes::Type axis) const
 Get the Average of all projected values on the specified axis.
virtual const std::vector
< std::string > & 
getAxisBindings () const
 Returns the axis bindings.
virtual AxisModelBasegetAxisModel (Axes::Type axis) const
 Get the AxisModel for axis axis.
virtual double getBinWidth (Axes::Type axis) const
 Returns the bin width of the axis.
FittergetFitter () const
 Returns the Fitter that is in use.
virtual int getMinEntries ()
 Get the minimum entries/bin.
virtual NTuplegetNTupleAfterCuts () const
 Template for projectors that can return subsets of the NTuple used by the DataRep.
virtual int getNumberOfBins (Axes::Type) const
 Returns the number of bins.
int getNumberOfEntries () const
 A call to this member function is meaningless.
const ObserverList_tgetObservers () const
 Returns the list of observers.
virtual double getOffset (Axes::Type axis) const
 Returns the offset of the axis.
int getOverflow () const
 Returns the number of overflow.
const std::vector< std::string > & getPointReps () const
 Return the vector of Point Reps.
virtual double getPosOn (hippodraw::Axes::Type) const
 Returns the minimum positive value.
const DataSourcegetProjectedValues () const
 Returns DataSource representation of projected values.
virtual const RangegetRange (Axes::Type) const
 Returns the Range along the specified axis.
virtual double getRMS (Axes::Type axis)
 Returns the RMS.
const std::vector< unsigned int > & getShape ()
 Get the shape of the projected values.
virtual const std::string & getTitle () const
 Finds the title of the plot.
int getUnderflow () const
 Returns the number of underflow.
virtual const std::string & getXLabel () const
 Finds the X axis label of the plot.
virtual const std::string & getYLabel (bool density=false) const
 Finds the Y axis label of the plot.
const std::vector< double > & getZAfterTransform (TransformBase *transform)
 Return Z values after binary transform.
const std::string & getZLabel () const
 Is meaningless for this projector.
virtual double getZValue (double x, double y) const
 Get the z value at the specified point (x,y).
const std::vector< double > & getZValues ()
 Return all Z values.
virtual bool hasDataSourceBindings () const
 Returns true if projector has binding to a DataSource.
bool hasSavedParameters () const
 Returns true if the function's parameters have been saved.
virtual int indexOf (const std::string &label) const
 Returns the index of the label.
void initializeFunction (ProjectorBase *projector)
 Gives the function object initial values based on a given data projector.
virtual bool isAxisBinned (const std::string &axis) const
 Returns true if specified axis is binned.
bool isDirty () const
 Returns true if the projector has been marked dirty.
virtual bool isEmpty () const
 Implements ProjectorBase.
virtual bool isImageConvertable () const
 Returns true if the projected values can converted to an image.
virtual bool isValueBinned () const
 Returns true if the projected values are the result of binning.
virtual void matrixTranspose (bool yes)
 Transposes the X and Y axis.
virtual void normalizeTo (const ProjectorBase *target)
 Sets the target of normalization.
virtual void normalizeTo (double norm)
 Sets a scale factor on the output so that the number of entries appears to be number.
virtual void notifyObservers () const
 Notifies Observer objects of a change.
double objectiveValue () const
 Returns the objective value (chi2 or likelihood) between the function and the data.
virtual Range preferredRange (Axes::Type) const
 Returns the preferred Range.
virtual void prepareValues ()
 Informs the projector to prepare its projected values for plotting.
const std::vector< double > & principleErrors () const
 Returns the principle diagonal of the covariance matrix.
void removeObserver (Observer *)
 Removes an Observer from the Observer list.
virtual void reset ()
 Resets the bins.
void restoreParameters ()
 Restores the function's parameter values from the previously saved values.
void saveParameters ()
 Makes a copy of the function's parameter values.
virtual void setAxisBinding (const std::string &axis, const std::string &label)
 Sets the axis binding.
virtual void setAxisBindings (const std::vector< std::string > &bindings)
 Sets the axis binding.
virtual void setAxisModel (Axes::Type axis, AxisModelBase *)
 Sets the AxisModel for axis axis.
virtual const RangesetBinWidth (Axes::Type axis, double width)
 Sets the bin width.
virtual const RangesetBinWidth (Axes::Type axis, int parm, bool dragging)
 Sets the bin width.
virtual void setDirty (bool value=true)
 Sets the dirty flag to value.
virtual void setFitCut (TupleCut *cut)
 Sets the cut to limit range of fitting.
virtual void setFitRange (bool yes=true)
 Sets use of a fitting range on or off.
void setFitter (Fitter *fitter)
 Sets the Fitter to be used.
virtual void setMinEntries (int entries)
 Set the minimum entries/bin.
virtual void setNormalizing (bool on)
 Sets the scaling number of entries on if on is true, otherwise turns if off.
virtual void setNumberOfBins (Axes::Type axis, unsigned int number)
 Sets the number of bins.
virtual void setOffset (const std::string &axis, int parm, bool dragging)
 Sets the bin offset.
virtual void setOffset (Axes::Type axis, double offset)
 Sets the bin offset.
void setParameters (const std::vector< double > &params)
 Set the parameter values by hand.
void setPrincipleErrors (std::vector< double >::const_iterator first, std::vector< double >::const_iterator last)
 Sets the principle errors.
virtual void setRange (hippodraw::Axes::Type, bool)
 Sets the range of the selected axis.
virtual void update (const Observable *)
 Implements the Observer pattern.
virtual Range valueRange () const
virtual bool wantsScaleFactor (const std::string &axis) const
 Returns whether the projector wants scale factor.
virtual void willDelete (const Observable *)
 Notifies this Observer object that one of its Observable objects is about to be deleted.
virtual ~FunctionProjector ()
 The virtual destructor.

Protected Member Functions

virtual void fillProjectedValues (DataSource *ntuple, bool in_range=false) const
 Does nothing.
void notifyObservers (Action action) const
 An internal method to iterate over all observers and to send the message action.

Protected Attributes

std::vector< std::string > m_pointreps
 Vector of acceptable PointReps.
DataSourcem_proj_values
 The NTuple representing the result of the projection.
AxisModelBasem_x_axis
 The AxisModel along the X axis.
AxisModelBasem_y_axis
 The AxisModel along the Y axis.
AxisModelBasem_z_axis
 The AxisModel along the Z axis.
std::vector< double > m_zval
 Sorted Z values in this projector.

Private Member Functions

virtual void addPointReps ()
 Function to add the acceptable point reps.

Private Attributes

std::vector< std::vector
< double > > 
m_covariance
 The error covariance matrix of the errors associated with the parameters of the function.
Fitterm_fitter
 A fitter object for the function.
FunctionBasem_function
 The list of function objects to be projected.
std::vector< double > m_principleErrors
 The principle errors of the errors associated with the parameters of the function.
std::vector< double > m_save_parms
 A vector used to save parameters so that they can be restored.
ProjectorBasem_target
 The ProjectorBase object containing the data points for the function and fitter.
std::string m_z_label
 Dummy member so getZLabel member can return reference.

Static Private Attributes

static std::string s_x_label
 An X label that might be used.

Detailed Description

A projector that plots one function.

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
Oded Wurman owurm.nosp@m.an@s.nosp@m.tanfo.nosp@m.rd.e.nosp@m.du

Definition at line 33 of file FunctionProjector.h.

Member Typedef Documentation

typedef void( Observer::* Action)(const Observable *)
inherited

The member function of the Observer that is called.

Definition at line 86 of file Observable.h.

typedef std::list< Observer * > ObserverList_t
inherited

The type of STL container to maintain list of Observer objects.

Definition at line 45 of file Observable.h.

Constructor & Destructor Documentation

FunctionProjector ( FunctionBase function,
ProjectorBase targetProjector 
)

This constructor takes a FunctionBase object and its target data projector.

Definition at line 40 of file FunctionProjector.cxx.

References FunctionProjector::m_function, and FunctionProjector::m_z_label.

FunctionProjector ( const FunctionProjector projector)

The copy constructor.

Todo:
To be implemented.

Definition at line 53 of file FunctionProjector.cxx.

~FunctionProjector ( )
virtual

The virtual destructor.

It is responsible for deleting the Function objects.

Definition at line 58 of file FunctionProjector.cxx.

References FunctionProjector::m_fitter, and FunctionProjector::m_function.

Member Function Documentation

void addObserver ( hippodraw::Observer observer)
inherited
void addPointReps ( )
privatevirtual

Function to add the acceptable point reps.

Definition at line 286 of file FunctionProjector.cxx.

void addValues ( const std::vector< double > &  v)
virtualinherited

Add values to the projection.

This method is provided as convenience for derived classes that respond to it. The implementation in this class does nothing.

Reimplemented in StHist2DProjector, and StHist1DProjector.

Definition at line 330 of file ProjectorBase.cxx.

void calcPrincipleErrors ( ) const

Calculates the principle errors from the fit.

Definition at line 227 of file FunctionProjector.cxx.

References FunctionProjector::m_covariance, FunctionProjector::m_fitter, FunctionProjector::m_principleErrors, and FunctionProjector::m_save_parms.

void checkScaling ( )
virtualinherited

Checks for scaling the display of the axis range.

This base class implementation does nothing. Derived classes should override this method if scaling of the axis is meaningful to them.

Reimplemented in Hist1DProjImp, BinningProjector, and Hist2DProjImp.

Definition at line 416 of file ProjectorBase.cxx.

ProjectorBase * clone ( )
virtual
Todo:
To be implemented.

Implements ProjectorBase.

Definition at line 65 of file FunctionProjector.cxx.

const vector< vector< double > > & covariance ( ) const

Returns the covariance matrix.

Definition at line 311 of file FunctionProjector.cxx.

References FunctionProjector::m_covariance, and FunctionProjector::m_fitter.

DataSource * createNTuple ( ) const
virtual

Returns a null pointer.

Implements ProjectorBase.

Definition at line 322 of file FunctionProjector.cxx.

NTuple * createNTupleWith ( const std::vector< TupleCut > &  cut_list) const
virtualinherited

Creates a NTuple from the projector's DataSource object using cut_list for not including rows that do not pass the cuts.

Note
This base class implementation returns a null pointer.

Reimplemented in NTupleProjector.

Definition at line 356 of file ProjectorBase.cxx.

const DataSource * createOldStyleNTuple ( ) const
virtualinherited
Range dataRangeOn ( hippodraw::Axes::Type  ) const
virtual
int degreesOfFreedom ( ) const

Returns the number of degrees of freedom in the fit.

Definition at line 269 of file FunctionProjector.cxx.

References Fitter::calcDegreesOfFreedom(), and FunctionProjector::m_fitter.

Referenced by FuncChiRep::drawProjectedValues().

void fillColumnAfterCuts ( const std::string &  column,
std::vector< double > &  columnData 
) const
virtualinherited

Fill the vector with values from named column with the present set of cuts applied.

This default implementation does nothing.

Reimplemented in NTupleProjector.

Definition at line 349 of file ProjectorBase.cxx.

Referenced by DataRep::fillColumnAfterCuts().

void fillProjectedValues ( DataSource ntuple,
bool  in_range = false 
) const
protectedvirtual

Does nothing.

Definition at line 330 of file FunctionProjector.cxx.

bool fitFunction ( )

Fits the function.

Attempts to fit the function to the data. Returns true if the fit converged, otherwise returns false. Creates a new fitter object if necessary.

Definition at line 130 of file FunctionProjector.cxx.

References Fitter::calcBestFit(), FunctionProjector::hasSavedParameters(), FunctionProjector::m_fitter, FunctionProjector::m_function, FunctionProjector::m_target, ProjectorBase::prepareValues(), FunctionProjector::saveParameters(), and ProjectorBase::setDirty().

Referenced by FunctionRep::fitFunction().

FunctionBase * function ( ) const

Returns a pointer to the contained function.

Definition at line 70 of file FunctionProjector.cxx.

References FunctionProjector::m_function.

Referenced by FunctionProjectorXML::createElement(), FuncParmRep::drawProjectedValues(), and FunctionRep::getFunction().

double getAverage ( Axes::Type  axis) const
virtualinherited

Get the Average of all projected values on the specified axis.

Todo:
this should be computed externally with the iterators
Todo:
Resolve if this method should be done exterior to the projector class by a functor using iterators.

Reimplemented in NTupleProjector, MapMatrixProjector, StHist2DProjector, Map1Projector, EqualEntriesHist1DProjector, DyHist1DProjector, and StHist1DProjector.

Definition at line 278 of file ProjectorBase.cxx.

Referenced by AverageTextRep::drawProjectedValues().

const vector< string > & getAxisBindings ( ) const
virtualinherited

Returns the axis bindings.

Returns the name associated with each axis. This member function should only be called with a derived class which can process it in a meaningful way. thus if this method is called on this base class, an assertion is raised.

Reimplemented in NTupleProjector.

Definition at line 99 of file ProjectorBase.cxx.

Referenced by VariableMesh::setAxisBindings(), and XYPlot::setAxisBindings().

AxisModelBase * getAxisModel ( Axes::Type  axis) const
virtualinherited
double getBinWidth ( Axes::Type  axis) const
virtualinherited

Returns the bin width of the axis.

Not all projectors has a notation of a bin width. This interface is declared for those that do. The implementation in this base class is to does nothing.

Reimplemented in MapMatrixProjector, EqualEntriesHist1DProjector, and BinningProjector.

Definition at line 316 of file ProjectorBase.cxx.

Referenced by PyDataRep::getBinWidth(), and CompositePlotter::getBinWidth().

Fitter * getFitter ( ) const

Returns the Fitter that is in use.

Definition at line 107 of file FunctionProjector.cxx.

References FunctionProjector::m_fitter.

int getMinEntries ( )
virtualinherited

Get the minimum entries/bin.

Reimplemented in BinningProjector.

Definition at line 531 of file ProjectorBase.cxx.

Referenced by CompositePlotter::getMinEntries().

NTuple * getNTupleAfterCuts ( ) const
virtualinherited

Template for projectors that can return subsets of the NTuple used by the DataRep.

Reimplemented in NTupleProjector.

Definition at line 342 of file ProjectorBase.cxx.

Referenced by DataRep::getNTupleAfterCuts().

int getNumberOfBins ( Axes::Type  ) const
virtualinherited

Returns the number of bins.

Returns the number of bins on the specified axis. The result is 0 if the axis is not binned.

Reimplemented in MapMatrixProjector, and BinningProjector.

Definition at line 116 of file ProjectorBase.cxx.

int getNumberOfEntries ( ) const
virtual

A call to this member function is meaningless.

Thus, it raises an assertion.

Implements ProjectorBase.

Definition at line 177 of file FunctionProjector.cxx.

const Observable::ObserverList_t & getObservers ( ) const
inherited

Returns the list of observers.

Definition at line 60 of file Observable.cxx.

double getOffset ( Axes::Type  axis) const
virtualinherited

Returns the offset of the axis.

Not all projectors has a notation of a bin width. This interface is declared for those that do. The implementation in this base class is to does nothing.

Reimplemented in MapMatrixProjector, and BinningProjector.

Definition at line 268 of file ProjectorBase.cxx.

Referenced by CompositePlotter::getOffset().

int getOverflow ( ) const
virtual

Returns the number of overflow.

It is meaningless.

Implements ProjectorBase.

Definition at line 193 of file FunctionProjector.cxx.

const vector< string > & getPointReps ( ) const
inherited

Return the vector of Point Reps.

Definition at line 335 of file ProjectorBase.cxx.

References ProjectorBase::m_pointreps.

double getPosOn ( hippodraw::Axes::Type  ) const
virtual

Returns the minimum positive value.

Todo:
Resolve if this method should be here.

Implements ProjectorBase.

Definition at line 276 of file FunctionProjector.cxx.

const DataSource * getProjectedValues ( ) const
inherited
const Range & getRange ( Axes::Type  axis) const
virtualinherited
double getRMS ( Axes::Type  axis)
virtualinherited

Returns the RMS.

Returns the root mean square of the data points along the axis axis.

Requests:
Can do better than use only the projected values in some derived classes.

Definition at line 289 of file ProjectorBase.cxx.

References ProjectorBase::getProjectedValues(), ProjectorHelper::stdCoord(), and hippodraw::Axes::X.

const std::vector< unsigned int > & getShape ( )
inherited

Get the shape of the projected values.

Used to export FITS file.

Definition at line 444 of file ProjectorBase.cxx.

References ProjectorBase::getProjectedValues(), and DataSource::getShape().

Referenced by ProjectorBase::getZValues().

const string & getTitle ( ) const
virtual

Finds the title of the plot.

Implements ProjectorBase.

Definition at line 147 of file FunctionProjector.cxx.

References FunctionProjector::m_function, and FunctionBase::name().

int getUnderflow ( ) const
virtual

Returns the number of underflow.

It is meaningless.

Implements ProjectorBase.

Definition at line 186 of file FunctionProjector.cxx.

const std::string & getXLabel ( ) const
virtual

Finds the X axis label of the plot.

Normally the label is taken from the data projector that is used in conjunction with the function projector. If called, the function returns "X".

Implements ProjectorBase.

Definition at line 159 of file FunctionProjector.cxx.

References FunctionProjector::s_x_label.

const string & getYLabel ( bool  density = false) const
virtual

Finds the Y axis label of the plot.

Normally the label is taken from the data projector that is used in conjunction with the function projector. If called, the function returns the name of the function. The argument density is not used.

Implements ProjectorBase.

Definition at line 164 of file FunctionProjector.cxx.

References FunctionProjector::m_function, and FunctionBase::name().

const std::vector< double > & getZAfterTransform ( TransformBase transform)
inherited

Return Z values after binary transform.

Todo:
This is the only method in all the classes of this directory that needs a heder file from transform directory. Is there a better way?

Definition at line 456 of file ProjectorBase.cxx.

References ProjectorBase::getZValue(), BinaryTransform::inverseTransform(), and ProjectorBase::m_zval.

const string & getZLabel ( ) const
virtual

Is meaningless for this projector.

Reimplemented from ProjectorBase.

Definition at line 281 of file FunctionProjector.cxx.

References FunctionProjector::m_z_label.

double getZValue ( double  x,
double  y 
) const
virtualinherited

Get the z value at the specified point (x,y).

Reimplemented in MapMatrixProjector, BinningProjector, MeshProjector, and Map3Projector.

Definition at line 323 of file ProjectorBase.cxx.

Referenced by ProjectorBase::getZAfterTransform(), and CompositePlotter::getZValue().

const std::vector< double > & getZValues ( )
inherited
bool hasDataSourceBindings ( ) const
virtualinherited

Returns true if projector has binding to a DataSource.

This base class implementation returns false. Derived classes that have DataSource binding should override this member function and return true.

Reimplemented in NTupleProjector.

Definition at line 518 of file ProjectorBase.cxx.

Referenced by BinningProjectorXML::createChildren().

bool hasSavedParameters ( ) const

Returns true if the function's parameters have been saved.

Definition at line 75 of file FunctionProjector.cxx.

References FunctionProjector::m_save_parms.

Referenced by FunctionProjector::fitFunction().

int indexOf ( const std::string &  label) const
virtualinherited

Returns the index of the label.

For example, the column index.

Reimplemented in NTupleProjector.

Definition at line 309 of file ProjectorBase.cxx.

void initializeFunction ( ProjectorBase projector)
bool isAxisBinned ( const std::string &  axis) const
virtualinherited

Returns true if specified axis is binned.

An axis that is binned responds to the width and offset controls. This base class implementation returns false.

Reimplemented in Profile2DProjector, EqualEntriesHist1DProjector, DyHist1DProjector, DyHist2DProjector, StHist2DProjector, StHist1DProjector, and ProfileProjector.

Definition at line 121 of file ProjectorBase.cxx.

Referenced by CompositePlotter::getBinWidth(), CompositePlotter::getOffset(), DisplayController::isAxisBinned(), DisplayController::setBinner(), and BinningProjector::setBinnerOn().

bool isDirty ( ) const
inherited

Returns true if the projector has been marked dirty.

A dirty projector is one whose projected values are invalid because of some change (e.g., an axis range has changed.)

Definition at line 70 of file ProjectorBase.cxx.

References ProjectorBase::m_isDirty.

Referenced by Profile2DProjector::dataRangeOn(), DataRep::isDirty(), Map2Projector::prepareValues(), MeshProjector::prepareValues(), BinningProjector::prepareValues(), MapMatrixProjector::prepareValues(), and Profile2DProjector::valueRange().

bool isEmpty ( ) const
virtual

Implements ProjectorBase.

Implements ProjectorBase.

Definition at line 292 of file FunctionProjector.cxx.

References FunctionProjector::m_function.

bool isImageConvertable ( ) const
virtualinherited

Returns true if the projected values can converted to an image.

Returns true if this projected values can be converted to an image. An image is defined as a regular grid of values. As a convenience to implementers of derived classes, this base class method returns false.

Reimplemented in MapMatrixProjector, and BinningProjector.

Definition at line 538 of file ProjectorBase.cxx.

bool isValueBinned ( ) const
virtualinherited

Returns true if the projected values are the result of binning.

The implementation in this base class returns false. It maybe overridden in derived classes that do binning.

Reimplemented in Hist2DProjImp, and Hist1DProjImp.

Definition at line 126 of file ProjectorBase.cxx.

Referenced by BinningProjector::normalizeTo().

void matrixTranspose ( bool  yes)
virtualinherited

Transposes the X and Y axis.

The implementation in this base class does nothing.

Reimplemented in MapMatrixProjector.

Definition at line 109 of file ProjectorBase.cxx.

void normalizeTo ( const ProjectorBase target)
virtualinherited

Sets the target of normalization.

The meaning of normalizing the projected values of one projector to another one depends on the derived class. This implementation in this base does nothing.

Reimplemented in BinningProjector.

Definition at line 409 of file ProjectorBase.cxx.

void normalizeTo ( double  norm)
virtualinherited

Sets a scale factor on the output so that the number of entries appears to be number.

This feature might be used, for example, to compare two histograms that have different number of entries by normalizing one to the other.

Reimplemented in BinningProjector.

Definition at line 388 of file ProjectorBase.cxx.

void notifyObservers ( ) const
virtualinherited

Notifies Observer objects of a change.

If interval counting is disabled, then Observer::Update is sent immediately. If interval counting is enabled, then the current count is incremented. If the current count is equal to the interval count, then the Observer::update message is sent and the current count reset to 0.

Reimplemented in NTuple, RootNTuple, NumArrayTuple, ListTuple, and FitsNTuple.

Definition at line 93 of file Observable.cxx.

References Observer::update().

Referenced by XyPlotter::addDataRep(), XyPlotter::addDataRepStacked(), FunctionController::addFunctionRep(), StHist1DProjector::addValues(), StHist2DProjector::addValues(), XyPlotter::autoScale(), Inspector::contourLevelsTextBox_returnPressed(), Inspector::contourSlider_valueChanged(), Inspector::contourTextBox_returnPressed(), FunctionRep::fitFunction(), XyPlotter::removeDataRep(), FunctionRep::restoreParameters(), DataRep::set(), CutPlotter::setActive(), PlotterBase::setAspectRatio(), XyPlotter::setAutoRanging(), XyPlotter::setBoxEdge(), QtDisplay::setContourLevels(), CutPlotter::setCutColor(), XyPlotter::setCutEnabled(), XyPlotter::setCutInverted(), XyPlotter::setCutRangeAt(), ProjectorBase::setDirty(), DataRep::setErrorDisplay(), XyPlotter::setHighRange(), PlotterBase::setLabel(), XyPlotter::setLabel(), DataSource::setLabelAt(), DataSource::setLabels(), XyPlotter::setLowRange(), DataSource::setName(), DisplayController::setNTuple(), FunctionRep::setParameters(), DyHistogram::setPointRep(), DyHistogramEqualEntries::setPointRep(), DataRep::setPointRep(), TextPlotter::setRepColor(), DataRep::setRepColor(), DataRep::setRepSize(), DataRep::setRepStyle(), XyPlotter::setReverse(), XyPlotter::setScaling(), XyPlotter::setShowGrid(), DataSource::setTitle(), PlotterBase::setTitle(), XyPlotter::setTransform(), XyPlotter::setValueRep(), NTupleProjector::update(), BinningProjector::update(), DataRep::update(), PlotterBase::update(), CutPlotter::update(), CutPlotter::updateTargets(), DataRep::~DataRep(), DataSource::~DataSource(), PlotterBase::~PlotterBase(), and RTuple::~RTuple().

void notifyObservers ( Action  action) const
protectedinherited

An internal method to iterate over all observers and to send the message action.

Definition at line 72 of file Observable.cxx.

double objectiveValue ( ) const

Returns the objective value (chi2 or likelihood) between the function and the data.

Definition at line 220 of file FunctionProjector.cxx.

References FunctionProjector::m_fitter, and Fitter::objectiveValue().

Referenced by FuncChiRep::drawProjectedValues().

Range preferredRange ( Axes::Type  axis) const
virtualinherited

Returns the preferred Range.

Returns the Range preferred by the projector. The default implementation in this base class is to return full range of the data on the axis. Derived classes, may need to override this implementation.

Reimplemented in MapMatrixProjector, MeshProjector, Hist2DProjImp, and Hist1DProjImp.

Definition at line 163 of file ProjectorBase.cxx.

References ProjectorBase::dataRangeOn(), Range::length(), Range::low(), Range::setHigh(), Range::setLow(), and hippodraw::Axes::Y.

Referenced by DataRep::preferredRange().

void prepareValues ( )
virtualinherited

Informs the projector to prepare its projected values for plotting.

This base class implementation sets the dirty flag to false indicating that the values are already prepared. Projectors that need to calculate the projected values should override this method and also set the dirty flag to false. For example, a projector might accumulate data into bins, and the position of the bin and its number of entries are used for the projected values.

Reimplemented in MapMatrixProjector, BinningProjector, EqualEntriesHist1DProjector, Map1Projector, MeshProjector, Map2Projector, Map3Projector, and LineProjector.

Definition at line 65 of file ProjectorBase.cxx.

References ProjectorBase::setDirty().

Referenced by DataRep::createNTuple(), ProjectorBase::createOldStyleNTuple(), FunctionProjector::fitFunction(), DataRep::getProjectedValues(), and FunctionProjector::initializeFunction().

const vector< double > & principleErrors ( ) const

Returns the principle diagonal of the covariance matrix.

Definition at line 253 of file FunctionProjector.cxx.

References FunctionProjector::m_principleErrors.

Referenced by FunctionRep::principleErrors().

void removeObserver ( hippodraw::Observer observer)
inherited
void reset ( )
virtualinherited

Resets the bins.

This interface is for the StHist1DProjector

Reimplemented in StHist1DProjector, BinningProjector, and Hist1DProjImp.

Definition at line 262 of file ProjectorBase.cxx.

Referenced by CompositePlotter::reset().

void restoreParameters ( )

Restores the function's parameter values from the previously saved values.

Definition at line 88 of file FunctionProjector.cxx.

References FunctionProjector::m_function, FunctionProjector::m_save_parms, ProjectorBase::setDirty(), and FunctionBase::setParameters().

Referenced by FunctionRep::restoreParameters().

void saveParameters ( )
void setAxisBinding ( const std::string &  axis,
const std::string &  label 
)
virtualinherited

Sets the axis binding.

Sets binding of the axis with name axis to entity with name label. It is expected that this member function will only be called on a derived class which can process it in a meaningful way. Thus if this method is called on this base class, an assertion is thrown.

Reimplemented in NTupleProjector.

Definition at line 84 of file ProjectorBase.cxx.

void setAxisBindings ( const std::vector< std::string > &  bindings)
virtualinherited

Sets the axis binding.

Sets binding of all axis entities with name in the vector. This member function should only be called with a derived class which can process it in a meaningful way. Thus if this method is called on this base class, an assertion is thrown.

Reimplemented in NTupleProjector.

Definition at line 92 of file ProjectorBase.cxx.

void setAxisModel ( Axes::Type  axis,
AxisModelBase axis_model 
)
virtualinherited

Sets the AxisModel for axis axis.

Reimplemented in BinningProjector.

Definition at line 192 of file ProjectorBase.cxx.

References ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, ProjectorBase::m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z.

Referenced by DataRep::setAxisModel().

const Range & setBinWidth ( Axes::Type  axis,
double  width 
)
virtualinherited

Sets the bin width.

Sets the bin width to width along the axis axis.

Not all projectors has a notation of a bin width. This interface is declared for those that do. The implementation in this base class is to does nothing.

Reimplemented in MapMatrixProjector, EqualEntriesHist1DProjector, Profile2DProjector, Hist2DProjImp, and BinningProjector.

Definition at line 234 of file ProjectorBase.cxx.

Referenced by CompositePlotter::setBinWidth().

const Range & setBinWidth ( Axes::Type  axis,
int  parm,
bool  dragging 
)
virtualinherited

Sets the bin width.

This method is intended to be used in conjunction with a slider widget in a graphical user interface. The slider range is assumed to be 0 to 100 with the current value at parm. If the slider is still being dragged, then dragging is true, otherwise it is false. A derived class determines withs own bin width based on the width it had when slider dragging first started. and the current position of the slider. The implementation in this base class does nothing.

Reimplemented in EqualEntriesHist1DProjector, Profile2DProjector, DyHist2DProjector, and BinningProjector.

Definition at line 242 of file ProjectorBase.cxx.

References ProjectorBase::getRange(), and ProjectorBase::m_x_axis.

void setDirty ( bool  value = true)
virtualinherited

Sets the dirty flag to value.

Definition at line 75 of file ProjectorBase.cxx.

References ProjectorBase::m_isDirty, and Observable::notifyObservers().

Referenced by StHist1DProjector::addValues(), StHist2DProjector::addValues(), Profile2DProjector::dataRangeOn(), FunctionProjector::fitFunction(), StHist1DProjector::getAverage(), StHist2DProjector::getAverage(), BinningProjector::normalize(), LineProjector::prepareValues(), Map3Projector::prepareValues(), Map2Projector::prepareValues(), MeshProjector::prepareValues(), Map1Projector::prepareValues(), EqualEntriesHist1DProjector::prepareValues(), BinningProjector::prepareValues(), ProjectorBase::prepareValues(), MapMatrixProjector::prepareValues(), StHist1DProjector::reset(), FunctionProjector::restoreParameters(), NTupleProjector::setAxisBinding(), BinningProjector::setBinnerOn(), ProfileProjector::setBinnerRange(), DyHist2DProjector::setBinnerRange(), DyHist1DProjector::setBinnerRange(), StHist1DProjector::setBinnerRange(), StHist2DProjector::setBinnerRange(), Profile2DProjector::setBinnerRange(), BinningProjector::setBinWidth(), Hist2DProjImp::setBinWidth(), Profile2DProjector::setBinWidth(), EqualEntriesHist1DProjector::setBinWidth(), DataRep::setDirty(), BinningProjector::setMinEntries(), MapMatrixProjector::setNTuple(), NTupleProjector::setNTuple(), DyHist2DProjector::setOffset(), BinningProjector::setOffset(), Hist2DProjImp::setOffset(), Profile2DProjector::setOffset(), FunctionProjector::setParameters(), Profile2DProjector::setRange(), FunctionProjector::setRange(), ProjectorBase::setRange(), NTupleProjector::update(), and BinningProjector::willDelete().

void setFitCut ( TupleCut cut)
virtual

Sets the cut to limit range of fitting.

Definition at line 337 of file FunctionProjector.cxx.

References FunctionProjector::m_fitter.

void setFitRange ( bool  yes = true)
virtual

Sets use of a fitting range on or off.

Definition at line 344 of file FunctionProjector.cxx.

References FunctionProjector::m_fitter.

void setFitter ( Fitter fitter)

Sets the Fitter to be used.

Definition at line 100 of file FunctionProjector.cxx.

References FunctionProjector::m_fitter.

void setMinEntries ( int  entries)
virtualinherited

Set the minimum entries/bin.

Reimplemented in BinningProjector.

Definition at line 525 of file ProjectorBase.cxx.

Referenced by CompositePlotter::setMinEntries().

void setNormalizing ( bool  on)
virtualinherited

Sets the scaling number of entries on if on is true, otherwise turns if off.

Reimplemented in BinningProjector.

Definition at line 395 of file ProjectorBase.cxx.

void setNumberOfBins ( Axes::Type  axis,
unsigned int  number 
)
virtualinherited

Sets the number of bins.

Sets the number of bins along the axis axis to number.

Not all projectors has a notation of a bin width. This interface is declared for those that do. The implementation in this base class is to does nothing.

Reimplemented in MapMatrixProjector.

Definition at line 228 of file ProjectorBase.cxx.

Referenced by CompositePlotter::setNumberOfBins().

void setOffset ( const std::string &  axis,
int  parm,
bool  dragging 
)
virtualinherited

Sets the bin offset.

See Also
setBinWidth ( const std::string &, int, bool )

Reimplemented in Profile2DProjector, BinningProjector, and DyHist2DProjector.

Definition at line 248 of file ProjectorBase.cxx.

Referenced by CompositePlotter::setOffset(), and DisplayController::setOffset().

void setOffset ( Axes::Type  axis,
double  offset 
)
virtualinherited

Sets the bin offset.

Sets the offset of bins by fraction offset of the bin width.

Not all projectors has a notation of a bin width. This interface is declared for those that do. The implementation in this base class is to does nothing.

Reimplemented in MapMatrixProjector, Profile2DProjector, Hist2DProjImp, and BinningProjector.

Definition at line 256 of file ProjectorBase.cxx.

void setParameters ( const std::vector< double > &  params)
void setPrincipleErrors ( std::vector< double >::const_iterator  first,
std::vector< double >::const_iterator  last 
)

Sets the principle errors.

Sets the principle errors of the parameters. This function may be used, for example, to set the errors found from a fitting procedure.

Definition at line 260 of file FunctionProjector.cxx.

References FunctionProjector::m_principleErrors, and num_util::size().

void setRange ( hippodraw::Axes::Type  axis,
bool  const_width 
)
virtual

Sets the range of the selected axis.

The base class implementation only sets the dirty flag. Derived classes may need to do more. The option bool parameter if true indicates a binning projector should hold the bin width parameter constant.

Reimplemented from ProjectorBase.

Definition at line 154 of file FunctionProjector.cxx.

References ProjectorBase::setDirty().

void update ( const Observable )
virtualinherited

Implements the Observer pattern.

The implementation in this abstract base class does nothing. Derived class may override this method if they are observers.

Implements Observer.

Reimplemented in BinningProjector, NTupleProjector, Profile2DProjector, DyHist1DProjector, DyHist2DProjector, and ProfileProjector.

Definition at line 402 of file ProjectorBase.cxx.

Range valueRange ( ) const
virtual
Todo:
Return value range of function.

Implements ProjectorBase.

Definition at line 170 of file FunctionProjector.cxx.

bool wantsScaleFactor ( const std::string &  axis) const
virtualinherited

Returns whether the projector wants scale factor.

Returns true if the projector wants to scale the axis, otherwise returns false. A projector supporting a histogram, for example, would want to scale the Y axis by the bin width in order to show entries per bin instead of density. This base class implementation always returns false.

Reimplemented in Hist2DProjImp, and Hist1DProjImp.

Definition at line 364 of file ProjectorBase.cxx.

Referenced by CompositePlotter::checkAxisScaling().

void willDelete ( const Observable )
virtualinherited

Notifies this Observer object that one of its Observable objects is about to be deleted.

Since most Observable objects are owned by its Observer, it is the Observer that issued the delete. Thus the default implementation here does nothing. Derived classes that observe objects owned by another should implement this method to remove the Observable from the list they are observing.

Reimplemented in ViewBase, FunctionRep, BinningProjector, NTupleProjector, Profile2DProjector, DyHist1DProjector, DyHist2DProjector, TextPlotter, CutPlotter, and ProfileProjector.

Definition at line 25 of file Observer.cxx.

Referenced by DataRep::~DataRep(), DataSource::~DataSource(), NTuple::~NTuple(), PlotterBase::~PlotterBase(), RootNTuple::~RootNTuple(), and RTuple::~RTuple().

Member Data Documentation

std::vector< std::vector < double > > m_covariance
mutableprivate

The error covariance matrix of the errors associated with the parameters of the function.

Definition at line 40 of file FunctionProjector.h.

Referenced by FunctionProjector::calcPrincipleErrors(), and FunctionProjector::covariance().

Fitter* m_fitter
private
FunctionBase* m_function
private
std::vector< std::string > m_pointreps
protectedinherited
std::vector< double > m_principleErrors
mutableprivate

The principle errors of the errors associated with the parameters of the function.

Definition at line 44 of file FunctionProjector.h.

Referenced by FunctionProjector::calcPrincipleErrors(), FunctionProjector::principleErrors(), FunctionProjector::saveParameters(), and FunctionProjector::setPrincipleErrors().

DataSource* m_proj_values
protectedinherited
std::vector< double > m_save_parms
private

A vector used to save parameters so that they can be restored.

Requests:
@@ Use a std::stack for this.

Definition at line 53 of file FunctionProjector.h.

Referenced by FunctionProjector::calcPrincipleErrors(), FunctionProjector::hasSavedParameters(), FunctionProjector::restoreParameters(), and FunctionProjector::saveParameters().

ProjectorBase* m_target
private

The ProjectorBase object containing the data points for the function and fitter.

Definition at line 61 of file FunctionProjector.h.

Referenced by FunctionProjector::fitFunction(), and FunctionProjector::initializeFunction().

AxisModelBase* m_x_axis
protectedinherited
AxisModelBase* m_y_axis
protectedinherited
AxisModelBase* m_z_axis
protectedinherited
std::string m_z_label
private

Dummy member so getZLabel member can return reference.

Definition at line 56 of file FunctionProjector.h.

Referenced by FunctionProjector::FunctionProjector(), and FunctionProjector::getZLabel().

std::vector< double > m_zval
mutableprotectedinherited

Sorted Z values in this projector.

Used to export FITS file.

Definition at line 119 of file ProjectorBase.h.

Referenced by ProjectorBase::getZAfterTransform(), and ProjectorBase::getZValues().

string s_x_label
staticprivate

An X label that might be used.

Definition at line 47 of file FunctionProjector.h.

Referenced by FunctionProjector::getXLabel().


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

Generated for HippoDraw Class Library by doxygen