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 *
7 //*************************************************************************
10 #ifndef ALIHLTTPCCAMERGEROUTPUT_H
11 #define ALIHLTTPCCAMERGEROUTPUT_H
13 #include "AliHLTTPCCADef.h"
14 #include "AliHLTTPCCAMergedTrack.h"
17 * @class AliHLTTPCCAMergerOutput
19 * AliHLTTPCCAMergerOutput class is used to store the output of AliHLTTPCCATracker{Component}
20 * and transport the output to AliHLTTPCCAMerger{Component}
22 * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
23 * This includes the reconstructed track parameters and some compressed information
24 * about the assigned clusters: clusterId, position and amplitude.
27 class AliHLTTPCCAMergerOutput
31 AliHLTTPCCAMergerOutput()
32 : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterId( 0 ), fClusterPackedAmp( 0 ) {}
34 ~AliHLTTPCCAMergerOutput() {}
37 GPUhd() int NTracks() const { return fNTracks; }
38 GPUhd() int NTrackClusters() const { return fNTrackClusters; }
40 GPUhd() const AliHLTTPCCAMergedTrack &Track( int i ) const { return fTracks[i]; }
41 GPUhd() int ClusterId ( int i ) const { return fClusterId[i]; }
42 GPUhd() UChar_t ClusterPackedAmp( int i ) const { return fClusterPackedAmp[i]; }
44 GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters );
45 GPUhd() void SetPointers();
47 GPUhd() void SetNTracks ( int v ) { fNTracks = v; }
48 GPUhd() void SetNTrackClusters( int v ) { fNTrackClusters = v; }
50 GPUhd() void SetTrack( int i, const AliHLTTPCCAMergedTrack &v ) { fTracks[i] = v; }
51 GPUhd() void SetClusterId( int i, int v ) { fClusterId[i] = v; }
52 GPUhd() void SetClusterPackedAmp( int i, UChar_t v ) { fClusterPackedAmp[i] = v; }
56 AliHLTTPCCAMergerOutput( const AliHLTTPCCAMergerOutput & )
57 : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterId( 0 ), fClusterPackedAmp( 0 ) {}
59 const AliHLTTPCCAMergerOutput& operator=( const AliHLTTPCCAMergerOutput &/*v*/ ) const {
63 int fNTracks; // number of reconstructed tracks
64 int fNTrackClusters; // total number of track clusters
65 AliHLTTPCCAMergedTrack *fTracks; // pointer to reconstructed tracks
66 int *fClusterId; // pointer to cluster IDs ( packed slice, patch, cluster )
67 UChar_t *fClusterPackedAmp; // pointer to packed cluster amplitudes
72 GPUhd() inline int AliHLTTPCCAMergerOutput::EstimateSize( int nOfTracks, int nOfTrackClusters )
74 // calculate the amount of memory [bytes] needed for the event
76 const int kClusterDataSize = sizeof( int ) + sizeof( UChar_t );
78 return sizeof( AliHLTTPCCAMergerOutput ) + sizeof( AliHLTTPCCAMergedTrack )*nOfTracks + kClusterDataSize*nOfTrackClusters;
82 GPUhd() inline void AliHLTTPCCAMergerOutput::SetPointers()
86 fTracks = ( AliHLTTPCCAMergedTrack* )( ( &fClusterPackedAmp ) + 1 );
87 fClusterId = ( int* ) ( fTracks + fNTracks );
88 fClusterPackedAmp = ( UChar_t* ) ( fClusterId + fNTrackClusters );
91 #endif //ALIHLTTPCCAMERGEROUTPUT_H