]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // @(#) $Id$ |
2 | ||
4de874d1 | 3 | #ifndef ALIL3_HOUGH_MaxFinder |
4 | #define ALIL3_HOUGH_MaxFinder | |
5 | ||
6 | #include "AliL3RootTypes.h" | |
146e74d9 | 7 | #include "AliL3StandardIncludes.h" |
4de874d1 | 8 | |
4cafa5fc | 9 | class AliL3Histogram; |
4de874d1 | 10 | class AliL3TrackArray; |
52a2a604 | 11 | class AliL3HoughTrack; |
208b54c5 | 12 | class TNtuple; |
4de874d1 | 13 | |
4fc9a6a4 | 14 | struct AxisWindow |
15 | { | |
16 | Int_t ymin; | |
17 | Int_t ymax; | |
18 | Int_t xbin; | |
19 | Int_t weight; | |
20 | }; | |
4cafa5fc | 21 | |
95a00d93 | 22 | class AliL3HoughMaxFinder { |
4de874d1 | 23 | |
24 | private: | |
25 | ||
26 | Int_t fThreshold; | |
4fc9a6a4 | 27 | AliL3Histogram *fCurrentHisto; //! |
3fe49b5b | 28 | |
b2a02bce | 29 | Float_t fGradX; |
30 | Float_t fGradY; | |
3fe49b5b | 31 | Float_t *fXPeaks; //! |
32 | Float_t *fYPeaks; //! | |
33 | Int_t *fWeight; //! | |
34 | Int_t fNPeaks; | |
35 | Int_t fNMax; | |
36 | ||
4de874d1 | 37 | Char_t fHistoType; |
38 | ||
2061190a | 39 | #ifndef no_root |
208b54c5 | 40 | TNtuple *fNtuppel; //! |
2061190a | 41 | #endif |
208b54c5 | 42 | |
4de874d1 | 43 | public: |
44 | AliL3HoughMaxFinder(); | |
3fe49b5b | 45 | AliL3HoughMaxFinder(Char_t *histotype,Int_t nmax,AliL3Histogram *hist=0); |
4de874d1 | 46 | virtual ~AliL3HoughMaxFinder(); |
3fe49b5b | 47 | void Reset(); |
2061190a | 48 | |
208b54c5 | 49 | void CreateNtuppel(); |
50 | void WriteNtuppel(Char_t *filename); | |
51 | ||
3fe49b5b | 52 | //Simple maxima finders: |
53 | void FindAbsMaxima(); | |
54 | void FindBigMaxima(); | |
b2a02bce | 55 | void FindMaxima(Int_t threshold=0); |
045549b7 | 56 | void FindAdaptedPeaks(Int_t nkappawindow,Float_t cut_ratio); |
0bd0c1ef | 57 | //Peak finder for HoughTransformerRow |
58 | void FindAdaptedRowPeaks(Int_t kappawindow,Int_t xsize,Int_t ysize); | |
3fe49b5b | 59 | //More sophisticated peak finders: |
7f66cda9 | 60 | void FindPeak(Int_t t1,Double_t t2,Int_t t3); |
afd8fed4 | 61 | void FindPeak1(Int_t y_window=2,Int_t x_bin_sides=1); |
4fc9a6a4 | 62 | void SortPeaks(struct AxisWindow **a,Int_t first,Int_t last); |
63 | Int_t PeakCompare(struct AxisWindow *a,struct AxisWindow *b); | |
4cafa5fc | 64 | |
3fe49b5b | 65 | //Setters: |
b2a02bce | 66 | void SetGradient(Float_t x,Float_t y) {fGradX=x; fGradY=y;} |
4de874d1 | 67 | void SetThreshold(Int_t f) {fThreshold = f;} |
4cafa5fc | 68 | void SetHistogram(AliL3Histogram *hist) {fCurrentHisto = hist;} |
69 | ||
3fe49b5b | 70 | //Getters: |
71 | Float_t GetXPeak(Int_t i); | |
72 | Float_t GetYPeak(Int_t i); | |
73 | Int_t GetWeight(Int_t i); | |
74 | Int_t GetEntries() {return fNPeaks;} | |
75 | ||
b1886074 | 76 | ClassDef(AliL3HoughMaxFinder,1) //Maximum finder class |
4de874d1 | 77 | |
78 | }; | |
79 | ||
3fe49b5b | 80 | inline Float_t AliL3HoughMaxFinder::GetXPeak(Int_t i) |
81 | { | |
82 | if(i<0 || i>fNMax) | |
83 | { | |
e06900d5 | 84 | STDCERR<<"AliL3HoughMaxFinder::GetXPeak : Invalid index "<<i<<STDENDL; |
3fe49b5b | 85 | return 0; |
86 | } | |
87 | return fXPeaks[i]; | |
88 | } | |
89 | ||
90 | inline Float_t AliL3HoughMaxFinder::GetYPeak(Int_t i) | |
91 | { | |
92 | if(i<0 || i>fNMax) | |
93 | { | |
e06900d5 | 94 | STDCERR<<"AliL3HoughMaxFinder::GetYPeak : Invalid index "<<i<<STDENDL; |
3fe49b5b | 95 | return 0; |
96 | } | |
97 | return fYPeaks[i]; | |
98 | ||
99 | } | |
100 | ||
101 | inline Int_t AliL3HoughMaxFinder::GetWeight(Int_t i) | |
102 | { | |
103 | if(i<0 || i>fNMax) | |
104 | { | |
e06900d5 | 105 | STDCERR<<"AliL3HoughMaxFinder::GetWeight : Invalid index "<<i<<STDENDL; |
3fe49b5b | 106 | return 0; |
107 | } | |
108 | return fWeight[i]; | |
109 | } | |
110 | ||
4de874d1 | 111 | #endif |
2061190a | 112 |