• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

beamtime/cern-oct12/go4/RICH/CbmRichRingFinderHoughImpl.h (r4864/r3568)

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; // maximum number of hits in RICH detector
00112 
00113    // parameters of the Hough Transform algorithm
00114         unsigned short fNofParts; // number of groups of hits for HT
00115 
00116         float fMaxDistance; // maximum distance between two hits
00117         float fMinDistance; // minimum distance between two hits
00118         float fMinDistanceSq; // = fMinDistance*fMinDistance
00119         float fMaxDistanceSq; // = fMaxDistance*fMaxDistance
00120 
00121         float fMinRadius; // minimum radius of the ring
00122         float fMaxRadius; // maximum radius of the ring
00123 
00124         float fDx; // x bin width of the ring center histogram
00125         float fDy; // y bin width of the ring center histogram
00126         float fDr; // width of the ring radius histogram
00127         unsigned short fNofBinsX; // number of bins in X direction
00128         unsigned short fNofBinsY; // number of bins in Y direction
00129         unsigned short fNofBinsXY; // fNofBinsX*fNofBinsY
00130 
00131         unsigned short fHTCut; // cut number of entries in maximum bin of XY histogram
00132 
00133         unsigned short fNofBinsR;// number of bins in radius histogram
00134         unsigned short fHTCutR; // cut number of entries in maximum bin of Radius histogram
00135 
00136         unsigned short fMinNofHitsInArea; // minimum number of hits in the local area
00137 
00138         float fRmsCoeffCOP;
00139         float fMaxCutCOP;
00140 
00141         float fCurMinX; // current minimum X position of the local area
00142         float fCurMinY; // current minimum Y position of the local area
00143 
00144         vector<CbmRichHoughHit> fData; // Rich hits
00145         vector<unsigned short> fHist; // XY histogram
00146         vector<unsigned short> fHistR; // Radius histogram
00147         vector< vector<unsigned short> > fHitInd; // store hit indexes for different group of hits
00148         vector<CbmRichRingLight*> fFoundRings; // collect found rings
00149         CbmRichRingFitterCOP* fFitCOP; // COP ring fitter
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

Generated on Tue Dec 10 2013 04:52:17 for ROCsoft by  doxygen 1.7.1