The base classes are partially pure abstract in that they contain pure virtual member functions. However, they also contain some concrete implementation when it is deemed appropriate. That is where the majority of all derived classes will want to share a common implementation.
This overview of the library will present the overview each class hierarchy along with an overview of the object data structure. It is easier to understand the purpose of each class hierarchy in context of the object data structure.
The class hierarchies are
A view is an Observer of a PlotterBase object, the base class of Plotter hierarchy. When it receives the Observer::update message, it initiates drawing by calling back the PlotterBase object with a pointer to itself.
The base class for view is ViewBase. See the documentation for ViewBase for more details.
The axis scales are maintained by derived class of AxisModelBase. A plotter also owns a Transform which may transform the data values from one coordinate system to another. For example, if the Y axis is on a logarithmic scale, it is a Transform object that does the transformation.
A plotter is an Observer of its Data Representation objects and an Observable.
The base class for plotters is PlotterBase. See the documentation for PlotterBase for more details.
A transform is usually based on two coordinates, X and Y and the BinaryTransform class represents this abstraction. However, frequently the transform on the X and Y axis are independent of each other. The XYTransform class implements this kind of binary transform. It uses two objects that do the transform on each axis. These objects instances of classes derived from UnaryTransform.
Transforms in which the coordinates on the X and Y axis are not independent are also possible. For example, the HammerAito transform implements a form of binary transform that uses latitude and longitude coordinates create Hammer-Aitoff projection.
The base class for transforms is TransformBase. However, it is not used directly since the minimum transform requires two coordinates. See the documentation for TransformBase for more details.
DyHistogram data representation
The base class for data representation classes is DataRep. Most of the functionality of the data representation is implemented in this base class. Derived classes have constructor to instantiates a Projector and Projected Value appropriate for their representation.
A data representation is an Observer of its Projector and is an Observable.
See the documentation for DataRep for more details.
Some projectors delegate part of their tasks to other objects. For example, a BinningProjector uses a Binner. The projector provides the binner with the set of values then asks it to create the projected value objects.
Projectors provide access to the Projected Value objects rows in a NTuple object. Multiple clients access this NTuple object. For example, the Point representation objects use it for drawing. The objective function of the fitter access the same NTuple object. When HippoDraw is used as a hippo Python extension module., the NTuple objects is available to it as well.
Some projectors are Observer objects and all are Observable. For example, the NTupleProjector is an observer of an NTuple object. When it receives the Observer::update message, it marks itself as needing to re-create the projected values and sends an update message to its observers.
The base class for projector is ProjectorBase.
A projected value is represented as a tuple and implemented as a C++ standard library vector<double>
. The indexes into this vector is managed by a enumeration within a namespace. For 2D values, hippodraw::DataPoint2DTuple is used while for 3D values, hippodraw::DataPoint3DTuple is used. The reason for using this technique is to avoid creation of a new classes, which for technical reasons would have a virtual base class, whose sole purpose would be to convey the tuple data to the clients.
The base class for point representation is RepBase. See the documentation for RepBase for more details.
Binners do the accumulation into bins, but not the calculation of which bin needs to be accumulated. It delegates that task to a member of the Binner Axis class hierarchy.
The base class for Binners is the BinsBase class. See the documentation for BinsBase for more details.
The implemented classes take a single double
as a coordinate, but this could be generalized in the future. If one wants two doubles, and the two coordinates are independent, then two of these classes could be used, as is the case with classes derived from Bins2DBase. A coordinate representing a time or date might be considered for future implementation, but will certainly requires changes to other class hierarchies as well.
The base class for binner axis is BinnerAxis. See the documentation for BinnerAxis for more details.
The base class for functions is FunctionBase. See the documentation for FunctionBase for more details.