]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/tracking-ca/AliHLTTPCCASliceOutput.h
treatment of MC labels added
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCASliceOutput.h
CommitLineData
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>
f0bada7f 15#ifndef HLTCA_GPUCODE
0f1f07c3 16#include "AliHLTTPCCASliceOutTrack.h"
f0bada7f 17#else
18class AliHLTTPCCASliceOutTrack;
19#endif
0f1f07c3 20
63d8b79d 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.
fbb9b71b 29 * This includes the reconstructed track parameters and some compressed information
63d8b79d 30 * about the assigned clusters: clusterId, position and amplitude.
31 *
32 */
33class AliHLTTPCCASliceOutput
34{
fbb9b71b 35 public:
d4594e7d 36
5cb6ddd4 37 struct outputControlStruct
38 {
39 outputControlStruct() : fOutputPtr( NULL ), fOutputMaxSize ( 0 ), fEndOfSpace(0) {}
cf9f6481 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
5cb6ddd4 42 bool fEndOfSpace; // end of space flag
43 };
44
45 GPUhd() int NTracks() const { return fNTracks; }
e4818148 46 GPUhd() int NLocalTracks() const { return fNLocalTracks; }
0f1f07c3 47 GPUhd() int NTrackClusters() const { return fNTrackClusters; }
f0bada7f 48#ifndef HLTCA_GPUCODE
0f1f07c3 49 GPUhd() const AliHLTTPCCASliceOutTrack *GetFirstTrack() const { return fMemory; }
50 GPUhd() AliHLTTPCCASliceOutTrack *FirstTrack(){ return fMemory; }
f0bada7f 51#endif
0f1f07c3 52 GPUhd() size_t Size() const { return(fMemorySize); }
5cb6ddd4 53
f0bada7f 54 static int EstimateSize( int nOfTracks, int nOfTrackClusters );
5cb6ddd4 55 static void Allocate(AliHLTTPCCASliceOutput* &ptrOutput, int nTracks, int nTrackHits, outputControlStruct* outputControl);
56
57 GPUhd() void SetNTracks ( int v ) { fNTracks = v; }
e4818148 58 GPUhd() void SetNLocalTracks ( int v ) { fNLocalTracks = v; }
5cb6ddd4 59 GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; }
e1f2d1c3 60
5cb6ddd4 61 private:
0f1f07c3 62
5cb6ddd4 63 AliHLTTPCCASliceOutput()
e4818148 64 : fNTracks( 0 ), fNLocalTracks( 0 ), fNTrackClusters( 0 ), fMemorySize( 0 ){}
5cb6ddd4 65
66 ~AliHLTTPCCASliceOutput() {}
67 const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
68 AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& );
e1f2d1c3 69
5cb6ddd4 70 GPUh() void SetMemorySize(size_t val) { fMemorySize = val; }
d4594e7d 71
5cb6ddd4 72 int fNTracks; // number of reconstructed tracks
e4818148 73 int fNLocalTracks;
5cb6ddd4 74 int fNTrackClusters; // total number of track clusters
0f1f07c3 75 size_t fMemorySize; // Amount of memory really used
b22af1bf 76
5cb6ddd4 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
0f1f07c3 79
f0bada7f 80#ifndef HLTCA_GPUCODE
0f1f07c3 81 AliHLTTPCCASliceOutTrack fMemory[0]; // the memory where the pointers above point into
f0bada7f 82#endif
b22af1bf 83
63d8b79d 84};
85
0f1f07c3 86#endif