Rewriting and cleaning up
[u/mrichter/AliRoot.git] / HLT / hough / AliL3HoughMaxFinder.h
1 #ifndef ALIL3_HOUGH_MaxFinder
2 #define ALIL3_HOUGH_MaxFinder
3
4 #include "AliL3RootTypes.h"
5
6 class AliL3Histogram;
7 class AliL3TrackArray;
8 class AliL3HoughTrack;
9
10 struct AxisWindow
11 {
12   Int_t ymin;
13   Int_t ymax;
14   Int_t xbin;
15   Int_t weight;
16 };
17
18 class AliL3HoughMaxFinder : public TObject {
19   
20  private:
21
22   Int_t fThreshold;
23   AliL3Histogram *fCurrentHisto;  //!
24
25   Char_t fHistoType;
26
27  public:
28   AliL3HoughMaxFinder(); 
29   AliL3HoughMaxFinder(Char_t *histotype,AliL3Histogram *hist=0);
30   virtual ~AliL3HoughMaxFinder();
31
32   void FindAbsMaxima(Int_t &max_xbin,Int_t &max_ybin);
33   AliL3TrackArray *FindBigMaxima(AliL3Histogram *hist);
34   AliL3TrackArray *FindMaxima(AliL3Histogram *hist,Int_t *rowrange=0,Int_t ref_row=0);
35   AliL3TrackArray *LookForPeaks(AliL3Histogram *hist,Int_t nbins);
36   
37   AliL3HoughTrack *FindPeak(Int_t t1,Double_t t2,Int_t t3);
38   AliL3HoughTrack *FindPeakLine(Double_t rho,Double_t theta);
39   AliL3HoughTrack *CalculatePeakInWindow(Int_t *maxbin,Int_t t0,Int_t t1,Double_t t2,Int_t t3);
40   void FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t &n);
41   void SortPeaks(struct AxisWindow **a,Int_t first,Int_t last);
42   Int_t PeakCompare(struct AxisWindow *a,struct AxisWindow *b);
43   
44   void SetThreshold(Int_t f) {fThreshold = f;}
45   
46   void SetHistogram(AliL3Histogram *hist) {fCurrentHisto = hist;}
47   
48   ClassDef(AliL3HoughMaxFinder,1)
49
50 };
51
52 #endif