]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/hough/AliHLTHough.h
STEERBase added to include path
[u/mrichter/AliRoot.git] / HLT / hough / AliHLTHough.h
1 // @(#) $Id$
2
3 #ifndef ALIL3HOUGH_H
4 #define ALIL3HOUGH_H
5
6 #include "AliHLTRootTypes.h"
7
8 class AliHLTHoughMaxFinder;
9 class AliHLTHoughBaseTransformer;
10 class AliHLTHistogram;
11 class AliHLTMemHandler;
12 class AliHLTFileHandler;
13 class AliHLTHoughEval;
14 class AliHLTTrackArray;
15 class AliHLTHoughMerger;
16 class AliHLTHoughIntMerger;
17 class AliHLTHoughGlobalMerger;
18 class AliHLTBenchmark;
19
20 #include "TThread.h"
21 #ifdef use_newio
22 #include <AliRunLoader.h>
23 #include <../RAW/AliRawEvent.h>
24 #endif
25 #ifdef use_aliroot
26 #include <AliESDEvent.h>
27 #include <AliESDHLTtrack.h>
28 #include "AliESDtrack.h"
29 #endif
30
31 class AliHLTHough {
32  public:
33   
34   AliHLTHough(); 
35   AliHLTHough(Char_t *path,Bool_t binary,Int_t netasegments=100,Bool_t bit8=kFALSE,Int_t tv=0,Char_t *infile=0,Char_t *ptr=0);
36   virtual ~AliHLTHough();
37
38 #ifdef use_newio  
39   void SetRunLoader(AliRunLoader *runloader) {fRunLoader = runloader;}
40 #endif
41
42   void Init(Int_t netasegments,Int_t tv,AliRawEvent *rawevent,Float_t zvertex=0.0);
43   void Init(Char_t *path,Bool_t binary,Int_t netasegments=100,Bool_t bit8=kFALSE,Int_t tv=0,Char_t *infile=0,Char_t *ptr=0,Float_t zvertex=0.0);
44   void Init(Bool_t doit=kFALSE, Bool_t addhists=kFALSE);
45
46   void Process(Int_t minslice,Int_t maxslice);
47   void ReadData(Int_t slice,Int_t eventnr=0);
48   void Transform(Int_t *rowrange = 0);
49   void ProcessSliceIter();
50   void ProcessPatchIter(Int_t patch);
51   void MergePatches();
52   void MergeInternally();
53   void MergeEtaSlices();
54
55   void FindTrackCandidates();
56   void FindTrackCandidatesRow();
57   void AddAllHistograms();
58   void AddAllHistogramsRows();
59   void PrepareForNextPatch(Int_t nextpatch);
60   Int_t Evaluate(Int_t roadwidth=1,Int_t nrowstomiss=1);
61   void EvaluatePatch(Int_t i,Int_t roadwidth,Int_t nrowstomiss);
62   void WriteTracks(Int_t slice,Char_t *path="./");
63   void WriteTracks(Char_t *path);
64 #ifdef use_aliroot
65   Int_t FillESD(AliESDEvent *esd);
66 #endif
67   void WriteDigits(Char_t *outfile="output_digits.root");
68   void InitEvaluate();
69   void DoBench(Char_t *filename);
70   void AddTracks();
71   
72   //Setters
73   void SetNEtaSegments(Int_t i) {fNEtaSegments = i;}
74   void SetAddHistograms() {fAddHistograms = kTRUE;}
75   void DoIterative() {fDoIterative = kTRUE;}
76   void SetWriteDigits() {fWriteDigits = kTRUE;}
77   void SetTransformerParams(Float_t ptres=0,Float_t ptmin=0,Float_t ptmax=0,Int_t ny=0,Int_t patch=-1);
78   //{fPtRes=ptres;fNBinY=ny;fLowPt=ptmin;fUpperPt=ptmax;fPhi=psi;}
79   void SetTransformerParams(Int_t nx,Int_t ny,Float_t lpt,Int_t patch);
80   void CalcTransformerParams(Float_t lpt);
81   void SetTransformerParams(Int_t nx,Int_t ny,Float_t lpt,Float_t phi);
82   //{fNBinX=nx;fNBinY=ny;fLowPt=lpt;fPhi=phi;}
83   void SetThreshold(Int_t t=3,Int_t patch=-1);
84   void SetNSaveIterations(Int_t t=10) {fNSaveIterations=t;}
85   void SetPeakThreshold(Int_t threshold=0,Int_t patch=-1);
86   
87   void SetPeakParameters(Int_t kspread,Float_t pratio) {fKappaSpread=kspread; fPeakRatio=pratio;}
88   
89   //Getters
90   AliHLTHoughBaseTransformer *GetTransformer(Int_t i) {if(!fHoughTransformer[i]) return 0; return fHoughTransformer[i];}
91   AliHLTTrackArray *GetTracks(Int_t i) {if(!fTracks[i]) return 0; return fTracks[i];}
92   AliHLTHoughEval *GetEval(Int_t i) {if(!fEval[i]) return 0; return fEval[i];}
93   AliHLTHoughMerger *GetMerger() {if(!fMerger) return 0; return fMerger;}
94   AliHLTHoughIntMerger *GetInterMerger() {if(!fInterMerger) return 0; return fInterMerger;}
95   AliHLTMemHandler *GetMemHandler(Int_t i) {if(!fMemHandler[i]) return 0; return fMemHandler[i];}
96   AliHLTHoughMaxFinder *GetMaxFinder() {return fPeakFinder;}
97
98   //Special methods for executing Hough Transform as a thread
99   static void *ProcessInThread(void *args);
100   void StartProcessInThread(Int_t minslice,Int_t maxslice);
101   Int_t WaitForThreadFinish();
102   void SetMinMaxSlices(Int_t minslice,Int_t maxslice) {fMinSlice = minslice; fMaxSlice = maxslice;} 
103   Int_t GetMinSlice() {return fMinSlice;}
104   Int_t GetMaxSlice() {return fMaxSlice;}
105   
106  private:
107   Char_t *fInputFile;//!
108   Char_t *fInputPtr;//!
109   AliRawEvent *fRawEvent;//!
110   Char_t fPath[1024]; // Path to the files
111   Bool_t fBinary; // Is input binary
112   Bool_t fAddHistograms; // Add all patch histograms at the end or not
113   Bool_t fDoIterative; // Iterative or not
114   Bool_t fWriteDigits; // Write Digits or not
115   Bool_t fUse8bits; // Use 8 bits or not
116   Int_t fNEtaSegments; // Number of eta slices
117   Int_t fNPatches; // Number of patches
118   Int_t fLastPatch; //The index of the last processed patch
119   Int_t fVersion; //which HoughTransformer to use
120   Int_t fCurrentSlice; // Current TPC slice (sector)
121   Int_t fEvent; // Current event number
122
123   Int_t fPeakThreshold[6]; // Threshold for the peak finder
124   Float_t fLowPt[6]; // Lower limit on Pt
125   Float_t fUpperPt[6]; // Upper limit on Pt
126   Float_t fPtRes[6]; // Desired Pt resolution
127   Float_t fPhi[6]; // Limit on the emission angle
128   Int_t fNBinX[6]; // Number of bins in the Hough space
129   Int_t fNBinY[6]; // Number of bins in the Hough space
130   Int_t fThreshold[6]; // Threshold for digits
131   Int_t fNSaveIterations; //for HoughtransformerVhdl
132   
133   //parameters for the peak finder:
134   Int_t fKappaSpread; // Kappa spread
135   Float_t fPeakRatio; // Peak ratio
136
137   Float_t fZVertex; // Z position of the primary vertex
138
139   Int_t fMinSlice; // First TPC slice (sector) to process while running in a thread
140   Int_t fMaxSlice; // Last TPC slice (sector) to process while running in a thread
141
142   AliHLTMemHandler **fMemHandler; //!
143   AliHLTHoughBaseTransformer **fHoughTransformer; //!
144   AliHLTHoughEval **fEval; //!
145   AliHLTHoughMaxFinder *fPeakFinder; //!
146   AliHLTTrackArray **fTracks; //!
147   AliHLTTrackArray *fGlobalTracks; //!
148   AliHLTHoughMerger *fMerger; //!
149   AliHLTHoughIntMerger *fInterMerger; //!
150   AliHLTHoughGlobalMerger *fGlobalMerger; //!
151   AliHLTBenchmark *fBenchmark; //!
152
153 #ifdef use_newio
154   AliRunLoader *fRunLoader; // Run Loader
155 #endif
156
157   void CleanUp();
158   Double_t GetCpuTime();
159
160   TThread *fThread; // Pointer to the TThread object in case of running in a thread
161
162   ClassDef(AliHLTHough,1) //Hough transform base class
163 };
164
165 typedef AliHLTHough AliL3Hough; // for backward comaptibility
166
167 #endif
168
169
170
171
172
173
174