2 // origin: hough/AliL3HoughMaxFinder.h,v 1.24 Mon Nov 8 11:31:13 2004 UTC by cvetan
4 #ifndef ALIHLTTPCHOUGHMAXFINDER_H
5 #define ALIHLTTPCHOUGHMAXFINDER_H
7 #include "AliHLTTPCRootTypes.h"
8 #include "AliHLTTPCStdIncludes.h"
10 class AliHLTTPCHistogram;
11 class AliHLTTPCTrackArray;
12 class AliHLTTPCHoughTrack;
15 struct AliHLTTPCAxisWindow
20 Int_t fWeight; // weight
23 struct AliHLTTPCPre2DPeak
25 Float_t fX; // X coordinate of the preak
26 Float_t fY; // Y coordinate of the preak
27 Float_t fSizeX; // Size of the peak
28 Float_t fSizeY; // Size of the peak
29 Int_t fStartX; // Start position of the peak
30 Int_t fStartY; // Start position of the peak
31 Int_t fEndX; // End position of the peak
32 Int_t fEndY; // End position of the peak
33 Float_t fWeight; // Weight assigned to the peak
36 class AliHLTTPCHoughMaxFinder {
39 AliHLTTPCHoughMaxFinder();
40 AliHLTTPCHoughMaxFinder(Char_t *histotype,Int_t nmax,AliHLTTPCHistogram *hist=0);
41 virtual ~AliHLTTPCHoughMaxFinder();
45 void WriteNtuppel(Char_t *filename);
47 //Simple maxima finders:
50 void FindMaxima(Int_t threshold=0);
51 void FindAdaptedPeaks(Int_t nkappawindow,Float_t cutratio);
52 //Peak finder for HoughTransformerRow
53 void FindAdaptedRowPeaks(Int_t kappawindow,Int_t xsize,Int_t ysize);
54 //More sophisticated peak finders:
55 void FindPeak(Int_t t1,Double_t t2,Int_t t3);
56 void FindPeak1(Int_t ywindow=2,Int_t xbinsides=1);
57 void SortPeaks(struct AliHLTTPCAxisWindow **a,Int_t first,Int_t last);
58 Int_t PeakCompare(struct AliHLTTPCAxisWindow *a,struct AliHLTTPCAxisWindow *b) const;
61 void SetGradient(Float_t x,Float_t y) {fGradX=x; fGradY=y;}
62 void SetThreshold(Int_t f) {fThreshold = f;}
63 void SetHistogram(AliHLTTPCHistogram *hist) {fCurrentHisto = hist;}
64 void SetTrackLUTs(UChar_t *tracknrows, UChar_t *trackfirstrow, UChar_t *tracklastrow, UChar_t *nextrow) {fTrackNRows = tracknrows; fTrackFirstRow = trackfirstrow; fTrackLastRow = tracklastrow; fNextRow = nextrow;}
65 void SetEtaSlice(Int_t etaslice) {fCurrentEtaSlice = etaslice;}
68 Float_t GetXPeak(Int_t i) const;
69 Float_t GetYPeak(Int_t i) const;
70 Float_t GetXPeakSize(Int_t i) const;
71 Float_t GetYPeakSize(Int_t i) const;
72 Int_t GetWeight(Int_t i) const;
73 Int_t GetStartEta(Int_t i) const;
74 Int_t GetEndEta(Int_t i) const;
75 Int_t GetEntries() const {return fNPeaks;}
77 //Method for merging of peaks produced by AliHLTTPCHoughTransfromerRow
78 Bool_t MergeRowPeaks(AliHLTTPCPre2DPeak *maxima1, AliHLTTPCPre2DPeak *maxima2,Float_t distance);
82 Int_t fThreshold; // Threshold for Peak Finder
83 Int_t fCurrentEtaSlice; // Current eta slice being processed
84 AliHLTTPCHistogram *fCurrentHisto; //!
86 UChar_t *fTrackNRows; //!
87 UChar_t *fTrackFirstRow; //!
88 UChar_t *fTrackLastRow; //!
89 UChar_t *fNextRow; //!
91 Float_t fGradX; // Gradient threshold inside Peak Finder
92 Float_t fGradY; // Gradient threshold inside Peak Finder
95 Int_t *fSTARTXPeaks; //!
96 Int_t *fSTARTYPeaks; //!
97 Int_t *fENDXPeaks; //!
98 Int_t *fENDYPeaks; //!
99 Int_t *fSTARTETAPeaks; //!
100 Int_t *fENDETAPeaks; //!
102 Int_t fN1PeaksPrevEtaSlice; // Index of the first peak in the previous eta slice
103 Int_t fN2PeaksPrevEtaSlice; // Index of the last peak in the previous eta slice
104 Int_t fNPeaks; // Index of the last accumulated peak
105 Int_t fNMax; // Maximum allowed number of peaks
107 Char_t fHistoType; // Histogram type
110 TNtuple *fNtuppel; //!
113 ClassDef(AliHLTTPCHoughMaxFinder,1) //Maximum finder class
117 inline Float_t AliHLTTPCHoughMaxFinder::GetXPeak(Int_t i) const
121 STDCERR<<"AliHLTTPCHoughMaxFinder::GetXPeak : Invalid index "<<i<<STDENDL;
127 inline Float_t AliHLTTPCHoughMaxFinder::GetYPeak(Int_t i) const
131 STDCERR<<"AliHLTTPCHoughMaxFinder::GetYPeak : Invalid index "<<i<<STDENDL;
138 inline Int_t AliHLTTPCHoughMaxFinder::GetWeight(Int_t i) const
142 STDCERR<<"AliHLTTPCHoughMaxFinder::GetWeight : Invalid index "<<i<<STDENDL;
148 inline Int_t AliHLTTPCHoughMaxFinder::GetStartEta(Int_t i) const
152 STDCERR<<"AliHLTTPCHoughMaxFinder::GetStartEta : Invalid index "<<i<<STDENDL;
155 return fSTARTETAPeaks[i];
158 inline Int_t AliHLTTPCHoughMaxFinder::GetEndEta(Int_t i) const
162 STDCERR<<"AliHLTTPCHoughMaxFinder::GetStartEta : Invalid index "<<i<<STDENDL;
165 return fENDETAPeaks[i];