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 ALIHLTTPCCASLICEOUTPUT_H
11 #define ALIHLTTPCCASLICEOUTPUT_H
13 #include "AliHLTTPCCADef.h"
15 #include "AliHLTTPCCASliceTrack.h"
18 * @class AliHLTTPCCASliceOutput
20 * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component}
21 * and transport the output to AliHLTTPCCAGBMerger{Component}
23 * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
24 * This includes the reconstructed track parameters and some compressed information
25 * about the assigned clusters: clusterId, position and amplitude.
28 class AliHLTTPCCASliceOutput
32 GPUhd() Int_t NTracks() const { return fNTracks; }
33 GPUhd() Int_t NTrackClusters() const { return fNTrackClusters; }
35 GPUhd() const AliHLTTPCCASliceTrack &Track( Int_t i ) const { return fTracks[i]; }
36 GPUhd() UInt_t ClusterIDrc ( Int_t i ) const { return fClusterIDrc[i]; }
37 GPUhd() UShort_t ClusterPackedYZ ( Int_t i ) const { return fClusterPackedYZ[i]; }
38 GPUhd() UChar_t ClusterPackedAmp( Int_t i ) const { return fClusterPackedAmp[i]; }
39 GPUhd() float2 ClusterUnpackedYZ ( Int_t i ) const { return fClusterUnpackedYZ[i]; }
40 GPUhd() float ClusterUnpackedX ( Int_t i ) const { return fClusterUnpackedX[i]; }
42 GPUhd() static Int_t EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters );
43 GPUhd() void SetPointers();
45 GPUhd() void SetNTracks ( Int_t v ) { fNTracks = v; }
46 GPUhd() void SetNTrackClusters( Int_t v ) { fNTrackClusters = v; }
48 GPUhd() void SetTrack( Int_t i, const AliHLTTPCCASliceTrack &v ) { fTracks[i] = v; }
49 GPUhd() void SetClusterIDrc( Int_t i, UInt_t v ) { fClusterIDrc[i] = v; }
50 GPUhd() void SetClusterPackedYZ( Int_t i, UShort_t v ) { fClusterPackedYZ[i] = v; }
51 GPUhd() void SetClusterPackedAmp( Int_t i, UChar_t v ) { fClusterPackedAmp[i] = v; }
52 GPUhd() void SetClusterUnpackedYZ( Int_t i, float2 v ) { fClusterUnpackedYZ[i] = v; }
53 GPUhd() void SetClusterUnpackedX( Int_t i, float v ) { fClusterUnpackedX[i] = v; }
57 AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& )
58 : fNTracks(0),fNTrackClusters(0),fTracks(0),fClusterIDrc(0), fClusterPackedYZ(0),fClusterUnpackedYZ(0),fClusterUnpackedX(0),fClusterPackedAmp(0){}
60 const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
62 Int_t fNTracks; // number of reconstructed tracks
63 Int_t fNTrackClusters; // total number of track clusters
64 AliHLTTPCCASliceTrack *fTracks; // pointer to reconstructed tracks
65 UInt_t *fClusterIDrc; // pointer to cluster IDs ( packed IRow and ICluster)
66 UShort_t *fClusterPackedYZ; // pointer to packed cluster YZ coordinates
67 float2 *fClusterUnpackedYZ; // pointer to cluster coordinates (temporary data, for debug proposes)
68 float *fClusterUnpackedX; // pointer to cluster coordinates (temporary data, for debug proposes)
69 UChar_t *fClusterPackedAmp; // pointer to packed cluster amplitudes
75 GPUhd() inline Int_t AliHLTTPCCASliceOutput::EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters )
77 // calculate the amount of memory [bytes] needed for the event
79 const Int_t kClusterDataSize = sizeof(UInt_t) + sizeof(UShort_t) + sizeof(float2) + sizeof(float)+ sizeof(UChar_t);
81 return sizeof(AliHLTTPCCASliceOutput) + sizeof(AliHLTTPCCASliceTrack)*nOfTracks + kClusterDataSize*nOfTrackClusters;
85 GPUhd() inline void AliHLTTPCCASliceOutput::SetPointers()
89 fTracks = (AliHLTTPCCASliceTrack*)((&fClusterPackedAmp)+1);
90 fClusterUnpackedYZ = (float2*) ( fTracks + fNTracks );
91 fClusterUnpackedX = (float*) ( fClusterUnpackedYZ + fNTrackClusters );
92 fClusterIDrc = (UInt_t*) ( fClusterUnpackedX + fNTrackClusters );
93 fClusterPackedYZ = (UShort_t*)( fClusterIDrc + fNTrackClusters );
94 fClusterPackedAmp = (UChar_t*) ( fClusterPackedYZ + fNTrackClusters );