PandaRoot
PndHoughSpace.h
Go to the documentation of this file.
1 // PndHoughSpace
3 // Defines a data structure for a hough space
5 
16 #ifndef PndHoughSpace_H_
17 #define PndHoughSpace_H_
18 
19 #include <map>
20 #include <set>
21 #include "TVector3.h"
22 
23 struct PairCmp {
24  bool operator()(const std::pair<int, int> &lhs, const std::pair<int, int> &rhs) const { return lhs.second >= rhs.second; }
25 };
26 
28 
29  public:
30  PndHoughSpace();
31 
32  virtual ~PndHoughSpace() {}
33 
35  virtual void SetNBins1(double n) { fNbins1 = n; }
37  virtual void SetNBins2(double n) { fNbins2 = n; }
39  void Init();
41  TVector3 GetCircleFromBin(Int_t bin);
43  Int_t GetBin(Int_t binX, Int_t binY);
45  void Fill(double x, double y);
47  void FindMaxima(std::vector<TVector3> &FoundMaxima);
49  void clear() { HoughSpaceMapBinToEntries.clear(); }
51  Int_t GetEntries() { return HoughSpaceMapBinToEntries.size(); }
53  std::vector<double> GetXBorder() { return bordersX; }
55  std::vector<double> GetYBorder() { return bordersY; }
56 
57  private:
58  std::map<int, int> HoughSpaceMapBinToEntries;
59 
60  std::vector<double> bordersX;
61  std::vector<double> bordersY;
62 
63  double fNbins1;
64  double fNbins2;
65 
66  Int_t fCounterNan;
67  Int_t fCounterUnderflowXY;
68  Int_t fCounterUnderflowXOverflowY;
69  Int_t fCounterUnderflowX;
70  Int_t fCounterOverflowXUnderflowY;
71  Int_t fCounterOveflowXY;
72  Int_t fCounterOverflowX;
73  Int_t fCounterUnerflowY;
74  Int_t fCounterOverflowY;
75 
76  ClassDef(PndHoughSpace, 1);
77 };
78 
79 #endif /* PndHoughSpace_H_ */
std::vector< double > GetYBorder()
Returns a vector containing the borders of each bin of the y axis.
Definition: PndHoughSpace.h:55
virtual void SetNBins1(double n)
Sets the number of bins in x direction of the Hough space.
Definition: PndHoughSpace.h:35
std::vector< double > GetXBorder()
Returns a vector containing the borders of each bin of the x axis.
Definition: PndHoughSpace.h:53
virtual ~PndHoughSpace()
Definition: PndHoughSpace.h:32
bool operator()(const std::pair< int, int > &lhs, const std::pair< int, int > &rhs) const
Definition: PndHoughSpace.h:24
virtual void SetNBins2(double n)
Sets the number of bins in y direction of the Hough space.
Definition: PndHoughSpace.h:37
Int_t GetEntries()
Returns the number of filled bins in the Hough space.
Definition: PndHoughSpace.h:51
void clear()
Clears the Hough space.
Definition: PndHoughSpace.h:49