CbmRoot
Loading...
Searching...
No Matches
CbmRichRingFinderHoughImpl.h
Go to the documentation of this file.
1/* Copyright (C) 2008-2021 UGiessen/JINR-LIT, Giessen/Dubna
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Semen Lebedev [committer] */
4
14#ifndef CBM_RICH_RING_FINDER_HOUGH_IMPL
15#define CBM_RICH_RING_FINDER_HOUGH_IMPL
16
18#include "CbmRichRingLight.h"
19
20#include <map>
21#include <vector>
22
23using std::vector;
24
27
28
38
39 protected:
40 static const unsigned short MAX_NOF_HITS = 65000; // maximum number of hits in RICH detector
41
42 // parameters of the Hough Transform algorithm
43 unsigned short fNofParts; // number of groups of hits for HT
44
45 float fMaxDistance; // maximum distance between two hits
46 float fMinDistance; // minimum distance between two hits
47 float fMinDistanceSq; // = fMinDistance*fMinDistance
48 float fMaxDistanceSq; // = fMaxDistance*fMaxDistance
49
50 float fMinRadius; // minimum radius of the ring
51 float fMaxRadius; // maximum radius of the ring
52
53 float fDx; // x bin width of the ring center histogram
54 float fDy; // y bin width of the ring center histogram
55 float fDr; // width of the ring radius histogram
56 unsigned short fNofBinsX; // number of bins in X direction
57 unsigned short fNofBinsY; // number of bins in Y direction
58 unsigned short fNofBinsXY; // fNofBinsX*fNofBinsY
59
60 unsigned short fHTCut; // cut number of entries in maximum bin of XY histogram
61
62 unsigned short fNofBinsR; // number of bins in radius histogram
63 unsigned short fHTCutR; // cut number of entries in maximum bin of Radius histogram
64
65 unsigned short fMinNofHitsInArea; // minimum number of hits in the local area
66
68 float fMaxCutEl;
71
72 float fAnnCut; //remove found hits only for good quality rings
73 float fUsedHitsAllCut; // percent of used hits
74
75 double fTimeCut;
76
77 float fCurMinX; // current minimum X position of the local area
78 float fCurMinY; // current minimum Y position of the local area
79
81
82 vector<CbmRichHoughHit> fData; // Rich hits
83 vector<unsigned short> fHist; // XY histogram
84 vector<unsigned short> fHistR; // Radius histogram
85 vector<vector<unsigned int>> fHitInd; // store hit indexes for different group of hits
86 vector<CbmRichRingLight*> fFoundRings; // collect found rings
87 CbmRichRingFitterCOP* fFitCOP; // COP ring fitter
88 CbmRichRingSelectAnn* fANNSelect; // ANN selection criteria
89
90 double fCurTime;
91
92 public:
97
102
106 void SetParameters();
107
116 void CalculateRingParameters(float x[], float y[], float* xc, float* yc, float* r);
117
121 virtual void HoughTransformReconstruction();
122
130 virtual void DefineLocalAreaAndHits(float x0, float y0, int* indmin, int* indmax);
131
137 virtual void HoughTransform(unsigned int indmin, unsigned int indmax);
138
145 virtual void HoughTransformGroup(unsigned int indmin, unsigned int indmax, int iPart);
146
152 void FindPeak(int indmin, int indmax);
153
157 void RingSelection();
158
164 void ReAssignSharedHits(int ringInd1, int ringInd2);
165
170 int GetHitIndexById(unsigned int hitId);
171
178 void RemoveHitsAroundRing(int indmin, int indmax, CbmRichRingLight* ring);
179
183 void Init();
184
188 void DoFind();
189
194 void SetData(const vector<CbmRichHoughHit>& data)
195 {
196 fData.clear();
197 fData = data;
198 }
199
203 vector<CbmRichRingLight*>& GetFoundRings() { return fFoundRings; }
204
205 void SetUseAnnSelect(bool use) { fUseAnnSelect = use; }
206
207 private:
212
217};
218#endif
Ring finder implementation based on Hough Transform method.
void RemoveHitsAroundRing(int indmin, int indmax, CbmRichRingLight *ring)
Set fIsUsed flag to true for hits attached to the ring.
int GetHitIndexById(unsigned int hitId)
Return hit indez in the internal Array.
vector< vector< unsigned int > > fHitInd
void CalculateRingParameters(float x[], float y[], float *xc, float *yc, float *r)
Calculate circle center and radius.
void SetParameters()
Set parameters of the algorithm.
virtual void HoughTransformGroup(unsigned int indmin, unsigned int indmax, int iPart)
CbmRichRingFinderHoughImpl & operator=(const CbmRichRingFinderHoughImpl &)
Assignment operator.
void DoFind()
Start point to run algorithm.
vector< CbmRichRingLight * > & GetFoundRings()
Return vector of found rings.
void RingSelection()
Ring selection procedure.
vector< CbmRichRingLight * > fFoundRings
static const unsigned short MAX_NOF_HITS
void FindPeak(int indmin, int indmax)
void SetData(const vector< CbmRichHoughHit > &data)
Set array of hits.
CbmRichRingFinderHoughImpl()
Standard constructor.
virtual void HoughTransform(unsigned int indmin, unsigned int indmax)
Run HoughTransformGroup for each group of hits.
CbmRichRingFinderHoughImpl(const CbmRichRingFinderHoughImpl &)
Copy constructor.
virtual void HoughTransformReconstruction()
Run HT for each hit.
virtual void DefineLocalAreaAndHits(float x0, float y0, int *indmin, int *indmax)
Find hits in a local area.
void ReAssignSharedHits(int ringInd1, int ringInd2)
Reassign shared hits from two rings to only one of the rings.
virtual ~CbmRichRingFinderHoughImpl()
Distructor.
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Implementation for concrete RICH ring selection algorithm: reject rings using a trained neural net (i...