3 //* This file is property of and copyright by the ALICE HLT Project *
4 //* ALICE Experiment at CERN, All rights reserved. *
5 //* See cxx source for full Copyright notice *
7 #ifndef ALIHLTTPCCATRACKLETCONSTRUCTOR_H
8 #define ALIHLTTPCCATRACKLETCONSTRUCTOR_H
11 #include "AliHLTTPCCADef.h"
14 * @class AliHLTTPCCATrackletConstructor
17 class AliHLTTPCCATrackletConstructor
21 class AliHLTTPCCASharedMemory
23 friend class AliHLTTPCCATrackletConstructor;
25 #if !defined(HLTCA_GPUCODE)
26 AliHLTTPCCASharedMemory()
27 : fItr0(0), fItr1(0), fNRows(0), fUsedHits(0), fMinStartRow(0), fMaxStartRow(0)
30 AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/)
31 : fItr0(0), fItr1(0), fNRows(0), fUsedHits(0), fMinStartRow(0), fMaxStartRow(0)
33 AliHLTTPCCASharedMemory& operator=(const AliHLTTPCCASharedMemory& /*dummy*/){ return *this; }
36 uint4 fData[2][(500+500+500)/4]; // temp memory
37 UInt_t fGridContent1[600]; // grid1 content
38 int fItr0; // start track index
39 int fItr1; // end track index
41 Int_t *fUsedHits; // array of used hits
42 int fMinStartRow; // min start row
43 int fMinStartRow32[32]; // min start row for each thread in warp
44 int fMaxStartRow; // max start row
45 int fMaxStartRow32[32];// max start row for each thread in warp
48 class AliHLTTPCCAThreadMemory
50 friend class AliHLTTPCCATrackletConstructor;
52 #if !defined(HLTCA_GPUCODE)
53 AliHLTTPCCAThreadMemory()
54 : fItr(0), fFirstRow(0), fLastRow(0), fCurrIH(0), fIsMemThread(0), fGo(0), fSave(0), fCurrentData(0), fStage(0), fNHits(0), fNMissed(0), fTrackStoreOffset(0), fHitStoreOffset(0)
57 AliHLTTPCCAThreadMemory( const AliHLTTPCCAThreadMemory& /*dummy*/)
58 : fItr(0), fFirstRow(0), fLastRow(0), fCurrIH(0), fIsMemThread(0), fGo(0), fSave(0), fCurrentData(0), fStage(0), fNHits(0), fNMissed(0), fTrackStoreOffset(0), fHitStoreOffset(0)
60 AliHLTTPCCAThreadMemory& operator=(const AliHLTTPCCAThreadMemory& /*dummy*/){ return *this; }
63 Int_t fItr; // track index
64 Int_t fFirstRow; // first row index
65 Int_t fLastRow; // last row index
66 Int_t fCurrIH; // indef of the current hit
67 Bool_t fIsMemThread; // is the thread used for memory taken
68 Bool_t fGo; // do fit/searching flag
69 Bool_t fSave; // save flag
70 Bool_t fCurrentData; // index of the current memory array
71 Int_t fStage; // reco stage
72 Int_t fNHits; // n track hits
73 Int_t fNMissed; // n missed hits during search
74 Int_t fTrackStoreOffset; // offset in the global array
75 Int_t fHitStoreOffset; // offset in the global array
78 GPUd() static Int_t NThreadSyncPoints(){ return 4+159*4 +1+1; }
80 GPUd() static void Thread( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread,
81 Int_t iSync, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r,
82 AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam1 &tParam );
84 GPUd() static void Step0
85 ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
86 AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam1 &tParam );
87 GPUd() static void Step1
88 ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
89 AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam1 &tParam );
90 GPUd() static void Step2
91 ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
92 AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam1 &tParam );
94 GPUd() static void ReadData( Int_t iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, Int_t iRow );
96 GPUd() static void UpdateTracklet
97 ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
98 AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam1 &tParam, Int_t iRow );
100 GPUd() static void UnpackGrid
101 ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
102 AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam1 &tParam, Int_t iRow );
104 GPUd() static void StoreTracklet
105 ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
106 AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam1 &tParam);
108 static Bool_t SAVE(){ return 1; }