a48b784bacb2dd54c2d940f80caafddb32a9a426
[u/mrichter/AliRoot.git] / HLT / hough / AliL3HoughTransformer.h
1 #ifndef ALIL3_HOUGHTRANSFORMER
2 #define ALIL3_HOUGHTRANSFORMER
3
4 #include "AliL3RootTypes.h"
5
6 class AliL3Transform;
7 class AliL3Histogram;
8 class AliL3DigitRowData;
9
10 class AliL3HoughTransformer {
11   
12  private:
13
14   Int_t fSlice;
15   Int_t fPatch;
16   Int_t fNEtaSegments;
17   Double_t fEtaMin;
18   Double_t fEtaMax;
19   Int_t fThreshold;
20   AliL3Transform *fTransform; //!
21   
22   //Pointers to histograms
23   AliL3Histogram **fParamSpace; //!
24
25   //Data pointers
26   UInt_t fNDigitRowData;
27   AliL3DigitRowData *fDigitRowData; //!
28   
29   Int_t GetEtaIndex(Double_t eta);
30   void DeleteHistograms();
31
32  public:
33   AliL3HoughTransformer(); 
34   AliL3HoughTransformer(Int_t slice,Int_t patch,Int_t n_eta_segments);
35   virtual ~AliL3HoughTransformer();
36   
37   void SetInputData(UInt_t ndigits,AliL3DigitRowData *ptr);
38   void CreateHistograms(Int_t nxbin,Double_t ptmin,Int_t nybin,Double_t phimin,Double_t phimax);
39   void CreateHistograms(Int_t nxbin,Double_t xmin,Double_t xmax,
40                         Int_t nybin,Double_t ymin,Double_t ymax);
41   //void CreateHistograms(Int_t nxbin=64,Double_t xmin=-0.006,Double_t xmax=0.006,
42   //Int_t nybin=64,Double_t ymin=-0.26,Double_t ymax=0.26);
43   void Reset();
44   void TransformCircle();
45   void TransformCircleC(Int_t row_range);
46   void TransformLine();
47
48   //Getters
49   Int_t GetSlice() {return fSlice;}
50   Int_t GetPatch() {return fPatch;}
51   Int_t GetNEtaSegments() {return fNEtaSegments;}
52   Int_t GetThreshold() {return fThreshold;}
53   Double_t GetEtaMin() {return fEtaMin;}
54   Double_t GetEtaMax() {return fEtaMax;}
55   Double_t GetEtaSlice() {return (fEtaMax - fEtaMin)/fNEtaSegments;}
56   void *GetDataPointer() {return (void*)fDigitRowData;}
57   AliL3Histogram *GetHistogram(Int_t eta_index);
58   
59   //setters
60   void SetThreshold(Int_t i) {fThreshold = i;}
61
62   ClassDef(AliL3HoughTransformer,1) //Hough transformation class
63
64 };
65
66 inline AliL3Histogram *AliL3HoughTransformer::GetHistogram(Int_t eta_index)
67 {
68   if(!fParamSpace || eta_index >= fNEtaSegments || eta_index < 0)
69     return 0;
70   if(!fParamSpace[eta_index])
71     return 0;
72   return fParamSpace[eta_index];
73 }
74
75 #endif