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 
10 #ifndef CBM_RICH_RING_FINDER_HOUGH_IMPL
11 #define CBM_RICH_RING_FINDER_HOUGH_IMPL
12 
13 #include "CbmRichRingLight.h"
14 #include "CbmRichRingFinderData.h"
15 
16 #include <vector>
17 #include <map>
18 
19 using std::vector;
20 
23 
24 
34 {
35 
36 protected:
37  static const unsigned short MAX_NOF_HITS = 65000; // maximum number of hits in RICH detector
38 
39  // parameters of the Hough Transform algorithm
40  unsigned short fNofParts; // number of groups of hits for HT
41 
42  float fMaxDistance; // maximum distance between two hits
43  float fMinDistance; // minimum distance between two hits
44  float fMinDistanceSq; // = fMinDistance*fMinDistance
45  float fMaxDistanceSq; // = fMaxDistance*fMaxDistance
46 
47  float fMinRadius; // minimum radius of the ring
48  float fMaxRadius; // maximum radius of the ring
49 
50  float fDx; // x bin width of the ring center histogram
51  float fDy; // y bin width of the ring center histogram
52  float fDr; // width of the ring radius histogram
53  unsigned short fNofBinsX; // number of bins in X direction
54  unsigned short fNofBinsY; // number of bins in Y direction
55  unsigned short fNofBinsXY; // fNofBinsX*fNofBinsY
56 
57  unsigned short fHTCut; // cut number of entries in maximum bin of XY histogram
58 
59  unsigned short fNofBinsR;// number of bins in radius histogram
60  unsigned short fHTCutR; // cut number of entries in maximum bin of Radius histogram
61 
62  unsigned short fMinNofHitsInArea; // minimum number of hits in the local area
63 
64  float fRmsCoeffEl;
65  float fMaxCutEl;
66  float fRmsCoeffCOP;
67  float fMaxCutCOP;
68 
69  float fAnnCut; //remove found hits only for good quality rings
70  float fUsedHitsAllCut; // percent of used hits
71 
72  float fCurMinX; // current minimum X position of the local area
73  float fCurMinY; // current minimum Y position of the local area
74 
75  vector<CbmRichHoughHit> fData; // Rich hits
76  vector<unsigned short> fHist; // XY histogram
77  vector<unsigned short> fHistR; // Radius histogram
78  vector< vector<unsigned short> > fHitInd; // store hit indexes for different group of hits
79  vector<CbmRichRingLight*> fFoundRings; // collect found rings
80  CbmRichRingFitterCOP* fFitCOP; // COP ring fitter
81  CbmRichRingSelectAnn* fANNSelect; // ANN selection criteria
82 
83 public:
88 
93 
97  void SetParameters();
98 
108  float x[],
109  float y[],
110  float *xc,
111  float *yc,
112  float *r);
113 
117  virtual void HoughTransformReconstruction();
118 
126  virtual void DefineLocalAreaAndHits(
127  float x0,
128  float y0,
129  int *indmin,
130  int *indmax);
131 
137  virtual void HoughTransform(
138  unsigned short indmin,
139  unsigned short indmax);
140 
147  virtual void HoughTransformGroup(
148  unsigned short indmin,
149  unsigned short indmax,
150  int iPart);
151 
157  void FindPeak(
158  int indmin,
159  int indmax);
160 
164  void RingSelection();
165 
171  void ReAssignSharedHits(
172  int ringInd1,
173  int ringInd2);
174 
179  int GetHitIndex(
180  unsigned short hitInd);
181 
189  int indmin,
190  int indmax,
191  CbmRichRingLight* ring);
192 
196  void Init();
197 
201  void DoFind();
202 
207  void SetData(
208  const vector<CbmRichHoughHit>& data)
209  {
210  fData.clear();
211  fData = data;
212  }
213 
217  vector<CbmRichRingLight*>& GetFoundRings()
218  {
219  return fFoundRings;
220  }
221 
222 private:
227 
232 };
233 #endif