CbmRoot
CbmRichRingFinderHoughImpl.h
Go to the documentation of this file.
1 
10 #ifndef CBM_RICH_RING_FINDER_HOUGH_IMPL
11 #define CBM_RICH_RING_FINDER_HOUGH_IMPL
12 
13 #include "CbmRichRingFinderData.h"
14 #include "CbmRichRingLight.h"
15 
16 #include <map>
17 #include <vector>
18 
19 using std::vector;
20 
23 
24 
34 
35 protected:
36  static const unsigned short MAX_NOF_HITS =
37  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
58  fHTCut; // cut number of entries in maximum bin of XY histogram
59 
60  unsigned short fNofBinsR; // number of bins in radius histogram
61  unsigned short
62  fHTCutR; // cut number of entries in maximum bin of Radius histogram
63 
64  unsigned short fMinNofHitsInArea; // minimum number of hits in the local area
65 
66  float fRmsCoeffEl;
67  float fMaxCutEl;
68  float fRmsCoeffCOP;
69  float fMaxCutCOP;
70 
71  float fAnnCut; //remove found hits only for good quality rings
72  float fUsedHitsAllCut; // percent of used hits
73 
74  double fTimeCut;
75 
76  float fCurMinX; // current minimum X position of the local area
77  float fCurMinY; // current minimum Y position of the local area
78 
80 
81  vector<CbmRichHoughHit> fData; // Rich hits
82  vector<unsigned short> fHist; // XY histogram
83  vector<unsigned short> fHistR; // Radius histogram
84  vector<vector<unsigned int>>
85  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 
101  virtual ~CbmRichRingFinderHoughImpl();
102 
106  void SetParameters();
107 
116  void
117  CalculateRingParameters(float x[], float y[], float* xc, float* yc, float* r);
118 
122  virtual void HoughTransformReconstruction();
123 
131  virtual void
132  DefineLocalAreaAndHits(float x0, float y0, int* indmin, int* indmax);
133 
139  virtual void HoughTransform(unsigned int indmin, unsigned int indmax);
140 
147  virtual void
148  HoughTransformGroup(unsigned int indmin, unsigned int indmax, int iPart);
149 
155  void FindPeak(int indmin, int indmax);
156 
160  void RingSelection();
161 
167  void ReAssignSharedHits(int ringInd1, int ringInd2);
168 
173  int GetHitIndexById(unsigned int hitId);
174 
181  void RemoveHitsAroundRing(int indmin, int indmax, CbmRichRingLight* ring);
182 
186  void Init();
187 
191  void DoFind();
192 
197  void SetData(const vector<CbmRichHoughHit>& data) {
198  fData.clear();
199  fData = data;
200  }
201 
205  vector<CbmRichRingLight*>& GetFoundRings() { return fFoundRings; }
206 
207  void SetUseAnnSelect(bool use) { fUseAnnSelect = use; }
208 
209 private:
214 
219 };
220 #endif
CbmRichRingFinderHoughImpl::GetHitIndexById
int GetHitIndexById(unsigned int hitId)
Return hit indez in the internal Array.
Definition: CbmRichRingFinderHoughImpl.cxx:499
CbmRichRingFinderHoughImpl::fHitInd
vector< vector< unsigned int > > fHitInd
Definition: CbmRichRingFinderHoughImpl.h:85
CbmRichRingSelectAnn
Implementation for concrete RICH ring selection algorithm: reject rings using a trained neural net (i...
Definition: CbmRichRingSelectAnn.h:39
CbmRichRingFinderHoughImpl::fCurMinY
float fCurMinY
Definition: CbmRichRingFinderHoughImpl.h:77
CbmRichRingFinderHoughImpl::fMinDistance
float fMinDistance
Definition: CbmRichRingFinderHoughImpl.h:43
CbmRichRingFinderHoughImpl::fNofParts
unsigned short fNofParts
Definition: CbmRichRingFinderHoughImpl.h:40
CbmRichRingFinderHoughImpl::HoughTransformReconstruction
virtual void HoughTransformReconstruction()
Run HT for each hit.
Definition: CbmRichRingFinderHoughImpl.cxx:162
CbmRichRingFinderHoughImpl::HoughTransform
virtual void HoughTransform(unsigned int indmin, unsigned int indmax)
Run HoughTransformGroup for each group of hits.
Definition: CbmRichRingFinderHoughImpl.cxx:228
CbmRichRingFinderHoughImpl::fNofBinsY
unsigned short fNofBinsY
Definition: CbmRichRingFinderHoughImpl.h:54
CbmRichRingFinderHoughImpl::fCurTime
double fCurTime
Definition: CbmRichRingFinderHoughImpl.h:90
CbmRichRingFinderHoughImpl::Init
void Init()
Definition: CbmRichRingFinderHoughImpl.cxx:98
CbmRichRingFinderHoughImpl::fANNSelect
CbmRichRingSelectAnn * fANNSelect
Definition: CbmRichRingFinderHoughImpl.h:88
CbmRichRingFinderHoughImpl::RemoveHitsAroundRing
void RemoveHitsAroundRing(int indmin, int indmax, CbmRichRingLight *ring)
Set fIsUsed flag to true for hits attached to the ring.
Definition: CbmRichRingFinderHoughImpl.cxx:411
CbmRichRingFinderHoughImpl::fMinRadius
float fMinRadius
Definition: CbmRichRingFinderHoughImpl.h:47
CbmRichRingFinderHoughImpl::ReAssignSharedHits
void ReAssignSharedHits(int ringInd1, int ringInd2)
Reassign shared hits from two rings to only one of the rings.
Definition: CbmRichRingFinderHoughImpl.cxx:467
CbmRichRingFinderHoughImpl::fDy
float fDy
Definition: CbmRichRingFinderHoughImpl.h:51
CbmRichRingFinderHoughImpl::SetParameters
void SetParameters()
Set parameters of the algorithm.
Definition: CbmRichRingFinderHoughImpl.cxx:128
CbmRichRingFinderHoughImpl::fDr
float fDr
Definition: CbmRichRingFinderHoughImpl.h:52
CbmRichRingFinderHoughImpl::fAnnCut
float fAnnCut
Definition: CbmRichRingFinderHoughImpl.h:71
CbmRichRingFinderHoughImpl::CbmRichRingFinderHoughImpl
CbmRichRingFinderHoughImpl()
Standard constructor.
Definition: CbmRichRingFinderHoughImpl.cxx:28
CbmRichRingFinderHoughImpl::fRmsCoeffCOP
float fRmsCoeffCOP
Definition: CbmRichRingFinderHoughImpl.h:68
CbmRichRingFitterCOP
Here the ring is fitted with the COP algorithm from A. Ayriyan/G. Ososkov.
Definition: CbmRichRingFitterCOP.h:28
CbmRichRingFinderHoughImpl::fMaxDistance
float fMaxDistance
Definition: CbmRichRingFinderHoughImpl.h:42
CbmRichRingFinderHoughImpl::fMinNofHitsInArea
unsigned short fMinNofHitsInArea
Definition: CbmRichRingFinderHoughImpl.h:64
CbmRichRingFinderHoughImpl::SetUseAnnSelect
void SetUseAnnSelect(bool use)
Definition: CbmRichRingFinderHoughImpl.h:207
CbmRichRingFinderHoughImpl::fNofBinsXY
unsigned short fNofBinsXY
Definition: CbmRichRingFinderHoughImpl.h:55
CbmRichRingFinderHoughImpl::DefineLocalAreaAndHits
virtual void DefineLocalAreaAndHits(float x0, float y0, int *indmin, int *indmax)
Find hits in a local area.
Definition: CbmRichRingFinderHoughImpl.cxx:179
CbmRichRingFinderHoughImpl::HoughTransformGroup
virtual void HoughTransformGroup(unsigned int indmin, unsigned int indmax, int iPart)
Definition: CbmRichRingFinderHoughImpl.cxx:235
CbmRichRingFinderHoughImpl::fUseAnnSelect
bool fUseAnnSelect
Definition: CbmRichRingFinderHoughImpl.h:79
CbmRichRingFinderHoughImpl::~CbmRichRingFinderHoughImpl
virtual ~CbmRichRingFinderHoughImpl()
Distructor.
Definition: CbmRichRingFinderHoughImpl.cxx:93
CbmRichRingFinderHoughImpl::fHist
vector< unsigned short > fHist
Definition: CbmRichRingFinderHoughImpl.h:82
CbmRichRingFinderHoughImpl::fHTCut
unsigned short fHTCut
Definition: CbmRichRingFinderHoughImpl.h:58
CbmRichRingFinderHoughImpl::FindPeak
void FindPeak(int indmin, int indmax)
Definition: CbmRichRingFinderHoughImpl.cxx:318
CbmRichRingLight.h
CbmRichRingFinderHoughImpl::fMaxRadius
float fMaxRadius
Definition: CbmRichRingFinderHoughImpl.h:48
CbmRichRingFinderHoughImpl::fMinDistanceSq
float fMinDistanceSq
Definition: CbmRichRingFinderHoughImpl.h:44
CbmRichRingFinderHoughImpl::fHistR
vector< unsigned short > fHistR
Definition: CbmRichRingFinderHoughImpl.h:83
CbmRichRingFinderHoughImpl::fRmsCoeffEl
float fRmsCoeffEl
Definition: CbmRichRingFinderHoughImpl.h:66
CbmRichRingFinderHoughImpl::fUsedHitsAllCut
float fUsedHitsAllCut
Definition: CbmRichRingFinderHoughImpl.h:72
CbmRichRingFinderHoughImpl::SetData
void SetData(const vector< CbmRichHoughHit > &data)
Set array of hits.
Definition: CbmRichRingFinderHoughImpl.h:197
CbmRichRingFinderData.h
CbmRichRingFinderHoughImpl::fTimeCut
double fTimeCut
Definition: CbmRichRingFinderHoughImpl.h:74
CbmRichRingFinderHoughImpl::fFoundRings
vector< CbmRichRingLight * > fFoundRings
Definition: CbmRichRingFinderHoughImpl.h:86
CbmRichRingFinderHoughImpl::DoFind
void DoFind()
Start point to run algorithm.
Definition: CbmRichRingFinderHoughImpl.cxx:112
CbmRichRingFinderHoughImpl::CalculateRingParameters
void CalculateRingParameters(float x[], float y[], float *xc, float *yc, float *r)
Calculate circle center and radius.
Definition: CbmRichRingFinderHoughImpl.cxx:507
CbmRichRingFinderHoughImpl::fNofBinsR
unsigned short fNofBinsR
Definition: CbmRichRingFinderHoughImpl.h:60
CbmRichRingFinderHoughImpl::fCurMinX
float fCurMinX
Definition: CbmRichRingFinderHoughImpl.h:76
CbmRichRingFinderHoughImpl::operator=
CbmRichRingFinderHoughImpl & operator=(const CbmRichRingFinderHoughImpl &)
Assignment operator.
CbmRichRingFinderHoughImpl::fDx
float fDx
Definition: CbmRichRingFinderHoughImpl.h:50
CbmRichRingFinderHoughImpl::fFitCOP
CbmRichRingFitterCOP * fFitCOP
Definition: CbmRichRingFinderHoughImpl.h:87
CbmRichRingFinderHoughImpl
Ring finder implementation based on Hough Transform method.
Definition: CbmRichRingFinderHoughImpl.h:33
x
Double_t x
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmRichRingFinderHoughImpl::fHTCutR
unsigned short fHTCutR
Definition: CbmRichRingFinderHoughImpl.h:62
CbmRichRingFinderHoughImpl::fMaxCutCOP
float fMaxCutCOP
Definition: CbmRichRingFinderHoughImpl.h:69
CbmRichRingFinderHoughImpl::RingSelection
void RingSelection()
Ring selection procedure.
Definition: CbmRichRingFinderHoughImpl.cxx:428
y
Double_t y
Definition: CbmMvdSensorDigiToHitTask.cxx:68
CbmRichRingFinderHoughImpl::fNofBinsX
unsigned short fNofBinsX
Definition: CbmRichRingFinderHoughImpl.h:53
CbmRichRingFinderHoughImpl::MAX_NOF_HITS
static const unsigned short MAX_NOF_HITS
Definition: CbmRichRingFinderHoughImpl.h:36
CbmRichRingFinderHoughImpl::fMaxCutEl
float fMaxCutEl
Definition: CbmRichRingFinderHoughImpl.h:67
CbmRichRingFinderHoughImpl::fData
vector< CbmRichHoughHit > fData
Definition: CbmRichRingFinderHoughImpl.h:81
CbmRichRingFinderHoughImpl::CbmRichRingFinderHoughImpl
CbmRichRingFinderHoughImpl(const CbmRichRingFinderHoughImpl &)
Copy constructor.
CbmRichRingLight
Definition: CbmRichRingLight.h:39
CbmRichRingFinderHoughImpl::fMaxDistanceSq
float fMaxDistanceSq
Definition: CbmRichRingFinderHoughImpl.h:45
CbmRichRingFinderHoughImpl::GetFoundRings
vector< CbmRichRingLight * > & GetFoundRings()
Return vector of found rings.
Definition: CbmRichRingFinderHoughImpl.h:205