Main Page | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

CutBinning.h

Go to the documentation of this file.
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 //  Class CutBinning:
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      * A BinningFun is used typically e.g. by a SetOfHistograms.
00122      * The client will normally book histograms for numbers 
00123      * 0...getNBins()-1.
00124      * In certain cases it may be useful to use e.g.  getBinTitle(i) 
00125      * with a number higher than getNBins()-1.
00126      * The maximal sensible number is given by getMaxBins().
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     // Data members
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 /* #ifndef __CUTBINNING_H */

Generated on Thu Oct 26 12:52:55 2006 for SFH by doxygen 1.3.2