]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCATrackletConstructor.h
Completely reworked version of TPC CA tracker (Sergey)
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCATrackletConstructor.h
1 //-*- Mode: C++ -*-
2
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                               *
6
7 #ifndef ALIHLTTPCCATRACKLETCONSTRUCTOR_H
8 #define ALIHLTTPCCATRACKLETCONSTRUCTOR_H
9
10
11 #include "AliHLTTPCCADef.h"
12
13 /**
14  * @class AliHLTTPCCATrackletConstructor
15  * 
16  */
17 class AliHLTTPCCATrackletConstructor
18 {
19  public:
20
21   class   AliHLTTPCCASharedMemory
22     {
23       friend class AliHLTTPCCATrackletConstructor;
24     public:
25 #if !defined(HLTCA_GPUCODE)
26       AliHLTTPCCASharedMemory()
27         : fItr0(0), fItr1(0), fNRows(0), fUsedHits(0), fMinStartRow(0), fMaxStartRow(0)
28       {}
29
30       AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/) 
31         : fItr0(0), fItr1(0), fNRows(0), fUsedHits(0), fMinStartRow(0), fMaxStartRow(0)
32       {}
33       AliHLTTPCCASharedMemory& operator=(const AliHLTTPCCASharedMemory& /*dummy*/){ return *this; }
34 #endif
35     protected:
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
40       int fNRows; // n rows
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
46     };
47
48   class  AliHLTTPCCAThreadMemory
49     {
50       friend class AliHLTTPCCATrackletConstructor;
51      public:
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) 
55       {}
56
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) 
59       {}
60       AliHLTTPCCAThreadMemory& operator=(const AliHLTTPCCAThreadMemory& /*dummy*/){ return *this; }
61 #endif
62     protected:
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
76     };
77
78   GPUd() static Int_t NThreadSyncPoints(){ return 4+159*4 +1+1; }  
79
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 );
83   
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 );
93
94   GPUd() static void ReadData( Int_t iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, Int_t iRow );
95
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 );
99
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 );
103
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);
107
108   static Bool_t SAVE(){ return 1; }
109
110 };
111
112
113 #endif