]>
Commit | Line | Data |
---|---|---|
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> |
e1f2d1c3 | 15 | #include "AliHLTTPCCASliceTrack.h" |
b22af1bf | 16 | //Obsolete |
17 | #include "AliHLTTPCCAOutTrack.h" | |
63d8b79d | 18 | |
19 | /** | |
20 | * @class AliHLTTPCCASliceOutput | |
21 | * | |
22 | * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component} | |
23 | * and transport the output to AliHLTTPCCAGBMerger{Component} | |
24 | * | |
25 | * The class contains all the necessary information about TPC tracks, reconstructed in one slice. | |
fbb9b71b | 26 | * This includes the reconstructed track parameters and some compressed information |
63d8b79d | 27 | * about the assigned clusters: clusterId, position and amplitude. |
28 | * | |
29 | */ | |
30 | class AliHLTTPCCASliceOutput | |
31 | { | |
fbb9b71b | 32 | public: |
d4594e7d | 33 | |
34 | struct outputControlStruct | |
35 | { | |
90da1ad5 | 36 | outputControlStruct() : fObsoleteOutput( 1 ), fDefaultOutput( 1 ), fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {} |
d4594e7d | 37 | int fObsoleteOutput; //Enable Obsolete Output |
38 | int fDefaultOutput; //Enable Default Output | |
39 | char* fOutputPtr; //Pointer to Output Space, NULL to allocate output space | |
90da1ad5 | 40 | int fOutputMaxSize; //Max Size of Output Data if Pointer to output space is given |
41 | bool fEndOfSpace; // end of space flag | |
d4594e7d | 42 | }; |
43 | ||
fbb9b71b | 44 | GPUhd() int NTracks() const { return fNTracks; } |
45 | GPUhd() int NTrackClusters() const { return fNTrackClusters; } | |
63d8b79d | 46 | |
e65db743 | 47 | GPUhd() const AliHLTTPCCASliceTrack &Track( int i ) const { return TracksP()[i]; } |
48 | GPUhd() unsigned char ClusterRow ( int i ) const { return ClusterRowP()[i]; } | |
49 | GPUhd() int ClusterId ( int i ) const { return ClusterIdP()[i]; } | |
50 | GPUhd() float2 ClusterUnpackedYZ ( int i ) const { return ClusterUnpackedYZP()[i]; } | |
51 | GPUhd() float ClusterUnpackedX ( int i ) const { return ClusterUnpackedXP()[i]; } | |
63d8b79d | 52 | |
fbb9b71b | 53 | GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters ); |
d4594e7d | 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); | |
63d8b79d | 56 | |
fbb9b71b | 57 | GPUhd() void SetNTracks ( int v ) { fNTracks = v; } |
58 | GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; } | |
63d8b79d | 59 | |
e65db743 | 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 SetClusterUnpackedYZ( int i, float2 v ) { ClusterUnpackedYZP()[i] = v; } | |
64 | GPUhd() void SetClusterUnpackedX( int i, float v ) { ClusterUnpackedXP()[i] = v; } | |
63d8b79d | 65 | |
d4594e7d | 66 | GPUhd() size_t OutputMemorySize() const { return(fMemorySize); } |
67 | ||
b22af1bf | 68 | //Obsolete Output |
e1f2d1c3 | 69 | |
b22af1bf | 70 | GPUhd() int NOutTracks() const { return(fNOutTracks); } |
71 | GPUhd() void SetNOutTracks(int val) { fNOutTracks = val; } | |
72 | GPUhd() AliHLTTPCCAOutTrack *OutTracks() const { return fOutTracks; } | |
73 | GPUhd() const AliHLTTPCCAOutTrack &OutTrack( int index ) const { return fOutTracks[index]; } | |
74 | GPUhd() int NOutTrackHits() const { return fNOutTrackHits; } | |
75 | GPUhd() void SetNOutTrackHits(int val) { fNOutTrackHits = val; } | |
76 | GPUhd() void SetOutTrackHit(int n, int val) { fOutTrackHits[n] = val; } | |
77 | GPUhd() int OutTrackHit( int i ) const { return fOutTrackHits[i]; } | |
78 | ||
79 | private: | |
98512261 | 80 | AliHLTTPCCASliceOutput() |
e65db743 | 81 | : fNTracks( 0 ), fNTrackClusters( 0 ), fTracksOffset( 0 ), fClusterIdOffset( 0 ), fClusterRowOffset( 0 ), fClusterUnpackedYZOffset( 0 ), fClusterUnpackedXOffset( 0 ), |
98512261 | 82 | fMemorySize( 0 ), fNOutTracks(0), fNOutTrackHits(0), fOutTracks(0), fOutTrackHits(0) {} |
e1f2d1c3 | 83 | |
98512261 | 84 | ~AliHLTTPCCASliceOutput() {} |
fbb9b71b | 85 | const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; } |
b22af1bf | 86 | AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& ); |
e1f2d1c3 | 87 | |
d4594e7d | 88 | GPUh() void SetMemorySize(size_t val) { fMemorySize = val; } |
89 | ||
e65db743 | 90 | GPUh() AliHLTTPCCASliceTrack *TracksP() const { return (AliHLTTPCCASliceTrack*)(fMemory+fTracksOffset); } |
91 | GPUh() int *ClusterIdP() const { return (int*)(fMemory+fClusterIdOffset); } | |
92 | GPUh() UChar_t *ClusterRowP() const { return (UChar_t *)(fMemory+fClusterRowOffset); } | |
93 | GPUh() float2 *ClusterUnpackedYZP() const { return (float2 *)(fMemory+fClusterUnpackedYZOffset); } | |
94 | GPUh() float *ClusterUnpackedXP() const { return (float *)(fMemory+fClusterUnpackedXOffset); } | |
95 | ||
6de2bc40 | 96 | int fNTracks; // number of reconstructed tracks |
97 | int fNTrackClusters; // total number of track clusters | |
e65db743 | 98 | int fTracksOffset; // pointer to reconstructed tracks |
99 | int fClusterIdOffset; // pointer to cluster Id's ( packed slice, patch, cluster ) | |
100 | int fClusterRowOffset; // pointer to cluster row numbers | |
101 | int fClusterUnpackedYZOffset; // pointer to cluster coordinates (temporary data, for debug proposes) | |
102 | int fClusterUnpackedXOffset; // pointer to cluster coordinates (temporary data, for debug proposes) | |
b22af1bf | 103 | size_t fMemorySize; // Amount of memory really used |
104 | ||
105 | // obsolete output | |
106 | ||
107 | int fNOutTracks; | |
108 | int fNOutTrackHits; | |
109 | AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks | |
110 | int *fOutTrackHits; // output array of ID's of the reconstructed hits | |
111 | ||
112 | //Must be last element of this class, user has to make sure to allocate anough memory consecutive to class memory! | |
98512261 | 113 | //This way the whole Slice Output is one consecutive Memory Segment |
114 | char fMemory[1]; // the memory where the pointers above point into | |
b22af1bf | 115 | |
63d8b79d | 116 | }; |
117 | ||
31649d4b | 118 | #endif //ALIHLTTPCCASLICEOUTPUT_H |