+ public:
+
+ GPUhd() static unsigned int IRowIClu2IDrc( unsigned int iRow, unsigned int iCluster ) {
+ return ( iCluster << 8 ) + iRow;
+ }
+
+ GPUhd() static unsigned int IDrc2IRow( unsigned int IDrc ) { return ( IDrc % 256 ); }
+ GPUhd() static unsigned int IDrc2IClu( unsigned int IDrc ) { return ( IDrc >> 8 ); }
+
+
+ GPUhd() static unsigned int ISliceIRowIClu2IDsrc( unsigned int iSlice, unsigned int iRow, unsigned int iCluster ) {
+ return ( iCluster << 14 ) + ( iRow << 6 ) + iSlice;
+ }
+
+ GPUhd() static unsigned int IDsrc2ISlice( unsigned int IDsrc ) { return ( IDsrc % 64 ); }
+ GPUhd() static unsigned int IDsrc2IRow ( unsigned int IDsrc ) { return ( ( IDsrc >> 6 ) % 256 ); }
+ GPUhd() static unsigned int IDsrc2IClu ( unsigned int IDsrc ) { return ( IDsrc >> 14 ); }
+
+
+ GPUhd() static unsigned short YZ2UShort( float Y, float Z );
+ GPUhd() static float UShort2Y ( unsigned short iYZ );
+ GPUhd() static float UShort2Z ( unsigned short iYZ );
+
+ static AliHLTTPCCACompressedCluster PackXYZ( int iRow, float X, float Y, float Z )
+ {
+ // pack the cluster
+
+ // get coordinates in [um]
+
+ Double_t rowX = AliHLTTPCTransform::Row2X( iRow );
+
+ Double_t x = (X - rowX )*1.e4 + 32768.;
+ Double_t y = Y*1.e4 + 8388608.;
+ Double_t z = Z*1.e4 + 8388608.;
+
+ // truncate if necessary
+ if( x<0 ) x = 0; else if( x > 0x0000FFFF ) x = 0x0000FFFF;
+ if( y<0 ) y = 0; else if( y > 0x00FFFFFF ) y = 0x00FFFFFF;
+ if( z<0 ) z = 0; else if( z > 0x00FFFFFF ) z = 0x00FFFFFF;
+
+ UInt_t ix0 = ( (UInt_t) x )&0x000000FF;
+ UInt_t ix1 = (( (UInt_t) x )&0x0000FF00 )>>8;
+ UInt_t iy = ( (UInt_t) y )&0x00FFFFFF;
+ UInt_t iz = ( (UInt_t) z )&0x00FFFFFF;
+
+ AliHLTTPCCACompressedCluster ret;
+ ret.fP0 = (ix0<<24) + iy;
+ ret.fP1 = (ix1<<24) + iz;
+ return ret;