]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCASliceOutput.h
Qmax for merged clusters fixed
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCASliceOutput.h
1 //-*- Mode: C++ -*-
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                               *
6 //                                                                        *
7 //*************************************************************************
8
9
10 #ifndef ALIHLTTPCCASLICEOUTPUT_H
11 #define ALIHLTTPCCASLICEOUTPUT_H
12
13 #include "AliHLTTPCCADef.h"
14 #include <cstdlib>
15 #ifndef HLTCA_GPUCODE
16 #include "AliHLTTPCCASliceOutTrack.h"
17 #else
18 class AliHLTTPCCASliceOutTrack;
19 #endif
20
21
22 /**
23  * @class AliHLTTPCCASliceOutput
24  *
25  * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component}
26  * and transport the output to AliHLTTPCCAGBMerger{Component}
27  *
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.
31  *
32  */
33 class AliHLTTPCCASliceOutput
34 {
35   public:
36
37   struct outputControlStruct
38   {
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 
43   };
44
45   GPUhd() int NTracks()                    const { return fNTracks;              }
46   GPUhd() int NLocalTracks()               const { return fNLocalTracks;         }
47   GPUhd() int NTrackClusters()             const { return fNTrackClusters;       }  
48 #ifndef HLTCA_GPUCODE
49   GPUhd() const AliHLTTPCCASliceOutTrack *GetFirstTrack() const { return fMemory; }
50   GPUhd() AliHLTTPCCASliceOutTrack *FirstTrack(){ return fMemory; }
51 #endif
52   GPUhd() size_t Size() const { return(fMemorySize); }
53
54   static int EstimateSize( int nOfTracks, int nOfTrackClusters );
55   static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl);
56
57   GPUhd() void SetNTracks       ( int v )  { fNTracks = v;        }
58   GPUhd() void SetNLocalTracks  ( int v )  { fNLocalTracks = v;   }
59   GPUhd() void SetNTrackClusters( int v )  { fNTrackClusters = v; }
60
61   private:
62
63   AliHLTTPCCASliceOutput()
64     : fNTracks( 0 ), fNLocalTracks( 0 ), fNTrackClusters( 0 ), fMemorySize( 0 ){}
65   
66   ~AliHLTTPCCASliceOutput() {}
67   const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
68   AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& );
69
70   GPUh() void SetMemorySize(size_t val) { fMemorySize = val; }
71
72   int fNTracks;                   // number of reconstructed tracks
73   int fNLocalTracks;
74   int fNTrackClusters;            // total number of track clusters
75   size_t fMemorySize;           // Amount of memory really used
76
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
79
80 #ifndef HLTCA_GPUCODE
81   AliHLTTPCCASliceOutTrack fMemory[0]; // the memory where the pointers above point into
82 #endif
83
84 };
85
86 #endif