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 *
8 #ifndef ALIHLTTPCCATRACKER_H
9 #define ALIHLTTPCCATRACKER_H
12 #include "AliHLTTPCCADef.h"
13 #include "AliHLTTPCCAParam.h"
14 #include "AliHLTTPCCARow.h"
15 #include "AliHLTTPCCAHit.h"
17 class AliHLTTPCCATrack;
18 class AliHLTTPCCAOutTrack;
19 class AliHLTTPCCATrackParam;
20 class AliHLTTPCCATrackParam1;
25 * @class AliHLTTPCCATracker
27 * Slice tracker for ALICE HLT.
28 * The class reconstructs tracks in one slice of TPC.
29 * The reconstruction algorithm is based on the Cellular Automaton method
31 * The CA tracker is designed stand-alone.
32 * It is integrated to the HLT framework via AliHLTTPCCATrackerComponent interface.
33 * The class is under construction.
36 class AliHLTTPCCATracker
40 #if !defined(HLTCA_GPUCODE)
42 AliHLTTPCCATracker( const AliHLTTPCCATracker& );
43 AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker& );
45 GPUd() ~AliHLTTPCCATracker();
48 GPUd() void Initialize( AliHLTTPCCAParam ¶m );
50 GPUd() void StartEvent();
52 GPUd() void ReadEvent( Int_t *RowFirstHit, Int_t *RowNHits, Float_t *Y, Float_t *Z, Int_t NHits );
58 GPUd() void GetErrors2( Int_t iRow, const AliHLTTPCCATrackParam &t, Float_t &Err2Y, Float_t &Err2Z ) const;
59 GPUd() void GetErrors2( Int_t iRow, const AliHLTTPCCATrackParam1 &t, Float_t &Err2Y, Float_t &Err2Z ) const;
61 GPUhd() AliHLTTPCCAParam &Param(){ return fParam; }
62 GPUhd() AliHLTTPCCARow *Rows(){ return fRows; }
64 Int_t * HitsID(){ return fHitsID; }
66 Int_t *OutTrackHits(){ return fOutTrackHits; }
67 Int_t NOutTrackHits() const { return fNOutTrackHits; }
68 GPUd() AliHLTTPCCAOutTrack *OutTracks(){ return fOutTracks; }
69 GPUd() Int_t NOutTracks() const { return fNOutTracks; }
70 GPUhd() Int_t *TrackHits(){ return fTrackHits; }
72 GPUhd() AliHLTTPCCATrack *Tracks(){ return fTracks; }
73 GPUhd() Int_t &NTracks() { return *fNTracks; }
75 Double_t *Timers(){ return fTimers; }
77 GPUhd() static Int_t IRowIHit2ID( Int_t iRow, Int_t iHit ){
78 return (iHit<<8)+iRow;
80 GPUhd() static Int_t ID2IRow( Int_t HitID ){
83 GPUhd() static Int_t ID2IHit( Int_t HitID ){
87 GPUhd() AliHLTTPCCAHit &ID2Hit( Int_t HitID ) {
88 return fHits[fRows[HitID%256].FirstHit() + (HitID>>8)];
90 GPUhd() AliHLTTPCCARow &ID2Row( Int_t HitID ) {
91 return fRows[HitID%256];
94 void FitTrack( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
95 void FitTrackFull( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
96 GPUhd() void SetPointers();
98 GPUhd() Short_t *HitLinkUp(){ return fHitLinkUp;}
99 GPUhd() Short_t *HitLinkDown(){ return fHitLinkDown;}
100 GPUhd() Int_t *StartHits(){ return fStartHits;}
101 GPUhd() Int_t *Tracklets(){ return fTracklets;}
102 GPUhd() Int_t *HitIsUsed(){ return fHitIsUsed;}
103 GPUhd() AliHLTTPCCAHit *Hits(){ return fHits;}
104 GPUhd() Int_t &NHitsTotal(){ return fNHitsTotal;}
105 GPUhd() uint4 *&TexHitsFullData(){ return fTexHitsFullData;}
106 GPUhd() Int_t &TexHitsFullSize(){ return fTexHitsFullSize;}
108 GPUd() UChar_t GetGridContent( UInt_t i ) const;
109 GPUd() AliHLTTPCCAHit GetHit( UInt_t i ) const;
115 AliHLTTPCCAParam fParam; // parameters
116 AliHLTTPCCARow fRows[200];// array of hit rows
117 Double_t fTimers[10]; // running CPU time for different parts of the algorithm
120 Int_t fNHitsTotal;// total number of hits in event
121 Int_t fGridSizeTotal; // total grid size
122 Int_t fGrid1SizeTotal;// total grid1 size
124 AliHLTTPCCAHit *fHits; // hits
125 ushort2 *fHits1; // hits1
127 UChar_t *fGridContents; // grid content
128 UInt_t *fGrid1Contents; // grid1 content
129 Int_t *fHitsID; // hit ID's
131 // temporary information
133 Short_t *fHitLinkUp; // array of up links
134 Short_t *fHitLinkDown;// array of down links
135 Int_t *fHitIsUsed; // array of used flags
136 Int_t *fStartHits; // array of start hits
137 Int_t *fTracklets; // array of tracklets
139 Int_t *fNTracks;// number of reconstructed tracks
140 AliHLTTPCCATrack *fTracks; // reconstructed tracks
141 Int_t *fTrackHits; // array of track hit numbers
145 Int_t fNOutTracks; // number of tracks in fOutTracks array
146 Int_t fNOutTrackHits; // number of hits in fOutTrackHits array
147 AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks
148 Int_t *fOutTrackHits; // output array of ID's of the reconstructed hits
150 char *fEventMemory; // common event memory
151 UInt_t fEventMemSize; // size of the event memory
153 uint4 *fTexHitsFullData; // CUDA texture for hits
154 Int_t fTexHitsFullSize; // size of the CUDA texture