BinsBase.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _BinsBase_H_
15 #define _BinsBase_H_
16 
17 #include "axes/AxesType.h"
18 
19 #include <list>
20 #include <vector>
21 
22 namespace hippodraw {
23 
24 class BinnerAxis;
25 class DataSource;
26 class NTuple;
27 class Range;
28 
34 {
35 
36 private:
37 
39  const std::string m_name;
40 
41 protected:
42 
47 
51 
53  mutable bool m_values_dirty;
54 
58  bool m_empty;
59 
61  BinsBase ( const char * name );
62 
64  BinsBase ( const BinsBase & binner );
65 
67  virtual double getLow ( hippodraw::Axes::Type axis ) const = 0;
68 
70  virtual void setNumberOfBins ( hippodraw::Axes::Type axis, int number ) = 0;
71 
72  public:
73 
75  virtual ~BinsBase();
76 
78  virtual BinsBase * clone () const = 0;
79 
81  const std::string & name () const;
82 
84  virtual int getNumberOfAxes () const = 0;
85 
89  virtual int getNumberOfEntries () const = 0;
90 
92  virtual int getUnderflow () const = 0;
93 
95  virtual int getOverflow () const = 0;
96 
102  virtual void scaleNumberOfEntries ( double number );
103 
107  virtual void setEntriesScaling ( bool on );
108 
112  bool isEmpty () const;
113 
115  virtual const BinnerAxis *
116  getBinnerOn ( hippodraw::Axes::Type axis ) const = 0;
117 
119  virtual void setBinnerOn ( BinnerAxis *, hippodraw::Axes::Type axis ) = 0;
120 
122  virtual void reset() = 0;
123 
125  bool isDirty();
126 
128  void setDirty();
129 
135  virtual double scaleFactor () const;
136 
139  virtual bool hasEqualWidths () const = 0;
140 
143  virtual int numberOfBins ( hippodraw::Axes::Type axis ) const = 0;
144 
150  virtual double binWidth ( hippodraw::Axes::Type axis ) const = 0;
151 
153  virtual const Range &
154  setBinWidth ( hippodraw::Axes::Type axis, double value ) = 0;
155 
158  virtual double calcBinWidth ( hippodraw::Axes::Type axis,
159  int parm,
160  bool dragging ) const = 0;
161 
163  virtual double calcOffset ( const std::string &,
164  int parm,
165  bool dragging ) const = 0;
166 
168  virtual double getOffset ( hippodraw::Axes::Type axis ) const = 0;
169 
172  virtual void setOffset ( hippodraw::Axes::Type axis, double value ) = 0;
173 
178  virtual const Range & setRange ( hippodraw::Axes::Type axis,
179  const Range &,
180  bool hold_width = true ) = 0;
181 
182  virtual const Range & getRange ( hippodraw::Axes::Type axis ) = 0;
183 
188  virtual void accumulate ( double x, double w_or_y = 1.0,
189  double z = 1.0, double w = 1.0 ) = 0;
190 
192  virtual double getZValue ( double x, double y ) const;
193 
197  virtual NTuple * prepareNTuple ( unsigned int rows ) const = 0;
198 
204  virtual NTuple * createNTuple () const = 0;
205 
211  virtual void fillDataSource ( DataSource * ntuple ) const = 0;
212 
218  virtual void setBinContents ( const DataSource * ntuple ) = 0;
219 
222  virtual void setMinEntries( int entries );
223 
226  virtual int getMinEntries ( );
227 };
228 
229 } // namespace hippodraw
230 
231 #endif // _BinsBase_H_
#define MDL_HIPPOPLOT_API
Definition: libhippo.h:36
numeric::array clone(numeric::array arr)
Definition: num_util.cpp:412
bool m_values_dirty
A flag to indicate that the objects in m_values are not correct.
Definition: BinsBase.h:53
The base class for the BinnerAxis hierarchy.
Definition: BinnerAxis.h:35
The namespace for axes.
A DataSource class implemented with std::vector&lt;double&gt; to store the column data. ...
Definition: NTuple.h:33
double m_scale_factor
The scale factor.
Definition: BinsBase.h:46
Expresses a range of values.
Definition: Range.h:33
bool m_is_scaling
A flag which is set true to enable scaling the output.
Definition: BinsBase.h:50
const std::string m_name
The name of the object in the Factory.
Definition: BinsBase.h:39
bool m_empty
A flag set to true, when no accumulation has yet occurred, otherwise is set false.
Definition: BinsBase.h:58
Type
Axes constants.
Definition: AxesType.h:31
The base class for the binner hierarchy.
Definition: BinsBase.h:33
Base class for DataSource.
Definition: DataSource.h:55

Generated for HippoDraw Class Library by doxygen