MINT2
UniformBinning.h
Go to the documentation of this file.
1 
17 #ifndef UNIFORMBINNING_HH
18 #define UNIFORMBINNING_HH
19 
20 // HyperPlot includes
21 #include "Mint/MessageService.h"
22 #include "Mint/HyperPoint.h"
23 #include "Mint/HyperPointSet.h"
24 #include "Mint/HyperCuboid.h"
25 #include "Mint/HyperVolume.h"
26 #include "Mint/RootPlotter1D.h"
27 #include "Mint/RootPlotter2D.h"
28 #include "Mint/HyperName.h"
29 #include "Mint/BinningBase.h"
30 #include "Mint/LoadingBar.h"
31 #include "Mint/CachedVar.h"
32 
33 
34 // Root includes
35 #include "TRandom3.h"
36 #include "TH1D.h"
37 #include "TH2D.h"
38 #include "TMath.h"
39 
40 // std includes
41 #include <algorithm>
42 #include <sstream>
43 
44 class UniformBinning : public BinningBase {
45 
46  private:
47 
49  std::vector<int> _nLocalBins;
50 
51  public:
52 
53  UniformBinning(HyperCuboid limits, int nLocalBins);
54  UniformBinning(HyperCuboid limits, std::vector<int> nLocalBins);
55 
56  virtual ~UniformBinning();
57 
58  int getNumLocalBins(int dimension) const;
59 
60  int getGlobalBinNumber( std::vector<int> localBinNumbers ) const;
61  std::vector<int> getLocalBinNumbers( int globalBinNumber ) const;
62 
63  int getLocalBinNumber(int dim, double val) const;
64  std::vector<int> getLocalBinNumbers(const HyperPoint& coords) const;
65 
66  double getLowBinEdgeLocal(int dim, int localBinNum) const;
67  double getHighBinEdgeLocal(int dim, int localBinNum) const;
68 
69  HyperPoint getLowCorner(int globalBinNum) const;
70  HyperPoint getHighCorner(int globalBinNum) const;
71 
72  /* Virtual functions that need to implemented from BinningBase */
73  /* These will be implemented in the derived classes */
74 
75  virtual void load(TString filename, TString option = "READ");
76  virtual BinningBase* clone() const;
77 
78  virtual void save(TString filename) const;
79  virtual void save() const;
80 
81  virtual void mergeBinnings( const BinningBase& other );
82 
83  virtual int getNumBins() const;
84  virtual int getBinNum(const HyperPoint& coords) const;
85 
86  virtual HyperVolume getBinHyperVolume(int binNumber) const;
87 
88  virtual HyperPoint getAverageBinWidth() const;
89  virtual HyperCuboid getLimits() const;
90 
91 
92 
93 };
94 
95 
96 
97 #endif
98 
double getHighBinEdgeLocal(int dim, int localBinNum) const
virtual TString filename() const
Definition: BinningBase.cpp:57
virtual HyperVolume getBinHyperVolume(int binNumber) const
virtual int getBinNum(const HyperPoint &coords) const
int getNumLocalBins(int dimension) const
virtual HyperPoint getAverageBinWidth() const
HyperCuboid _limits
int getGlobalBinNumber(std::vector< int > localBinNumbers) const
virtual HyperCuboid getLimits() const
virtual void save() const
double getLowBinEdgeLocal(int dim, int localBinNum) const
HyperPoint getHighCorner(int globalBinNum) const
std::vector< int > getLocalBinNumbers(int globalBinNumber) const
UniformBinning(HyperCuboid limits, int nLocalBins)
The only constructor.
int getLocalBinNumber(int dim, double val) const
virtual ~UniformBinning()
virtual BinningBase * clone() const
HyperPoint getLowCorner(int globalBinNum) const
virtual int getNumBins() const
std::vector< int > _nLocalBins
virtual void mergeBinnings(const BinningBase &other)
virtual void load(TString filename, TString option="READ")