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"
16 #include "AliHLTTPCCASliceOutTrack.h"
18 class AliHLTTPCCASliceOutTrack;
23 * @class AliHLTTPCCASliceOutput
25 * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component}
26 * and transport the output to AliHLTTPCCAGBMerger{Component}
28 * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
29 * This includes the reconstructed track parameters and some compressed information
30 * about the assigned clusters: clusterId, position and amplitude.
33 class AliHLTTPCCASliceOutput
37 struct outputControlStruct
39 outputControlStruct() : fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {}
40 char* volatile fOutputPtr; //Pointer to Output Space, NULL to allocate output space
41 volatile int fOutputMaxSize; //Max Size of Output Data if Pointer to output space is given
42 bool fEndOfSpace; // end of space flag
45 GPUhd() int NTracks() const { return fNTracks; }
46 GPUhd() int NLocalTracks() const { return fNLocalTracks; }
47 GPUhd() int NTrackClusters() const { return fNTrackClusters; }
49 GPUhd() const AliHLTTPCCASliceOutTrack *GetFirstTrack() const { return fMemory; }
50 GPUhd() AliHLTTPCCASliceOutTrack *FirstTrack(){ return fMemory; }
52 GPUhd() size_t Size() const { return(fMemorySize); }
54 static int EstimateSize( int nOfTracks, int nOfTrackClusters );
55 static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl);
57 GPUhd() void SetNTracks ( int v ) { fNTracks = v; }
58 GPUhd() void SetNLocalTracks ( int v ) { fNLocalTracks = v; }
59 GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; }
63 AliHLTTPCCASliceOutput()
64 : fNTracks( 0 ), fNLocalTracks( 0 ), fNTrackClusters( 0 ), fMemorySize( 0 ){}
66 ~AliHLTTPCCASliceOutput() {}
67 const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
68 AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& );
70 GPUh() void SetMemorySize(size_t val) { fMemorySize = val; }
72 int fNTracks; // number of reconstructed tracks
74 int fNTrackClusters; // total number of track clusters
75 size_t fMemorySize; // Amount of memory really used
77 //Must be last element of this class, user has to make sure to allocate anough memory consecutive to class memory!
78 //This way the whole Slice Output is one consecutive Memory Segment
81 AliHLTTPCCASliceOutTrack fMemory[0]; // the memory where the pointers above point into