]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/tracking-ca/AliHLTTPCCASliceOutput.h
Update of the GPU tracker
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCASliceOutput.h
CommitLineData
63d8b79d 1//-*- Mode: C++ -*-
2// ************************************************************************
fbb9b71b 3// This file is property of and copyright by the ALICE HLT Project *
63d8b79d 4// ALICE Experiment at CERN, All rights reserved. *
5// See cxx source for full Copyright notice *
6// *
7//*************************************************************************
8
9
10#ifndef ALIHLTTPCCASLICEOUTPUT_H
11#define ALIHLTTPCCASLICEOUTPUT_H
12
13#include "AliHLTTPCCADef.h"
b22af1bf 14#include <cstdlib>
f0bada7f 15#ifndef HLTCA_GPUCODE
0f1f07c3 16#include "AliHLTTPCCASliceOutTrack.h"
f0bada7f 17#else
18class AliHLTTPCCASliceOutTrack;
19#endif
0f1f07c3 20
63d8b79d 21
22/**
23 * @class AliHLTTPCCASliceOutput
24 *
25 * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component}
26 * and transport the output to AliHLTTPCCAGBMerger{Component}
27 *
28 * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
fbb9b71b 29 * This includes the reconstructed track parameters and some compressed information
63d8b79d 30 * about the assigned clusters: clusterId, position and amplitude.
31 *
32 */
33class AliHLTTPCCASliceOutput
34{
fbb9b71b 35 public:
d4594e7d 36
5cb6ddd4 37 struct outputControlStruct
38 {
39 outputControlStruct() : fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {}
40 char* fOutputPtr; //Pointer to Output Space, NULL to allocate output space
41 int fOutputMaxSize; //Max Size of Output Data if Pointer to output space is given
42 bool fEndOfSpace; // end of space flag
43 };
44
45 GPUhd() int NTracks() const { return fNTracks; }
0f1f07c3 46 GPUhd() int NTrackClusters() const { return fNTrackClusters; }
f0bada7f 47#ifndef HLTCA_GPUCODE
0f1f07c3 48 GPUhd() const AliHLTTPCCASliceOutTrack *GetFirstTrack() const { return fMemory; }
49 GPUhd() AliHLTTPCCASliceOutTrack *FirstTrack(){ return fMemory; }
f0bada7f 50#endif
0f1f07c3 51 GPUhd() size_t Size() const { return(fMemorySize); }
5cb6ddd4 52
f0bada7f 53 static int EstimateSize( int nOfTracks, int nOfTrackClusters );
5cb6ddd4 54 static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl);
55
56 GPUhd() void SetNTracks ( int v ) { fNTracks = v; }
57 GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; }
e1f2d1c3 58
5cb6ddd4 59 private:
0f1f07c3 60
5cb6ddd4 61 AliHLTTPCCASliceOutput()
0f1f07c3 62 : fNTracks( 0 ), fNTrackClusters( 0 ), fMemorySize( 0 ){}
5cb6ddd4 63
64 ~AliHLTTPCCASliceOutput() {}
65 const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
66 AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& );
e1f2d1c3 67
5cb6ddd4 68 GPUh() void SetMemorySize(size_t val) { fMemorySize = val; }
d4594e7d 69
5cb6ddd4 70 int fNTracks; // number of reconstructed tracks
71 int fNTrackClusters; // total number of track clusters
0f1f07c3 72 size_t fMemorySize; // Amount of memory really used
b22af1bf 73
5cb6ddd4 74 //Must be last element of this class, user has to make sure to allocate anough memory consecutive to class memory!
75 //This way the whole Slice Output is one consecutive Memory Segment
0f1f07c3 76
f0bada7f 77#ifndef HLTCA_GPUCODE
0f1f07c3 78 AliHLTTPCCASliceOutTrack fMemory[0]; // the memory where the pointers above point into
f0bada7f 79#endif
b22af1bf 80
63d8b79d 81};
82
0f1f07c3 83#endif