]>
Commit | Line | Data |
---|---|---|
326c2d4b | 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 | #ifndef ALIHLTTPCCATRACKER_H | |
9 | #define ALIHLTTPCCATRACKER_H | |
10 | ||
11 | ||
00d07bcd | 12 | #include "AliHLTTPCCADef.h" |
326c2d4b | 13 | #include "AliHLTTPCCAParam.h" |
14 | #include "AliHLTTPCCARow.h" | |
00d07bcd | 15 | #include "AliHLTTPCCAHit.h" |
326c2d4b | 16 | |
d54804bf | 17 | class AliHLTTPCCATrack; |
326c2d4b | 18 | class AliHLTTPCCAOutTrack; |
d54804bf | 19 | class AliHLTTPCCATrackParam; |
00d07bcd | 20 | class AliHLTTPCCATrackParam1; |
21 | ||
22 | ||
326c2d4b | 23 | |
24 | /** | |
25 | * @class AliHLTTPCCATracker | |
dc4788ec | 26 | * |
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 | |
30 | * | |
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. | |
34 | * | |
326c2d4b | 35 | */ |
36 | class AliHLTTPCCATracker | |
37 | { | |
38 | public: | |
39 | ||
00d07bcd | 40 | #if !defined(HLTCA_GPUCODE) |
326c2d4b | 41 | AliHLTTPCCATracker(); |
42 | AliHLTTPCCATracker( const AliHLTTPCCATracker& ); | |
43 | AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker& ); | |
dc4788ec | 44 | |
00d07bcd | 45 | GPUd() ~AliHLTTPCCATracker(); |
46 | #endif | |
326c2d4b | 47 | |
00d07bcd | 48 | GPUd() void Initialize( AliHLTTPCCAParam ¶m ); |
326c2d4b | 49 | |
00d07bcd | 50 | GPUd() void StartEvent(); |
326c2d4b | 51 | |
00d07bcd | 52 | GPUd() void ReadEvent( Int_t *RowFirstHit, Int_t *RowNHits, Float_t *Y, Float_t *Z, Int_t NHits ); |
326c2d4b | 53 | |
54 | void Reconstruct(); | |
55 | ||
00d07bcd | 56 | void WriteOutput(); |
57 | ||
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; | |
326c2d4b | 60 | |
00d07bcd | 61 | GPUhd() AliHLTTPCCAParam &Param(){ return fParam; } |
62 | GPUhd() AliHLTTPCCARow *Rows(){ return fRows; } | |
63 | ||
64 | Int_t * HitsID(){ return fHitsID; } | |
326c2d4b | 65 | |
66 | Int_t *OutTrackHits(){ return fOutTrackHits; } | |
67 | Int_t NOutTrackHits() const { return fNOutTrackHits; } | |
00d07bcd | 68 | GPUd() AliHLTTPCCAOutTrack *OutTracks(){ return fOutTracks; } |
69 | GPUd() Int_t NOutTracks() const { return fNOutTracks; } | |
70 | GPUhd() Int_t *TrackHits(){ return fTrackHits; } | |
326c2d4b | 71 | |
00d07bcd | 72 | GPUhd() AliHLTTPCCATrack *Tracks(){ return fTracks; } |
73 | GPUhd() Int_t &NTracks() { return *fNTracks; } | |
326c2d4b | 74 | |
dc4788ec | 75 | Double_t *Timers(){ return fTimers; } |
76 | ||
00d07bcd | 77 | GPUhd() static Int_t IRowIHit2ID( Int_t iRow, Int_t iHit ){ |
78 | return (iHit<<8)+iRow; | |
d54804bf | 79 | } |
00d07bcd | 80 | GPUhd() static Int_t ID2IRow( Int_t HitID ){ |
81 | return ( HitID%256 ); | |
326c2d4b | 82 | } |
00d07bcd | 83 | GPUhd() static Int_t ID2IHit( Int_t HitID ){ |
84 | return ( HitID>>8 ); | |
d54804bf | 85 | } |
00d07bcd | 86 | |
87 | GPUhd() AliHLTTPCCAHit &ID2Hit( Int_t HitID ) { | |
88 | return fHits[fRows[HitID%256].FirstHit() + (HitID>>8)]; | |
326c2d4b | 89 | } |
00d07bcd | 90 | GPUhd() AliHLTTPCCARow &ID2Row( Int_t HitID ) { |
91 | return fRows[HitID%256]; | |
d54804bf | 92 | } |
93 | ||
d54804bf | 94 | void FitTrack( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const; |
00d07bcd | 95 | void FitTrackFull( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const; |
96 | GPUhd() void SetPointers(); | |
97 | ||
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;} | |
107 | ||
108 | GPUd() UChar_t GetGridContent( UInt_t i ) const; | |
109 | GPUd() AliHLTTPCCAHit GetHit( UInt_t i ) const; | |
110 | ||
111 | private: | |
112 | ||
113 | // | |
d54804bf | 114 | |
326c2d4b | 115 | AliHLTTPCCAParam fParam; // parameters |
00d07bcd | 116 | AliHLTTPCCARow fRows[200];// array of hit rows |
117 | Double_t fTimers[10]; // running CPU time for different parts of the algorithm | |
118 | ||
119 | // event | |
120 | Int_t fNHitsTotal;// total number of hits in event | |
121 | Int_t fGridSizeTotal; // total grid size | |
122 | Int_t fGrid1SizeTotal;// total grid1 size | |
326c2d4b | 123 | |
00d07bcd | 124 | AliHLTTPCCAHit *fHits; // hits |
125 | ushort2 *fHits1; // hits1 | |
126 | ||
127 | UChar_t *fGridContents; // grid content | |
128 | UInt_t *fGrid1Contents; // grid1 content | |
129 | Int_t *fHitsID; // hit ID's | |
130 | ||
131 | // temporary information | |
132 | ||
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 | |
326c2d4b | 138 | |
00d07bcd | 139 | Int_t *fNTracks;// number of reconstructed tracks |
140 | AliHLTTPCCATrack *fTracks; // reconstructed tracks | |
141 | Int_t *fTrackHits; // array of track hit numbers | |
142 | ||
143 | // output | |
144 | ||
145 | Int_t fNOutTracks; // number of tracks in fOutTracks array | |
326c2d4b | 146 | Int_t fNOutTrackHits; // number of hits in fOutTrackHits array |
147 | AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks | |
00d07bcd | 148 | Int_t *fOutTrackHits; // output array of ID's of the reconstructed hits |
d54804bf | 149 | |
00d07bcd | 150 | char *fEventMemory; // common event memory |
151 | UInt_t fEventMemSize; // size of the event memory | |
326c2d4b | 152 | |
00d07bcd | 153 | uint4 *fTexHitsFullData; // CUDA texture for hits |
154 | Int_t fTexHitsFullSize; // size of the CUDA texture | |
326c2d4b | 155 | }; |
156 | ||
00d07bcd | 157 | |
326c2d4b | 158 | #endif |