ProjectorBase.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _ProjectorBase_H_
15 #define _ProjectorBase_H_
16 
17 #include "axes/AxesType.h"
18 #include "pattern/Observable.h"
19 #include "pattern/Observer.h"
20 
21 #ifdef _MSC_VER
22 #include <msdevstudio/MSconfig.h>
23 #endif
24 
25 #include <vector>
26 
27 namespace hippodraw {
28 
29 class AxisModelBase;
30 class BinsBase;
31 class DataSource;
32 class NTuple;
33 class Range;
34 class TupleCut;
35 class TransformBase;
36 
57  : public Observable, public Observer
58 {
59 
60 private:
61 
65  bool m_isDirty;
66 
67 protected:
68 
70  ProjectorBase ( const ProjectorBase & projector );
71 
81 
89 
93 
97 
101  std::string m_z_label;
102 
104  std::vector < std::string > m_pointreps;
105 
111 
115  virtual void addPointReps () = 0;
116 
119  mutable std::vector < double > m_zval;
120 
121 
122 public:
123 
125  ProjectorBase();
126 
128  virtual ~ProjectorBase();
129 
132  virtual ProjectorBase * clone() = 0;
133 
140  virtual void setAxisBinding ( const std::string & axis,
141  const std::string & label );
142 
146  virtual void matrixTranspose ( bool yes );
147 
154  virtual
155  void setAxisBindings ( const std::vector < std::string > & bindings );
156 
163  virtual const std::vector < std::string > & getAxisBindings () const;
164 
171  virtual bool isEmpty () const = 0;
172 
181  virtual void prepareValues ();
182 
184  virtual Range dataRangeOn ( Axes::Type ) const = 0;
185 
190  virtual Range preferredRange ( Axes::Type ) const;
191 
195  bool isDirty () const;
196 
198  virtual void setDirty ( bool value = true );
199 
203  virtual int getNumberOfBins ( Axes::Type ) const;
204 
206  virtual void setAxisModel ( Axes::Type axis, AxisModelBase * );
207 
209  virtual AxisModelBase * getAxisModel ( Axes::Type axis )const;
210 
214  virtual bool isAxisBinned ( const std::string & axis ) const;
215 
220  virtual bool isValueBinned () const;
221 
223  virtual const std::string & getTitle() const = 0;
224 
231  virtual Range valueRange () const = 0;
232 
238  virtual const Range & getRange ( Axes::Type ) const;
239 
245  virtual void setRange ( Axes::Type axis,
246  bool const_width = true );
247 
251  virtual double getPosOn ( Axes::Type ) const = 0;
252 
260  virtual void setNumberOfBins ( Axes::Type axis,
261  unsigned int number );
262 
270  virtual const Range & setBinWidth ( Axes::Type axis,
271  double width );
272 
282  virtual const Range & setBinWidth ( Axes::Type axis,
283  int parm,
284  bool dragging );
285 
289  virtual void setOffset ( const std::string & axis,
290  int parm,
291  bool dragging );
292 
300  virtual void setOffset ( Axes::Type axis, double offset );
301 
302 
306  virtual void reset ();
307 
308 
316  virtual double getOffset ( Axes::Type axis ) const;
317 
324  virtual double getBinWidth ( Axes::Type axis ) const;
325 
328  virtual const std::string & getXLabel() const = 0;
329 
336  virtual const std::string & getYLabel ( bool flag = false ) const = 0;
337 
340  virtual const std::string & getZLabel() const;
341 
344  virtual int indexOf ( const std::string & label ) const;
345 
346 
351  virtual int getNumberOfEntries () const = 0;
352 
354  virtual int getUnderflow () const = 0;
355 
357  virtual int getOverflow () const = 0;
358 
359 
363  virtual double getAverage(Axes::Type axis) const;
364 
368  virtual double getRMS ( Axes::Type axis );
369 
371  virtual double getZValue ( double x, double y ) const;
372 
377  virtual void addValues ( const std::vector < double > & v );
378 
380  const std::vector < std::string > & getPointReps() const;
381 
387  virtual DataSource * createNTuple () const = 0;
388 
391  const DataSource * getProjectedValues () const;
392 
393  virtual const DataSource * createOldStyleNTuple () const;
394 
398  virtual NTuple * getNTupleAfterCuts () const;
399 
403  virtual void fillColumnAfterCuts(const std::string & column,
404  std::vector<double> & columnData) const;
405 
410  virtual
411  NTuple * createNTupleWith ( const std::vector< TupleCut > & cut_list ) const;
412 
420  virtual bool wantsScaleFactor ( const std::string & axis ) const;
421 
427  virtual void normalizeTo ( const ProjectorBase * target );
428 
434  virtual void normalizeTo ( double norm );
435 
439  virtual void setNormalizing ( bool on );
440 
445  virtual void update ( const Observable * );
446 
452  virtual void checkScaling ();
453 
454 
457  const std::vector <double> & getZValues();
458 
461  const std::vector <unsigned int> & getShape();
462 
465  const std::vector <double> & getZAfterTransform(TransformBase * transform);
466 
472  virtual bool hasDataSourceBindings () const;
473 
476  virtual void setMinEntries( int entries );
477 
480  virtual int getMinEntries ( );
481 
488  virtual bool isImageConvertable () const;
489 
490 };
491 
492 } // namespace hippodraw
493 
494 #endif // _ProjectorBase_H_

Generated for HippoDraw Class Library by doxygen