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