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"
18 class AliHLTTPCCATrack;
19 class AliHLTTPCCAOutTrack;
20 class AliHLTTPCCATrackParam;
21 class AliHLTTPCCATracklet;
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 );
54 GPUd() void SetupRowData();
59 GPUd() void GetErrors2( Int_t iRow, const AliHLTTPCCATrackParam &t, Float_t &Err2Y, Float_t &Err2Z ) const;
61 GPUhd() static Int_t IRowIHit2ID( Int_t iRow, Int_t iHit ){
62 return (iHit<<8)+iRow;
64 GPUhd() static Int_t ID2IRow( Int_t HitID ){
67 GPUhd() static Int_t ID2IHit( Int_t HitID ){
71 //GPUhd() AliHLTTPCCAHit &ID2Hit( Int_t HitID ) {
72 //return fHits[fRows[HitID%256].FirstHit() + (HitID>>8)];
74 GPUhd() AliHLTTPCCARow &ID2Row( Int_t HitID ) {
75 return fRows[HitID%256];
78 void FitTrack( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
79 void FitTrackFull( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
80 GPUhd() void SetPointers();
82 #if !defined(HLTCA_GPUCODE)
83 GPUh() void WriteEvent( std::ostream &out );
84 GPUh() void ReadEvent( std::istream &in );
85 GPUh() void WriteTracks( std::ostream &out ) ;
86 GPUh() void ReadTracks( std::istream &in );
89 GPUhd() AliHLTTPCCAParam &Param(){ return fParam; }
90 GPUhd() AliHLTTPCCARow *Rows(){ return fRows; }
91 GPUhd() Double_t *Timers(){ return fTimers; }
92 GPUhd() Int_t &NHitsTotal(){ return fNHitsTotal;}
94 GPUhd() Char_t *InputEvent() { return fInputEvent; }
95 GPUhd() Int_t &InputEventSize(){ return fInputEventSize; }
97 GPUhd() uint4 *RowData() { return fRowData; }
98 GPUhd() Int_t &RowDataSize() { return fRowDataSize; }
100 GPUhd() Int_t * HitInputIDs(){ return fHitInputIDs; }
101 GPUhd() Int_t *HitWeights(){ return fHitWeights; }
103 GPUhd() Int_t *NTracklets(){ return fNTracklets; }
104 GPUhd() Int_t *TrackletStartHits(){ return fTrackletStartHits; }
105 GPUhd() AliHLTTPCCATracklet *Tracklets(){ return fTracklets;}
107 GPUhd() Int_t *NTracks() { return fNTracks; }
108 GPUhd() AliHLTTPCCATrack *Tracks(){ return fTracks; }
109 GPUhd() Int_t *NTrackHits() { return fNTrackHits; }
110 GPUhd() Int_t *TrackHits(){ return fTrackHits; }
112 GPUhd() Int_t *NOutTracks() const { return fNOutTracks; }
113 GPUhd() AliHLTTPCCAOutTrack *OutTracks(){ return fOutTracks; }
114 GPUhd() Int_t *NOutTrackHits() const { return fNOutTrackHits; }
115 GPUhd() Int_t *OutTrackHits(){ return fOutTrackHits; }
117 GPUh() void SetCommonMemory( Char_t *mem ){ fCommonMemory = mem; }
121 AliHLTTPCCAParam fParam; // parameters
122 AliHLTTPCCARow fRows[200];// array of hit rows
123 Double_t fTimers[10]; // running CPU time for different parts of the algorithm
127 Int_t fNHitsTotal;// total number of hits in event
129 Char_t *fCommonMemory; // common event memory
130 Int_t fCommonMemorySize; // size of the event memory [bytes]
132 Char_t *fInputEvent; // input event
133 Int_t fInputEventSize; // size of the input event [bytes]
135 uint4 *fRowData; // TPC rows: clusters, grid, links to neighbours
136 Int_t fRowDataSize; // size of the row data
138 Int_t *fHitInputIDs; // cluster index in InputEvent
139 Int_t *fHitWeights; // the weight of the longest tracklet crossed the cluster
141 Int_t *fNTracklets; // number of tracklets
142 Int_t *fTrackletStartHits; // start hits for the tracklets
143 AliHLTTPCCATracklet *fTracklets; // tracklets
146 Int_t *fNTracks; // number of reconstructed tracks
147 AliHLTTPCCATrack *fTracks; // reconstructed tracks
148 Int_t *fNTrackHits; // number of track hits
149 Int_t *fTrackHits; // array of track hit numbers
153 Int_t *fNOutTracks; // number of tracks in fOutTracks array
154 AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks
155 Int_t *fNOutTrackHits; // number of hits in fOutTrackHits array
156 Int_t *fOutTrackHits; // output array of ID's of the reconstructed hits