BinsBase.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00014 #ifndef _BinsBase_H_
00015 #define _BinsBase_H_
00016 
00017 #include "axes/AxesType.h"
00018 
00019 #include <list>
00020 #include <vector>
00021 
00022 namespace hippodraw {
00023 
00024 class BinnerAxis;
00025 class DataSource;
00026 class NTuple;
00027 class Range;
00028 
00033 class MDL_HIPPOPLOT_API BinsBase
00034 {
00035 
00036 private: 
00037 
00039   const std::string m_name;
00040 
00041 protected:
00042 
00046   double m_scale_factor;
00047 
00050   bool m_is_scaling;
00051 
00053   mutable bool m_values_dirty;
00054 
00058   bool m_empty;
00059 
00061   BinsBase ( const char * name );
00062 
00064   BinsBase ( const BinsBase & binner );
00065 
00067   virtual double getLow ( hippodraw::Axes::Type axis ) const = 0;
00068 
00070   virtual void setNumberOfBins ( hippodraw::Axes::Type axis, int number ) = 0;
00071 
00072  public:
00073 
00075   virtual ~BinsBase();
00076 
00078   virtual BinsBase * clone () const = 0;
00079 
00081   const std::string & name () const;
00082 
00084   virtual int getNumberOfAxes () const = 0;
00085 
00089   virtual int getNumberOfEntries () const = 0;
00090 
00092   virtual int getUnderflow () const = 0;
00093 
00095   virtual int getOverflow () const = 0;
00096 
00102   virtual void scaleNumberOfEntries ( double number );
00103 
00107   virtual void setEntriesScaling ( bool on );
00108 
00112   bool isEmpty () const;
00113 
00115   virtual const BinnerAxis * 
00116   getBinnerOn ( hippodraw::Axes::Type axis ) const = 0;
00117 
00119   virtual void setBinnerOn ( BinnerAxis *, hippodraw::Axes::Type axis ) = 0;
00120 
00122   virtual void reset() = 0;
00123 
00125   bool isDirty();
00126 
00128   void setDirty();
00129 
00135   virtual double scaleFactor () const;
00136 
00139   virtual bool hasEqualWidths () const = 0;
00140 
00143   virtual int numberOfBins ( hippodraw::Axes::Type axis ) const = 0;
00144 
00150   virtual double binWidth ( hippodraw::Axes::Type axis ) const = 0;
00151 
00153   virtual const Range & 
00154   setBinWidth ( hippodraw::Axes::Type axis, double value ) = 0;
00155 
00158   virtual double calcBinWidth ( hippodraw::Axes::Type axis,
00159                                 int parm,
00160                                 bool dragging ) const = 0;
00161 
00163   virtual double calcOffset ( const std::string &,
00164                               int parm,
00165                               bool dragging ) const = 0;
00166 
00168   virtual double getOffset ( hippodraw::Axes::Type axis ) const = 0;
00169 
00172   virtual void setOffset ( hippodraw::Axes::Type axis, double value ) = 0;
00173 
00178   virtual const Range & setRange ( hippodraw::Axes::Type axis, 
00179                                    const Range &, 
00180                                    bool hold_width = true ) = 0;
00181 
00182   virtual const Range & getRange ( hippodraw::Axes::Type axis ) = 0;
00183 
00188   virtual void accumulate ( double x, double w_or_y = 1.0, 
00189                             double z = 1.0, double w = 1.0 ) = 0;
00190 
00192   virtual double getZValue ( double x, double y ) const;
00193 
00197   virtual NTuple * prepareNTuple ( unsigned int rows ) const = 0;
00198 
00204   virtual NTuple * createNTuple () const = 0;
00205 
00211   virtual void fillDataSource ( DataSource * ntuple ) const = 0;
00212 
00218   virtual void setBinContents ( const DataSource * ntuple ) = 0;
00219 
00222   virtual void setMinEntries( int entries );
00223 
00226   virtual int getMinEntries ( );
00227 };
00228 
00229 } // namespace hippodraw
00230 
00231 #endif // _BinsBase_H_

Generated for HippoDraw Class Library by doxygen