EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CbmRichRingFinderHoughImpl.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file CbmRichRingFinderHoughImpl.h
1 // --------------------------------------------------------------------------------------
2 // ----- CbmRichRingFinderHoughImpl source file -----
3 // ----- Algorithm idea: G.A. Ososkov (ososkov@jinr.ru) and Semen Lebedev (s.lebedev@gsi.de) -----
4 // ----- Implementation: Semen Lebedev (s.lebedev@gsi.de)-----
5 
6 #ifndef CBM_RICH_RING_FINDER_HOUGH_IMPL_H
7 #define CBM_RICH_RING_FINDER_HOUGH_IMPL_H
8 
9 #include "CbmRichRingLight.h"
12 
13 #include <vector>
14 #include <map>
15 #include <functional>
16 
17 class CbmRichHoughHit {
18 public:
20  float fX2plusY2;
21  unsigned short fId;
22  bool fIsUsed;
23 };
24 
26  public std::binary_function<
27  const CbmRichHoughHit,
28  const CbmRichHoughHit,
29  bool>
30 {
31 public:
32  bool operator()(const CbmRichHoughHit &m1, const CbmRichHoughHit &m2) const {
33  return m1.fHit.fX < m2.fHit.fX;
34  }
35 };
36 
38  public std::binary_function<
39  const CbmRichRingLight*,
40  const CbmRichRingLight*,
41  bool>
42 {
43 public:
44  bool operator()(const CbmRichRingLight* ring1, const CbmRichRingLight* ring2) const {
45  return ring1->GetSelectionNN() > ring2->GetSelectionNN();
46  }
47 };
48 
50 
51 protected:
52  static const unsigned short kMAX_NOF_HITS = 65500;
53  static const unsigned short fNofParts = 2;
54 
55  float fMaxDistance;
56  float fMinDistance;
57  float fMinDistanceSq;
58  float fMaxDistanceSq;
59 
60  float fMinRadius;
61  float fMaxRadius;
62 
63  float fDx;
64  float fDy;
65  float fDr;
66  unsigned short fNofBinsX;
67  unsigned short fNofBinsY;
68  unsigned short fNofBinsXY;
69  unsigned short fHTCut;
70  unsigned short fHitCut;
71 
72  unsigned short fNofBinsR;
73  unsigned short fHTCutR;
74  unsigned short fHitCutR;
75 
76  unsigned short fMinNofHitsInArea;
77 
78  float fRmsCoeffEl;
79  float fMaxCutEl;
80  float fRmsCoeffCOP;
81  float fMaxCutCOP;
82 
83  float fAnnCut;
84  float fUsedHitsCut;
85  float fUsedHitsAllCut;
86 
87  float fCurMinX;
88  float fCurMinY;
89 
90  std::vector<CbmRichHoughHit> fData;
91  std::vector<CbmRichHoughHit> fDataPart1;
92  std::vector<CbmRichHoughHit> fDataPart2;
93 
94  std::vector<unsigned short> fHist;
95  std::vector<unsigned short> fHistR;
96  std::vector< std::vector<unsigned short> > fHitInd;
97 
98  std::vector<CbmRichRingLight*> fFoundRings;
99 
102 
103 public:
105  virtual ~CbmRichRingFinderHoughImpl();
106  void SetParameters();
107  virtual void HoughTransformReconstruction();
108  virtual void DefineLocalAreaAndHits(float x0, float y0, int *indmin, int *indmax);
109  virtual void HoughTransform(unsigned short indmin,
110  unsigned short indmax);
111  virtual void HoughTransformGroup(unsigned short indmin,
112  unsigned short indmax, int iPart);
113  void FindPeak(int indmin, int indmax);
114  void RingSelection();
115  void ReAssingSharedHits(int ringInd1, int ringInd2);
116  int GetHitIndex(unsigned short hitInd);
117  void RemoveHitsAroundRing(int indmin, int indmax, CbmRichRingLight* ring);
118  void Init();
119  void DoFind();
120 
121  void SetData(const std::vector<CbmRichHoughHit>& data){
122  fData.clear();
123  fData = data;
124  }
125 
126  std::vector<CbmRichRingLight*>& GetFoundRings(){
127  return fFoundRings;
128  }
129 };
130 #endif // CBM_RICH_RING_FINDER_HOUGH_IMPL_H