#include <Map1Projector.h>
Inheritance diagram for Map1Projector:


The X axis is generated by the row number. A NTuple is created with the projected values for presentation to clients.
Sanket B. Malde <sanket@stanford.edu>
Oded Wurman <owurman@stanford.edu>
Definition at line 31 of file Map1Projector.h.
Public Types | |
| typedef void(hippodraw::Observer::* | Action )(const Observable *) |
| The member function of the Observer that is called. | |
| typedef std::list< hippodraw::Observer * > | ObserverList_t |
| The type of STL container to maintain list of Observer objects. | |
Public Member Functions | |
| bool | acceptRow (unsigned int i) const |
For row i of the column, returns true if all the cuts accept the row. | |
| virtual void | addCut (const TupleCut *cut) |
| Adds the cut to the list of cuts. | |
| void | addObserver (hippodraw::Observer *) |
| Adds an Observer to the Observer list. | |
| virtual void | addValues (const std::vector< double > &v) |
| Add values to the projection. | |
| virtual const std::vector< std::string > & | bindingOptions () const |
| Returns a vector of strings describing the binding options. | |
| ProjectorBase * | clone () |
| The clone function returns an object of its own kind which is a copy of this object at this moment. | |
| virtual DataSource * | createNTuple () const |
| Creates an NTuple representation of the projected values. | |
| virtual const DataSource * | createOldStyleNTuple () const |
| virtual Range | dataRangeOn (hippodraw::Axes::Type) const |
| Returns the range of the data on the specified axis. | |
| virtual double | getAverage (hippodraw::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 current axis bindings. | |
| virtual AxisModelBase * | getAxisModel (hippodraw::Axes::Type axis) const |
| Get the AxisModel for axis axis. | |
| virtual double | getBinWidth (hippodraw::Axes::Type axis) const |
| Returns the bin width of the axis. | |
| const std::vector< const TupleCut * > & | getCutList () const |
| Returns the list of TupleCut objects used by this projector. | |
| virtual DataSource * | getNTuple () |
| Returns the DataSource used by the projector. | |
| virtual const DataSource * | getNTuple () const |
| Returns the DataSoruce used by the projector. | |
| virtual NTuple * | getNTupleAfterCuts () const |
| Template for projectors that can return subsets of the NTuple used by the DataRep. | |
| virtual const std::string & | getNTupleName () const |
| Returns the name of the NTuple used by this projector. | |
| virtual int | getNumberOfBins (hippodraw::Axes::Type) const |
| Returns the number of bins. | |
| int | getNumberOfEntries () const |
| Returns the number of entries in to the projected values list. | |
| const ObserverList_t & | getObservers () const |
| Returns the list of observers. | |
| virtual double | getOffset (hippodraw::Axes::Type axis) const |
| Returns the offset of the axis. | |
| const std::vector< std::string > & | getPointReps () const |
| Return the vector of Point Reps. | |
| virtual double | getPosOn (hippodraw::Axes::Type axis) const |
| Returns the minimum positive value of the data on a specified axis. | |
| const DataSource * | getProjectedValues () const |
| Returns ntuple representation of projected values. | |
| virtual const Range & | getRange (hippodraw::Axes::Type) const |
| Returns the Range along the specified axis. | |
| virtual double | getRMS (hippodraw::Axes::Type axis) |
| Returns the RMS. | |
| virtual const std::string & | getTitle () const |
| Finds the title of the plot. | |
| const std::string & | getXLabel () const |
| Returns the label (title) of the x axis. | |
| const std::string & | getYLabel (bool density=false) const |
| Returns the label for the Y axis. | |
| virtual const std::string & | getZLabel () const |
| Finds the Z axis label of the plot. | |
| virtual double | getZValue (double x, double y) const |
| Get the z value at the specified point (x,y). | |
| int | indexOf (const std::string &label) const |
| Returns the index of the label. | |
| unsigned int | indexOfBindingOption (const std::string &axis) const |
| Returns an index to the binding option. | |
| virtual bool | inRange (int row) const |
| Checks if the entries in a given row are within the range of the axis model. | |
| virtual bool | isAxisBinned (const std::string &axis) const |
Returns true if specified axis is binned. | |
| bool | isDataValid () const |
Returns true if all the data in the bound DataSource is valid. | |
| bool | isDirty () const |
Returns true if the projector has been marked dirty. | |
| virtual bool | isEmpty () const |
Returns true if the data source used by this projector is empty. | |
| virtual bool | isValueBinned () const |
Returns true if the projected values are the result of binning. | |
| Map1Projector () | |
| This default constructor binds to the first two columns. | |
| virtual void | matrixTranspose (bool yes) |
| Transposes the X and Y axis. | |
| virtual void | normalizeTo (double norm) |
| Sets a scale factor on the output so that the number of entries appears to be number. | |
| virtual void | normalizeTo (const ProjectorBase *target) |
| Sets the target of normalization. | |
| virtual void | notifyObservers () const |
| Notifies Observer objects of a change. | |
| virtual Range | preferredRange (hippodraw::Axes::Type) const |
| Returns the preferred Range. | |
| virtual void | prepareValues () |
| Informs the projector to prepare its projected values for plotting. | |
| virtual void | removeCut (const TupleCut *cut) |
| Removes the cut from the cut list. | |
| void | removeObserver (hippodraw::Observer *) |
| Removes an Observer from the Observer list. | |
| virtual void | reset () |
| Resets the bins. | |
| virtual void | setAxisBinding (const std::string &axis, const std::string &label) |
| Sets the axis binding. | |
| virtual void | setAxisBindings (const std::vector< std::string > &labels) |
| Sets the axis bindings, Sets, in the order of the binding options, the binding to the NTuple by labels contained in labels. | |
| virtual void | setAxisModel (hippodraw::Axes::Type axis, AxisModelBase *) |
| Sets the AxisModel for axis axis. | |
| virtual void | setBinWidth (const std::string &axis, int parm, bool dragging) |
| Sets the bin width. | |
| virtual void | setBinWidth (hippodraw::Axes::Type axis, double width) |
| Sets the bin width. | |
| virtual void | setDirty (bool value=true) |
| Sets the dirty flag to value. | |
| virtual void | setNormalizing (bool on) |
Sets the scaling number of entries on if on is true, otherwise turns if off. | |
| virtual void | setNTuple (const DataSource *source) |
| Changes the DataSource used for the projections to source. | |
| virtual void | setNumberOfBins (hippodraw::Axes::Type axis, unsigned int number) |
| Sets the number of bins. | |
| virtual void | setOffset (hippodraw::Axes::Type axis, double offset) |
| Sets the bin offset. | |
| virtual void | setOffset (const std::string &axis, int parm, bool dragging) |
| Sets the bin offset. | |
| virtual void | setRange (hippodraw::Axes::Type axis, bool const_width=true) |
| Sets the range of the selected axis. | |
| virtual void | setXErrorOption (bool enable) |
| Sets whether the X error options are to be enabled or not. | |
| virtual void | setYErrorOption (bool enable) |
| Sets whether the Y error options are to be enabled or not. | |
| virtual void | update (const Observable *) |
| Responds to update message from the data source. | |
| virtual Range | valueRange () const |
| Finds the range of the projected values. | |
| virtual bool | wantsScaleFactor (const std::string &axis) const |
| Returns whether the projector wants scale factor. | |
| virtual void | willDelete (const Observable *) |
| Responds to willDelete message from the observed data source. | |
| ~Map1Projector () | |
| The destructor. | |
Protected Member Functions | |
| virtual void | addPointReps () |
| Function to add the acceptable point reps. | |
| virtual void | changedNTuple () |
| This function is called when the NTuple has been changed to a new one. | |
| Range | dataRange (int column) const |
| Returns the range of data on the specified column. | |
| Range | dataRangeWithError (int data, int error) const |
| Returns a range considering both data and error. | |
| virtual void | fillDataSource (DataSource *ntuple, bool in_range=false) const |
| Fills the DataSource source with the projected values. | |
| virtual void | fillProjectedValues (DataSource *ntuple, bool in_range=false) const |
| Fills the NTuple ntuple with the projected values. | |
| double | getPos (int column) const |
| Returns the minimum positive value on the specified column. | |
| double | getPosWithError (int data, int error) const |
| Returns the minimum positive values considering both data and error. | |
| Map1Projector (const Map1Projector &projector) | |
| The copy constructor. | |
| void | notifyObservers (Action action) const |
| An internal method to iterate over all observers and to send the message action. | |
| void | setAxisBinding (int axis, const std::string &label) |
| Sets the axis binding for axis binding option to the column with label label. | |
Protected Attributes | |
| std::vector< std::string > | m_binding_options |
| The list of binding options for the Projector. | |
| std::vector< std::string > | m_bindings |
| The list of current bindings. | |
| std::vector< unsigned int > | m_columns |
| A vector containing indexes to the columns of the NTuple. | |
| std::vector< const TupleCut * > | m_cut_list |
| A list of cuts that filter the projection. | |
| unsigned int | m_min_bindings |
| The minimum number of columns that must be bound. | |
| const DataSource * | m_ntuple |
| The pointer to the data source being projected. | |
| std::vector< std::string > | m_pointreps |
| Vector of acceptable PointReps. | |
| DataSource * | m_proj_values |
| The NTuple representing the result of the projection. | |
| const ProjectorBase * | m_target |
| The target projector. | |
| AxisModelBase * | m_x_axis |
The AxisModel along the X axis. | |
| AxisModelBase * | m_y_axis |
The AxisModel along the Y axis. | |
| AxisModelBase * | m_z_axis |
The AxisModel along the Z axis. | |
| std::string | m_z_label |
| Dummy member so that getZLabel can return a reference. | |
Private Attributes | |
| std::string | m_x_label |
| The label for the generated x axis. | |
| std::string | m_y_option |
| The label for the Y error binding option. | |
|
|
The member function of the Observer that is called.
Definition at line 83 of file Observable.h. |
|
|
The type of STL container to maintain list of Observer objects.
Definition at line 46 of file Observable.h. |
|
|
The copy constructor.
Definition at line 60 of file Map1Projector.cxx. References addPointReps(). |
|
|
This default constructor binds to the first two columns.
Definition at line 50 of file Map1Projector.cxx. References addPointReps(), NTupleProjector::m_binding_options, and NTupleProjector::m_min_bindings. Referenced by clone(). |
|
|
The destructor.
Definition at line 67 of file Map1Projector.cxx. |
|
|
For row i of the column, returns
Definition at line 159 of file NTupleProjector.cxx. References NTupleProjector::m_cut_list, NTupleProjector::m_ntuple, and num_util::size(). Referenced by ProfileProjector::execute(), Profile2DProjector::execute(), DyHist2DProjector::execute(), DyHist1DProjector::execute(), MapMatrixProjector::fillDataSource(), Map3Projector::fillDataSource(), Map2Projector::fillDataSource(), fillDataSource(), StripChartProjector::fillProjectedValues(), MapMatrixProjector::fillProjectedValues(), Map3Projector::fillProjectedValues(), Map2Projector::fillProjectedValues(), fillProjectedValues(), NTupleProjector::getAverage(), DyHist1DProjector::getAverage(), NTupleProjector::getNTupleAfterCuts(), and NTupleProjector::getNumberOfEntries(). |
|
|
Adds the cut to the list of cuts.
Definition at line 348 of file NTupleProjector.cxx. References NTupleProjector::m_cut_list. Referenced by NTupleProjectorXML::addCuts(), and CutController::linkCutAndRep(). |
|
|
Adds an Observer to the Observer list.
Definition at line 49 of file Observable.cxx. References Observable::m_list. Referenced by CutPlotter::addCutTarget(), XyPlotter::addDataRep(), FunctionRep::FunctionRep(), BinningProjector::normalizeTo(), DataRepController::setAxisBindings(), DisplayController::setNTuple(), CutPlotter::setNTuple(), and TextPlotter::setParentDataRep(). |
|
|
Function to add the acceptable point reps.
Implements ProjectorBase. Definition at line 205 of file Map1Projector.cxx. References ProjectorBase::m_pointreps. Referenced by Map1Projector(). |
|
|
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 StHist1DProjector, and StHist2DProjector. Definition at line 312 of file ProjectorBase.cxx. |
|
|
Returns a vector of strings describing the binding options.
Definition at line 97 of file NTupleProjector.cxx. References NTupleProjector::m_binding_options. Referenced by DataRepController::bindingOptions(). |
|
|
This function is called when the NTuple has been changed to a new one. The X and Y axis indexes are checked for validity and reset to the last column if invalid. The X and Y error indexes are checked for validity and reset to negative if they are invalid. Implements NTupleProjector. Definition at line 112 of file Map1Projector.cxx. References DataSource::columns(), NTupleProjector::m_columns, and NTupleProjector::m_ntuple. |
|
|
The clone function returns an object of its own kind which is a copy of this object at this moment.
Implements ProjectorBase. Definition at line 71 of file Map1Projector.cxx. References Map1Projector(). |
|
|
Creates an NTuple representation of the projected values. Derived classes should create a representation appropriate for their projection. They should at least include the coordinates, the width of the coordinates, the value and the error on the value. Implements ProjectorBase. Definition at line 212 of file Map1Projector.cxx. References hippodraw::DataPoint2DTuple::ERROR, fillProjectedValues(), NTuple::setLabels(), and hippodraw::DataPoint2DTuple::WIDTH. Referenced by prepareValues(). |
|
|
Reimplemented in BinningProjector. Definition at line 345 of file ProjectorBase.cxx. References ProjectorBase::getProjectedValues(), and ProjectorBase::prepareValues(). |
|
|
Returns the range of data on the specified column. The range may need to be calculated. Definition at line 288 of file NTupleProjector.cxx. References DataSource::columns(), NTupleProjector::m_is_valid, and NTupleProjector::m_ntuple. Referenced by ProfileProjector::dataRangeOn(), Profile2DProjector::dataRangeOn(), MapMatrixProjector::dataRangeOn(), Map3Projector::dataRangeOn(), Map2Projector::dataRangeOn(), dataRangeOn(), DyHist2DProjector::dataRangeOn(), DyHist1DProjector::dataRangeOn(), and Map3Projector::valueRange(). |
|
|
Returns the range of the data on the specified axis. The range may need to be calculated. Implements NTupleProjector. Definition at line 126 of file Map1Projector.cxx. References NTupleProjector::dataRange(), NTupleProjector::dataRangeWithError(), getPosOn(), NTupleProjector::m_columns, NTupleProjector::m_ntuple, DataSource::rows(), hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by valueRange(). |
|
||||||||||||
|
Returns a range considering both data and error.
Definition at line 263 of file NTupleProjector.cxx. References DataSource::columns(), NTupleProjector::getPosWithError(), NTupleProjector::m_ntuple, std::max(), std::min(), and num_util::size(). Referenced by Map2Projector::dataRangeOn(), and dataRangeOn(). |
|
||||||||||||
|
Fills the DataSource source with the projected values.
Fills the DataSource source with the results of projecting the data source to projected values. Derived classes must implement this method. Clients, such as plotters or fitters, can then use getProjectedValues method to access the projected value data. The default behavior is to fill the DataSource with all values that are accepted by the TupleCut objects, if any. If in_range is equal to Implements ProjectorBase. Definition at line 258 of file Map1Projector.cxx. References NTupleProjector::acceptRow(), inRange(), NTupleProjector::m_columns, NTupleProjector::m_ntuple, hippodraw::DataPoint2DTuple::SIZE, num_util::size(), hippodraw::Axes::X, hippodraw::DataPoint2DTuple::XERR, hippodraw::Axes::Y, and hippodraw::DataPoint2DTuple::YERR. |
|
||||||||||||
|
Fills the NTuple ntuple with the projected values.
Fills the NTuple !ntuple with the results of projecting the data source to projected values. Derived classes must implement this method. Clients, such as plotters or fitters, can then use getProjectedValues method to access the projected value data. The default behavior is to fill the NTuple with all values that are accepted by the TupleCut objects, if any. If in_range is equal to Implements ProjectorBase. Definition at line 232 of file Map1Projector.cxx. References NTupleProjector::acceptRow(), inRange(), NTupleProjector::m_columns, NTupleProjector::m_ntuple, hippodraw::DataPoint2DTuple::SIZE, num_util::size(), hippodraw::Axes::X, hippodraw::DataPoint2DTuple::XERR, hippodraw::Axes::Y, and hippodraw::DataPoint2DTuple::YERR. Referenced by createNTuple(), and prepareValues(). |
|
|
Get the Average of all projected values on the specified axis.
Reimplemented from NTupleProjector. Definition at line 174 of file Map1Projector.cxx. References std::accumulate(), num_util::data(), ProjectorBase::getProjectedValues(), prepareValues(), num_util::size(), hippodraw::Axes::X, and hippodraw::Axes::Y. |
|
|
Returns the current axis bindings. Returns the label for each column to which the projector is bound. If column is not bound, returns the string "nil" for that column. Reimplemented from ProjectorBase. Definition at line 124 of file NTupleProjector.cxx. References DataSource::getLabelAt(), NTupleProjector::m_bindings, NTupleProjector::m_columns, NTupleProjector::m_ntuple, and num_util::size(). Referenced by DisplayController::axisBindings(), and NTupleProjectorXML::createElement(). |
|
|
Get the AxisModel for axis axis.
Definition at line 204 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 CompositePlotter::processReturnValue(), and ContourPointRep::setContourValues(). |
|
|
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 BinningProjector, and MapMatrixProjector. Definition at line 299 of file ProjectorBase.cxx. Referenced by PyDataRep::getBinWidth(), and CompositePlotter::getBinWidth(). |
|
|
Returns the list of TupleCut objects used by this projector.
Definition at line 362 of file NTupleProjector.cxx. References NTupleProjector::m_cut_list. Referenced by CutController::connectDataRep(), and NTupleProjectorXML::createChildren(). |
|
|
Returns the DataSource used by the projector.
Definition at line 420 of file NTupleProjector.cxx. References NTupleProjector::m_ntuple. |
|
|
Returns the DataSoruce used by the projector.
Definition at line 412 of file NTupleProjector.cxx. References NTupleProjector::m_ntuple. Referenced by NTupleProjectorXML::createElement(), NTupleProjector::getAverage(), DyHist1DProjector::getAverage(), DisplayController::getDataSourceLabels(), and DisplayController::getNTuple(). |
|
|
Template for projectors that can return subsets of the NTuple used by the DataRep.
Reimplemented from ProjectorBase. Definition at line 492 of file NTupleProjector.cxx. References NTupleProjector::acceptRow(), DataSource::columns(), DataSource::getLabels(), NTupleProjector::m_ntuple, DataSource::rows(), NTuple::setLabels(), and num_util::size(). |
|
|
Returns the name of the NTuple used by this projector.
Definition at line 425 of file NTupleProjector.cxx. References DataSource::getName(), and NTupleProjector::m_ntuple. Referenced by DisplayController::getDataSourceName(). |
|
|
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 BinningProjector, and MapMatrixProjector. Definition at line 116 of file ProjectorBase.cxx. Referenced by BinningProjector::getNumberOfBins(). |
|
|
Returns the number of entries in to the projected values list.
Implements ProjectorBase. Definition at line 369 of file NTupleProjector.cxx. References NTupleProjector::acceptRow(), NTupleProjector::inRange(), NTupleProjector::m_ntuple, DataSource::rows(), and num_util::size(). |
|
|
Returns the list of observers.
Definition at line 57 of file Observable.cxx. References Observable::m_list. |
|
|
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 BinningProjector, and MapMatrixProjector. Definition at line 258 of file ProjectorBase.cxx. Referenced by CompositePlotter::getOffset(). |
|
|
Return the vector of Point Reps.
Definition at line 317 of file ProjectorBase.cxx. References ProjectorBase::m_pointreps. |
|
|
Returns the minimum positive value on the specified column.
Definition at line 330 of file NTupleProjector.cxx. References DataSource::columns(), NTupleProjector::m_ntuple, and num_util::size(). Referenced by ProfileProjector::getPosOn(), Profile2DProjector::getPosOn(), MapMatrixProjector::getPosOn(), Map3Projector::getPosOn(), Map2Projector::getPosOn(), getPosOn(), DyHist2DProjector::getPosOn(), and DyHist1DProjector::getPosOn(). |
|
|
Returns the minimum positive value of the data on a specified axis.
Implements ProjectorBase. Definition at line 144 of file Map1Projector.cxx. References NTupleProjector::getPos(), NTupleProjector::getPosWithError(), NTupleProjector::m_columns, NTupleProjector::m_ntuple, hippodraw::Axes::X, and hippodraw::Axes::Y. Referenced by dataRangeOn(). |
|
||||||||||||
|
Returns the minimum positive values considering both data and error.
Definition at line 301 of file NTupleProjector.cxx. References DataSource::columns(), NTupleProjector::m_ntuple, std::min(), and num_util::size(). Referenced by NTupleProjector::dataRangeWithError(), MapMatrixProjector::getPosOn(), Map2Projector::getPosOn(), and getPosOn(). |
|
|
Returns ntuple representation of projected values.
Definition at line 338 of file ProjectorBase.cxx. References ProjectorBase::m_proj_values. Referenced by BinningProjectorXML::createChildren(), ProjectorBase::createOldStyleNTuple(), StHist2DProjector::getAverage(), StHist1DProjector::getAverage(), MapMatrixProjector::getAverage(), getAverage(), ProjectorBase::getRMS(), and FunctionProjector::initializeFunction(). |
|
|
Returns the Range along the specified axis. The behavior implemented here is to return the range of the AxisModelBase owned by the PlotterBase. However, derived classes may override this function, such as projectors that have binners, if this behavior is incorrect. Definition at line 145 of file ProjectorBase.cxx. References AxisModelBase::getRange(), ProjectorBase::m_x_axis, ProjectorBase::m_y_axis, ProjectorBase::m_z_axis, hippodraw::Axes::X, hippodraw::Axes::Y, and hippodraw::Axes::Z. Referenced by LineProjector::dataRangeOn(), LineProjector::fillDataSource(), LineProjector::fillProjectedValues(), NTupleProjector::getAverage(), DyHist1DProjector::getAverage(), LineProjector::getPosOn(), and LineProjector::valueRange(). |
|
|
Returns the RMS. Returns the root mean square of the data points along the axis axis. Definition at line 279 of file ProjectorBase.cxx. References ProjectorBase::getProjectedValues(), ProjectorHelper::stdCoord(), and hippodraw::Axes::X. |
|
|
Finds the title of the plot. This implementation gets the title from the NTuple. Implements ProjectorBase. Definition at line 248 of file NTupleProjector.cxx. References NTupleProjector::m_ntuple, and DataSource::title(). |
|
|
Returns the label (title) of the x axis. Gets it from the NTuple object. Reimplemented from NTupleProjector. Definition at line 159 of file Map1Projector.cxx. References m_x_label. |
|
|
Returns the label for the Y axis. Returns the label for the Y axis which is always the label of the bound NTuple column. The argument density is ignored. Reimplemented from NTupleProjector. Definition at line 164 of file Map1Projector.cxx. References DataSource::getLabelAt(), NTupleProjector::m_columns, and NTupleProjector::m_ntuple. |
|
|
Finds the Z axis label of the plot. A plotter may ask the projector for the default label. Reimplemented in FunctionProjector, Hist2DProjImp, Map3Projector, MapMatrixProjector, and Profile2DProjector. Definition at line 292 of file ProjectorBase.cxx. References ProjectorBase::m_z_label. Referenced by NTupleProjector::getAverage(), and CompositePlotter::getLabel(). |
|
||||||||||||
|
Get the z value at the specified point (x,y).
Reimplemented in BinningProjector, Map3Projector, and MapMatrixProjector. Definition at line 305 of file ProjectorBase.cxx. Referenced by CompositePlotter::getZValue(). |
|