]>
Commit | Line | Data |
---|---|---|
4de874d1 | 1 | #ifndef ALIL3_HOUGH_MaxFinder |
2 | #define ALIL3_HOUGH_MaxFinder | |
3 | ||
4 | #include "AliL3RootTypes.h" | |
3fe49b5b | 5 | #include <stream.h> |
4de874d1 | 6 | |
4cafa5fc | 7 | class AliL3Histogram; |
4de874d1 | 8 | class AliL3TrackArray; |
52a2a604 | 9 | class AliL3HoughTrack; |
208b54c5 | 10 | class TNtuple; |
4de874d1 | 11 | |
4fc9a6a4 | 12 | struct AxisWindow |
13 | { | |
14 | Int_t ymin; | |
15 | Int_t ymax; | |
16 | Int_t xbin; | |
17 | Int_t weight; | |
18 | }; | |
4cafa5fc | 19 | |
95a00d93 | 20 | class AliL3HoughMaxFinder { |
4de874d1 | 21 | |
22 | private: | |
23 | ||
24 | Int_t fThreshold; | |
4fc9a6a4 | 25 | AliL3Histogram *fCurrentHisto; //! |
3fe49b5b | 26 | |
27 | Float_t *fXPeaks; //! | |
28 | Float_t *fYPeaks; //! | |
29 | Int_t *fWeight; //! | |
30 | Int_t fNPeaks; | |
31 | Int_t fNMax; | |
32 | ||
4de874d1 | 33 | Char_t fHistoType; |
34 | ||
208b54c5 | 35 | TNtuple *fNtuppel; //! |
36 | ||
37 | ||
4de874d1 | 38 | public: |
39 | AliL3HoughMaxFinder(); | |
3fe49b5b | 40 | AliL3HoughMaxFinder(Char_t *histotype,Int_t nmax,AliL3Histogram *hist=0); |
4de874d1 | 41 | virtual ~AliL3HoughMaxFinder(); |
3fe49b5b | 42 | void Reset(); |
208b54c5 | 43 | void CreateNtuppel(); |
44 | void WriteNtuppel(Char_t *filename); | |
45 | ||
3fe49b5b | 46 | //Simple maxima finders: |
47 | void FindAbsMaxima(); | |
48 | void FindBigMaxima(); | |
208b54c5 | 49 | void FindMaxima(Double_t grad_x,Double_t grad_y); |
4fc9a6a4 | 50 | |
3fe49b5b | 51 | //More sophisticated peak finders: |
52 | AliL3TrackArray *LookForPeaks(AliL3Histogram *hist,Int_t nbins); | |
b1886074 | 53 | void FindPeak(Int_t t1,Double_t t2,Int_t t3,Float_t &kappa,Float_t &phi0); |
4fc9a6a4 | 54 | AliL3HoughTrack *FindPeakLine(Double_t rho,Double_t theta); |
4cafa5fc | 55 | AliL3HoughTrack *CalculatePeakInWindow(Int_t *maxbin,Int_t t0,Int_t t1,Double_t t2,Int_t t3); |
b1886074 | 56 | void FindPeak1(Float_t *xpeaks,Float_t *ypeaks,Int_t *weight,Int_t &n,Int_t y_window=2,Int_t x_bin_sides=1); |
4fc9a6a4 | 57 | void SortPeaks(struct AxisWindow **a,Int_t first,Int_t last); |
58 | Int_t PeakCompare(struct AxisWindow *a,struct AxisWindow *b); | |
4cafa5fc | 59 | |
3fe49b5b | 60 | //Setters: |
4de874d1 | 61 | void SetThreshold(Int_t f) {fThreshold = f;} |
4cafa5fc | 62 | void SetHistogram(AliL3Histogram *hist) {fCurrentHisto = hist;} |
63 | ||
3fe49b5b | 64 | //Getters: |
65 | Float_t GetXPeak(Int_t i); | |
66 | Float_t GetYPeak(Int_t i); | |
67 | Int_t GetWeight(Int_t i); | |
68 | Int_t GetEntries() {return fNPeaks;} | |
69 | ||
b1886074 | 70 | ClassDef(AliL3HoughMaxFinder,1) //Maximum finder class |
4de874d1 | 71 | |
72 | }; | |
73 | ||
3fe49b5b | 74 | inline Float_t AliL3HoughMaxFinder::GetXPeak(Int_t i) |
75 | { | |
76 | if(i<0 || i>fNMax) | |
77 | { | |
78 | cerr<<"AliL3HoughMaxFinder::GetXPeak : Invalid index "<<i<<endl; | |
79 | return 0; | |
80 | } | |
81 | return fXPeaks[i]; | |
82 | } | |
83 | ||
84 | inline Float_t AliL3HoughMaxFinder::GetYPeak(Int_t i) | |
85 | { | |
86 | if(i<0 || i>fNMax) | |
87 | { | |
88 | cerr<<"AliL3HoughMaxFinder::GetYPeak : Invalid index "<<i<<endl; | |
89 | return 0; | |
90 | } | |
91 | return fYPeaks[i]; | |
92 | ||
93 | } | |
94 | ||
95 | inline Int_t AliL3HoughMaxFinder::GetWeight(Int_t i) | |
96 | { | |
97 | if(i<0 || i>fNMax) | |
98 | { | |
99 | cerr<<"AliL3HoughMaxFinder::GetWeight : Invalid index "<<i<<endl; | |
100 | return 0; | |
101 | } | |
102 | return fWeight[i]; | |
103 | } | |
104 | ||
4de874d1 | 105 | #endif |