StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
AliHLTTPCCASliceOutput.cxx
1 // @(#) $Id: AliHLTTPCCASliceOutput.cxx,v 1.1 2016/02/05 23:27:29 fisyak Exp $
2 // **************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
5 // *
6 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
7 // Ivan Kisel <kisel@kip.uni-heidelberg.de> *
8 // for The ALICE HLT Project. *
9 // *
10 // Developed by: Igor Kulakov <I.Kulakov@gsi.de> *
11 // Maksym Zyzak <M.Zyzak@gsi.de> *
12 // *
13 // Permission to use, copy, modify and distribute this software and its *
14 // documentation strictly for non-commercial purposes is hereby granted *
15 // without fee, provided that the above copyright notice appears in all *
16 // copies and that both the copyright notice and this permission notice *
17 // appear in the supporting documentation. The authors make no claims *
18 // about the suitability of this software for any purpose. It is *
19 // provided "as is" without express or implied warranty. *
20 // *
21 //***************************************************************************
22 
23 #include "AliHLTTPCCASliceOutput.h"
24 #include "MemoryAssignmentHelpers.h"
25 
26 int AliHLTTPCCASliceOutput::EstimateSize( int nOfTracks, int nOfTrackClusters )
27 {
28  // // calculate the amount of memory [bytes] needed for the event
29 
30  const int kClusterDataSize =
31  sizeof( DataCompressor::RowCluster )
32  + sizeof( unsigned short )
33  + sizeof( float2 )
34  + sizeof( float )
35  + sizeof( UChar_t );
36 
37  const int aligmentMaxSize =
38  sizeof( AliHLTTPCCASliceTrack ) + kClusterDataSize; // aligment during AssignMemory
39  return
40  sizeof( AliHLTTPCCASliceTrack ) * nOfTracks
41  + kClusterDataSize * nOfTrackClusters
42  + aligmentMaxSize;
43 
44  // return
45  // RequiredMemory(fTracks, fNTracks) +
46  // RequiredMemory( fClusterUnpackedYZ, fNTrackClusters ) +
47  // RequiredMemory( fClusterUnpackedX, fNTrackClusters ) +
48  // RequiredMemory( fClusterIDrc, fNTrackClusters ) +
49  // RequiredMemory( fClusterPackedYZ, fNTrackClusters ) +
50  // RequiredMemory( fClusterPackedAmp, fNTrackClusters );
51 }
52 
53 
54 void AliHLTTPCCASliceOutput::SetPointers()
55 {
56  // set all pointers
57 
58  char *mem = &fMemory[0];
59  AssignMemory( fTracks, mem, fNTracks );
60  AssignMemory( fClusterUnpackedYZ, mem, fNTrackClusters );
61  AssignMemory( fClusterUnpackedX, mem, fNTrackClusters );
62  AssignMemory( fClusterIDrc, mem, fNTrackClusters );
63  AssignMemory( fClusterPackedYZ, mem, fNTrackClusters );
64  AssignMemory( fClusterPackedAmp, mem, fNTrackClusters );
65 }
66