3 #ifndef ALIL3HOUGHMAXFINDER_H
4 #define ALIL3HOUGHMAXFINDER_H
6 #include "AliHLTRootTypes.h"
7 #include "AliHLTStandardIncludes.h"
10 class AliHLTTrackArray;
11 class AliHLTHoughTrack;
14 struct AliHLTAxisWindow
19 Int_t fWeight; // weight
22 struct AliHLTPre2DPeak
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
35 class AliHLTHoughMaxFinder {
38 AliHLTHoughMaxFinder();
39 AliHLTHoughMaxFinder(Char_t *histotype,Int_t nmax,AliHLTHistogram *hist=0);
40 virtual ~AliHLTHoughMaxFinder();
44 void WriteNtuppel(Char_t *filename);
46 //Simple maxima finders:
49 void FindMaxima(Int_t threshold=0);
50 void FindAdaptedPeaks(Int_t nkappawindow,Float_t cutratio);
51 //Peak finder for HoughTransformerRow
52 void FindAdaptedRowPeaks(Int_t kappawindow,Int_t xsize,Int_t ysize);
53 //More sophisticated peak finders:
54 void FindPeak(Int_t t1,Double_t t2,Int_t t3);
55 void FindPeak1(Int_t ywindow=2,Int_t xbinsides=1);
56 void SortPeaks(struct AliHLTAxisWindow **a,Int_t first,Int_t last);
57 Int_t PeakCompare(struct AliHLTAxisWindow *a,struct AliHLTAxisWindow *b) const;
60 void SetGradient(Float_t x,Float_t y) {fGradX=x; fGradY=y;}
61 void SetThreshold(Int_t f) {fThreshold = f;}
62 void SetHistogram(AliHLTHistogram *hist) {fCurrentHisto = hist;}
63 void SetTrackLUTs(UChar_t *tracknrows, UChar_t *trackfirstrow, UChar_t *tracklastrow, UChar_t *nextrow) {fTrackNRows = tracknrows; fTrackFirstRow = trackfirstrow; fTrackLastRow = tracklastrow; fNextRow = nextrow;}
64 void SetEtaSlice(Int_t etaslice) {fCurrentEtaSlice = etaslice;}
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;}
76 //Method for merging of peaks produced by AliHLTHoughTransfromerRow
77 Bool_t MergeRowPeaks(AliHLTPre2DPeak *maxima1, AliHLTPre2DPeak *maxima2,Float_t distance);
81 Int_t fThreshold; // Threshold for Peak Finder
82 Int_t fCurrentEtaSlice; // Current eta slice being processed
83 AliHLTHistogram *fCurrentHisto; //!
85 UChar_t *fTrackNRows; //!
86 UChar_t *fTrackFirstRow; //!
87 UChar_t *fTrackLastRow; //!
88 UChar_t *fNextRow; //!
90 Float_t fGradX; // Gradient threshold inside Peak Finder
91 Float_t fGradY; // Gradient threshold inside Peak Finder
94 Int_t *fSTARTXPeaks; //!
95 Int_t *fSTARTYPeaks; //!
96 Int_t *fENDXPeaks; //!
97 Int_t *fENDYPeaks; //!
98 Int_t *fSTARTETAPeaks; //!
99 Int_t *fENDETAPeaks; //!
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
106 Char_t fHistoType; // Histogram type
109 TNtuple *fNtuppel; //!
112 ClassDef(AliHLTHoughMaxFinder,1) //Maximum finder class
116 typedef AliHLTHoughMaxFinder AliL3HoughMaxFinder; // for backward compatibility
118 inline Float_t AliHLTHoughMaxFinder::GetXPeak(Int_t i) const
122 STDCERR<<"AliHLTHoughMaxFinder::GetXPeak : Invalid index "<<i<<STDENDL;
128 inline Float_t AliHLTHoughMaxFinder::GetYPeak(Int_t i) const
132 STDCERR<<"AliHLTHoughMaxFinder::GetYPeak : Invalid index "<<i<<STDENDL;
139 inline Int_t AliHLTHoughMaxFinder::GetWeight(Int_t i) const
143 STDCERR<<"AliHLTHoughMaxFinder::GetWeight : Invalid index "<<i<<STDENDL;
149 inline Int_t AliHLTHoughMaxFinder::GetStartEta(Int_t i) const
153 STDCERR<<"AliHLTHoughMaxFinder::GetStartEta : Invalid index "<<i<<STDENDL;
156 return fSTARTETAPeaks[i];
159 inline Int_t AliHLTHoughMaxFinder::GetEndEta(Int_t i) const
163 STDCERR<<"AliHLTHoughMaxFinder::GetStartEta : Invalid index "<<i<<STDENDL;
166 return fENDETAPeaks[i];