00001
00017 #ifndef __CUTBINNING_H
00018 #define __CUTBINNING_H
00019
00020 #include "jbltools/sfh/BinningFun.h"
00021
00022 #include<vector>
00023
00024 class BaseCut;
00025 class FillIterator;
00026
00027
00029
00046 class CutBinning: public BinningFun {
00047 public:
00049
00052 CutBinning (int nbins,
00053 const BaseCut *cuts[],
00054 const char *name = 0
00055 );
00057
00060 CutBinning (int nbins,
00061 BaseCut *cuts[],
00062 const char *name = 0
00063 );
00065
00068 CutBinning (int nbins,
00069 const BaseCut *cuts[],
00070 const char *titles[],
00071 const char *name = 0
00072 );
00074
00077 CutBinning (int nbins,
00078 BaseCut *cuts[],
00079 const char *titles[],
00080 const char *name = 0
00081 );
00082
00084 virtual int operator() () const { return -1; }
00085
00087 virtual bool operator() (int i
00088 ) const;
00089
00091 virtual bool isExclusive() const {
00092 return false;
00093 }
00094
00096
00103 virtual const char *getBinName(int i
00104 ) const;
00106
00113 virtual const char *getBinTitle(int i
00114 ) const;
00116 virtual const FillIterator *getIterator() const { return theFillIterator; }
00117
00118
00120
00121
00122
00123
00124
00125
00126
00127
00128 virtual int getMaxBins() const { return getNBins(); }
00129
00131 virtual bool hasBinLabels() const;
00132
00134 virtual const char *getBinLabel(int i
00135 ) const;
00136 protected:
00138 virtual ~CutBinning() {}
00139
00141
00146 void genDefinition();
00147
00149 void checkIterators();
00150
00151
00152 private:
00153
00154 std::vector<const BaseCut *> theCuts;
00155 std::vector<std::string> binNames;
00156 std::vector<std::string> binTitles;
00157 const FillIterator *theFillIterator;
00158 };
00159
00160
00161 #endif