]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/hough/AliHLTHough.h
STEERBase added to include path
[u/mrichter/AliRoot.git] / HLT / hough / AliHLTHough.h
CommitLineData
3e87ef69 1// @(#) $Id$
2
917e711b 3#ifndef ALIL3HOUGH_H
4#define ALIL3HOUGH_H
f000f8a5 5
4aa41877 6#include "AliHLTRootTypes.h"
7
8class AliHLTHoughMaxFinder;
9class AliHLTHoughBaseTransformer;
10class AliHLTHistogram;
11class AliHLTMemHandler;
12class AliHLTFileHandler;
13class AliHLTHoughEval;
14class AliHLTTrackArray;
15class AliHLTHoughMerger;
16class AliHLTHoughIntMerger;
17class AliHLTHoughGlobalMerger;
18class AliHLTBenchmark;
f000f8a5 19
a8ffd46b 20#include "TThread.h"
de3c3890 21#ifdef use_newio
22#include <AliRunLoader.h>
a109e73e 23#include <../RAW/AliRawEvent.h>
24#endif
25#ifdef use_aliroot
af885e0f 26#include <AliESDEvent.h>
a109e73e 27#include <AliESDHLTtrack.h>
d523f52c 28#include "AliESDtrack.h"
de3c3890 29#endif
30
4aa41877 31class AliHLTHough {
f000f8a5 32 public:
4fc9a6a4 33
4aa41877 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();
de3c3890 37
38#ifdef use_newio
39 void SetRunLoader(AliRunLoader *runloader) {fRunLoader = runloader;}
40#endif
41
a109e73e 42 void Init(Int_t netasegments,Int_t tv,AliRawEvent *rawevent,Float_t zvertex=0.0);
917e711b 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);
6dbc57b4 44 void Init(Bool_t doit=kFALSE, Bool_t addhists=kFALSE);
45
a6008206 46 void Process(Int_t minslice,Int_t maxslice);
208b54c5 47 void ReadData(Int_t slice,Int_t eventnr=0);
917e711b 48 void Transform(Int_t *rowrange = 0);
b1886074 49 void ProcessSliceIter();
50 void ProcessPatchIter(Int_t patch);
51 void MergePatches();
52 void MergeInternally();
44c7f8de 53 void MergeEtaSlices();
54
a6008206 55 void FindTrackCandidates();
de3c3890 56 void FindTrackCandidatesRow();
a6008206 57 void AddAllHistograms();
0bd0c1ef 58 void AddAllHistogramsRows();
a8ffd46b 59 void PrepareForNextPatch(Int_t nextpatch);
917e711b 60 Int_t Evaluate(Int_t roadwidth=1,Int_t nrowstomiss=1);
61 void EvaluatePatch(Int_t i,Int_t roadwidth,Int_t nrowstomiss);
3fe49b5b 62 void WriteTracks(Int_t slice,Char_t *path="./");
b2a02bce 63 void WriteTracks(Char_t *path);
a109e73e 64#ifdef use_aliroot
af885e0f 65 Int_t FillESD(AliESDEvent *esd);
a109e73e 66#endif
a6008206 67 void WriteDigits(Char_t *outfile="output_digits.root");
3fe49b5b 68 void InitEvaluate();
3e87ef69 69 void DoBench(Char_t *filename);
b2a02bce 70 void AddTracks();
3fe49b5b 71
4fc9a6a4 72 //Setters
73 void SetNEtaSegments(Int_t i) {fNEtaSegments = i;}
a6008206 74 void SetAddHistograms() {fAddHistograms = kTRUE;}
b1886074 75 void DoIterative() {fDoIterative = kTRUE;}
a6008206 76 void SetWriteDigits() {fWriteDigits = kTRUE;}
b2a02bce 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);
1e75562a 80 void CalcTransformerParams(Float_t lpt);
b2a02bce 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);
636080ea 84 void SetNSaveIterations(Int_t t=10) {fNSaveIterations=t;}
b2a02bce 85 void SetPeakThreshold(Int_t threshold=0,Int_t patch=-1);
3e87ef69 86
5a31e9df 87 void SetPeakParameters(Int_t kspread,Float_t pratio) {fKappaSpread=kspread; fPeakRatio=pratio;}
88
4fc9a6a4 89 //Getters
4aa41877 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;}
a8ffd46b 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;}
917e711b 105
106 private:
107 Char_t *fInputFile;//!
108 Char_t *fInputPtr;//!
a109e73e 109 AliRawEvent *fRawEvent;//!
917e711b 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
a8ffd46b 118 Int_t fLastPatch; //The index of the last processed patch
917e711b 119 Int_t fVersion; //which HoughTransformer to use
a8ffd46b 120 Int_t fCurrentSlice; // Current TPC slice (sector)
917e711b 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
8da9b1eb 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
a8ffd46b 141
4aa41877 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; //!
917e711b 152
153#ifdef use_newio
154 AliRunLoader *fRunLoader; // Run Loader
155#endif
156
157 void CleanUp();
158 Double_t GetCpuTime();
f000f8a5 159
8da9b1eb 160 TThread *fThread; // Pointer to the TThread object in case of running in a thread
a8ffd46b 161
4aa41877 162 ClassDef(AliHLTHough,1) //Hough transform base class
f000f8a5 163};
164
4aa41877 165typedef AliHLTHough AliL3Hough; // for backward comaptibility
166
f000f8a5 167#endif
6dbc57b4 168
169
170
171
172
173
174