2 // ************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
5 // See cxx source for full Copyright notice *
7 //*************************************************************************
10 #ifndef ALIHLTTPCCASLICEOUTPUT_H
11 #define ALIHLTTPCCASLICEOUTPUT_H
13 #include "AliHLTTPCCADef.h"
15 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
19 #include "AliHLTTPCCASliceOutTrack.h"
21 class AliHLTTPCCASliceOutTrack;
29 * @class AliHLTTPCCASliceOutput
31 * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component}
32 * and transport the output to AliHLTTPCCAGBMerger{Component}
34 * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
35 * This includes the reconstructed track parameters and some compressed information
36 * about the assigned clusters: clusterId, position and amplitude.
39 class AliHLTTPCCASliceOutput
43 struct outputControlStruct
45 outputControlStruct() : fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {}
46 char* volatile fOutputPtr; //Pointer to Output Space, NULL to allocate output space
47 volatile int fOutputMaxSize; //Max Size of Output Data if Pointer to output space is given
48 bool fEndOfSpace; // end of space flag
51 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
52 GPUhd() int NTracks() const { return fNTracks; }
53 GPUhd() int NLocalTracks() const { return fNLocalTracks; }
54 GPUhd() int NTrackClusters() const { return fNTrackClusters; }
56 GPUhd() const AliHLTTPCCASliceOutTrack *GetFirstTrack() const { return fMemory; }
57 GPUhd() AliHLTTPCCASliceOutTrack *FirstTrack(){ return fMemory; }
59 GPUhd() size_t Size() const { return(fMemorySize); }
61 static int EstimateSize( int nOfTracks, int nOfTrackClusters );
62 static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl);
64 GPUhd() void SetNTracks ( int v ) { fNTracks = v; }
65 GPUhd() void SetNLocalTracks ( int v ) { fNLocalTracks = v; }
66 GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; }
70 AliHLTTPCCASliceOutput()
71 : fNTracks( 0 ), fNLocalTracks( 0 ), fNTrackClusters( 0 ), fMemorySize( 0 ){}
73 ~AliHLTTPCCASliceOutput() {}
74 AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& );
75 AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) { return *this; }
77 GPUh() void SetMemorySize(size_t val) { fMemorySize = val; }
79 int fNTracks; // number of reconstructed tracks
81 int fNTrackClusters; // total number of track clusters
82 size_t fMemorySize; // Amount of memory really used
84 //Must be last element of this class, user has to make sure to allocate anough memory consecutive to class memory!
85 //This way the whole Slice Output is one consecutive Memory Segment
88 AliHLTTPCCASliceOutTrack fMemory[0]; // the memory where the pointers above point into