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 *
8 //*************************************************************************
10 #ifndef ALIHLTTPCCATRACKER_H
11 #define ALIHLTTPCCATRACKER_H
14 #include "AliHLTTPCCADef.h"
15 #include "AliHLTTPCCAParam.h"
16 #include "AliHLTTPCCARow.h"
17 #include "AliHLTTPCCAHit.h"
20 class AliHLTTPCCATrack;
21 class AliHLTTPCCAOutTrack;
22 class AliHLTTPCCATrackParam;
23 class AliHLTTPCCATracklet;
27 * @class AliHLTTPCCATracker
29 * Slice tracker for ALICE HLT.
30 * The class reconstructs tracks in one slice of TPC.
31 * The reconstruction algorithm is based on the Cellular Automaton method
33 * The CA tracker is designed stand-alone.
34 * It is integrated to the HLT framework via AliHLTTPCCATrackerComponent interface.
35 * The class is under construction.
38 class AliHLTTPCCATracker
42 #if !defined(HLTCA_GPUCODE)
44 AliHLTTPCCATracker( const AliHLTTPCCATracker& );
45 AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker& );
47 GPUd() ~AliHLTTPCCATracker();
50 GPUd() void Initialize( const AliHLTTPCCAParam ¶m );
52 GPUd() void StartEvent();
54 GPUd() void ReadEvent( const Int_t *RowFirstHit, const Int_t *RowNHits, const Float_t *Y, const Float_t *Z, Int_t NHits );
56 GPUd() void SetupRowData();
61 GPUd() void GetErrors2( Int_t iRow, const AliHLTTPCCATrackParam &t, Float_t &Err2Y, Float_t &Err2Z ) const;
62 GPUd() void GetErrors2( Int_t iRow, Float_t z, Float_t sinPhi, Float_t cosPhi, Float_t DzDs, Float_t &Err2Y, Float_t &Err2Z ) const;
64 GPUhd() static Int_t IRowIHit2ID( Int_t iRow, Int_t iHit ){
65 return (iHit<<8)+iRow;
67 GPUhd() static Int_t ID2IRow( Int_t HitID ){
70 GPUhd() static Int_t ID2IHit( Int_t HitID ){
74 //GPUhd() AliHLTTPCCAHit &ID2Hit( Int_t HitID ) {
75 //return fHits[fRows[HitID%256].FirstHit() + (HitID>>8)];
77 GPUhd() const AliHLTTPCCARow &ID2Row( Int_t HitID ) const {
78 return fRows[HitID%256];
81 void FitTrack( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
82 void FitTrackFull( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
83 GPUhd() void SetPointersCommon();
84 GPUhd() void SetPointersHits( Int_t MaxNHits );
85 GPUhd() void SetPointersTracks( Int_t MaxNTracks );
87 #if !defined(HLTCA_GPUCODE)
88 GPUh() void WriteEvent( std::ostream &out );
89 GPUh() void ReadEvent( std::istream &in );
90 GPUh() void WriteTracks( std::ostream &out ) ;
91 GPUh() void ReadTracks( std::istream &in );
94 GPUhd() const AliHLTTPCCAParam &Param() const { return fParam; }
95 GPUhd() void SetParam( const AliHLTTPCCAParam &v ){ fParam = v; }
97 GPUhd() const AliHLTTPCCARow &Row(Int_t i) const { return fRows[i]; }
98 GPUhd() Double_t Timer(Int_t i) const { return fTimers[i]; }
99 GPUhd() void SetTimer(Int_t i, Double_t v ){ fTimers[i] = v; }
101 GPUhd() Int_t NHitsTotal() const { return fNHitsTotal;}
103 GPUhd() const Char_t *InputEvent() const { return fInputEvent; }
104 GPUhd() Int_t InputEventSize() const { return fInputEventSize; }
106 GPUhd() const uint4 *RowData() const { return fRowData; }
107 GPUhd() Int_t RowDataSize() const { return fRowDataSize; }
109 GPUhd() Int_t *HitInputIDs() const { return fHitInputIDs; }
110 GPUhd() Int_t *HitWeights() const { return fHitWeights; }
112 GPUhd() Int_t *NTracklets() const { return fNTracklets; }
113 GPUhd() Int_t *TrackletStartHits() const { return fTrackletStartHits; }
114 GPUhd() AliHLTTPCCATracklet *Tracklets() const { return fTracklets;}
116 GPUhd() Int_t *NTracks() const { return fNTracks; }
117 GPUhd() AliHLTTPCCATrack *Tracks() const { return fTracks; }
118 GPUhd() Int_t *NTrackHits() const { return fNTrackHits; }
119 GPUhd() Int_t *TrackHits() const { return fTrackHits; }
121 GPUhd() Int_t *NOutTracks() const { return fNOutTracks; }
122 GPUhd() AliHLTTPCCAOutTrack *OutTracks() const { return fOutTracks; }
123 GPUhd() Int_t *NOutTrackHits() const { return fNOutTrackHits; }
124 GPUhd() Int_t *OutTrackHits() const { return fOutTrackHits; }
126 GPUh() void SetCommonMemory( Char_t * const mem ){ fCommonMemory = mem; }
130 AliHLTTPCCAParam fParam; // parameters
131 AliHLTTPCCARow fRows[200];// array of hit rows
132 Double_t fTimers[10]; // running CPU time for different parts of the algorithm
136 Int_t fNHitsTotal;// total number of hits in event
138 Char_t *fCommonMemory; // common event memory
139 Int_t fCommonMemorySize; // size of the event memory [bytes]
141 Char_t *fHitMemory; // event memory for hits
142 Int_t fHitMemorySize; // size of the event memory [bytes]
144 Char_t *fTrackMemory; // event memory for tracks
145 Int_t fTrackMemorySize; // size of the event memory [bytes]
147 Char_t *fInputEvent; // input event
148 Int_t fInputEventSize; // size of the input event [bytes]
150 uint4 *fRowData; // TPC rows: clusters, grid, links to neighbours
151 Int_t fRowDataSize; // size of the row data
153 Int_t *fHitInputIDs; // cluster index in InputEvent
154 Int_t *fHitWeights; // the weight of the longest tracklet crossed the cluster
156 Int_t *fNTracklets; // number of tracklets
157 Int_t *fTrackletStartHits; // start hits for the tracklets
158 AliHLTTPCCATracklet *fTracklets; // tracklets
161 Int_t *fNTracks; // number of reconstructed tracks
162 AliHLTTPCCATrack *fTracks; // reconstructed tracks
163 Int_t *fNTrackHits; // number of track hits
164 Int_t *fTrackHits; // array of track hit numbers
168 Int_t *fNOutTracks; // number of tracks in fOutTracks array
169 AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks
170 Int_t *fNOutTrackHits; // number of hits in fOutTrackHits array
171 Int_t *fOutTrackHits; // output array of ID's of the reconstructed hits
175 Int_t *fTmpHitInputIDs; // temporary step