PandaRoot
PndHoughSpace.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
14 // PndHoughSpace
15 // Defines a data structure for a hough space
17 
28 #ifndef PndHoughSpace_H_
29 #define PndHoughSpace_H_
30 
31 #include <map>
32 #include <set>
33 #include "TVector3.h"
34 
35 struct PairCmp {
36  bool operator()(const std::pair<int, int> &lhs, const std::pair<int, int> &rhs) const { return lhs.second >= rhs.second; }
37 };
38 
40 
41  public:
42  PndHoughSpace();
43 
44  virtual ~PndHoughSpace() {}
45 
47  virtual void SetNBins1(double n) { fNbins1 = n; }
49  virtual void SetNBins2(double n) { fNbins2 = n; }
51  void Init();
53  TVector3 GetCircleFromBin(Int_t bin);
55  Int_t GetBin(Int_t binX, Int_t binY);
57  void Fill(double x, double y);
59  void FindMaxima(std::vector<TVector3> &FoundMaxima);
61  void clear() { HoughSpaceMapBinToEntries.clear(); }
63  Int_t GetEntries() { return HoughSpaceMapBinToEntries.size(); }
65  std::vector<double> GetXBorder() { return bordersX; }
67  std::vector<double> GetYBorder() { return bordersY; }
68 
69  private:
70  std::map<int, int> HoughSpaceMapBinToEntries;
71 
72  std::vector<double> bordersX;
73  std::vector<double> bordersY;
74 
75  double fNbins1;
76  double fNbins2;
77 
78  Int_t fCounterNan;
79  Int_t fCounterUnderflowXY;
80  Int_t fCounterUnderflowXOverflowY;
81  Int_t fCounterUnderflowX;
82  Int_t fCounterOverflowXUnderflowY;
83  Int_t fCounterOveflowXY;
84  Int_t fCounterOverflowX;
85  Int_t fCounterUnerflowY;
86  Int_t fCounterOverflowY;
87 
88  ClassDef(PndHoughSpace, 1);
89 };
90 
91 #endif /* PndHoughSpace_H_ */
std::vector< double > GetYBorder()
Returns a vector containing the borders of each bin of the y axis.
Definition: PndHoughSpace.h:67
virtual void SetNBins1(double n)
Sets the number of bins in x direction of the Hough space.
Definition: PndHoughSpace.h:47
std::vector< double > GetXBorder()
Returns a vector containing the borders of each bin of the x axis.
Definition: PndHoughSpace.h:65
virtual ~PndHoughSpace()
Definition: PndHoughSpace.h:44
bool operator()(const std::pair< int, int > &lhs, const std::pair< int, int > &rhs) const
Definition: PndHoughSpace.h:36
virtual void SetNBins2(double n)
Sets the number of bins in y direction of the Hough space.
Definition: PndHoughSpace.h:49
Int_t GetEntries()
Returns the number of filled bins in the Hough space.
Definition: PndHoughSpace.h:63
void clear()
Clears the Hough space.
Definition: PndHoughSpace.h:61