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> |
0f1f07c3 |
15 | #include "AliHLTTPCCASliceOutTrack.h" |
16 | |
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; } |
0f1f07c3 |
42 | GPUhd() int NTrackClusters() const { return fNTrackClusters; } |
43 | GPUhd() const AliHLTTPCCASliceOutTrack *GetFirstTrack() const { return fMemory; } |
44 | GPUhd() AliHLTTPCCASliceOutTrack *FirstTrack(){ return fMemory; } |
45 | GPUhd() size_t Size() const { return(fMemorySize); } |
5cb6ddd4 |
46 | |
47 | GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters ); |
5cb6ddd4 |
48 | static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl); |
49 | |
50 | GPUhd() void SetNTracks ( int v ) { fNTracks = v; } |
51 | GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; } |
e1f2d1c3 |
52 | |
5cb6ddd4 |
53 | private: |
0f1f07c3 |
54 | |
5cb6ddd4 |
55 | AliHLTTPCCASliceOutput() |
0f1f07c3 |
56 | : fNTracks( 0 ), fNTrackClusters( 0 ), fMemorySize( 0 ){} |
5cb6ddd4 |
57 | |
58 | ~AliHLTTPCCASliceOutput() {} |
59 | const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; } |
60 | AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& ); |
e1f2d1c3 |
61 | |
5cb6ddd4 |
62 | GPUh() void SetMemorySize(size_t val) { fMemorySize = val; } |
d4594e7d |
63 | |
5cb6ddd4 |
64 | int fNTracks; // number of reconstructed tracks |
65 | int fNTrackClusters; // total number of track clusters |
0f1f07c3 |
66 | size_t fMemorySize; // Amount of memory really used |
b22af1bf |
67 | |
5cb6ddd4 |
68 | //Must be last element of this class, user has to make sure to allocate anough memory consecutive to class memory! |
69 | //This way the whole Slice Output is one consecutive Memory Segment |
0f1f07c3 |
70 | |
71 | AliHLTTPCCASliceOutTrack fMemory[0]; // the memory where the pointers above point into |
b22af1bf |
72 | |
63d8b79d |
73 | }; |
74 | |
0f1f07c3 |
75 | #endif |