]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCASliceOutput.h
TPC CA Global Merger component added
[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
15 #include "AliHLTTPCCASliceTrack.h"
16
17 /**
18  * @class AliHLTTPCCASliceOutput
19  *
20  * AliHLTTPCCASliceOutput class is used to store the output of AliHLTTPCCATracker{Component}
21  * and transport the output to AliHLTTPCCAGBMerger{Component}
22  *
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.
26  *
27  */
28 class AliHLTTPCCASliceOutput
29 {
30  public:
31
32   GPUhd() Int_t NTracks()                    const { return fNTracks;              }
33   GPUhd() Int_t NTrackClusters()             const { return fNTrackClusters;       }
34
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
41   GPUhd() static Int_t EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters );
42   GPUhd() void SetPointers();
43
44   GPUhd() void SetNTracks       ( Int_t v )  { fNTracks = v;        }
45   GPUhd() void SetNTrackClusters( Int_t v )  { fNTrackClusters = v; }
46
47   GPUhd() void SetTrack( Int_t i, const AliHLTTPCCASliceTrack &v ) {  fTracks[i] = v; }
48   GPUhd() void SetClusterIDrc( Int_t i, UInt_t v ) {  fClusterIDrc[i] = v; }
49   GPUhd() void SetClusterPackedYZ( Int_t i, UShort_t v ) {  fClusterPackedYZ[i] = v; }
50   GPUhd() void SetClusterPackedAmp( Int_t i, UChar_t v ) {  fClusterPackedAmp[i] = v; }
51   GPUhd() void SetClusterUnpackedYZ( Int_t i, float2 v ) {  fClusterUnpackedYZ[i] = v; }
52
53  private:
54
55   AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& )
56     : fNTracks(0),fNTrackClusters(0),fTracks(0),fClusterIDrc(0), fClusterPackedYZ(0),fClusterUnpackedYZ(0),fClusterPackedAmp(0){}
57
58   const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
59
60   Int_t fNTracks;                 // number of reconstructed tracks
61   Int_t fNTrackClusters;          // total number of track clusters
62   AliHLTTPCCASliceTrack *fTracks; // pointer to reconstructed tracks
63   UInt_t   *fClusterIDrc;         // pointer to cluster IDs ( packed IRow and ICluster)
64   UShort_t *fClusterPackedYZ;     // pointer to packed cluster YZ coordinates 
65   float2   *fClusterUnpackedYZ;   // pointer to cluster coordinates (temporary data, for debug proposes)
66   UChar_t  *fClusterPackedAmp;    // pointer to packed cluster amplitudes
67
68 };
69
70
71
72 GPUhd() inline Int_t AliHLTTPCCASliceOutput::EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters )
73 {
74   // calculate the amount of memory [bytes] needed for the event
75
76   const Int_t kClusterDataSize = sizeof(UInt_t) + sizeof(UShort_t) + sizeof(float2)+ sizeof(UChar_t);
77
78   return sizeof(AliHLTTPCCASliceOutput) + sizeof(AliHLTTPCCASliceTrack)*nOfTracks + kClusterDataSize*nOfTrackClusters;
79 }
80
81
82 GPUhd() inline void AliHLTTPCCASliceOutput::SetPointers()
83 {
84   // set all pointers
85
86   fTracks            = (AliHLTTPCCASliceTrack*)((&fClusterPackedAmp)+1);
87   fClusterUnpackedYZ = (float2*)  ( fTracks   + fNTracks );
88   fClusterIDrc       = (UInt_t*)  ( fClusterUnpackedYZ + fNTrackClusters );
89   fClusterPackedYZ   = (UShort_t*)( fClusterIDrc       + fNTrackClusters );
90   fClusterPackedAmp  = (UChar_t*) ( fClusterPackedYZ + fNTrackClusters );
91 }
92
93 #endif