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