]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCATracker.h
3f353d3162c035ab2a25e2f29ad8c7546756ba05
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCATracker.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3 // ************************************************************************
4 // This file is property of and copyright by the ALICE HLT Project        *
5 // ALICE Experiment at CERN, All rights reserved.                         *
6 // See cxx source for full Copyright notice                               *
7 //                                                                        *
8 //*************************************************************************
9
10 #ifndef ALIHLTTPCCATRACKER_H
11 #define ALIHLTTPCCATRACKER_H
12
13
14 #include "AliHLTTPCCADef.h"
15 #include "AliHLTTPCCAGPUConfig.h"
16
17 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
18 #include <iostream>
19 #endif
20
21 #include "AliHLTTPCCAParam.h"
22 #include "AliHLTTPCCAHitId.h"
23 #include "AliHLTTPCCASliceData.h"
24 #include "AliHLTTPCCASliceOutput.h"
25 #include "AliHLTTPCCATrackletConstructor.h"
26 #include "AliHLTTPCCATracklet.h"
27
28 MEM_CLASS_PRE() class AliHLTTPCCATrack;
29 MEM_CLASS_PRE() class AliHLTTPCCATrackParam;
30 class AliHLTTPCCAClusterData;
31 MEM_CLASS_PRE() class AliHLTTPCCARow;
32
33 #include "TStopwatch.h"
34
35 /**
36  * @class AliHLTTPCCATracker
37  *
38  * Slice tracker for ALICE HLT.
39  * The class reconstructs tracks in one slice of TPC.
40  * The reconstruction algorithm is based on the Cellular Automaton method
41  *
42  * The CA tracker is designed stand-alone.
43  * It is integrated to the HLT framework via AliHLTTPCCATrackerComponent interface.
44  * The class is under construction.
45  *
46  */
47
48 class AliHLTTPCCAClusterData;
49
50 MEM_CLASS_PRE() class AliHLTTPCCATracker
51 {
52   public:
53
54   AliHLTTPCCATracker()
55     :
56 #ifdef HLTCA_STANDALONE
57       fStageAtSync( NULL ),
58           fLinkTmpMemory( NULL ),
59 #endif
60           fParam(),
61       fOutputControl(),
62       fClusterData( 0 ),
63       fData(),
64       fIsGPUTracker( false ),
65       fGPUDebugLevel( 0 ),
66       fGPUDebugOut( 0 ),
67       fRowStartHitCountOffset( NULL ),
68       fTrackletTmpStartHits( NULL ),
69       fGPUTrackletTemp( NULL ),
70       fRowBlockTracklets( NULL ),
71       fRowBlockPos( NULL ),
72       fBlockStartingTracklet( NULL ),
73       fGPUParametersConst(),
74       fCommonMem( 0 ),
75       fHitMemory( 0 ),
76       fHitMemorySize( 0 ),
77       fTrackletMemory( 0 ),
78       fTrackletMemorySize( 0 ),
79       fTrackMemory( 0 ),
80       fTrackMemorySize( 0 ),
81       fTrackletStartHits( 0 ),
82       fTracklets( 0 ),
83       fTrackletRowHits( NULL ),
84       fTracks( 0 ),
85       fTrackHits( 0 ),
86       fOutput( 0 )
87   {
88     // constructor
89     for( int i=0; i<10; i++ ) fTimers[i] = 0;
90     for( int i=0; i<16; i++ ) fPerfTimers[i] = 0;
91   }
92   ~AliHLTTPCCATracker();
93   
94   struct StructGPUParameters
95   {
96     StructGPUParameters() : fNextTracklet(0), fScheduleFirstDynamicTracklet( 0 ), fGPUError( 0 ) {}
97         int fNextTracklet;                                              //Next Tracklet to process
98     int fScheduleFirstDynamicTracklet;          //Last Tracklet with fixed position in sheduling
99     int fGPUError;                                                      //Signalizes error on GPU during GPU Reconstruction, kind of return value
100   };
101   
102   MEM_CLASS_PRE2() struct StructGPUParametersConst
103   {
104     StructGPUParametersConst() : fGPUFixedBlockCount( 0 ), fGPUiSlice( 0 ), fGPUnSlices( 0 ), fGPUMem( NULL ) {}
105     int fGPUFixedBlockCount;                            //Count of blocks that is used for this tracker in fixed schedule situations
106     int fGPUiSlice;                                                     // slice number processed by running GPU MP
107     int fGPUnSlices;                                            // n of slices to be processed in parallel
108         GPUglobalref() char* fGPUMem;                   //Base pointer to GPU memory (Needed for OpenCL for verification)
109   };
110   
111   struct commonMemoryStruct
112   {
113     commonMemoryStruct() : fNTracklets( 0 ), fNTracks( 0 ), fNLocalTracks( 0 ), fNTrackHits( 0 ), fNLocalTrackHits( 0 ), fGPUParameters() {}
114     int fNTracklets;     // number of tracklets
115     int fNTracks;            // number of reconstructed tracks
116         int fNLocalTracks;       //number of reconstructed tracks before global tracking
117     int fNTrackHits;           // number of track hits
118         int fNLocalTrackHits; //see above
119     StructGPUParameters fGPUParameters; // GPU parameters
120   };
121   
122   MEM_CLASS_PRE2() void Initialize( const MEM_LG2(AliHLTTPCCAParam) &param );
123   
124   void StartEvent();
125   
126   int CheckEmptySlice() const;
127   void WriteOutputPrepare();
128   void WriteOutput();
129   
130 #if !defined(HLTCA_GPUCODE)
131   void Reconstruct();
132   void ReconstructOutput();
133 #endif //!HLTCA_GPUCODE
134   void DoTracking();
135   
136   //Make Reconstruction steps directly callable (Used for GPU debugging)
137   void RunNeighboursFinder();
138   void RunNeighboursCleaner();
139   void RunStartHitsFinder();
140   void RunTrackletConstructor();
141   void RunTrackletSelector();
142   
143   //GPU Tracker Interface
144   void SetGPUTracker();
145 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
146   void SetGPUDebugLevel(int Level, std::ostream *NewDebugOut = NULL) {fGPUDebugLevel = Level;if (NewDebugOut) fGPUDebugOut = NewDebugOut;}
147   char* SetGPUTrackerCommonMemory(char* const pGPUMemory);
148   char* SetGPUTrackerHitsMemory(char* pGPUMemory, int MaxNHits);
149   char* SetGPUTrackerTrackletsMemory(char* pGPUMemory, int MaxNTracklets, int constructorBlockCount);
150   char* SetGPUTrackerTracksMemory(char* pGPUMemory, int MaxNTracks, int MaxNHits );
151   
152   //Debugging Stuff
153   void DumpSliceData(std::ostream &out);        //Dump Input Slice Data
154   void DumpLinks(std::ostream &out);            //Dump all links to file (for comparison after NeighboursFinder/Cleaner)
155   void DumpStartHits(std::ostream &out);        //Same for Start Hits
156   void DumpHitWeights(std::ostream &out); //....
157   void DumpTrackHits(std::ostream &out);        //Same for Track Hits
158   void DumpTrackletHits(std::ostream &out);     //Same for Track Hits
159   void DumpOutput(FILE* out);   //Similar for output
160
161   void SetOutput( AliHLTTPCCASliceOutput** out ) { fOutput = out; }
162   void ReadEvent( AliHLTTPCCAClusterData *clusterData );
163
164   GPUhd() const AliHLTTPCCASliceOutput::outputControlStruct* OutputControl() const { return fOutputControl; }  
165   GPUh() void SetOutputControl( AliHLTTPCCASliceOutput::outputControlStruct* const val) { fOutputControl = val; }
166
167   GPUhd() AliHLTTPCCAClusterData *ClusterData() const { return fClusterData; }
168
169   GPUh() void ClearSliceDataHitWeights() {fData.ClearHitWeights();}
170   GPUh() MakeType(const MEM_LG(AliHLTTPCCARow)&) Row( const AliHLTTPCCAHitId &HitId ) const { return fData.Row( HitId.RowIndex() ); }
171
172   GPUhd() AliHLTTPCCASliceOutput** Output() const { return fOutput; }
173
174   GPUh() GPUglobalref() commonMemoryStruct *CommonMemory() const {return(fCommonMem); }
175   GPUh() static size_t CommonMemorySize() { return(sizeof(AliHLTTPCCATracker::commonMemoryStruct)); }
176   GPUh() GPUglobalref() char* HitMemory() const {return(fHitMemory); }
177   GPUh() size_t HitMemorySize() const {return(fHitMemorySize); }
178   GPUh() char* TrackletMemory() {return(fTrackletMemory); }
179   GPUh() size_t TrackletMemorySize() const {return(fTrackletMemorySize); }
180   GPUh() char* TrackMemory() {return(fTrackMemory); }
181   GPUh() size_t TrackMemorySize() const {return(fTrackMemorySize); }
182
183   GPUh() void SetGPUSliceDataMemory(void* const pSliceMemory, void* const pRowMemory) { fData.SetGPUSliceDataMemory(pSliceMemory, pRowMemory); }
184   GPUh() unsigned long long int* PerfTimer(unsigned int i) {return &fPerfTimers[i]; }
185
186   GPUh() static int SortComparison(const void* a, const void* b);
187 #endif  
188   
189   MEM_CLASS_PRE2() GPUd() void GetErrors2( int iRow,  const MEM_LG2(AliHLTTPCCATrackParam) &t, float &Err2Y, float &Err2Z ) const {fParam.GetClusterErrors2( iRow, t.GetZ(), t.SinPhi(), t.GetCosPhi(), t.DzDs(), Err2Y, Err2Z );}
190   GPUd() void GetErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const
191   {
192         fParam.GetClusterErrors2( iRow, z, sinPhi, cosPhi, DzDs, Err2Y, Err2Z );
193         Err2Y*=fParam.ClusterError2CorrectionY();
194         Err2Z*=fParam.ClusterError2CorrectionZ();
195   }
196   
197   MEM_CLASS_PRE2() void FitTrack( const MEM_LG2(AliHLTTPCCATrack) &track, float *t0 = 0 ) const;
198   MEM_CLASS_PRE2() void FitTrackFull( const MEM_LG2(AliHLTTPCCATrack) &track, float *t0 = 0 ) const;
199   
200   void SetupCommonMemory();
201   void SetPointersHits( int MaxNHits );
202   void SetPointersTracklets ( int MaxNTracklets );
203   void SetPointersTracks( int MaxNTracks, int MaxNHits );
204   size_t SetPointersSliceData(const AliHLTTPCCAClusterData *data, bool allocate = false) { return(fData.SetPointers(data, allocate)); }
205  
206 #if !defined(HLTCA_GPUCODE)
207   GPUh() void WriteEvent( std::ostream &out );
208   GPUh() void WriteTracks( std::ostream &out ) ;
209   GPUh() void ReadTracks( std::istream &in );
210 #endif //!HLTCA_GPUCODE
211   
212   GPUhd() MakeType(const MEM_LG(AliHLTTPCCAParam)&) Param() const { return fParam; }
213   GPUhd() MakeType(const MEM_LG(AliHLTTPCCAParam)*) pParam() const { return &fParam; }
214   MEM_CLASS_PRE2() GPUhd() void SetParam( const MEM_LG2(AliHLTTPCCAParam) &v ) { fParam = v; }
215   
216   GPUhd() MakeType(const MEM_LG(AliHLTTPCCASliceData)&) Data() const { return fData; }
217   
218   GPUhd() GPUglobalref() const MEM_GLOBAL(AliHLTTPCCARow)& Row( int rowIndex ) const { return fData.Row( rowIndex ); }
219   
220   GPUhd() double Timer( int i ) const { return fTimers[i]; }
221   GPUhd() void SetTimer( int i, double v ) { fTimers[i] = v; }
222   
223   GPUhd() int NHitsTotal() const { return fData.NumberOfHits(); }
224   
225   MEM_TEMPLATE() GPUd() void SetHitLinkUpData( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex, short v ) { fData.SetHitLinkUpData( row, hitIndex, v ); }
226   MEM_TEMPLATE() GPUd() void SetHitLinkDownData( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex, short v ) { fData.SetHitLinkDownData( row, hitIndex, v ); }
227   MEM_TEMPLATE() GPUd() short HitLinkUpData( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex ) const { return fData.HitLinkUpData( row, hitIndex ); }
228   MEM_TEMPLATE() GPUd() short HitLinkDownData( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex ) const { return fData.HitLinkDownData( row, hitIndex ); }
229   
230   //MEM_CLASS_PRE2() GPUd() GPUglobalref() const ushort2 *HitData( const MEM_TYPE( AliHLTTPCCARow)&row ) const { return fData.HitData(row); }
231   MEM_TEMPLATE() GPUd() GPUglobalref() const ushort2 *HitData( const MEM_TYPE( AliHLTTPCCARow)& row ) const { return fData.HitData(row); }
232   MEM_TEMPLATE() GPUd() GPUglobalref() const short_v *HitLinkUpData  ( const MEM_TYPE( AliHLTTPCCARow)&row ) const { return fData.HitLinkUpData(row); }
233   MEM_TEMPLATE() GPUd() GPUglobalref() const short_v *HitLinkDownData( const MEM_TYPE( AliHLTTPCCARow)&row ) const { return fData.HitLinkDownData(row); }
234   MEM_TEMPLATE() GPUd() GPUglobalref() const ushort_v *FirstHitInBin( const MEM_TYPE( AliHLTTPCCARow)&row ) const { return fData.FirstHitInBin(row); }
235   
236   MEM_TEMPLATE() GPUd() int FirstHitInBin( const MEM_TYPE( AliHLTTPCCARow)&row, int binIndex ) const { return fData.FirstHitInBin( row, binIndex ); }
237   
238   MEM_TEMPLATE() GPUd() unsigned short HitDataY( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex ) const {
239     return fData.HitDataY( row, hitIndex );
240   }
241   MEM_TEMPLATE() GPUd() unsigned short HitDataZ( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex ) const {
242     return fData.HitDataZ( row, hitIndex );
243   }
244   MEM_TEMPLATE() GPUd() ushort2 HitData( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex ) const {
245     return fData.HitData( row, hitIndex );
246   }
247   
248   MEM_TEMPLATE() GPUhd() int HitInputID( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex ) const { return fData.ClusterDataIndex( row, hitIndex ); }
249   
250   /**
251    * The hit weight is used to determine whether a hit belongs to a certain tracklet or another one
252    * competing for the same hit. The tracklet that has a higher weight wins. Comparison is done
253    * using the the number of hits in the tracklet (the more hits it has the more it keeps). If
254    * tracklets have the same number of hits then it doesn't matter who gets it, but it should be
255    * only one. So a unique number (row index is good) is added in the least significant part of
256    * the weight
257    */
258   GPUd() static int CalculateHitWeight( int NHits, float chi2, int ) {
259     const float chi2_suppress = 6.f;
260     float weight = (((float) NHits * (chi2_suppress - chi2 / 500.f)) * (1e9 / chi2_suppress / 160.));
261     if (weight < 0 || weight > 2e9) weight = 0;
262     return ( (int) weight );
263     //return( (NHits << 16) + num);
264   }
265   MEM_TEMPLATE() GPUd() void MaximizeHitWeight( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex, int weight ) {
266     fData.MaximizeHitWeight( row, hitIndex, weight );
267   }
268   MEM_TEMPLATE() GPUd() void SetHitWeight( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex, int weight ) {
269         fData.SetHitWeight( row, hitIndex, weight );
270   }
271   MEM_TEMPLATE() GPUd() int HitWeight( const MEM_TYPE( AliHLTTPCCARow)&row, int hitIndex ) const {
272     return fData.HitWeight( row, hitIndex );
273   }
274   
275   GPUhd() GPUglobalref() int *NTracklets() const { return &fCommonMem->fNTracklets; }
276   
277   GPUhd() const AliHLTTPCCAHitId &TrackletStartHit( int i ) const { return fTrackletStartHits[i]; }
278   GPUhd() GPUglobalref() AliHLTTPCCAHitId *TrackletStartHits() const { return fTrackletStartHits; }
279   GPUhd() GPUglobalref() AliHLTTPCCAHitId *TrackletTmpStartHits() const { return fTrackletTmpStartHits; }
280   MEM_CLASS_PRE2() GPUhd() const MEM_LG2(AliHLTTPCCATracklet) &Tracklet( int i ) const { return fTracklets[i]; }
281   GPUhd() GPUglobalref() MEM_GLOBAL(AliHLTTPCCATracklet) *Tracklets() const { return fTracklets;}
282   GPUhd() GPUglobalref()int* TrackletRowHits() const { return fTrackletRowHits; }
283
284   GPUhd() GPUglobalref() int *NTracks()  const { return &fCommonMem->fNTracks; }
285   GPUhd() GPUglobalref() MEM_GLOBAL(AliHLTTPCCATrack) *Tracks() const { return fTracks; }
286   GPUhd() GPUglobalref() int *NTrackHits()  const { return &fCommonMem->fNTrackHits; }
287   GPUhd() GPUglobalref() AliHLTTPCCAHitId *TrackHits() const { return fTrackHits; }
288   
289  
290   GPUhd() GPUglobalref() MEM_GLOBAL(AliHLTTPCCARow)* SliceDataRows() const {return(fData.Rows()); }
291   
292   GPUhd() GPUglobalref() uint3* RowStartHitCountOffset() const {return(fRowStartHitCountOffset);}
293 #ifdef HLTCA_GPUCODE
294   MEM_CLASS_PRE2() GPUhd() AliHLTTPCCATrackletConstructor::MEM_LG2(AliHLTTPCCAGPUTempMemory)* GPUTrackletTemp() const {return(fGPUTrackletTemp);}
295 #endif
296   GPUhd() GPUglobalref() int* RowBlockTracklets(int reverse, int iRowBlock) const {return(&fRowBlockTracklets[(reverse * ((fParam.NRows() / HLTCA_GPU_SCHED_ROW_STEP) + 1) + iRowBlock) * fCommonMem->fNTracklets]);}
297   GPUhd() GPUglobalref() int* RowBlockTracklets() const {return(fRowBlockTracklets);}
298   GPUhd() GPUglobalref() int4* RowBlockPos(int reverse, int iRowBlock) const {return(&fRowBlockPos[reverse * ((fParam.NRows() / HLTCA_GPU_SCHED_ROW_STEP) + 1) + iRowBlock]);}
299   GPUhd() GPUglobalref() int4* RowBlockPos() const {return(fRowBlockPos);}
300   GPUhd() GPUglobalref() uint2* BlockStartingTracklet() const {return(fBlockStartingTracklet);}
301   GPUhd() GPUglobalref() StructGPUParameters* GPUParameters() const {return(&fCommonMem->fGPUParameters);}
302   GPUhd() MakeType(MEM_LG(StructGPUParametersConst)*) GPUParametersConst() {return(&fGPUParametersConst);}
303   GPUhd() void SetGPUTextureBase(char* val) { fData.SetGPUTextureBase(val); }
304
305 #ifdef HLTCA_STANDALONE
306   GPUhd() char* StageAtSync() {return(fStageAtSync);}
307 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
308   GPUh() const char* LinkTmpMemory() const {return(fLinkTmpMemory);}
309 #endif
310 #endif
311
312 #ifdef HLTCA_STANDALONE
313         static inline void StandaloneQueryTime(ULong64_t *i);
314         static inline void StandaloneQueryFreq(ULong64_t *i);
315 #endif //HLTCA_STANDALONE
316   void StandalonePerfTime(int i);
317
318   struct trackSortData
319   {
320         int fTtrack;            //Track ID
321         float fSortVal;         //Value to sort for
322   };
323
324   void PerformGlobalTracking(AliHLTTPCCATracker& sliceLeft, AliHLTTPCCATracker& sliceRight, int MaxTracks);
325
326 private:
327 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
328   GPUh() int PerformGlobalTrackingRun(AliHLTTPCCATracker& sliceNeighbour, int iTrack, int rowIndex, float angle, int direction);
329 #endif
330
331         //Temporary Variables for Standalone measurements
332 #ifdef HLTCA_STANDALONE
333 public:
334   char* fStageAtSync;                           //Pointer to array storing current stage for every thread at every sync point
335   char *fLinkTmpMemory;                         //tmp memory for hits after neighbours finder
336 private:
337 #endif
338   
339   MEM_LG(AliHLTTPCCAParam) fParam; // parameters
340   double fTimers[10]; // timers
341   ULong64_t fPerfTimers[16]; // running CPU time for different parts of the algorithm
342   
343   AliHLTTPCCASliceOutput::outputControlStruct* fOutputControl; // output control
344   
345   /** A pointer to the ClusterData object that the SliceData was created from. This can be used to
346    * merge clusters from inside the SliceTracker code and recreate the SliceData. */
347   GPUglobalref() AliHLTTPCCAClusterData *fClusterData; // ^
348   MEM_LG(AliHLTTPCCASliceData) fData; // The SliceData object. It is used to encapsulate the storage in memory from the access
349   
350   bool fIsGPUTracker; // is it GPU tracker object
351   int fGPUDebugLevel; // debug level
352
353 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
354   std::ostream *fGPUDebugOut; // debug stream
355 #else
356   void* fGPUDebugOut; //No this is a hack, but I have no better idea.
357 #endif
358   
359   //GPU Temp Arrays
360   GPUglobalref() uint3* fRowStartHitCountOffset;                                //Offset, length and new offset of start hits in row
361   GPUglobalref() AliHLTTPCCAHitId *fTrackletTmpStartHits;       //Unsorted start hits
362   GPUglobalref() MEM_GLOBAL(AliHLTTPCCATrackletConstructor::AliHLTTPCCAGPUTempMemory)* fGPUTrackletTemp;        //Temp Memory for GPU Tracklet Constructor
363   GPUglobalref() int* fRowBlockTracklets;                                       //Reference which tracklet is processed in which rowblock next
364   GPUglobalref() int4* fRowBlockPos;                                                    //x is last tracklet to be processed, y is last tracklet already processed, z is last tracklet to be processed in next iteration, w is initial x value to check if tracklet must be initialized  
365   GPUglobalref() uint2* fBlockStartingTracklet;                 // First Tracklet that is to be processed by current GPU MP
366
367   MEM_LG(StructGPUParametersConst) fGPUParametersConst; // Parameters for GPU if this is a GPU tracker
368
369   // event
370   
371   GPUglobalref() commonMemoryStruct *fCommonMem; // common event memory
372   
373   GPUglobalref() char *fHitMemory; // event memory for hits
374   size_t   fHitMemorySize; // size of the event memory for hits [bytes]
375
376   GPUglobalref() char *fTrackletMemory; //event memory for tracklets
377   size_t fTrackletMemorySize; //size of the event memory for tracklets
378
379   GPUglobalref() char *fTrackMemory; // event memory for tracks
380   size_t   fTrackMemorySize; // size of the event memory for tracks [bytes]
381
382   GPUglobalref() AliHLTTPCCAHitId *fTrackletStartHits;   // start hits for the tracklets
383   GPUglobalref() MEM_GLOBAL(AliHLTTPCCATracklet) *fTracklets; // tracklets
384   GPUglobalref() int *fTrackletRowHits;                 //Hits for each Tracklet in each row
385
386   //
387   GPUglobalref() MEM_GLOBAL(AliHLTTPCCATrack) *fTracks;  // reconstructed tracks
388   GPUglobalref() AliHLTTPCCAHitId *fTrackHits;          // array of track hit numbers
389   
390   // output
391   
392   GPUglobalref() AliHLTTPCCASliceOutput **fOutput;              //address of pointer pointing to SliceOutput Object
393   
394   // disable copy
395   AliHLTTPCCATracker( const AliHLTTPCCATracker& );
396   AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker& );
397   
398   static int StarthitSortComparison(const void*a, const void* b);
399 };
400
401 #if defined(HLTCA_STANDALONE) && (!defined(__OPENCL__) || defined(HLTCA_HOSTCODE))
402         void AliHLTTPCCATracker::StandaloneQueryTime(unsigned long long int *i)
403         {
404         #ifdef R__WIN32
405                   QueryPerformanceCounter((LARGE_INTEGER*) i);
406         #else
407                   timespec t;
408                   clock_gettime(CLOCK_REALTIME, &t);
409                   *i = (unsigned long long int) t.tv_sec * (unsigned long long int) 1000000000 + (unsigned long long int) t.tv_nsec;
410         #endif //R__WIN32
411         }
412
413         void AliHLTTPCCATracker::StandaloneQueryFreq(unsigned long long int *i)
414         {
415         #ifdef R__WIN32
416                   QueryPerformanceFrequency((LARGE_INTEGER*) i);
417         #else
418                 *i = 1000000000;
419         #endif //R__WIN32
420         }
421 #endif //HLTCA_STANDALONE
422
423 #endif //ALIHLTTPCCATRACKER_H