]>
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" |
70e4a065 | 16 | #include "AliHLTTPCCACompressedInputData.h" |
63d8b79d | 17 | |
18 | /** | |
19 | * @class AliHLTTPCCASliceOutput | |
20 | * | |
21 | * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component} | |
22 | * and transport the output to AliHLTTPCCAGBMerger{Component} | |
23 | * | |
24 | * The class contains all the necessary information about TPC tracks, reconstructed in one slice. | |
fbb9b71b | 25 | * This includes the reconstructed track parameters and some compressed information |
63d8b79d | 26 | * about the assigned clusters: clusterId, position and amplitude. |
27 | * | |
28 | */ | |
29 | class AliHLTTPCCASliceOutput | |
30 | { | |
fbb9b71b | 31 | public: |
d4594e7d | 32 | |
5cb6ddd4 | 33 | struct outputControlStruct |
34 | { | |
35 | outputControlStruct() : fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {} | |
36 | char* fOutputPtr; //Pointer to Output Space, NULL to allocate output space | |
37 | int fOutputMaxSize; //Max Size of Output Data if Pointer to output space is given | |
38 | bool fEndOfSpace; // end of space flag | |
39 | }; | |
40 | ||
41 | GPUhd() int NTracks() const { return fNTracks; } | |
42 | GPUhd() int NTrackClusters() const { return fNTrackClusters; } | |
43 | ||
44 | GPUhd() const AliHLTTPCCASliceTrack &Track( int i ) const { return TracksP()[i]; } | |
45 | GPUhd() unsigned char ClusterRow ( int i ) const { return ClusterRowP()[i]; } | |
46 | GPUhd() int ClusterId ( int i ) const { return ClusterIdP()[i]; } | |
47 | GPUhd() const AliHLTTPCCACompressedCluster &ClusterPackedXYZ ( int i ) const { return ClusterPackedXYZP()[i]; } | |
48 | ||
49 | GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters ); | |
50 | void SetPointers(int nTracks = -1, int nTrackClusters = -1, const outputControlStruct* outputControl = NULL); | |
51 | static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl); | |
52 | ||
53 | GPUhd() void SetNTracks ( int v ) { fNTracks = v; } | |
54 | GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; } | |
55 | ||
56 | GPUhd() void SetTrack( int i, const AliHLTTPCCASliceTrack &v ) { TracksP()[i] = v; } | |
57 | GPUhd() void SetClusterRow( int i, unsigned char v ) { ClusterRowP()[i] = v; } | |
58 | GPUhd() void SetClusterId( int i, int v ) { ClusterIdP()[i] = v; } | |
59 | GPUhd() void SetClusterPackedXYZ( int i, AliHLTTPCCACompressedCluster v ) { ClusterPackedXYZP()[i] = v; } | |
60 | ||
61 | GPUhd() size_t OutputMemorySize() const { return(fMemorySize); } | |
b22af1bf | 62 | |
e1f2d1c3 | 63 | |
5cb6ddd4 | 64 | private: |
65 | AliHLTTPCCASliceOutput() | |
66 | : fNTracks( 0 ), fNTrackClusters( 0 ), fTracksOffset( 0 ), fClusterIdOffset( 0 ), fClusterRowOffset( 0 ), fClusterPackedXYZOffset( 0 ), | |
67 | fMemorySize( 0 ){} | |
68 | ||
69 | ~AliHLTTPCCASliceOutput() {} | |
70 | const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; } | |
71 | AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& ); | |
e1f2d1c3 | 72 | |
5cb6ddd4 | 73 | GPUh() void SetMemorySize(size_t val) { fMemorySize = val; } |
d4594e7d | 74 | |
e65db743 | 75 | GPUh() AliHLTTPCCASliceTrack *TracksP() const { return (AliHLTTPCCASliceTrack*)(fMemory+fTracksOffset); } |
76 | GPUh() int *ClusterIdP() const { return (int*)(fMemory+fClusterIdOffset); } | |
77 | GPUh() UChar_t *ClusterRowP() const { return (UChar_t *)(fMemory+fClusterRowOffset); } | |
70e4a065 | 78 | GPUh() AliHLTTPCCACompressedCluster *ClusterPackedXYZP() const { return (AliHLTTPCCACompressedCluster *)(fMemory+fClusterPackedXYZOffset); } |
e65db743 | 79 | |
5cb6ddd4 | 80 | int fNTracks; // number of reconstructed tracks |
81 | int fNTrackClusters; // total number of track clusters | |
82 | int fTracksOffset; // pointer to reconstructed tracks | |
83 | int fClusterIdOffset; // pointer to cluster Id's ( packed slice, patch, cluster ) | |
84 | int fClusterRowOffset; // pointer to cluster row numbers | |
85 | int fClusterPackedXYZOffset; // pointer to cluster coordinates | |
86 | size_t fMemorySize; // Amount of memory really used | |
b22af1bf | 87 | |
5cb6ddd4 | 88 | //Must be last element of this class, user has to make sure to allocate anough memory consecutive to class memory! |
89 | //This way the whole Slice Output is one consecutive Memory Segment | |
98512261 | 90 | char fMemory[1]; // the memory where the pointers above point into |
b22af1bf | 91 | |
63d8b79d | 92 | }; |
93 | ||
31649d4b | 94 | #endif //ALIHLTTPCCASLICEOUTPUT_H |