]>
Commit | Line | Data |
---|---|---|
3e87ef69 | 1 | // @(#) $Id$ |
2 | ||
917e711b | 3 | #ifndef ALIL3HOUGHMAXFINDER_H |
4 | #define ALIL3HOUGHMAXFINDER_H | |
4de874d1 | 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 | |
917e711b | 14 | struct AliL3AxisWindow |
4fc9a6a4 | 15 | { |
917e711b | 16 | Int_t fYmin; // min Y |
17 | Int_t fYmax; // max Y | |
18 | Int_t fXbin; // X bin | |
19 | Int_t fWeight; // weight | |
4fc9a6a4 | 20 | }; |
4cafa5fc | 21 | |
1e75562a | 22 | struct AliL3Pre2DPeak |
23 | { | |
24 | Float_t fX; // X coordinate of the preak | |
25 | Float_t fY; // Y coordinate of the preak | |
26 | Float_t fSizeX; // Size of the peak | |
27 | Float_t fSizeY; // Size of the peak | |
28 | Int_t fStartX; // Start position of the peak | |
29 | Int_t fStartY; // Start position of the peak | |
30 | Int_t fEndX; // End position of the peak | |
31 | Int_t fEndY; // End position of the peak | |
32 | Float_t fWeight; // Weight assigned to the peak | |
33 | }; | |
34 | ||
95a00d93 | 35 | class AliL3HoughMaxFinder { |
208b54c5 | 36 | |
4de874d1 | 37 | public: |
38 | AliL3HoughMaxFinder(); | |
3fe49b5b | 39 | AliL3HoughMaxFinder(Char_t *histotype,Int_t nmax,AliL3Histogram *hist=0); |
4de874d1 | 40 | virtual ~AliL3HoughMaxFinder(); |
3fe49b5b | 41 | void Reset(); |
2061190a | 42 | |
208b54c5 | 43 | void CreateNtuppel(); |
44 | void WriteNtuppel(Char_t *filename); | |
45 | ||
3fe49b5b | 46 | //Simple maxima finders: |
47 | void FindAbsMaxima(); | |
48 | void FindBigMaxima(); | |
b2a02bce | 49 | void FindMaxima(Int_t threshold=0); |
917e711b | 50 | void FindAdaptedPeaks(Int_t nkappawindow,Float_t cutratio); |
0bd0c1ef | 51 | //Peak finder for HoughTransformerRow |
52 | void FindAdaptedRowPeaks(Int_t kappawindow,Int_t xsize,Int_t ysize); | |
3fe49b5b | 53 | //More sophisticated peak finders: |
7f66cda9 | 54 | void FindPeak(Int_t t1,Double_t t2,Int_t t3); |
917e711b | 55 | void FindPeak1(Int_t ywindow=2,Int_t xbinsides=1); |
56 | void SortPeaks(struct AliL3AxisWindow **a,Int_t first,Int_t last); | |
57 | Int_t PeakCompare(struct AliL3AxisWindow *a,struct AliL3AxisWindow *b) const; | |
4cafa5fc | 58 | |
3fe49b5b | 59 | //Setters: |
b2a02bce | 60 | void SetGradient(Float_t x,Float_t y) {fGradX=x; fGradY=y;} |
4de874d1 | 61 | void SetThreshold(Int_t f) {fThreshold = f;} |
4cafa5fc | 62 | void SetHistogram(AliL3Histogram *hist) {fCurrentHisto = hist;} |
1e75562a | 63 | void SetTrackLUTs(UChar_t *tracknrows, UChar_t *trackfirstrow, UChar_t *tracklastrow, UChar_t *nextrow) {fTrackNRows = tracknrows; fTrackFirstRow = trackfirstrow; fTrackLastRow = tracklastrow; fNextRow = nextrow;} |
de3c3890 | 64 | void SetEtaSlice(Int_t etaslice) {fCurrentEtaSlice = etaslice;} |
4cafa5fc | 65 | |
3fe49b5b | 66 | //Getters: |
917e711b | 67 | Float_t GetXPeak(Int_t i) const; |
68 | Float_t GetYPeak(Int_t i) const; | |
69 | Float_t GetXPeakSize(Int_t i) const; | |
70 | Float_t GetYPeakSize(Int_t i) const; | |
71 | Int_t GetWeight(Int_t i) const; | |
72 | Int_t GetStartEta(Int_t i) const; | |
73 | Int_t GetEndEta(Int_t i) const; | |
74 | Int_t GetEntries() const {return fNPeaks;} | |
1e75562a | 75 | |
76 | //Method for merging of peaks produced by AliL3HoughTransfromerRow | |
77 | Bool_t MergeRowPeaks(AliL3Pre2DPeak *maxima1, AliL3Pre2DPeak *maxima2,Float_t distance); | |
917e711b | 78 | |
79 | private: | |
80 | ||
81 | Int_t fThreshold; // Threshold for Peak Finder | |
82 | Int_t fCurrentEtaSlice; // Current eta slice being processed | |
83 | AliL3Histogram *fCurrentHisto; //! | |
a8ffd46b | 84 | |
85 | UChar_t *fTrackNRows; //! | |
86 | UChar_t *fTrackFirstRow; //! | |
87 | UChar_t *fTrackLastRow; //! | |
1e75562a | 88 | UChar_t *fNextRow; //! |
917e711b | 89 | |
90 | Float_t fGradX; // Gradient threshold inside Peak Finder | |
91 | Float_t fGradY; // Gradient threshold inside Peak Finder | |
92 | Float_t *fXPeaks; //! | |
93 | Float_t *fYPeaks; //! | |
94 | Int_t *fSTARTXPeaks; //! | |
95 | Int_t *fSTARTYPeaks; //! | |
96 | Int_t *fENDXPeaks; //! | |
97 | Int_t *fENDYPeaks; //! | |
98 | Int_t *fSTARTETAPeaks; //! | |
99 | Int_t *fENDETAPeaks; //! | |
100 | Int_t *fWeight; //! | |
101 | Int_t fN1PeaksPrevEtaSlice; // Index of the first peak in the previous eta slice | |
102 | Int_t fN2PeaksPrevEtaSlice; // Index of the last peak in the previous eta slice | |
103 | Int_t fNPeaks; // Index of the last accumulated peak | |
104 | Int_t fNMax; // Maximum allowed number of peaks | |
105 | ||
106 | Char_t fHistoType; // Histogram type | |
107 | ||
108 | #ifndef no_root | |
109 | TNtuple *fNtuppel; //! | |
110 | #endif | |
3fe49b5b | 111 | |
b1886074 | 112 | ClassDef(AliL3HoughMaxFinder,1) //Maximum finder class |
4de874d1 | 113 | |
114 | }; | |
115 | ||
917e711b | 116 | inline Float_t AliL3HoughMaxFinder::GetXPeak(Int_t i) const |
3fe49b5b | 117 | { |
118 | if(i<0 || i>fNMax) | |
119 | { | |
e06900d5 | 120 | STDCERR<<"AliL3HoughMaxFinder::GetXPeak : Invalid index "<<i<<STDENDL; |
3fe49b5b | 121 | return 0; |
122 | } | |
123 | return fXPeaks[i]; | |
124 | } | |
125 | ||
917e711b | 126 | inline Float_t AliL3HoughMaxFinder::GetYPeak(Int_t i) const |
3fe49b5b | 127 | { |
128 | if(i<0 || i>fNMax) | |
129 | { | |
e06900d5 | 130 | STDCERR<<"AliL3HoughMaxFinder::GetYPeak : Invalid index "<<i<<STDENDL; |
3fe49b5b | 131 | return 0; |
132 | } | |
133 | return fYPeaks[i]; | |
134 | ||
135 | } | |
136 | ||
917e711b | 137 | inline Int_t AliL3HoughMaxFinder::GetWeight(Int_t i) const |
3fe49b5b | 138 | { |
139 | if(i<0 || i>fNMax) | |
140 | { | |
e06900d5 | 141 | STDCERR<<"AliL3HoughMaxFinder::GetWeight : Invalid index "<<i<<STDENDL; |
3fe49b5b | 142 | return 0; |
143 | } | |
144 | return fWeight[i]; | |
145 | } | |
146 | ||
917e711b | 147 | inline Int_t AliL3HoughMaxFinder::GetStartEta(Int_t i) const |
de3c3890 | 148 | { |
149 | if(i<0 || i>fNMax) | |
150 | { | |
151 | STDCERR<<"AliL3HoughMaxFinder::GetStartEta : Invalid index "<<i<<STDENDL; | |
152 | return 0; | |
153 | } | |
154 | return fSTARTETAPeaks[i]; | |
155 | } | |
156 | ||
917e711b | 157 | inline Int_t AliL3HoughMaxFinder::GetEndEta(Int_t i) const |
de3c3890 | 158 | { |
159 | if(i<0 || i>fNMax) | |
160 | { | |
161 | STDCERR<<"AliL3HoughMaxFinder::GetStartEta : Invalid index "<<i<<STDENDL; | |
162 | return 0; | |
163 | } | |
164 | return fENDETAPeaks[i]; | |
165 | } | |
166 | ||
4de874d1 | 167 | #endif |
2061190a | 168 |