Go to the documentation of this file.00001
00010 #ifndef CBM_RICH_RING_FINDER_HOUGH_IMPL
00011 #define CBM_RICH_RING_FINDER_HOUGH_IMPL
00012
00013 #include "CbmRichRingLight.h"
00014
00015 #include <vector>
00016 #include <map>
00017 #include <functional>
00018
00019 using std::vector;
00020
00021 class CbmRichRingFitterCOP;
00022
00031 class CbmRichHoughHit {
00032 public:
00036 CbmRichHoughHit():
00037 fHit(),
00038 fX2plusY2(0.f),
00039 fId(0),
00040 fIsUsed(false)
00041 { }
00042
00043 virtual ~CbmRichHoughHit(){}
00044
00045 CbmRichHitLight fHit;
00046 float fX2plusY2;
00047 unsigned short fId;
00048 bool fIsUsed;
00049 };
00050
00059 class CbmRichHoughHitCmpUp:
00060 public std::binary_function<
00061 const CbmRichHoughHit,
00062 const CbmRichHoughHit,
00063 bool>
00064 {
00065 public:
00066 bool operator()(
00067 const CbmRichHoughHit &m1,
00068 const CbmRichHoughHit &m2) const
00069 {
00070 return m1.fHit.fX < m2.fHit.fX;
00071 }
00072 };
00073
00074
00083 class CbmRichRingComparatorMore:
00084 public std::binary_function<
00085 const CbmRichRingLight*,
00086 const CbmRichRingLight*,
00087 bool>
00088 {
00089 public:
00090 bool operator()(
00091 const CbmRichRingLight* ring1,
00092 const CbmRichRingLight* ring2) const
00093 {
00094 return ring1->GetSelectionNN() > ring2->GetSelectionNN();
00095 }
00096 };
00097
00098
00107 class CbmRichRingFinderHoughImpl
00108 {
00109
00110 protected:
00111 static const unsigned short MAX_NOF_HITS = 65000;
00112
00113
00114 unsigned short fNofParts;
00115
00116 float fMaxDistance;
00117 float fMinDistance;
00118 float fMinDistanceSq;
00119 float fMaxDistanceSq;
00120
00121 float fMinRadius;
00122 float fMaxRadius;
00123
00124 float fDx;
00125 float fDy;
00126 float fDr;
00127 unsigned short fNofBinsX;
00128 unsigned short fNofBinsY;
00129 unsigned short fNofBinsXY;
00130
00131 unsigned short fHTCut;
00132
00133 unsigned short fNofBinsR;
00134 unsigned short fHTCutR;
00135
00136 unsigned short fMinNofHitsInArea;
00137
00138 float fRmsCoeffCOP;
00139 float fMaxCutCOP;
00140
00141 float fCurMinX;
00142 float fCurMinY;
00143
00144 vector<CbmRichHoughHit> fData;
00145 vector<unsigned short> fHist;
00146 vector<unsigned short> fHistR;
00147 vector< vector<unsigned short> > fHitInd;
00148 vector<CbmRichRingLight*> fFoundRings;
00149 CbmRichRingFitterCOP* fFitCOP;
00150
00151 public:
00155 CbmRichRingFinderHoughImpl ();
00156
00160 virtual ~CbmRichRingFinderHoughImpl();
00161
00165 void SetParameters();
00166
00170 virtual void HoughTransformReconstruction();
00171
00179 virtual void DefineLocalAreaAndHits(
00180 float x0,
00181 float y0,
00182 int *indmin,
00183 int *indmax);
00184
00190 virtual void HoughTransform(
00191 unsigned short indmin,
00192 unsigned short indmax);
00193
00200 virtual void HoughTransformGroup(
00201 unsigned short indmin,
00202 unsigned short indmax,
00203 int iPart);
00204
00210 void FindPeak(
00211 int indmin,
00212 int indmax);
00213
00217 void DoFind(
00218 const vector<CbmRichHitLight>& hits);
00219
00223 vector<CbmRichRingLight*>& GetFoundRings()
00224 {
00225 return fFoundRings;
00226 }
00227
00228 private:
00232 CbmRichRingFinderHoughImpl(const CbmRichRingFinderHoughImpl&);
00233
00237 CbmRichRingFinderHoughImpl& operator=(const CbmRichRingFinderHoughImpl&);
00238 };
00239 #endif