2 // **************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project *
4 // ALICE Experiment at CERN, All rights reserved. *
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. *
10 // Permission to use, copy, modify and distribute this software and its *
11 // documentation strictly for non-commercial purposes is hereby granted *
12 // without fee, provided that the above copyright notice appears in all *
13 // copies and that both the copyright notice and this permission notice *
14 // appear in the supporting documentation. The authors make no claims *
15 // about the suitability of this software for any purpose. It is *
16 // provided "as is" without express or implied warranty. *
18 //***************************************************************************
20 #include "AliHLTTPCCASliceOutput.h"
22 GPUhd() int AliHLTTPCCASliceOutput::EstimateSize( int nOfTracks, int nOfTrackClusters )
24 // calculate the amount of memory [bytes] needed for the event
26 const int kClusterDataSize = sizeof( int ) + sizeof( unsigned short ) + sizeof( float2 ) + sizeof( float ) + sizeof( UChar_t ) + sizeof( UChar_t );
28 return sizeof( AliHLTTPCCASliceOutput ) + sizeof( AliHLTTPCCASliceTrack )*nOfTracks + kClusterDataSize*nOfTrackClusters;
31 template<typename T> inline void AssignNoAlignment( T *&dst, char *&mem, int count )
33 // assign memory to the pointer dst
35 mem = ( char * )( dst + count );
38 GPUhd() void AliHLTTPCCASliceOutput::SetPointers()
42 char *mem = &fMemory[0];
43 AssignNoAlignment( fTracks, mem, fNTracks );
44 AssignNoAlignment( fClusterUnpackedYZ, mem, fNTrackClusters );
45 AssignNoAlignment( fClusterUnpackedX, mem, fNTrackClusters );
46 AssignNoAlignment( fClusterId, mem, fNTrackClusters );
47 AssignNoAlignment( fClusterPackedYZ, mem, fNTrackClusters );
48 AssignNoAlignment( fClusterRow, mem, fNTrackClusters );
49 AssignNoAlignment( fClusterPackedAmp, mem, fNTrackClusters );