StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AliHLTTPCCAMergerOutput.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 ALIHLTTPCCAMERGEROUTPUT_H
11 #define ALIHLTTPCCAMERGEROUTPUT_H
12 
13 #include "AliHLTTPCCADef.h"
14 #include "AliHLTTPCCAMergedTrack.h"
15 #include "AliHLTTPCCADataCompressor.h"
16 
29 {
30  public:
31 
33  : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterIDsrc( 0 ), fClusterPackedAmp( 0 ) {}
34 
36  : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterIDsrc( 0 ), fClusterPackedAmp( 0 ) {}
37 
38  const AliHLTTPCCAMergerOutput& operator=( const AliHLTTPCCAMergerOutput &/*v*/ ) const {
39  return *this;
40  }
41 
43 
44 
45  int NTracks() const { return fNTracks; }
46  int NTrackClusters() const { return fNTrackClusters; }
47 
48  const AliHLTTPCCAMergedTrack &Track( int i ) const { return fTracks[i]; }
49  const DataCompressor::SliceRowCluster &ClusterIDsrc ( int i ) const { return fClusterIDsrc[i]; }
50  UChar_t ClusterPackedAmp( int i ) const { return fClusterPackedAmp[i]; }
51 
52  static int EstimateSize( int nOfTracks, int nOfTrackClusters );
53  void SetPointers();
54 
55  void SetNTracks ( int v ) { fNTracks = v; }
56  void SetNTrackClusters( int v ) { fNTrackClusters = v; }
57 
58  void SetTrack( int i, const AliHLTTPCCAMergedTrack &v ) { fTracks[i] = v; }
59  void SetClusterIDsrc( int i, const DataCompressor::SliceRowCluster &v ) { fClusterIDsrc[i] = v; }
60  void SetClusterPackedAmp( int i, UChar_t v ) { fClusterPackedAmp[i] = v; }
61 
62  private:
63 
64  int fNTracks; // number of reconstructed tracks
65  int fNTrackClusters; // total number of track clusters
66  AliHLTTPCCAMergedTrack *fTracks; // pointer to reconstructed tracks
67  DataCompressor::SliceRowCluster *fClusterIDsrc; // pointer to cluster IDs ( packed IRow and ICluster)
68  UChar_t *fClusterPackedAmp; // pointer to packed cluster amplitudes
69 
70 };
71 
72 
73 
74 inline int AliHLTTPCCAMergerOutput::EstimateSize( int nOfTracks, int nOfTrackClusters )
75 {
76  // calculate the amount of memory [bytes] needed for the event
77 
78  const int kClusterDataSize = sizeof( unsigned int ) + sizeof( UChar_t );
79 
80  return sizeof( AliHLTTPCCAMergerOutput ) + sizeof( AliHLTTPCCAMergedTrack )*nOfTracks + kClusterDataSize*nOfTrackClusters;
81 }
82 
83 
84 inline void AliHLTTPCCAMergerOutput::SetPointers()
85 {
86  // set all pointers
87 
88  fTracks = ( AliHLTTPCCAMergedTrack* )( ( &fClusterPackedAmp ) + 1 );
89  fClusterIDsrc = ( DataCompressor::SliceRowCluster* ) ( fTracks + fNTracks );
90  fClusterPackedAmp = ( UChar_t* ) ( fClusterIDsrc + fNTrackClusters );
91 }
92 
93 #endif
C++ STL includes.
Definition: AgUStep.h:47