00001 /* -*- mode: c++ -*- */ 00002 00014 #ifndef _EqualEntriesHist1DProjector_H_ 00015 #define _EqualEntriesHist1DProjector_H_ 00016 00017 #include "NTupleProjector.h" 00018 #include "axes/Range.h" 00019 00020 namespace hippodraw { 00021 00022 class Range; 00023 00034 class MDL_HIPPOPLOT_API EqualEntriesHist1DProjector : public NTupleProjector 00035 { 00036 00037 private: 00038 00041 std::string m_y_label; 00042 00045 unsigned int m_bin_num; 00046 00049 unsigned int m_start_num; 00050 00053 Range m_range; 00054 00056 void adjustNumberOfBins(); 00057 00058 protected: 00059 00061 EqualEntriesHist1DProjector ( const EqualEntriesHist1DProjector & projector ); 00062 00067 virtual void changedNTuple(); 00068 00070 virtual void addPointReps (); 00071 00072 public: 00073 00075 EqualEntriesHist1DProjector( ); 00076 00079 ProjectorBase * clone(); 00080 00085 virtual Range dataRangeOn ( hippodraw::Axes::Type axis ) const; 00086 virtual Range valueRange ( ) const; 00087 Range dataRangeOnValue ( ) const; 00088 00091 virtual double getPosOn ( hippodraw::Axes::Type axis ) const; 00092 00095 virtual const std::string & getYLabel ( bool density = false ) const; 00096 00098 virtual double getAverage ( hippodraw::Axes::Type axis ) const; 00099 00100 virtual bool isAxisBinned ( const std::string & axis ) const; 00101 00103 virtual int getUnderflow () const; 00104 00106 virtual int getOverflow () const; 00107 00108 virtual DataSource * createNTuple () const; 00109 00110 virtual void prepareValues (); 00111 00113 virtual const Range& setBinWidth ( Axes::Type axis, int parm, bool dragging ); 00115 virtual const Range& setBinWidth ( Axes::Type axis, double number ); 00116 00118 virtual double getBinWidth ( Axes::Type axis ) const; 00119 00120 protected: 00121 00122 virtual void fillProjectedValues ( DataSource * ntuple, 00123 bool in_range = false ) const; 00124 }; 00125 00126 } // namespace hippodraw 00127 00128 #endif // _EqualEntriesHist1DProjector_H_