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 #include "AliHLTTPCCASliceTrack.h"
16 #include "AliHLTTPCCACompressedInputData.h"
18 #include "AliHLTTPCCAOutTrack.h"
21 * @class AliHLTTPCCASliceOutput
23 * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component}
24 * and transport the output to AliHLTTPCCAGBMerger{Component}
26 * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
27 * This includes the reconstructed track parameters and some compressed information
28 * about the assigned clusters: clusterId, position and amplitude.
31 class AliHLTTPCCASliceOutput
35 struct outputControlStruct
37 outputControlStruct() : fObsoleteOutput( 1 ), fDefaultOutput( 1 ), fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {}
38 int fObsoleteOutput; //Enable Obsolete Output
39 int fDefaultOutput; //Enable Default Output
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
45 GPUhd() int NTracks() const { return fNTracks; }
46 GPUhd() int NTrackClusters() const { return fNTrackClusters; }
48 GPUhd() const AliHLTTPCCASliceTrack &Track( int i ) const { return TracksP()[i]; }
49 GPUhd() unsigned char ClusterRow ( int i ) const { return ClusterRowP()[i]; }
50 GPUhd() int ClusterId ( int i ) const { return ClusterIdP()[i]; }
51 GPUhd() const AliHLTTPCCACompressedCluster &ClusterPackedXYZ ( int i ) const { return ClusterPackedXYZP()[i]; }
53 GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters );
54 void SetPointers(int nTracks = -1, int nTrackClusters = -1, const outputControlStruct* outputControl = NULL);
55 static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl);
57 GPUhd() void SetNTracks ( int v ) { fNTracks = v; }
58 GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; }
60 GPUhd() void SetTrack( int i, const AliHLTTPCCASliceTrack &v ) { TracksP()[i] = v; }
61 GPUhd() void SetClusterRow( int i, unsigned char v ) { ClusterRowP()[i] = v; }
62 GPUhd() void SetClusterId( int i, int v ) { ClusterIdP()[i] = v; }
63 GPUhd() void SetClusterPackedXYZ( int i, AliHLTTPCCACompressedCluster v ) { ClusterPackedXYZP()[i] = v; }
65 GPUhd() size_t OutputMemorySize() const { return(fMemorySize); }
69 GPUhd() int NOutTracks() const { return(fNOutTracks); }
70 GPUhd() void SetNOutTracks(int val) { fNOutTracks = val; }
71 GPUhd() AliHLTTPCCAOutTrack *OutTracks() const { return fOutTracks; }
72 GPUhd() const AliHLTTPCCAOutTrack &OutTrack( int index ) const { return fOutTracks[index]; }
73 GPUhd() int NOutTrackHits() const { return fNOutTrackHits; }
74 GPUhd() void SetNOutTrackHits(int val) { fNOutTrackHits = val; }
75 GPUhd() void SetOutTrackHit(int n, int val) { fOutTrackHits[n] = val; }
76 GPUhd() int OutTrackHit( int i ) const { return fOutTrackHits[i]; }
79 AliHLTTPCCASliceOutput()
80 : fNTracks( 0 ), fNTrackClusters( 0 ), fTracksOffset( 0 ), fClusterIdOffset( 0 ), fClusterRowOffset( 0 ), fClusterPackedXYZOffset( 0 ),
81 fMemorySize( 0 ), fNOutTracks(0), fNOutTrackHits(0), fOutTracks(0), fOutTrackHits(0) {}
83 ~AliHLTTPCCASliceOutput() {}
84 const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
85 AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& );
87 GPUh() void SetMemorySize(size_t val) { fMemorySize = val; }
89 GPUh() AliHLTTPCCASliceTrack *TracksP() const { return (AliHLTTPCCASliceTrack*)(fMemory+fTracksOffset); }
90 GPUh() int *ClusterIdP() const { return (int*)(fMemory+fClusterIdOffset); }
91 GPUh() UChar_t *ClusterRowP() const { return (UChar_t *)(fMemory+fClusterRowOffset); }
92 GPUh() AliHLTTPCCACompressedCluster *ClusterPackedXYZP() const { return (AliHLTTPCCACompressedCluster *)(fMemory+fClusterPackedXYZOffset); }
94 int fNTracks; // number of reconstructed tracks
95 int fNTrackClusters; // total number of track clusters
96 int fTracksOffset; // pointer to reconstructed tracks
97 int fClusterIdOffset; // pointer to cluster Id's ( packed slice, patch, cluster )
98 int fClusterRowOffset; // pointer to cluster row numbers
99 int fClusterPackedXYZOffset; // pointer to cluster coordinates
100 size_t fMemorySize; // Amount of memory really used
106 AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks
107 int *fOutTrackHits; // output array of ID's of the reconstructed hits
109 //Must be last element of this class, user has to make sure to allocate anough memory consecutive to class memory!
110 //This way the whole Slice Output is one consecutive Memory Segment
111 char fMemory[1]; // the memory where the pointers above point into
115 #endif //ALIHLTTPCCASLICEOUTPUT_H