]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
cosmetical changes
authorsgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Apr 2009 20:57:12 +0000 (20:57 +0000)
committersgorbuno <sgorbuno@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 13 Apr 2009 20:57:12 +0000 (20:57 +0000)
66 files changed:
HLT/TPCLib/tracking-ca/AliHLT3DTrackParam.cxx
HLT/TPCLib/tracking-ca/AliHLT3DTrackParam.h
HLT/TPCLib/tracking-ca/AliHLTTPCCADataCompressor.h
HLT/TPCLib/tracking-ca/AliHLTTPCCADef.h
HLT/TPCLib/tracking-ca/AliHLTTPCCADisplay.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCADisplay.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAGBHit.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAGBHit.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAGBTrack.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAGBTrack.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAGBTracker.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAGBTracker.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAGlobalMergerComponent.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAGlobalMergerComponent.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAGrid.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAGrid.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAHit.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAHitArea.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAHitArea.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAMCPoint.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAMCPoint.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAMCTrack.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAMCTrack.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAMath.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAMergedTrack.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAMerger.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAMerger.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAMergerOutput.h
HLT/TPCLib/tracking-ca/AliHLTTPCCANeighboursCleaner.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCANeighboursCleaner.h
HLT/TPCLib/tracking-ca/AliHLTTPCCANeighboursFinder.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCANeighboursFinder.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAOutTrack.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAOutTrack.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAParam.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAParam.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAPerformance.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAPerformance.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAProcess.h
HLT/TPCLib/tracking-ca/AliHLTTPCCARow.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCARow.h
HLT/TPCLib/tracking-ca/AliHLTTPCCASliceOutput.h
HLT/TPCLib/tracking-ca/AliHLTTPCCASliceTrack.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAStartHitsFinder.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAStartHitsFinder.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATrack.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATrack.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackConvertor.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackConvertor.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackLinearisation.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackParam.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackParam.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATracker.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATracker.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackerComponent.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackerComponent.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATracklet.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATracklet.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackletConstructor.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackletConstructor.h
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackletSelector.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackletSelector.h
HLT/TPCLib/tracking-ca/AliHLTTPCCAUsedHitsInitialiser.cxx
HLT/TPCLib/tracking-ca/AliHLTTPCCAUsedHitsInitialiser.h
HLT/TPCLib/tracking-ca/AliTPCtrackerCA.cxx
HLT/TPCLib/tracking-ca/AliTPCtrackerCA.h

index b7f275eadbc542f30ae1c1f699f5db11a6f38686..99d37cd93579ebc21cd14c201f0de498628395b6 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLT3DTrackParam.h"
 #include "TMath.h"
 
-ClassImp(AliHLT3DTrackParam)
+ClassImp( AliHLT3DTrackParam )
 
 //* Transport utilities
-  
-Double_t AliHLT3DTrackParam::GetDStoPoint( Double_t Bz, const Double_t xyz[3], const Double_t *T0 ) const
+
+double AliHLT3DTrackParam::GetDStoPoint( double Bz, const double xyz[3], const double *T0 ) const
 {
   //* Get DS = Path/Momentum to a certain space point for Bz field
 
-  Double_t q = fSignQ;
-  if( !T0 ) T0 = fParam; 
+  double q = fSignQ;
+  if ( !T0 ) T0 = fParam;
   else q = T0[6];
 
-  const Double_t kCLight = 0.000299792458;
-  Double_t bq = Bz*q*kCLight;
-  Double_t pt2 = T0[3]*T0[3] + T0[4]*T0[4];
-  if( pt2<1.e-4 ) return 0;
-  Double_t dx = xyz[0] - T0[0];
-  Double_t dy = xyz[1] - T0[1]; 
-  Double_t a = dx*T0[3]+dy*T0[4];
-  Double_t dS = 0;
-  if( TMath::Abs(bq)<1.e-8 ) dS = a/pt2;
-  else dS = TMath::ATan2( bq*a, pt2 + bq*(dy*T0[3] -dx*T0[4]) )/bq;
+  const double kCLight = 0.000299792458;
+  double bq = Bz * q * kCLight;
+  double pt2 = T0[3] * T0[3] + T0[4] * T0[4];
+  if ( pt2 < 1.e-4 ) return 0;
+  double dx = xyz[0] - T0[0];
+  double dy = xyz[1] - T0[1];
+  double a = dx * T0[3] + dy * T0[4];
+  double dS = 0;
+  if ( TMath::Abs( bq ) < 1.e-8 ) dS = a / pt2;
+  else dS = TMath::ATan2( bq * a, pt2 + bq * ( dy * T0[3] - dx * T0[4] ) ) / bq;
   return dS;
 }
 
 
-void AliHLT3DTrackParam::TransportToDS( Double_t Bz, Double_t DS, Double_t *T0 )
+void AliHLT3DTrackParam::TransportToDS( double Bz, double DS, double *T0 )
 {
-  //* Transport the particle on DS = Path/Momentum, for Bz field 
+  //* Transport the particle on DS = Path/Momentum, for Bz field
 
-  Double_t tmp[7];
-  if( !T0 ){
+  double tmp[7];
+  if ( !T0 ) {
     T0 = tmp;
     T0[0] = fParam[0];
     T0[1] = fParam[1];
@@ -60,71 +60,73 @@ void AliHLT3DTrackParam::TransportToDS( Double_t Bz, Double_t DS, Double_t *T0 )
     T0[5] = fParam[5];
     T0[6] = fSignQ;
   }
-  const Double_t kCLight = 0.000299792458;
-  Bz = Bz*T0[6]*kCLight;
-  Double_t bs= Bz*DS;
-  Double_t s = TMath::Sin(bs), c = TMath::Cos(bs);
-  Double_t sB, cB;
-  if( TMath::Abs(bs)>1.e-10){
-    sB= s/Bz;
-    cB= (1-c)/Bz;
-  }else{
-    sB = (1. - bs*bs/6.)*DS;
-    cB = .5*sB*bs;
+  const double kCLight = 0.000299792458;
+  Bz = Bz * T0[6] * kCLight;
+  double bs = Bz * DS;
+  double s = TMath::Sin( bs ), c = TMath::Cos( bs );
+  double sB, cB;
+  if ( TMath::Abs( bs ) > 1.e-10 ) {
+    sB = s / Bz;
+    cB = ( 1 - c ) / Bz;
+  } else {
+    sB = ( 1. - bs * bs / 6. ) * DS;
+    cB = .5 * sB * bs;
   }
-    
-  Double_t px = T0[3];
-  Double_t py = T0[4];
-  Double_t pz = T0[5];
-  
-  Double_t d[6] = { fParam[0]-T0[0], fParam[1]-T0[1], fParam[2]-T0[2], 
-                   fParam[3]-T0[3], fParam[4]-T0[4], fParam[5]-T0[5]  };
-
-  T0[0] = T0[0] + sB*px + cB*py;
-  T0[1] = T0[1] - cB*px + sB*py;
-  T0[2] = T0[2] + DS*pz                       ;
-  T0[3] =          c*px + s*py;
-  T0[4] =         -s*px + c*py;
+
+  double px = T0[3];
+  double py = T0[4];
+  double pz = T0[5];
+
+  double d[6] = { fParam[0] - T0[0], fParam[1] - T0[1], fParam[2] - T0[2],
+                    fParam[3] - T0[3], fParam[4] - T0[4], fParam[5] - T0[5]
+                  };
+
+  T0[0] = T0[0] + sB * px + cB * py;
+  T0[1] = T0[1] - cB * px + sB * py;
+  T0[2] = T0[2] + DS * pz                       ;
+  T0[3] =          c * px + s * py;
+  T0[4] =         -s * px + c * py;
   T0[5] = T0[5];
-  Double_t mJ[6][6] = { {1,0,0,   sB, cB,  0, },
-                        {0,1,0,  -cB, sB,  0, },
-                        {0,0,1,    0,  0, DS, },
-                        {0,0,0,    c,  s,  0, },
-                        {0,0,0,   -s,  c,  0, },
-                        {0,0,0,    0,  0,  1, }   };
-
-  for( Int_t i=0; i<6; i++){
+
+  double mJ[6][6] = { {1, 0, 0,   sB, cB,  0, },
+    {0, 1, 0,  -cB, sB,  0, },
+    {0, 0, 1,    0,  0, DS, },
+    {0, 0, 0,    c,  s,  0, },
+    {0, 0, 0,   -s,  c,  0, },
+    {0, 0, 0,    0,  0,  1, }
+  };
+
+  for ( int i = 0; i < 6; i++ ) {
     fParam[i] = T0[i];
-    for( Int_t j=0; j<6; j++) fParam[i] += mJ[i][j]*d[j];
+    for ( int j = 0; j < 6; j++ ) fParam[i] += mJ[i][j] * d[j];
   }
 
-  Double_t mA[6][6];
-  for( Int_t k=0,i=0; i<6; i++)
-    for( Int_t j=0; j<=i; j++, k++ ) mA[i][j] = mA[j][i] = fCov[k]; 
+  double mA[6][6];
+  for ( int k = 0, i = 0; i < 6; i++ )
+    for ( int j = 0; j <= i; j++, k++ ) mA[i][j] = mA[j][i] = fCov[k];
 
-  Double_t mJC[6][6];
-  for( Int_t i=0; i<6; i++ )
-    for( Int_t j=0; j<6; j++ ){
-      mJC[i][j]=0;
-      for( Int_t k=0; k<6; k++ ) mJC[i][j]+=mJ[i][k]*mA[k][j];
+  double mJC[6][6];
+  for ( int i = 0; i < 6; i++ )
+    for ( int j = 0; j < 6; j++ ) {
+      mJC[i][j] = 0;
+      for ( int k = 0; k < 6; k++ ) mJC[i][j] += mJ[i][k] * mA[k][j];
     }
-  
-  for( Int_t k=0,i=0; i<6; i++)
-    for( Int_t j=0; j<=i; j++, k++ ){
+
+  for ( int k = 0, i = 0; i < 6; i++ )
+    for ( int j = 0; j <= i; j++, k++ ) {
       fCov[k] = 0;
-      for( Int_t l=0; l<6; l++ ) fCov[k]+=mJC[i][l]*mJ[j][l];
+      for ( int l = 0; l < 6; l++ ) fCov[k] += mJC[i][l] * mJ[j][l];
     }
 }
 
 
-//* Fit utilities 
+//* Fit utilities
 
 void AliHLT3DTrackParam::InitializeCovarianceMatrix()
 {
   //* Initialization of covariance matrix
 
-  for( Int_t i=0; i<21; i++ ) fCov[i] = 0;
+  for ( int i = 0; i < 21; i++ ) fCov[i] = 0;
   fSignQ = 0;
   fCov[0] = fCov[ 2] = fCov[ 5] = 100.;
   fCov[9] = fCov[14] = fCov[20] = 10000.;
@@ -132,249 +134,252 @@ void AliHLT3DTrackParam::InitializeCovarianceMatrix()
   fNDF = -5;
 }
 
-void AliHLT3DTrackParam::GetGlueMatrix( const Double_t xyz[3], 
-                                       Double_t G[6], const Double_t *T0  ) const 
+void AliHLT3DTrackParam::GetGlueMatrix( const double xyz[3],
+                                        double G[6], const double *T0  ) const
 {
   //* !
 
-  if( !T0 ) T0 = fParam;
-
-  Double_t dx = xyz[0]-T0[0], dy = xyz[1]-T0[1], dz = xyz[2]-T0[2];
-  Double_t px2= T0[3]*T0[3], py2= T0[4]*T0[4], pz2= T0[5]*T0[5];
-  Double_t s2 = (dx*dx + dy*dy + dz*dz);
-  Double_t p2 = px2 + py2 + pz2;
-  if( p2>1.e-4 ) s2/=p2;
-  Double_t x = T0[3]*s2;
-  Double_t xx= px2*s2, xy= x*T0[4], xz= x*T0[5], yy= py2*s2, yz= T0[4]*T0[5]*s2;
-  G[ 0]= xx;
-  G[ 1]= xy;   G[ 2]= yy;
-  G[ 3]= xz;   G[ 4]= yz;   G[ 5]= pz2*s2;  
+  if ( !T0 ) T0 = fParam;
+
+  double dx = xyz[0] - T0[0], dy = xyz[1] - T0[1], dz = xyz[2] - T0[2];
+  double px2 = T0[3] * T0[3], py2 = T0[4] * T0[4], pz2 = T0[5] * T0[5];
+  double s2 = ( dx * dx + dy * dy + dz * dz );
+  double p2 = px2 + py2 + pz2;
+  if ( p2 > 1.e-4 ) s2 /= p2;
+  double x = T0[3] * s2;
+  double xx = px2 * s2, xy = x * T0[4], xz = x * T0[5], yy = py2 * s2, yz = T0[4] * T0[5] * s2;
+  G[ 0] = xx;
+  G[ 1] = xy;   G[ 2] = yy;
+  G[ 3] = xz;   G[ 4] = yz;   G[ 5] = pz2 * s2;
 }
 
 
 
-void AliHLT3DTrackParam::Filter( const Double_t m[3], const Double_t V[6], const Double_t G[6] )
-{ 
+void AliHLT3DTrackParam::Filter( const double m[3], const double V[6], const double G[6] )
+{
   //* !
-  
-  Double_t 
-    c00 = fCov[ 0],
-    c10 = fCov[ 1], c11 = fCov[ 2],
-    c20 = fCov[ 3], c21 = fCov[ 4], c22 = fCov[ 5],
-    c30 = fCov[ 6], c31 = fCov[ 7], c32 = fCov[ 8],
-    c40 = fCov[10], c41 = fCov[11], c42 = fCov[12],
-    c50 = fCov[15], c51 = fCov[16], c52 = fCov[17];
-  
+
   double
-    z0 = m[0]-fParam[0],
-    z1 = m[1]-fParam[1],
-    z2 = m[2]-fParam[2];
-  
-  Double_t mS[6] = { c00+V[0]+G[0], c10+V[1]+G[1], c11+V[2]+G[2],
-                    c20+V[3]+G[3], c21+V[4]+G[4], c22+V[5]+G[5] };
-  Double_t mSi[6];
-  mSi[0] = mS[4]*mS[4] - mS[2]*mS[5];
-  mSi[1] = mS[1]*mS[5] - mS[3]*mS[4];
-  mSi[3] = mS[2]*mS[3] - mS[1]*mS[4];
-  Double_t det = 1./(mS[0]*mSi[0] + mS[1]*mSi[1] + mS[3]*mSi[3]);
+  c00 = fCov[ 0],
+        c10 = fCov[ 1], c11 = fCov[ 2],
+                              c20 = fCov[ 3], c21 = fCov[ 4], c22 = fCov[ 5],
+                                                                    c30 = fCov[ 6], c31 = fCov[ 7], c32 = fCov[ 8],
+                                                                                                          c40 = fCov[10], c41 = fCov[11], c42 = fCov[12],
+                                                                                                                                                c50 = fCov[15], c51 = fCov[16], c52 = fCov[17];
+
+  double
+  z0 = m[0] - fParam[0],
+       z1 = m[1] - fParam[1],
+            z2 = m[2] - fParam[2];
+
+  double mS[6] = { c00 + V[0] + G[0], c10 + V[1] + G[1], c11 + V[2] + G[2],
+                     c20 + V[3] + G[3], c21 + V[4] + G[4], c22 + V[5] + G[5]
+                   };
+  double mSi[6];
+  mSi[0] = mS[4] * mS[4] - mS[2] * mS[5];
+  mSi[1] = mS[1] * mS[5] - mS[3] * mS[4];
+  mSi[3] = mS[2] * mS[3] - mS[1] * mS[4];
+  double det = 1. / ( mS[0] * mSi[0] + mS[1] * mSi[1] + mS[3] * mSi[3] );
   mSi[0] *= det;
   mSi[1] *= det;
   mSi[3] *= det;
-  mSi[2] = ( mS[3]*mS[3] - mS[0]*mS[5] )*det;
-  mSi[4] = ( mS[0]*mS[4] - mS[1]*mS[3] )*det;
-  mSi[5] = ( mS[1]*mS[1] - mS[0]*mS[2] )*det;
-  
+  mSi[2] = ( mS[3] * mS[3] - mS[0] * mS[5] ) * det;
+  mSi[4] = ( mS[0] * mS[4] - mS[1] * mS[3] ) * det;
+  mSi[5] = ( mS[1] * mS[1] - mS[0] * mS[2] ) * det;
+
   fNDF  += 2;
-  fChi2 += ( +(mSi[0]*z0 + mSi[1]*z1 + mSi[3]*z2)*z0
-            +(mSi[1]*z0 + mSi[2]*z1 + mSi[4]*z2)*z1
-            +(mSi[3]*z0 + mSi[4]*z1 + mSi[5]*z2)*z2 );
-        
-  Double_t k0, k1, k2 ; // k = CHtS
-    
-  k0 = c00*mSi[0] + c10*mSi[1] + c20*mSi[3];
-  k1 = c00*mSi[1] + c10*mSi[2] + c20*mSi[4];
-  k2 = c00*mSi[3] + c10*mSi[4] + c20*mSi[5];
-    
-  fParam[ 0]+= k0*z0  + k1*z1  + k2*z2 ;
-  fCov  [ 0]-= k0*c00 + k1*c10 + k2*c20;
-  
-  k0 = c10*mSi[0] + c11*mSi[1] + c21*mSi[3];
-  k1 = c10*mSi[1] + c11*mSi[2] + c21*mSi[4];
-  k2 = c10*mSi[3] + c11*mSi[4] + c21*mSi[5];
-  
-  fParam[ 1]+= k0*z0  + k1*z1  + k2*z2 ;
-  fCov  [ 1]-= k0*c00 + k1*c10 + k2*c20;
-  fCov  [ 2]-= k0*c10 + k1*c11 + k2*c21;
-  
-  k0 = c20*mSi[0] + c21*mSi[1] + c22*mSi[3];
-  k1 = c20*mSi[1] + c21*mSi[2] + c22*mSi[4];
-  k2 = c20*mSi[3] + c21*mSi[4] + c22*mSi[5];
-  
-  fParam[ 2]+= k0*z0  + k1*z1  + k2*z2 ;
-  fCov  [ 3]-= k0*c00 + k1*c10 + k2*c20;
-  fCov  [ 4]-= k0*c10 + k1*c11 + k2*c21;
-  fCov  [ 5]-= k0*c20 + k1*c21 + k2*c22;
-  
-  k0 = c30*mSi[0] + c31*mSi[1] + c32*mSi[3];
-  k1 = c30*mSi[1] + c31*mSi[2] + c32*mSi[4];
-  k2 = c30*mSi[3] + c31*mSi[4] + c32*mSi[5];
-  
-  fParam[ 3]+= k0*z0  + k1*z1  + k2*z2 ;
-  fCov  [ 6]-= k0*c00 + k1*c10 + k2*c20;
-  fCov  [ 7]-= k0*c10 + k1*c11 + k2*c21;
-  fCov  [ 8]-= k0*c20 + k1*c21 + k2*c22;
-  fCov  [ 9]-= k0*c30 + k1*c31 + k2*c32;
-  
-  k0 = c40*mSi[0] + c41*mSi[1] + c42*mSi[3];
-  k1 = c40*mSi[1] + c41*mSi[2] + c42*mSi[4];
-  k2 = c40*mSi[3] + c41*mSi[4] + c42*mSi[5];
-    
-  fParam[ 4]+= k0*z0  + k1*z1  + k2*z2 ;
-  fCov  [10]-= k0*c00 + k1*c10 + k2*c20;
-  fCov  [11]-= k0*c10 + k1*c11 + k2*c21;
-  fCov  [12]-= k0*c20 + k1*c21 + k2*c22;
-  fCov  [13]-= k0*c30 + k1*c31 + k2*c32;
-  fCov  [14]-= k0*c40 + k1*c41 + k2*c42;
-
-  k0 = c50*mSi[0] + c51*mSi[1] + c52*mSi[3];
-  k1 = c50*mSi[1] + c51*mSi[2] + c52*mSi[4];
-  k2 = c50*mSi[3] + c51*mSi[4] + c52*mSi[5];
-  
-  fParam[ 5]+= k0*z0  + k1*z1  + k2*z2 ;
-  fCov  [15]-= k0*c00 + k1*c10 + k2*c20;
-  fCov  [16]-= k0*c10 + k1*c11 + k2*c21;
-  fCov  [17]-= k0*c20 + k1*c21 + k2*c22;
-  fCov  [18]-= k0*c30 + k1*c31 + k2*c32;
-  fCov  [19]-= k0*c40 + k1*c41 + k2*c42;
-  fCov  [20]-= k0*c50 + k1*c51 + k2*c52;
+  fChi2 += ( +( mSi[0] * z0 + mSi[1] * z1 + mSi[3] * z2 ) * z0
+             + ( mSi[1] * z0 + mSi[2] * z1 + mSi[4] * z2 ) * z1
+             + ( mSi[3] * z0 + mSi[4] * z1 + mSi[5] * z2 ) * z2 );
+
+  double k0, k1, k2 ; // k = CHtS
+
+  k0 = c00 * mSi[0] + c10 * mSi[1] + c20 * mSi[3];
+  k1 = c00 * mSi[1] + c10 * mSi[2] + c20 * mSi[4];
+  k2 = c00 * mSi[3] + c10 * mSi[4] + c20 * mSi[5];
+
+  fParam[ 0] += k0 * z0  + k1 * z1  + k2 * z2 ;
+  fCov  [ 0] -= k0 * c00 + k1 * c10 + k2 * c20;
+
+  k0 = c10 * mSi[0] + c11 * mSi[1] + c21 * mSi[3];
+  k1 = c10 * mSi[1] + c11 * mSi[2] + c21 * mSi[4];
+  k2 = c10 * mSi[3] + c11 * mSi[4] + c21 * mSi[5];
+
+  fParam[ 1] += k0 * z0  + k1 * z1  + k2 * z2 ;
+  fCov  [ 1] -= k0 * c00 + k1 * c10 + k2 * c20;
+  fCov  [ 2] -= k0 * c10 + k1 * c11 + k2 * c21;
+
+  k0 = c20 * mSi[0] + c21 * mSi[1] + c22 * mSi[3];
+  k1 = c20 * mSi[1] + c21 * mSi[2] + c22 * mSi[4];
+  k2 = c20 * mSi[3] + c21 * mSi[4] + c22 * mSi[5];
+
+  fParam[ 2] += k0 * z0  + k1 * z1  + k2 * z2 ;
+  fCov  [ 3] -= k0 * c00 + k1 * c10 + k2 * c20;
+  fCov  [ 4] -= k0 * c10 + k1 * c11 + k2 * c21;
+  fCov  [ 5] -= k0 * c20 + k1 * c21 + k2 * c22;
+
+  k0 = c30 * mSi[0] + c31 * mSi[1] + c32 * mSi[3];
+  k1 = c30 * mSi[1] + c31 * mSi[2] + c32 * mSi[4];
+  k2 = c30 * mSi[3] + c31 * mSi[4] + c32 * mSi[5];
+
+  fParam[ 3] += k0 * z0  + k1 * z1  + k2 * z2 ;
+  fCov  [ 6] -= k0 * c00 + k1 * c10 + k2 * c20;
+  fCov  [ 7] -= k0 * c10 + k1 * c11 + k2 * c21;
+  fCov  [ 8] -= k0 * c20 + k1 * c21 + k2 * c22;
+  fCov  [ 9] -= k0 * c30 + k1 * c31 + k2 * c32;
+
+  k0 = c40 * mSi[0] + c41 * mSi[1] + c42 * mSi[3];
+  k1 = c40 * mSi[1] + c41 * mSi[2] + c42 * mSi[4];
+  k2 = c40 * mSi[3] + c41 * mSi[4] + c42 * mSi[5];
+
+  fParam[ 4] += k0 * z0  + k1 * z1  + k2 * z2 ;
+  fCov  [10] -= k0 * c00 + k1 * c10 + k2 * c20;
+  fCov  [11] -= k0 * c10 + k1 * c11 + k2 * c21;
+  fCov  [12] -= k0 * c20 + k1 * c21 + k2 * c22;
+  fCov  [13] -= k0 * c30 + k1 * c31 + k2 * c32;
+  fCov  [14] -= k0 * c40 + k1 * c41 + k2 * c42;
+
+  k0 = c50 * mSi[0] + c51 * mSi[1] + c52 * mSi[3];
+  k1 = c50 * mSi[1] + c51 * mSi[2] + c52 * mSi[4];
+  k2 = c50 * mSi[3] + c51 * mSi[4] + c52 * mSi[5];
+
+  fParam[ 5] += k0 * z0  + k1 * z1  + k2 * z2 ;
+  fCov  [15] -= k0 * c00 + k1 * c10 + k2 * c20;
+  fCov  [16] -= k0 * c10 + k1 * c11 + k2 * c21;
+  fCov  [17] -= k0 * c20 + k1 * c21 + k2 * c22;
+  fCov  [18] -= k0 * c30 + k1 * c31 + k2 * c32;
+  fCov  [19] -= k0 * c40 + k1 * c41 + k2 * c42;
+  fCov  [20] -= k0 * c50 + k1 * c51 + k2 * c52;
 
   // fit charge
 
-  Double_t px = fParam[3];
-  Double_t py = fParam[4];
-  Double_t pz = fParam[5];
-  
-  Double_t p = TMath::Sqrt( px*px + py*py + pz*pz );
-  Double_t pi = 1./p;
-  Double_t qp = fSignQ*pi;
-  Double_t qp3 = qp*pi*pi;
-  Double_t 
-    c60 = qp3*(c30+c40+c50),
-    c61 = qp3*(c31+c41+c51),
-    c62 = qp3*(c32+c42+c52);
-
-  k0 = c60*mSi[0] + c61*mSi[1] + c62*mSi[3];
-  k1 = c60*mSi[1] + c61*mSi[2] + c62*mSi[4];
-  k2 = c60*mSi[3] + c61*mSi[4] + c62*mSi[5];
-  
-  qp+= k0*z0  + k1*z1  + k2*z2 ;
-  if( qp>0 ) fSignQ = 1;
-  else if(qp<0 ) fSignQ = -1;
+  double px = fParam[3];
+  double py = fParam[4];
+  double pz = fParam[5];
+
+  double p = TMath::Sqrt( px * px + py * py + pz * pz );
+  double pi = 1. / p;
+  double qp = fSignQ * pi;
+  double qp3 = qp * pi * pi;
+  double
+  c60 = qp3 * ( c30 + c40 + c50 ),
+        c61 = qp3 * ( c31 + c41 + c51 ),
+              c62 = qp3 * ( c32 + c42 + c52 );
+
+  k0 = c60 * mSi[0] + c61 * mSi[1] + c62 * mSi[3];
+  k1 = c60 * mSi[1] + c61 * mSi[2] + c62 * mSi[4];
+  k2 = c60 * mSi[3] + c61 * mSi[4] + c62 * mSi[5];
+
+  qp += k0 * z0  + k1 * z1  + k2 * z2 ;
+  if ( qp > 0 ) fSignQ = 1;
+  else if ( qp < 0 ) fSignQ = -1;
   else fSignQ = 0;
 }
 
 
 //* Other utilities
 
-void AliHLT3DTrackParam::SetDirection( Double_t Direction[3] )
+void AliHLT3DTrackParam::SetDirection( double Direction[3] )
 {
-  //* Change track direction 
+  //* Change track direction
 
-  if( fParam[3]*Direction[0] + fParam[4]*Direction[1] + fParam[5]*Direction[2] >= 0 ) return;
+  if ( fParam[3]*Direction[0] + fParam[4]*Direction[1] + fParam[5]*Direction[2] >= 0 ) return;
 
   fParam[3] = -fParam[3];
   fParam[4] = -fParam[4];
   fParam[5] = -fParam[5];
   fSignQ    = -fSignQ;
 
-  fCov[ 6]=-fCov[ 6]; fCov[ 7]=-fCov[ 7]; fCov[ 8]=-fCov[ 8];
-  fCov[10]=-fCov[10]; fCov[11]=-fCov[11]; fCov[12]=-fCov[12];
-  fCov[15]=-fCov[15]; fCov[16]=-fCov[16]; fCov[17]=-fCov[17];
+  fCov[ 6] = -fCov[ 6]; fCov[ 7] = -fCov[ 7]; fCov[ 8] = -fCov[ 8];
+  fCov[10] = -fCov[10]; fCov[11] = -fCov[11]; fCov[12] = -fCov[12];
+  fCov[15] = -fCov[15]; fCov[16] = -fCov[16]; fCov[17] = -fCov[17];
 }
 
 
-void AliHLT3DTrackParam::RotateCoordinateSystem( Double_t alpha )
+void AliHLT3DTrackParam::RotateCoordinateSystem( double alpha )
 {
   //* !
 
-  Double_t cA = TMath::Cos( alpha );
-  Double_t sA = TMath::Sin( alpha );
-  Double_t x= fParam[0], y= fParam[1], px= fParam[3], py= fParam[4];
-  fParam[0] = x*cA + y*sA;
-  fParam[1] =-x*sA + y*cA;
+  double cA = TMath::Cos( alpha );
+  double sA = TMath::Sin( alpha );
+  double x = fParam[0], y = fParam[1], px = fParam[3], py = fParam[4];
+  fParam[0] = x * cA + y * sA;
+  fParam[1] = -x * sA + y * cA;
   fParam[2] = fParam[2];
-  fParam[3] = px*cA + py*sA;
-  fParam[4] =-px*sA + py*cA;
-  fParam[5] = fParam[5];  
-
-  Double_t mJ[6][6] = { { cA,sA, 0,  0,  0,  0 },
-                        {-sA,cA, 0,  0,  0,  0 },
-                        {  0, 0, 1,  0,  0,  0 },
-                        {  0, 0, 0, cA, sA,  0 },
-                        {  0, 0, 0,-sA, cA,  0 },
-                        {  0, 0, 0,  0,  0,  1 }  };
-                  
-  Double_t mA[6][6];
-  for( Int_t k=0,i=0; i<6; i++)
-    for( Int_t j=0; j<=i; j++, k++ ) mA[i][j] = mA[j][i] = fCov[k]; 
-
-  Double_t mJC[6][6];
-  for( Int_t i=0; i<6; i++ )
-    for( Int_t j=0; j<6; j++ ){
-      mJC[i][j]=0;
-      for( Int_t k=0; k<6; k++ ) mJC[i][j]+=mJ[i][k]*mA[k][j];
+  fParam[3] = px * cA + py * sA;
+  fParam[4] = -px * sA + py * cA;
+  fParam[5] = fParam[5];
+
+  double mJ[6][6] = { { cA, sA, 0,  0,  0,  0 },
+    { -sA, cA, 0,  0,  0,  0 },
+    {  0, 0, 1,  0,  0,  0 },
+    {  0, 0, 0, cA, sA,  0 },
+    {  0, 0, 0, -sA, cA,  0 },
+    {  0, 0, 0,  0,  0,  1 }
+  };
+
+  double mA[6][6];
+  for ( int k = 0, i = 0; i < 6; i++ )
+    for ( int j = 0; j <= i; j++, k++ ) mA[i][j] = mA[j][i] = fCov[k];
+
+  double mJC[6][6];
+  for ( int i = 0; i < 6; i++ )
+    for ( int j = 0; j < 6; j++ ) {
+      mJC[i][j] = 0;
+      for ( int k = 0; k < 6; k++ ) mJC[i][j] += mJ[i][k] * mA[k][j];
     }
-  
-  for( Int_t k=0,i=0; i<6; i++)
-    for( Int_t j=0; j<=i; j++, k++ ){
+
+  for ( int k = 0, i = 0; i < 6; i++ )
+    for ( int j = 0; j <= i; j++, k++ ) {
       fCov[k] = 0;
-      for( Int_t l=0; l<6; l++ ) fCov[k]+=mJC[i][l]*mJ[j][l];
+      for ( int l = 0; l < 6; l++ ) fCov[k] += mJC[i][l] * mJ[j][l];
     }
 }
 
 
-void AliHLT3DTrackParam::Get5Parameters( Double_t alpha, Double_t T[6], Double_t C[15] ) const
+void AliHLT3DTrackParam::Get5Parameters( double alpha, double T[6], double C[15] ) const
 {
   //* !
 
   AliHLT3DTrackParam t = *this;
-  t.RotateCoordinateSystem(alpha);
-  Double_t 
-    x= t.fParam[0], y= t.fParam[1], z = t.fParam[2], 
-    px= t.fParam[3], py= t.fParam[4], pz = t.fParam[5], q = t.fSignQ;
+  t.RotateCoordinateSystem( alpha );
+  double
+  x = t.fParam[0], y = t.fParam[1], z = t.fParam[2],
+                                        px = t.fParam[3], py = t.fParam[4], pz = t.fParam[5], q = t.fSignQ;
 
-  Double_t p2 = px*px+py*py+pz*pz;
-  if( p2<1.e-8 ) p2 = 1;
-  Double_t n2 = 1./p2;
-  Double_t n = sqrt(n2);
+  double p2 = px * px + py * py + pz * pz;
+  if ( p2 < 1.e-8 ) p2 = 1;
+  double n2 = 1. / p2;
+  double n = sqrt( n2 );
 
   T[5] = x;
   T[0] = y;
   T[1] = z;
-  T[2] = py/px;
-  T[3] = pz/px;
-  T[4] = q*n;
-
-  Double_t mJ[5][6] = { { -T[2], 1, 0,  0,  0,  0 },
-                        { -T[3], 0, 1,  0,  0,  0 },
-                        { 0, 0, 0,  -T[2]/px,  1./px,  0 },
-                        { 0, 0, 0, -T[3]/px,  0,  1./px },
-                        { 0, 0, 0, -T[4]*n2*px, -T[4]*n2*py, -T[4]*n2*pz} };
-
-  Double_t mA[6][6];
-  for( Int_t k=0,i=0; i<6; i++)
-    for( Int_t j=0; j<=i; j++, k++ ) mA[i][j] = mA[j][i] = t.fCov[k]; 
-
-  Double_t mJC[5][6];
-  for( Int_t i=0; i<5; i++ )
-    for( Int_t j=0; j<6; j++ ){
-      mJC[i][j]=0;
-      for( Int_t k=0; k<6; k++ ) mJC[i][j]+=mJ[i][k]*mA[k][j];
+  T[2] = py / px;
+  T[3] = pz / px;
+  T[4] = q * n;
+
+  double mJ[5][6] = { { -T[2], 1, 0,  0,  0,  0 },
+    { -T[3], 0, 1,  0,  0,  0 },
+    { 0, 0, 0,  -T[2] / px,  1. / px,  0 },
+    { 0, 0, 0, -T[3] / px,  0,  1. / px },
+    { 0, 0, 0, -T[4]*n2*px, -T[4]*n2*py, -T[4]*n2*pz}
+  };
+
+  double mA[6][6];
+  for ( int k = 0, i = 0; i < 6; i++ )
+    for ( int j = 0; j <= i; j++, k++ ) mA[i][j] = mA[j][i] = t.fCov[k];
+
+  double mJC[5][6];
+  for ( int i = 0; i < 5; i++ )
+    for ( int j = 0; j < 6; j++ ) {
+      mJC[i][j] = 0;
+      for ( int k = 0; k < 6; k++ ) mJC[i][j] += mJ[i][k] * mA[k][j];
     }
-  
-  for( Int_t k=0,i=0; i<5; i++)
-    for( Int_t j=0; j<=i; j++, k++ ){
+
+  for ( int k = 0, i = 0; i < 5; i++ )
+    for ( int j = 0; j <= i; j++, k++ ) {
       C[k] = 0;
-      for( Int_t l=0; l<6; l++ ) C[k]+=mJC[i][l]*mJ[j][l];
+      for ( int l = 0; l < 6; l++ ) C[k] += mJC[i][l] * mJ[j][l];
     }
 }
index b23a66aed48bdba3ceb33b5850907e59022a31f8..a800dc085ed4569e499819c2ca0b7e7dcbe73fa4 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ***************************************************************************
-// This file is property of and copyright by the ALICE HLT Project           * 
+// This file is property of and copyright by the ALICE HLT Project           *
 // ALICE Experiment at CERN, All rights reserved.                            *
 // See cxx source for full Copyright notice                                  *
 //                                                                           *
 /**
  * @class AliHLT3DTrackParam
  */
-class AliHLT3DTrackParam :public TObject
+class AliHLT3DTrackParam : public TObject
 {
- public:
-
-  //*
-  //*  INITIALIZATION
-  //*
-
-  //* Constructor 
-
-  AliHLT3DTrackParam(): fChi2(0),fNDF(0),fSignQ(0){} 
-
-  //* Destructor (empty)
-
-  virtual ~AliHLT3DTrackParam(){}
-
-  //*
-  //*  ACCESSORS
-  //*
-
-
-  //* Simple accessors 
-
-  Double_t GetX()      const { return fParam[0]; }
-  Double_t GetY()      const { return fParam[1]; }
-  Double_t GetZ()      const { return fParam[2]; }
-  Double_t GetPx()     const { return fParam[3]; }
-  Double_t GetPy()     const { return fParam[4]; }
-  Double_t GetPz()     const { return fParam[5]; }
-  Double_t GetChi2()   const { return fChi2;  }
-  Int_t    GetNDF()    const { return fNDF;   }
-  Int_t    GetCharge() const { return fSignQ; }
-  
-  Double_t GetParameter ( Int_t i ) const { return fParam[i]; }
-  Double_t GetCovariance( Int_t i ) const { return fCov[i]; }
-  Double_t GetCovariance( Int_t i, Int_t j ) const { return fCov[( j<=i ) ? i*(i+1)/2+j :j*(j+1)/2+i]; }
-
-  //*
-  //* Accessors
-  //*
-  
-  const Double_t *Param()  const { return fParam; }
-  const Double_t *Cov() const   { return fCov;   }
-  Double_t X()      const  { return fParam[0]; }
-  Double_t Y()      const  { return fParam[1]; }
-  Double_t Z()      const  { return fParam[2]; }
-  Double_t Px()     const  { return fParam[3]; }
-  Double_t Py()     const  { return fParam[4]; }
-  Double_t Pz()     const  { return fParam[5]; }
-  Double_t Chi2()   const  { return fChi2;  }
-  Int_t    NDF()    const  { return fNDF;   }
-  Int_t    Charge()  const { return fSignQ; }
-
-  //* Accessors with calculations( &value, &estimated sigma )
-  //* error flag returned (0 means no error during calculations) 
-
-
-  //*
-  //*  MODIFIERS
-  //*
-  
-  void SetParam( Int_t i, Double_t v )  { fParam[i] = v; }
-  void SetCov( Int_t i, Double_t v ){ fCov[i] = v;   }
-  void SetX( Double_t v )      { fParam[0] = v; }
-  void SetY( Double_t v )      { fParam[1] = v; }
-  void SetZ( Double_t v )      { fParam[2] = v; }
-  void SetPx( Double_t v )     { fParam[3] = v; }
-  void SetPy( Double_t v )     { fParam[4] = v; }
-  void SetPz( Double_t v )     { fParam[5] = v; }
-  void SetChi2( Double_t v )   { fChi2 = v;  }
-  void SetNDF( Int_t v )       { fNDF = v;   }
-  void SetCharge( Int_t v )    { fSignQ = v; }
-  
-
-  //*
-  //*  UTILITIES
-  //*
-  
-  //* Transport utilities
-  
-  Double_t GetDStoPoint( Double_t Bz, const Double_t xyz[3], const Double_t *T0=0 ) const;
-
-  void TransportToDS( Double_t Bz, Double_t DS, Double_t *T0=0 );
-
-  void TransportToPoint( Double_t Bz, const Double_t xyz[3], Double_t *T0=0 )
-    { 
-      TransportToDS( Bz,GetDStoPoint(Bz, xyz, T0), T0 ) ; 
+  public:
+
+    //*
+    //*  INITIALIZATION
+    //*
+
+    //* Constructor
+
+    AliHLT3DTrackParam(): fChi2( 0 ), fNDF( 0 ), fSignQ( 0 ) {}
+
+    //* Destructor (empty)
+
+    virtual ~AliHLT3DTrackParam() {}
+
+    //*
+    //*  ACCESSORS
+    //*
+
+
+    //* Simple accessors
+
+    double GetX()      const { return fParam[0]; }
+    double GetY()      const { return fParam[1]; }
+    double GetZ()      const { return fParam[2]; }
+    double GetPx()     const { return fParam[3]; }
+    double GetPy()     const { return fParam[4]; }
+    double GetPz()     const { return fParam[5]; }
+    double GetChi2()   const { return fChi2;  }
+    int    GetNDF()    const { return fNDF;   }
+    int    GetCharge() const { return fSignQ; }
+
+    double GetParameter ( int i ) const { return fParam[i]; }
+    double GetCovariance( int i ) const { return fCov[i]; }
+    double GetCovariance( int i, int j ) const { return fCov[( j<=i ) ? i*( i+1 )/2+j :j*( j+1 )/2+i]; }
+
+    //*
+    //* Accessors
+    //*
+
+    const double *Param()  const { return fParam; }
+    const double *Cov() const   { return fCov;   }
+    double X()      const  { return fParam[0]; }
+    double Y()      const  { return fParam[1]; }
+    double Z()      const  { return fParam[2]; }
+    double Px()     const  { return fParam[3]; }
+    double Py()     const  { return fParam[4]; }
+    double Pz()     const  { return fParam[5]; }
+    double Chi2()   const  { return fChi2;  }
+    int    NDF()    const  { return fNDF;   }
+    int    Charge()  const { return fSignQ; }
+
+    //* Accessors with calculations( &value, &estimated sigma )
+    //* error flag returned (0 means no error during calculations)
+
+
+    //*
+    //*  MODIFIERS
+    //*
+
+    void SetParam( int i, double v )  { fParam[i] = v; }
+    void SetCov( int i, double v ) { fCov[i] = v;   }
+    void SetX( double v )      { fParam[0] = v; }
+    void SetY( double v )      { fParam[1] = v; }
+    void SetZ( double v )      { fParam[2] = v; }
+    void SetPx( double v )     { fParam[3] = v; }
+    void SetPy( double v )     { fParam[4] = v; }
+    void SetPz( double v )     { fParam[5] = v; }
+    void SetChi2( double v )   { fChi2 = v;  }
+    void SetNDF( int v )       { fNDF = v;   }
+    void SetCharge( int v )    { fSignQ = v; }
+
+
+    //*
+    //*  UTILITIES
+    //*
+
+    //* Transport utilities
+
+    double GetDStoPoint( double Bz, const double xyz[3], const double *T0 = 0 ) const;
+
+    void TransportToDS( double Bz, double DS, double *T0 = 0 );
+
+    void TransportToPoint( double Bz, const double xyz[3], double *T0 = 0 ) {
+      TransportToDS( Bz, GetDStoPoint( Bz, xyz, T0 ), T0 ) ;
     }
 
-  void TransportToPoint( Double_t Bz, Double_t x, Double_t y, Double_t z, const Double_t *T0=0 )
-    { 
-      Double_t xyz[3] = {x,y,z};
+    void TransportToPoint( double Bz, double x, double y, double z, const double *T0 = 0 ) {
+      double xyz[3] = {x, y, z};
       TransportToPoint( Bz, xyz, T0 );
     }
 
-  //* Fit utilities 
+    //* Fit utilities
 
-  void InitializeCovarianceMatrix();
+    void InitializeCovarianceMatrix();
 
-  void GetGlueMatrix( const Double_t p[3], Double_t G[6], const Double_t *T0=0  ) const ;
+    void GetGlueMatrix( const double p[3], double G[6], const double *T0 = 0  ) const ;
 
-  void Filter( const Double_t m[3], const Double_t V[6], const Double_t G[6] );
+    void Filter( const double m[3], const double V[6], const double G[6] );
 
-  //* Other utilities
+    //* Other utilities
 
-  void SetDirection( Double_t Direction[3] );
+    void SetDirection( double Direction[3] );
 
-  void RotateCoordinateSystem( Double_t alpha );
+    void RotateCoordinateSystem( double alpha );
 
-  void Get5Parameters( Double_t alpha, Double_t T[6], Double_t C[15] ) const;
+    void Get5Parameters( double alpha, double T[6], double C[15] ) const;
 
- protected:
 protected:
 
-  Double_t fParam[6]; // Parameters ( x, y, z, px, py, pz ): 3-position and 3-momentum
-  Double_t fCov[21];  // Covariance matrix
-  Double_t fChi2;     // Chi^2
-  Int_t    fNDF;      // Number of Degrees of Freedom
-  Int_t    fSignQ;    // Charge
+    double fParam[6]; // Parameters ( x, y, z, px, py, pz ): 3-position and 3-momentum
+    double fCov[21];  // Covariance matrix
+    double fChi2;     // Chi^2
+    int    fNDF;      // Number of Degrees of Freedom
+    int    fSignQ;    // Charge
 
-  ClassDef(AliHLT3DTrackParam, 1);
+    ClassDef( AliHLT3DTrackParam, 1 );
 
 };
 
index 05bc9bd934e2b9c0d95b58c03008c17de46fe650..ed892d90365fe34ab86fcd777ea68f6361e52aae 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCADataCompressor
 {
-public:
-  
-  GPUhd() static UInt_t IRowIClu2IDrc( UInt_t iRow, UInt_t iCluster ){ 
-    return (iCluster<<8)+iRow; 
-  }
+  public:
 
-  GPUhd() static UInt_t IDrc2IRow( UInt_t IDrc ){ return ( IDrc%256 ); }  
-  GPUhd() static UInt_t IDrc2IClu( UInt_t IDrc ){ return ( IDrc>>8  ); }  
+    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 UInt_t ISliceIRowIClu2IDsrc( UInt_t iSlice, UInt_t iRow, UInt_t iCluster ){ 
-    return (iCluster<<14) + (iRow<<6) + iSlice; 
-  }
 
-  GPUhd() static UInt_t IDsrc2ISlice( UInt_t IDsrc ){  return (  IDsrc%64      ); }
-  GPUhd() static UInt_t IDsrc2IRow  ( UInt_t IDsrc ){  return ( (IDsrc>>6)%256 ); }  
-  GPUhd() static UInt_t IDsrc2IClu  ( UInt_t IDsrc ){  return (  IDsrc>>14     ); }  
+    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 );
 
-  GPUhd() static UShort_t YZ2UShort( Float_t Y, Float_t Z );
-  GPUhd() static Float_t  UShort2Y ( UShort_t iYZ );
-  GPUhd() static Float_t  UShort2Z ( UShort_t iYZ );
-  
 };
 
 
 // Inline methods
 
 
-GPUhd() inline UShort_t AliHLTTPCCADataCompressor::YZ2UShort( Float_t Y, Float_t Z )
-{ 
+GPUhd() inline unsigned short AliHLTTPCCADataCompressor::YZ2UShort( float Y, float Z )
+{
   // compress Y and Z coordinates in range [-3., 3.] to 16 bits
 
-  const Float_t kMult = 255./6.;
-  Y = (Y+3.)*kMult;
-  Z = (Z+3.)*kMult;
-  if( Y<0. ) Y = 0.;
-  else if( Y>255. ) Y = 255.;
-  if( Z<0. ) Z = 0.;
-  else if( Z>255. ) Z = 255.;
-  return static_cast<UShort_t>( ( static_cast<UInt_t>( Y )<<8) + static_cast<UInt_t>( Z ) );
-}  
-
-GPUhd() inline Float_t AliHLTTPCCADataCompressor::UShort2Y( UShort_t iYZ )
-{ 
+  const float kMult = 255. / 6.;
+  Y = ( Y + 3. ) * kMult;
+  Z = ( Z + 3. ) * kMult;
+  if ( Y < 0. ) Y = 0.;
+  else if ( Y > 255. ) Y = 255.;
+  if ( Z < 0. ) Z = 0.;
+  else if ( Z > 255. ) Z = 255.;
+  return static_cast<unsigned short>( ( static_cast<unsigned int>( Y ) << 8 ) + static_cast<unsigned int>( Z ) );
+}
+
+GPUhd() inline float AliHLTTPCCADataCompressor::UShort2Y( unsigned short iYZ )
+{
   // extract Y coordinate from the compressed 16bits format to [-3.,3.]
 
-  const Float_t kMult = 6./255.; 
-  return (iYZ >> 8)*kMult - 3.;
-}  
+  const float kMult = 6. / 255.;
+  return ( iYZ >> 8 )*kMult - 3.;
+}
 
-GPUhd() inline Float_t AliHLTTPCCADataCompressor::UShort2Z( UShort_t iYZ )
-{ 
+GPUhd() inline float AliHLTTPCCADataCompressor::UShort2Z( unsigned short iYZ )
+{
   // extract Z coordinate from the compressed 16bits format to [-3.,3.]
 
-  const Float_t kMult = 6./255.; 
-  return (iYZ % 256)*kMult - 3.;
+  const float kMult = 6. / 255.;
+  return ( iYZ % 256 )*kMult - 3.;
 }
 
 #endif
index 7c2fab3604de7d7d74ec1d9c46345d2c3c674066..20fe866e68141825ff7550d75af19d6c73b6114d 100644 (file)
@@ -1,18 +1,18 @@
 //-*- Mode: C++ -*-
 
-//* This file is property of and copyright by the ALICE HLT Project        * 
+//* This file is property of and copyright by the ALICE HLT Project        *
 //* ALICE Experiment at CERN, All rights reserved.                         *
 //* See cxx source for full Copyright notice                               *
 
 #ifndef ALIHLTTPCCADEF_H
 #define ALIHLTTPCCADEF_H
 
+
 /**
  * Definitions needed for AliHLTTPCCATracker
  *
- */  
+ */
+
 //#define HLTCA_STANDALONE // compilation w/o root
 #define HLTCA_INTERNAL_PERFORMANCE
 
 #define ClassDef(name,id)
 #define ClassImp(name)
 
-typedef char           Char_t;      //Signed Character 1 byte (char)
+typedef char           char;      //Signed Character 1 byte (char)
 typedef unsigned char  UChar_t;     //Unsigned Character 1 byte (unsigned char)
-typedef short          Short_t;     //Signed Short integer 2 bytes (short)
-typedef unsigned short UShort_t;    //Unsigned Short integer 2 bytes (unsigned short)
+typedef short          short;     //Signed Short integer 2 bytes (short)
+typedef unsigned short unsigned short;    //Unsigned Short integer 2 bytes (unsigned short)
 #ifdef R__INT16
-typedef long           Int_t;       //Signed integer 4 bytes
-typedef unsigned long  UInt_t;      //Unsigned integer 4 bytes
+typedef long           int;       //Signed integer 4 bytes
+typedef unsigned long  unsigned int;      //Unsigned integer 4 bytes
 #else
-typedef int            Int_t;       //Signed integer 4 bytes (int)
-typedef unsigned int   UInt_t;      //Unsigned integer 4 bytes (unsigned int)
+typedef int            int;       //Signed integer 4 bytes (int)
+typedef unsigned int   unsigned int;      //Unsigned integer 4 bytes (unsigned int)
 #endif
 #ifdef R__B64    // Note: Long_t and ULong_t are currently not portable types
 typedef int            Seek_t;      //File pointer (int)
@@ -49,12 +49,12 @@ typedef int            Seek_t;      //File pointer (int)
 typedef long           Long_t;      //Signed long integer 4 bytes (long)
 typedef unsigned long  ULong_t;     //Unsigned long integer 4 bytes (unsigned long)
 #endif
-typedef float          Float_t;     //Float 4 bytes (float)
+typedef float          float;     //Float 4 bytes (float)
 typedef float          Float16_t;   //Float 4 bytes written with a truncated mantissa
-typedef double         Double_t;    //Double 8 bytes
+typedef double         double;    //Double 8 bytes
 typedef double         Double32_t;  //Double 8 bytes in memory, written as a 4 bytes float
 typedef char           Text_t;      //General string (char)
-typedef bool           Bool_t;      //Boolean (0=false, 1=true) (bool)
+typedef bool           bool;      //Boolean (0=false, 1=true) (bool)
 typedef unsigned char  Byte_t;      //Byte (8 bits) (unsigned char)
 typedef short          Version_t;   //Class version identifier (short)
 typedef const char     Option_t;    //Option string (const char)
@@ -79,7 +79,7 @@ typedef double         Coord_t;     //Pad world coordinates (double)
 typedef float          Angle_t;     //Graphics angle (float)
 typedef float          Size_t;      //Attribute size (float)
 
-#else 
+#else
 
 #include "Rtypes.h"
 #include "AliHLTDataTypes.h"
@@ -94,30 +94,30 @@ namespace AliHLTTPCCADefinitions
 
 #ifdef HLTCA_GPUCODE
 
-#define GPUd() __device__ 
-#define GPUhd() __host__ __device__ 
-#define GPUh() __host__ inline 
-#define GPUg() __global__ 
+#define GPUd() __device__
+#define GPUhd() __host__ __device__
+#define GPUh() __host__ inline
+#define GPUg() __global__
 
-#define GPUshared() __shared__ 
+#define GPUshared() __shared__
 #define GPUsync() __syncthreads()
 
-__constant__ float4 gAliHLTTPCCATracker[30000/sizeof(float4)];
+__constant__ float4 gAliHLTTPCCATracker[30000/sizeof( float4 )];
 
 #else
 
-#define GPUd() 
+#define GPUd()
 #define GPUhd()
 #define GPUg()
-#define GPUh() 
-#define GPUshared() 
-#define GPUsync() 
-
-struct float2{ float x; float y; };
-struct uchar2{ unsigned char x; unsigned char y; };
-struct ushort2{ unsigned short x; unsigned short y; };
-struct uint1{ unsigned int x; };
-struct uint4{ unsigned int x,y,z,w; };
+#define GPUh()
+#define GPUshared()
+#define GPUsync()
+
+struct float2 { float x; float y; };
+struct uchar2 { unsigned char x; unsigned char y; };
+struct ushort2 { unsigned short x; unsigned short y; };
+struct uint1 { unsigned int x; };
+struct uint4 { unsigned int x, y, z, w; };
 
 #endif
 
index d89a15ad5895e0d1912f9b32004666ad812c02bc..c0890b0a7d7f8d47b72d1c23ec9b85d2d74fd80f 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 class AliHLTTPCCADisplay::AliHLTTPCCADisplayTmpHit
 {
 
-public:
-
-  Int_t ID() const { return fHitID; }
-  Double_t S() const { return fS; }
-  Double_t Z() const { return fZ; }
-  
-  void SetID( Int_t v ){ fHitID = v; }    
-  void SetS( Double_t v){ fS = v; }
-  void SetZ( Double_t v){ fZ = v; }
-  
-  static Bool_t CompareHitDS( const AliHLTTPCCADisplayTmpHit &a, 
-                             const AliHLTTPCCADisplayTmpHit  &b )
-  {    
-    return (a.fS < b.fS);
-  }
+  public:
 
-  static Bool_t CompareHitZ( const AliHLTTPCCADisplayTmpHit &a, 
-                            const AliHLTTPCCADisplayTmpHit  &b )
-  {    
-    return (a.fZ < b.fZ);
-  }
+    int ID() const { return fHitID; }
+    double S() const { return fS; }
+    double Z() const { return fZ; }
+
+    void SetID( int v ) { fHitID = v; }
+    void SetS( double v ) { fS = v; }
+    void SetZ( double v ) { fZ = v; }
 
-private:
+    static bool CompareHitDS( const AliHLTTPCCADisplayTmpHit &a,
+                                const AliHLTTPCCADisplayTmpHit  &b ) {
+      return ( a.fS < b.fS );
+    }
+
+    static bool CompareHitZ( const AliHLTTPCCADisplayTmpHit &a,
+                               const AliHLTTPCCADisplayTmpHit  &b ) {
+      return ( a.fZ < b.fZ );
+    }
 
-  Int_t fHitID; // hit ID
-  Double_t fS;  // hit position on the XY track curve 
-  Double_t fZ;  // hit Z position
+  private:
+
+    int fHitID; // hit ID
+    double fS;  // hit position on the XY track curve
+    double fZ;  // hit Z position
 
 };
 
@@ -78,68 +76,68 @@ AliHLTTPCCADisplay &AliHLTTPCCADisplay::Instance()
 {
   // reference to static object
   static AliHLTTPCCADisplay gAliHLTTPCCADisplay;
-  static Bool_t firstCall = 1;
-  if( firstCall ){
-    if( !gApplication ) new TApplication("myapp",0,0);
+  static bool firstCall = 1;
+  if ( firstCall ) {
+    if ( !gApplication ) new TApplication( "myapp", 0, 0 );
     gAliHLTTPCCADisplay.Init();
     firstCall = 0;
   }
-  return gAliHLTTPCCADisplay; 
+  return gAliHLTTPCCADisplay;
 }
 
-AliHLTTPCCADisplay::AliHLTTPCCADisplay() : fYX(0), fZX(0), fAsk(1), fSliceView(1), fSlice(0),fGB(0), fPerf(0), 
-                                          fCos(1), fSin(0), fZMin(-250), fZMax(250),fYMin(-250), fYMax(250),fSliceCos(1), fSliceSin(0),
-                                          fRInnerMin(83.65), fRInnerMax(133.3), fROuterMin(133.5), fROuterMax(247.7),
-                                          fTPCZMin(-250.), fTPCZMax(250), fArc(), fLine(), fPLine(), fMarker(), fBox(), fCrown(), fLatex(), fDrawOnlyRef(0)
+AliHLTTPCCADisplay::AliHLTTPCCADisplay() : fYX( 0 ), fZX( 0 ), fAsk( 1 ), fSliceView( 1 ), fSlice( 0 ), fGB( 0 ), fPerf( 0 ),
+    fCos( 1 ), fSin( 0 ), fZMin( -250 ), fZMax( 250 ), fYMin( -250 ), fYMax( 250 ), fSliceCos( 1 ), fSliceSin( 0 ),
+    fRInnerMin( 83.65 ), fRInnerMax( 133.3 ), fROuterMin( 133.5 ), fROuterMax( 247.7 ),
+    fTPCZMin( -250. ), fTPCZMax( 250 ), fArc(), fLine(), fPLine(), fMarker(), fBox(), fCrown(), fLatex(), fDrawOnlyRef( 0 )
 {
-  fPerf = &(AliHLTTPCCAPerformance::Instance());
+  fPerf = &( AliHLTTPCCAPerformance::Instance() );
   // constructor
-} 
+}
 
 
-AliHLTTPCCADisplay::AliHLTTPCCADisplay( const AliHLTTPCCADisplay& ) 
-  : fYX(0), fZX(0), fAsk(1), fSliceView(1), fSlice(0), fGB(0), fPerf(0),
-    fCos(1), fSin(0), fZMin(-250), fZMax(250), fYMin(-250), fYMax(250), fSliceCos(1), fSliceSin(0),
-    fRInnerMin(83.65), fRInnerMax(133.3), fROuterMin(133.5), fROuterMax(247.7),
-    fTPCZMin(-250.), fTPCZMax(250), fArc(), fLine(), fPLine(), fMarker(), fBox(), fCrown(), fLatex(), fDrawOnlyRef(0)
+AliHLTTPCCADisplay::AliHLTTPCCADisplay( const AliHLTTPCCADisplay& )
+    : fYX( 0 ), fZX( 0 ), fAsk( 1 ), fSliceView( 1 ), fSlice( 0 ), fGB( 0 ), fPerf( 0 ),
+    fCos( 1 ), fSin( 0 ), fZMin( -250 ), fZMax( 250 ), fYMin( -250 ), fYMax( 250 ), fSliceCos( 1 ), fSliceSin( 0 ),
+    fRInnerMin( 83.65 ), fRInnerMax( 133.3 ), fROuterMin( 133.5 ), fROuterMax( 247.7 ),
+    fTPCZMin( -250. ), fTPCZMax( 250 ), fArc(), fLine(), fPLine(), fMarker(), fBox(), fCrown(), fLatex(), fDrawOnlyRef( 0 )
 {
   // dummy
 }
 
-const AliHLTTPCCADisplay& AliHLTTPCCADisplay::operator=( const AliHLTTPCCADisplay& ) const 
+const AliHLTTPCCADisplay& AliHLTTPCCADisplay::operator=( const AliHLTTPCCADisplay& ) const
 {
   // dummy
   return *this;
 }
+
 AliHLTTPCCADisplay::~AliHLTTPCCADisplay()
 {
   // destructor
-  delete fYX; 
+  delete fYX;
   delete fZX;
 }
 
 void AliHLTTPCCADisplay::Init()
 {
   // initialization
-  gStyle->SetCanvasBorderMode(0);
-  gStyle->SetCanvasBorderSize(1);
-  gStyle->SetCanvasColor(0);
-  fYX = new TCanvas ("YX", "YX window", -1, 0, 600, 600);
-  fZX = new TCanvas ("ZX", "ZX window", -610, 0, 590, 600);  
-  fMarker = TMarker(0.0, 0.0, 20);//6);
+  gStyle->SetCanvasBorderMode( 0 );
+  gStyle->SetCanvasBorderSize( 1 );
+  gStyle->SetCanvasColor( 0 );
+  fYX = new TCanvas ( "YX", "YX window", -1, 0, 600, 600 );
+  fZX = new TCanvas ( "ZX", "ZX window", -610, 0, 590, 600 );
+  fMarker = TMarker( 0.0, 0.0, 20 );//6);
   fDrawOnlyRef = 0;
 }
 
 void AliHLTTPCCADisplay::Update()
 {
   // update windows
-  if( !fAsk ) return;
+  if ( !fAsk ) return;
   fYX->Update();
   fZX->Update();
-  fYX->Print("YX.pdf");
-  fZX->Print("ZX.pdf");
+  fYX->Print( "YX.pdf" );
+  fZX->Print( "ZX.pdf" );
+
 }
 
 void AliHLTTPCCADisplay::ClearView()
@@ -153,14 +151,14 @@ void AliHLTTPCCADisplay::Ask()
 {
   // whait for the pressed key, when "r" pressed, don't ask anymore
   char symbol;
-  if (fAsk){
+  if ( fAsk ) {
     Update();
-    std::cout<<"ask> "<<std::endl;
-    do{
-      std::cin.get(symbol);
-      if (symbol == 'r')
-       fAsk = false;
-    } while (symbol != '\n');
+    std::cout << "ask> " << std::endl;
+    do {
+      std::cin.get( symbol );
+      if ( symbol == 'r' )
+        fAsk = false;
+    } while ( symbol != '\n' );
   }
 }
 
@@ -194,23 +192,23 @@ void AliHLTTPCCADisplay::SetCurrentSlice( AliHLTTPCCATracker *slice )
   // set reference to the current CA tracker, and read the current slice geometry
   fSlice = slice;
   SetSliceTransform( slice );
-  if( fSliceView ){
+  if ( fSliceView ) {
     fCos = slice->Param().SinAlpha();
     fSin = slice->Param().CosAlpha();
     fZMin = slice->Param().ZMin();
     fZMax = slice->Param().ZMax();
     ClearView();
-    Double_t r0 = .5*(slice->Param().RMax()+slice->Param().RMin());
-    Double_t dr = .5*(slice->Param().RMax()-slice->Param().RMin());
+    double r0 = .5 * ( slice->Param().RMax() + slice->Param().RMin() );
+    double dr = .5 * ( slice->Param().RMax() - slice->Param().RMin() );
     fYMin = -dr;
     fYMax = dr;
-    Double_t cx = 0;
-    Double_t cy = r0;    
-    Double_t cz = .5*(slice->Param().ZMax()+slice->Param().ZMin());
-    Double_t dz = .5*(slice->Param().ZMax()-slice->Param().ZMin())*1.2;
-    fYX->Range(cx-dr, cy-dr*1.05, cx+dr, cy+dr);
-    fZX->Range(cz-dz, cy-dr*1.05, cz+dz, cy+dr);
-    
+    double cx = 0;
+    double cy = r0;
+    double cz = .5 * ( slice->Param().ZMax() + slice->Param().ZMin() );
+    double dz = .5 * ( slice->Param().ZMax() - slice->Param().ZMin() ) * 1.2;
+    fYX->Range( cx - dr, cy - dr*1.05, cx + dr, cy + dr );
+    fZX->Range( cz - dz, cy - dr*1.05, cz + dz, cy + dr );
+
     //fYX->Range(cx-dr*.3, cy-dr*1.05, cx+dr*.3, cy-dr*.35);
     //fZX->Range(cz-dz, cy-dr*1.05, cz+dz, cy-dr*.3);
 
@@ -219,45 +217,45 @@ void AliHLTTPCCADisplay::SetCurrentSlice( AliHLTTPCCATracker *slice )
 
     //fYX->Range(cx-dr*.08, cy-dr*1., cx-dr*.02, cy-dr*0.7);
     //fZX->Range(cz-dz*.2, cy-dr*1., cz-dz*.05, cy-dr*0.7);
-    
-    //Double_t x0 = cx-dr*.1, x1 = cx-dr*.05;
-    //Double_t y0 = cy-dr*1.05, y1 = cy-dr*0.7;
-    //Double_t z0 = cz-dz*.3, z1 = cz;
-    //Double_t xc = (x0+x1)/2, yc= (y0+y1)/2, zc=(z0+z1)/2;
-    //Double_t d = TMath::Max((x1-x0)/2,TMath::Max((y1-y0)/2,(z1-z0)/2));
+
+    //double x0 = cx-dr*.1, x1 = cx-dr*.05;
+    //double y0 = cy-dr*1.05, y1 = cy-dr*0.7;
+    //double z0 = cz-dz*.3, z1 = cz;
+    //double xc = (x0+x1)/2, yc= (y0+y1)/2, zc=(z0+z1)/2;
+    //double d = TMath::Max((x1-x0)/2,TMath::Max((y1-y0)/2,(z1-z0)/2));
     //fYX->Range(xc-d, yc-d, xc+d, yc+d);
     //fZX->Range(zc-d, yc-d, zc+d, yc+d);
-    
-   }
+
+  }
 }
 
-void AliHLTTPCCADisplay::SetSliceTransform( Double_t alpha )
+void AliHLTTPCCADisplay::SetSliceTransform( double alpha )
 {
   fSliceCos = TMath::Cos( alpha );
   fSliceSin = TMath::Sin( alpha );
-} 
+}
 
 void AliHLTTPCCADisplay::SetSliceTransform( AliHLTTPCCATracker *slice )
 {
-  SetSliceTransform(slice->Param().Alpha());
+  SetSliceTransform( slice->Param().Alpha() );
 }
 
 
 void AliHLTTPCCADisplay::DrawTPC()
 {
   // schematically draw TPC detector
-  fYX->Range(-fROuterMax, -fROuterMax, fROuterMax, fROuterMax);
+  fYX->Range( -fROuterMax, -fROuterMax, fROuterMax, fROuterMax );
   //fYX->Range( -fROuterMax*.7, -fROuterMax, fROuterMax*0., -fROuterMax*.5);
   fYX->Clear();
   {
-    fArc.SetLineColor(kBlack);
-    fArc.SetFillStyle(0);
-    fYX->cd();    
-    for( Int_t iSlice=0; iSlice<18; iSlice++){
-      fCrown.SetLineColor(kBlack);
-      fCrown.SetFillStyle(0);
-      fCrown.DrawCrown(0,0,fRInnerMin, fRInnerMax, 360./18.*iSlice, 360./18.*(iSlice+1) );
-      fCrown.DrawCrown(0,0,fROuterMin, fROuterMax, 360./18.*iSlice, 360./18.*(iSlice+1) );
+    fArc.SetLineColor( kBlack );
+    fArc.SetFillStyle( 0 );
+    fYX->cd();
+    for ( int iSlice = 0; iSlice < 18; iSlice++ ) {
+      fCrown.SetLineColor( kBlack );
+      fCrown.SetFillStyle( 0 );
+      fCrown.DrawCrown( 0, 0, fRInnerMin, fRInnerMax, 360. / 18.*iSlice, 360. / 18.*( iSlice + 1 ) );
+      fCrown.DrawCrown( 0, 0, fROuterMin, fROuterMax, 360. / 18.*iSlice, 360. / 18.*( iSlice + 1 ) );
     }
   }
   fZX->cd();
@@ -266,55 +264,55 @@ void AliHLTTPCCADisplay::DrawTPC()
   fZX->Clear();
 }
 
-void AliHLTTPCCADisplay::DrawSlice( AliHLTTPCCATracker *slice, Bool_t DrawRows )
-{     
+void AliHLTTPCCADisplay::DrawSlice( AliHLTTPCCATracker *slice, bool DrawRows )
+{
   // draw current the TPC slice
   fYX->cd();
-  Double_t r0 = .5*(slice->Param().RMax()+slice->Param().RMin());
-  Double_t dr = .5*(slice->Param().RMax()-slice->Param().RMin());
-  Double_t cx = r0*slice->Param().CosAlpha();
-  Double_t cy = r0*slice->Param().SinAlpha();
-  Double_t raddeg = 180./3.1415;
-  Double_t a0 = raddeg*.5*(slice->Param().AngleMax() + slice->Param().AngleMin());
-  Double_t da = raddeg*.5*(slice->Param().AngleMax() - slice->Param().AngleMin());
-  if( fSliceView ){
+  double r0 = .5 * ( slice->Param().RMax() + slice->Param().RMin() );
+  double dr = .5 * ( slice->Param().RMax() - slice->Param().RMin() );
+  double cx = r0 * slice->Param().CosAlpha();
+  double cy = r0 * slice->Param().SinAlpha();
+  double raddeg = 180. / 3.1415;
+  double a0 = raddeg * .5 * ( slice->Param().AngleMax() + slice->Param().AngleMin() );
+  double da = raddeg * .5 * ( slice->Param().AngleMax() - slice->Param().AngleMin() );
+  if ( fSliceView ) {
     cx = 0; cy = r0;
     a0 = 90.;
-    fLatex.DrawLatex(cx-dr+dr*.05,cy-dr+dr*.05, Form("YX, Slice %2i",slice->Param().ISlice()));
+    fLatex.DrawLatex( cx - dr + dr*.05, cy - dr + dr*.05, Form( "YX, Slice %2i", slice->Param().ISlice() ) );
   } else {
-    a0+= raddeg*TMath::ATan2(fSin, fCos );
+    a0 += raddeg * TMath::ATan2( fSin, fCos );
   }
-  fArc.SetLineColor(kBlack);
-  fArc.SetFillStyle(0);     
-  fCrown.SetLineColor(kBlack);
-  fCrown.SetFillStyle(0);
-  fCrown.DrawCrown(0,0, fRInnerMin, fRInnerMax, a0-da, a0+da );
-  fCrown.DrawCrown(0,0, fROuterMin, fROuterMax, a0-da, a0+da );
+  fArc.SetLineColor( kBlack );
+  fArc.SetFillStyle( 0 );
+  fCrown.SetLineColor( kBlack );
+  fCrown.SetFillStyle( 0 );
+  fCrown.DrawCrown( 0, 0, fRInnerMin, fRInnerMax, a0 - da, a0 + da );
+  fCrown.DrawCrown( 0, 0, fROuterMin, fROuterMax, a0 - da, a0 + da );
   //fCrown.DrawCrown(0,0, slice->Param().RMin(),slice->Param().RMax(), a0-da, a0+da );
-  
-  fLine.SetLineColor(kBlack);
+
+  fLine.SetLineColor( kBlack );
+
   fZX->cd();
 
-  Double_t cz = .5*(slice->Param().ZMax()+slice->Param().ZMin());
-  Double_t dz = .5*(slice->Param().ZMax()-slice->Param().ZMin())*1.2;
-  //fLine.DrawLine(cz+dz, cy-dr, cz+dz, cy+dr ); 
-  if( fSliceView ) fLatex.DrawLatex(cz-dz+dz*.05,cy-dr+dr*.05, Form("ZX, Slice %2i",slice->Param().ISlice()));
-
-  if( DrawRows ){
-    fLine.SetLineWidth(1);
-    fLine.SetLineColor(kBlack);    
-    SetSliceTransform(fSlice);      
-    for( Int_t iRow=0; iRow<fSlice->Param().NRows(); iRow++ ){
-      Double_t x = fSlice->Row(iRow).X();
-      Double_t y = fSlice->Row(iRow).MaxY();
-      Double_t vx0, vy0, vx1, vy1;
-      Slice2View( x, y, &vx0, &vy0 );  
-      Slice2View( x, -y, &vx1, &vy1 );    
+  double cz = .5 * ( slice->Param().ZMax() + slice->Param().ZMin() );
+  double dz = .5 * ( slice->Param().ZMax() - slice->Param().ZMin() ) * 1.2;
+  //fLine.DrawLine(cz+dz, cy-dr, cz+dz, cy+dr );
+  if ( fSliceView ) fLatex.DrawLatex( cz - dz + dz*.05, cy - dr + dr*.05, Form( "ZX, Slice %2i", slice->Param().ISlice() ) );
+
+  if ( DrawRows ) {
+    fLine.SetLineWidth( 1 );
+    fLine.SetLineColor( kBlack );
+    SetSliceTransform( fSlice );
+    for ( int iRow = 0; iRow < fSlice->Param().NRows(); iRow++ ) {
+      double x = fSlice->Row( iRow ).X();
+      double y = fSlice->Row( iRow ).MaxY();
+      double vx0, vy0, vx1, vy1;
+      Slice2View( x, y, &vx0, &vy0 );
+      Slice2View( x, -y, &vx1, &vy1 );
       fYX->cd();
-      fLine.DrawLine(vx0, vy0,vx1,vy1);
+      fLine.DrawLine( vx0, vy0, vx1, vy1 );
       fZX->cd();
-      fLine.DrawLine(fTPCZMin, vy0,fTPCZMax,vy1);
+      fLine.DrawLine( fTPCZMin, vy0, fTPCZMax, vy1 );
     }
   }
 
@@ -327,277 +325,281 @@ void AliHLTTPCCADisplay::Set2Slices( AliHLTTPCCATracker * const slice )
 
   fSlice = slice;
   fSliceView = 0;
-  fCos = TMath::Cos(TMath::Pi()/2 - (slice->Param().Alpha()+10./180.*TMath::Pi()));
-  fSin = TMath::Sin(TMath::Pi()/2 - (slice->Param().Alpha()+10./180.*TMath::Pi()));
+  fCos = TMath::Cos( TMath::Pi() / 2 - ( slice->Param().Alpha() + 10. / 180.*TMath::Pi() ) );
+  fSin = TMath::Sin( TMath::Pi() / 2 - ( slice->Param().Alpha() + 10. / 180.*TMath::Pi() ) );
   fZMin = slice->Param().ZMin();
   fZMax = slice->Param().ZMax();
   ClearView();
-  Double_t r0 = .5*(slice->Param().RMax()+slice->Param().RMin());
-  Double_t dr = .5*(slice->Param().RMax()-slice->Param().RMin());
-  Double_t cx = 0;
-  Double_t cy = r0;    
-  fYX->Range(cx-1.3*dr, cy-1.1*dr, cx+1.3*dr, cy+1.1*dr);
+  double r0 = .5 * ( slice->Param().RMax() + slice->Param().RMin() );
+  double dr = .5 * ( slice->Param().RMax() - slice->Param().RMin() );
+  double cx = 0;
+  double cy = r0;
+  fYX->Range( cx - 1.3*dr, cy - 1.1*dr, cx + 1.3*dr, cy + 1.1*dr );
   fYX->cd();
-  Int_t islice = slice->Param().ISlice();
-  Int_t jslice = slice->Param().ISlice()+1;
-  if( islice==17 ) jslice = 0;
-  else if( islice==35 ) jslice = 18;
-  fLatex.DrawLatex(cx-1.3*dr+1.3*dr*.05,cy-dr+dr*.05, Form("YX, Slices %2i/%2i",islice,jslice));
-  Double_t cz = .5*(slice->Param().ZMax()+slice->Param().ZMin());
-  Double_t dz = .5*(slice->Param().ZMax()-slice->Param().ZMin())*1.2;
-  fZX->Range(cz-dz, cy-1.1*dr, cz+dz, cy+1.1*dr);//+dr);
-  fZX->cd();  
-  fLatex.DrawLatex(cz-dz+dz*.05,cy-dr+dr*.05, Form("ZX, Slices %2i/%2i",islice,jslice));
+  int islice = slice->Param().ISlice();
+  int jslice = slice->Param().ISlice() + 1;
+  if ( islice == 17 ) jslice = 0;
+  else if ( islice == 35 ) jslice = 18;
+  fLatex.DrawLatex( cx - 1.3*dr + 1.3*dr*.05, cy - dr + dr*.05, Form( "YX, Slices %2i/%2i", islice, jslice ) );
+  double cz = .5 * ( slice->Param().ZMax() + slice->Param().ZMin() );
+  double dz = .5 * ( slice->Param().ZMax() - slice->Param().ZMin() ) * 1.2;
+  fZX->Range( cz - dz, cy - 1.1*dr, cz + dz, cy + 1.1*dr );//+dr);
+  fZX->cd();
+  fLatex.DrawLatex( cz - dz + dz*.05, cy - dr + dr*.05, Form( "ZX, Slices %2i/%2i", islice, jslice ) );
 }
 
-Int_t AliHLTTPCCADisplay::GetColor( Int_t i ) const 
+int AliHLTTPCCADisplay::GetColor( int i ) const
 {
   // Get color with respect to Z coordinate
-  const Color_t kMyColor[9] = { kGreen, kBlue, kYellow, kCyan, kOrange, 
-                                kSpring, kTeal, kAzure, kViolet };
-  if( i<0 ) i= 0;
-  if( i==0 ) return kBlack;
-  return kMyColor[(i-1)%9];
+  const Color_t kMyColor[9] = { kGreen, kBlue, kYellow, kCyan, kOrange,
+                                kSpring, kTeal, kAzure, kViolet
+                              };
+  if ( i < 0 ) i = 0;
+  if ( i == 0 ) return kBlack;
+  return kMyColor[( i-1 )%9];
 }
 
-Int_t AliHLTTPCCADisplay::GetColorZ( Double_t z ) const 
+int AliHLTTPCCADisplay::GetColorZ( double z ) const
 {
   // Get color with respect to Z coordinate
-  const Color_t kMyColor[11] = { kGreen, kBlue, kYellow, kMagenta, kCyan, 
-                                kOrange, kSpring, kTeal, kAzure, kViolet, kPink };
-
-  Double_t zz = (z-fZMin)/(fZMax-fZMin);    
-  Int_t iz = (int) (zz*11);
-  if( iz<0 ) iz = 0;
-  if( iz>10 ) iz = 10;
+  const Color_t kMyColor[11] = { kGreen, kBlue, kYellow, kMagenta, kCyan,
+                                 kOrange, kSpring, kTeal, kAzure, kViolet, kPink
+                               };
+
+  double zz = ( z - fZMin ) / ( fZMax - fZMin );
+  int iz = ( int ) ( zz * 11 );
+  if ( iz < 0 ) iz = 0;
+  if ( iz > 10 ) iz = 10;
   return kMyColor[iz];
 }
 
-Int_t AliHLTTPCCADisplay::GetColorY( Double_t y ) const 
+int AliHLTTPCCADisplay::GetColorY( double y ) const
 {
   // Get color with respect to Z coordinate
-  const Color_t kMyColor[11] = { kGreen, kBlue, kYellow, kMagenta, kCyan, 
-                                kOrange, kSpring, kTeal, kAzure, kViolet, kPink };
-
-  Double_t yy = (y-fYMin)/(fYMax-fYMin);    
-  Int_t iy = (int) (yy*11);
-  if( iy<0 ) iy = 0;
-  if( iy>10 ) iy = 10;
+  const Color_t kMyColor[11] = { kGreen, kBlue, kYellow, kMagenta, kCyan,
+                                 kOrange, kSpring, kTeal, kAzure, kViolet, kPink
+                               };
+
+  double yy = ( y - fYMin ) / ( fYMax - fYMin );
+  int iy = ( int ) ( yy * 11 );
+  if ( iy < 0 ) iy = 0;
+  if ( iy > 10 ) iy = 10;
   return kMyColor[iy];
 }
 
-Int_t AliHLTTPCCADisplay::GetColorK( Double_t k ) const 
+int AliHLTTPCCADisplay::GetColorK( double k ) const
 {
   // Get color with respect to Z coordinate
-  const Color_t kMyColor[11] = { kRed, kBlue, kYellow, kMagenta, kCyan, 
-                                kOrange, kSpring, kTeal, kAzure, kViolet, kPink };
-  const Double_t kCLight = 0.000299792458;  
-  const Double_t kBz = 5;
-  Double_t k2QPt = 100;
-  if( TMath::Abs(kBz)>1.e-4 ) k2QPt= 1./(kBz*kCLight);
-  Double_t qPt = k*k2QPt;
-  Double_t pt = 100;
-  if( TMath::Abs(qPt) >1.e-4 ) pt = 1./TMath::Abs(qPt);
-  
-  Double_t yy = (pt-0.1)/(1.-0.1);
-  Int_t iy = (int) (yy*11);
-  if( iy<0 ) iy = 0;
-  if( iy>10 ) iy = 10;
+  const Color_t kMyColor[11] = { kRed, kBlue, kYellow, kMagenta, kCyan,
+                                 kOrange, kSpring, kTeal, kAzure, kViolet, kPink
+                               };
+  const double kCLight = 0.000299792458;
+  const double kBz = 5;
+  double k2QPt = 100;
+  if ( TMath::Abs( kBz ) > 1.e-4 ) k2QPt = 1. / ( kBz * kCLight );
+  double qPt = k * k2QPt;
+  double pt = 100;
+  if ( TMath::Abs( qPt ) > 1.e-4 ) pt = 1. / TMath::Abs( qPt );
+
+  double yy = ( pt - 0.1 ) / ( 1. - 0.1 );
+  int iy = ( int ) ( yy * 11 );
+  if ( iy < 0 ) iy = 0;
+  if ( iy > 10 ) iy = 10;
   return kMyColor[iy];
 }
 
-void AliHLTTPCCADisplay::Global2View( Double_t x, Double_t y, Double_t *xv, Double_t *yv ) const
+void AliHLTTPCCADisplay::Global2View( double x, double y, double *xv, double *yv ) const
 {
   // convert coordinates global->view
-  *xv = x*fCos + y*fSin;
-  *yv = y*fCos - x*fSin;
+  *xv = x * fCos + y * fSin;
+  *yv = y * fCos - x * fSin;
 }
 
 
-void AliHLTTPCCADisplay::Slice2View( Double_t x, Double_t y, Double_t *xv, Double_t *yv ) const
+void AliHLTTPCCADisplay::Slice2View( double x, double y, double *xv, double *yv ) const
 {
   // convert coordinates slice->view
-  Double_t xg = x*fSliceCos - y*fSliceSin;
-  Double_t yg = y*fSliceCos + x*fSliceSin;
-  *xv = xg*fCos - yg*fSin;
-  *yv = yg*fCos + xg*fSin;
+  double xg = x * fSliceCos - y * fSliceSin;
+  double yg = y * fSliceCos + x * fSliceSin;
+  *xv = xg * fCos - yg * fSin;
+  *yv = yg * fCos + xg * fSin;
 }
 
 
-void AliHLTTPCCADisplay::DrawGBHit( AliHLTTPCCAGBTracker &tracker, Int_t iHit, Int_t color, Size_t width  )
+void AliHLTTPCCADisplay::DrawGBHit( AliHLTTPCCAGBTracker &tracker, int iHit, int color, Size_t width  )
 {
   // draw hit
   AliHLTTPCCAGBHit &h = tracker.Hits()[iHit];
   AliHLTTPCCATracker &slice = tracker.Slices()[h.ISlice()];
-  SetSliceTransform(&slice);
-  
-  if( color<0 ){
-    if( fPerf ){
-      Int_t lab = fPerf->HitLabels()[h.ID()].fLab[0];
-      color = GetColor(lab+1);
-      if( lab>=0 ){
-       AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lab];
-       if( mc.P()>=1. ) color = kRed;  
-       else if(fDrawOnlyRef) return;
+  SetSliceTransform( &slice );
+
+  if ( color < 0 ) {
+    if ( fPerf ) {
+      int lab = fPerf->HitLabels()[h.ID()].fLab[0];
+      color = GetColor( lab + 1 );
+      if ( lab >= 0 ) {
+        AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lab];
+        if ( mc.P() >= 1. ) color = kRed;
+        else if ( fDrawOnlyRef ) return;
       }
-    }else color=GetColorZ( h.Z() );
+    } else color = GetColorZ( h.Z() );
   }
-  if( width>0 )fMarker.SetMarkerSize(width);
-  else fMarker.SetMarkerSize(.3);
-  fMarker.SetMarkerColor(color);
-  Double_t vx, vy;
-  Slice2View( h.X(), h.Y(), &vx, &vy );  
-  
+  if ( width > 0 )fMarker.SetMarkerSize( width );
+  else fMarker.SetMarkerSize( .3 );
+  fMarker.SetMarkerColor( color );
+  double vx, vy;
+  Slice2View( h.X(), h.Y(), &vx, &vy );
+
   fYX->cd();
-  fMarker.DrawMarker(vx, vy);
-  fZX->cd();  
-  fMarker.DrawMarker(h.Z(), vy); 
+  fMarker.DrawMarker( vx, vy );
+  fZX->cd();
+  fMarker.DrawMarker( h.Z(), vy );
 }
 
-void AliHLTTPCCADisplay::DrawGBHits( AliHLTTPCCAGBTracker &tracker, Int_t color, Size_t width )
+void AliHLTTPCCADisplay::DrawGBHits( AliHLTTPCCAGBTracker &tracker, int color, Size_t width )
 {
-  // draw hits 
+  // draw hits
+
+  if ( !fPerf ) return;
+  if ( width < 0 ) width = .3;
 
-  if( !fPerf ) return;
-  if( width<0 ) width = .3;
-    
-  for( Int_t iHit = 0; iHit<tracker.NHits(); iHit++ ){
+  for ( int iHit = 0; iHit < tracker.NHits(); iHit++ ) {
     AliHLTTPCCAGBHit &h = tracker.Hits()[iHit];
-    Int_t imc = fPerf->HitLabels()[h.ID()].fLab[0];
-    AliHLTTPCCAMCTrack *mc = (imc>=0) ?&(fPerf->MCTracks()[imc]) :0;
-    if(fDrawOnlyRef && (!mc || (mc->P()<1))) continue;
-    Int_t col = color;
-    if( color<0 ){
-      col = GetColor(imc+1) ;
-      if( mc && (mc->P()>=1.) ) col = kRed;        
-    }    
+    int imc = fPerf->HitLabels()[h.ID()].fLab[0];
+    AliHLTTPCCAMCTrack *mc = ( imc >= 0 ) ? &( fPerf->MCTracks()[imc] ) : 0;
+    if ( fDrawOnlyRef && ( !mc || ( mc->P() < 1 ) ) ) continue;
+    int col = color;
+    if ( color < 0 ) {
+      col = GetColor( imc + 1 ) ;
+      if ( mc && ( mc->P() >= 1. ) ) col = kRed;
+    }
 
     AliHLTTPCCATracker &slice = tracker.Slices()[h.ISlice()];
-    SetSliceTransform(&slice);
+    SetSliceTransform( &slice );
+
+    fMarker.SetMarkerSize( width );
+    fMarker.SetMarkerColor( col );
+    double vx, vy;
+    Slice2View( h.X(), h.Y(), &vx, &vy );
 
-    fMarker.SetMarkerSize(width);
-    fMarker.SetMarkerColor(col);
-    Double_t vx, vy;
-    Slice2View( h.X(), h.Y(), &vx, &vy );  
-      
     fYX->cd();
-    fMarker.DrawMarker(vx, vy);
-    fZX->cd();  
-    fMarker.DrawMarker(h.Z(), vy); 
+    fMarker.DrawMarker( vx, vy );
+    fZX->cd();
+    fMarker.DrawMarker( h.Z(), vy );
   }
 }
 
-void AliHLTTPCCADisplay::DrawSliceHit( Int_t iRow, Int_t iHit, Int_t color, Size_t width )
+void AliHLTTPCCADisplay::DrawSliceHit( int iRow, int iHit, int color, Size_t width )
 {
   // draw hit
-  if( !fSlice ) return;
-  const AliHLTTPCCARow &row = fSlice->Row(iRow);        
+  if ( !fSlice ) return;
+  const AliHLTTPCCARow &row = fSlice->Row( iRow );
   float y0 = row.Grid().YMin();
   float z0 = row.Grid().ZMin();
   float stepY = row.HstepY();
   float stepZ = row.HstepZ();
   const uint4* tmpint4 = fSlice->RowData() + row.FullOffset();
-  const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
+  const ushort2 *hits = reinterpret_cast<const ushort2*>( tmpint4 );
   ushort2 hh = hits[iHit];
-  Float_t x = row.X();
-  Float_t y = y0 + hh.x*stepY;
-  Float_t z = z0 + hh.y*stepZ;
-
-  SetSliceTransform(fSlice);
-  
-  if( color<0 ){
-    if( fPerf && fGB ){
-      Int_t id = fGB->FirstSliceHit()[fSlice->Param().ISlice()]+fSlice->HitInputIDs()[row.FirstHit()+iHit];
+  float x = row.X();
+  float y = y0 + hh.x * stepY;
+  float z = z0 + hh.y * stepZ;
+
+  SetSliceTransform( fSlice );
+
+  if ( color < 0 ) {
+    if ( fPerf && fGB ) {
+      int id = fGB->FirstSliceHit()[fSlice->Param().ISlice()] + fSlice->HitInputIDs()[row.FirstHit()+iHit];
       AliHLTTPCCAGBHit &h = fGB->Hits()[id];
-      Int_t lab = fPerf->HitLabels()[h.ID()].fLab[0];
-      color = GetColor(lab+1);
-      if( lab>=0 ){
-       AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lab];
-       if( mc.P()>=1. ) color = kRed;  
-       else if(fDrawOnlyRef) return;
+      int lab = fPerf->HitLabels()[h.ID()].fLab[0];
+      color = GetColor( lab + 1 );
+      if ( lab >= 0 ) {
+        AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lab];
+        if ( mc.P() >= 1. ) color = kRed;
+        else if ( fDrawOnlyRef ) return;
       }
-    }else color=GetColorZ( z );
+    } else color = GetColorZ( z );
   }
-  if( width>0 )fMarker.SetMarkerSize(width);
-  else fMarker.SetMarkerSize(.3);
-  fMarker.SetMarkerColor(color);
-  Double_t vx, vy;
-  Slice2View( x, y, &vx, &vy );    
+  if ( width > 0 )fMarker.SetMarkerSize( width );
+  else fMarker.SetMarkerSize( .3 );
+  fMarker.SetMarkerColor( color );
+  double vx, vy;
+  Slice2View( x, y, &vx, &vy );
   fYX->cd();
-  fMarker.DrawMarker(vx, vy);
-  fZX->cd();  
-  fMarker.DrawMarker(z, vy); 
+  fMarker.DrawMarker( vx, vy );
+  fZX->cd();
+  fMarker.DrawMarker( z, vy );
 }
 
-void AliHLTTPCCADisplay::DrawSliceHits( Int_t color, Size_t width )
+void AliHLTTPCCADisplay::DrawSliceHits( int color, Size_t width )
 {
 
-  // draw hits 
+  // draw hits
 
-  for( Int_t iRow=0; iRow<fSlice->Param().NRows(); iRow++ ){
-    const AliHLTTPCCARow &row = fSlice->Row(iRow);
-    for( Int_t ih=0; ih<row.NHits(); ih++ ){
-      DrawSliceHit( iRow, ih, color, width );     
+  for ( int iRow = 0; iRow < fSlice->Param().NRows(); iRow++ ) {
+    const AliHLTTPCCARow &row = fSlice->Row( iRow );
+    for ( int ih = 0; ih < row.NHits(); ih++ ) {
+      DrawSliceHit( iRow, ih, color, width );
     }
-  }  
+  }
 }
 
 
-void AliHLTTPCCADisplay::DrawSliceLink( Int_t iRow, Int_t iHit, Int_t colorUp, Int_t colorDn, Int_t width )
+void AliHLTTPCCADisplay::DrawSliceLink( int iRow, int iHit, int colorUp, int colorDn, int width )
 {
-  // draw link between clusters 
+  // draw link between clusters
 
-  if( !fPerf || !fGB) return;
+  if ( !fPerf || !fGB ) return;
   AliHLTTPCCAGBTracker &tracker = *fGB;
-  if( width<0 ) width = 1.;
+  if ( width < 0 ) width = 1.;
   fLine.SetLineWidth( width );
-  Int_t colUp = colorUp>=0 ? colorUp :kMagenta;
-  Int_t colDn = colorDn>=0 ? colorDn :kBlack;
-  if( iRow<1 || iRow>=fSlice->Param().NRows()-1 ) return;
-
-  const AliHLTTPCCARow& row = fSlice->Row(iRow);
-  const AliHLTTPCCARow& rowUp = fSlice->Row(iRow+1);
-  const AliHLTTPCCARow& rowDn = fSlice->Row(iRow-1);
-    
-  Int_t id = fSlice->HitInputIDs()[row.FirstHit()+iHit];
-  AliHLTTPCCAGBHit &h = tracker.Hits()[tracker.FirstSliceHit()[fSlice->Param().ISlice()]+id]; 
-  Short_t iUp = ((Short_t*)(fSlice->RowData() + row.FullOffset()))[row.FullLinkOffset()+iHit];
-  Short_t iDn = ((Short_t*)(fSlice->RowData() + row.FullOffset()))[row.FullLinkOffset()+row.NHits()+iHit];
-
-  if( iUp>=0){
-    Int_t id1 =fSlice->HitInputIDs()[rowUp.FirstHit()+iUp];
-    AliHLTTPCCAGBHit &h1 = tracker.Hits()[tracker.FirstSliceHit()[fSlice->Param().ISlice()]+id1]; 
-    Double_t vx, vy, vx1, vy1;
-    Slice2View( h.X(), h.Y(), &vx, &vy );  
-    Slice2View( h1.X(), h1.Y(), &vx1, &vy1 );  
+  int colUp = colorUp >= 0 ? colorUp : kMagenta;
+  int colDn = colorDn >= 0 ? colorDn : kBlack;
+  if ( iRow < 1 || iRow >= fSlice->Param().NRows() - 1 ) return;
+
+  const AliHLTTPCCARow& row = fSlice->Row( iRow );
+  const AliHLTTPCCARow& rowUp = fSlice->Row( iRow + 1 );
+  const AliHLTTPCCARow& rowDn = fSlice->Row( iRow - 1 );
+
+  int id = fSlice->HitInputIDs()[row.FirstHit()+iHit];
+  AliHLTTPCCAGBHit &h = tracker.Hits()[tracker.FirstSliceHit()[fSlice->Param().ISlice()] + id];
+  short iUp = ( ( short* )( fSlice->RowData() + row.FullOffset() ) )[row.FullLinkOffset()+iHit];
+  short iDn = ( ( short* )( fSlice->RowData() + row.FullOffset() ) )[row.FullLinkOffset()+row.NHits()+iHit];
+
+  if ( iUp >= 0 ) {
+    int id1 = fSlice->HitInputIDs()[rowUp.FirstHit()+iUp];
+    AliHLTTPCCAGBHit &h1 = tracker.Hits()[tracker.FirstSliceHit()[fSlice->Param().ISlice()] + id1];
+    double vx, vy, vx1, vy1;
+    Slice2View( h.X(), h.Y(), &vx, &vy );
+    Slice2View( h1.X(), h1.Y(), &vx1, &vy1 );
     fLine.SetLineColor( colUp );
     fYX->cd();
-    fLine.DrawLine(vx-.1,vy,vx1-.1,vy1);
+    fLine.DrawLine( vx - .1, vy, vx1 - .1, vy1 );
     fZX->cd();
-    fLine.DrawLine(h.Z()-1.,vy,h1.Z()-1.,vy1);
+    fLine.DrawLine( h.Z() - 1., vy, h1.Z() - 1., vy1 );
   }
-  if( iDn>=0){
-    Int_t id1 =fSlice->HitInputIDs()[rowDn.FirstHit()+iDn];
-    AliHLTTPCCAGBHit &h1 = tracker.Hits()[tracker.FirstSliceHit()[fSlice->Param().ISlice()]+id1]; 
-    Double_t vx, vy, vx1, vy1;
-    Slice2View( h.X(), h.Y(), &vx, &vy );  
-    Slice2View( h1.X(), h1.Y(), &vx1, &vy1 );  
+  if ( iDn >= 0 ) {
+    int id1 = fSlice->HitInputIDs()[rowDn.FirstHit()+iDn];
+    AliHLTTPCCAGBHit &h1 = tracker.Hits()[tracker.FirstSliceHit()[fSlice->Param().ISlice()] + id1];
+    double vx, vy, vx1, vy1;
+    Slice2View( h.X(), h.Y(), &vx, &vy );
+    Slice2View( h1.X(), h1.Y(), &vx1, &vy1 );
     fLine.SetLineColor( colDn );
     fYX->cd();
-    fLine.DrawLine(vx+.1,vy,vx1+.1,vy1);
+    fLine.DrawLine( vx + .1, vy, vx1 + .1, vy1 );
     fZX->cd();
-    fLine.DrawLine(h.Z()+1.,vy,h1.Z()+1.,vy1);
+    fLine.DrawLine( h.Z() + 1., vy, h1.Z() + 1., vy1 );
   }
 }
 
 
-void AliHLTTPCCADisplay::DrawSliceLinks( Int_t colorUp, Int_t colorDn, Int_t width )
+void AliHLTTPCCADisplay::DrawSliceLinks( int colorUp, int colorDn, int width )
 {
-  // draw links between clusters 
+  // draw links between clusters
 
-  for( Int_t iRow=1; iRow<fSlice->Param().NRows()-1; iRow++){
-    const AliHLTTPCCARow& row = fSlice->Row(iRow);
-    for( Int_t ih=0; ih<row.NHits(); ih++ ){
+  for ( int iRow = 1; iRow < fSlice->Param().NRows() - 1; iRow++ ) {
+    const AliHLTTPCCARow& row = fSlice->Row( iRow );
+    for ( int ih = 0; ih < row.NHits(); ih++ ) {
       DrawSliceLink( iRow, ih, colorUp, colorDn, width );
     }
   }
@@ -605,41 +607,41 @@ void AliHLTTPCCADisplay::DrawSliceLinks( Int_t colorUp, Int_t colorDn, Int_t wid
 
 
 
-Int_t AliHLTTPCCADisplay::GetTrackMC( const AliHLTTPCCADisplayTmpHit *vHits, Int_t NHits )
+int AliHLTTPCCADisplay::GetTrackMC( const AliHLTTPCCADisplayTmpHit *vHits, int NHits )
 {
   // get MC label for the track
-  
+
   AliHLTTPCCAGBTracker &tracker = *fGB;
 
-  Int_t label = -1; 
-  Double_t purity = 0;
-  Int_t *lb = new Int_t[NHits*3];
-  Int_t nla=0;
+  int label = -1;
+  double purity = 0;
+  int *lb = new int[NHits*3];
+  int nla = 0;
   //std::cout<<"\n\nTrack hits mc: "<<std::endl;
-  for( Int_t ihit=0; ihit<NHits; ihit++){
+  for ( int ihit = 0; ihit < NHits; ihit++ ) {
     AliHLTTPCCAGBHit &h = tracker.Hits()[vHits[ihit].ID()];
     AliHLTTPCCAPerformance::AliHLTTPCCAHitLabel &l = fPerf->HitLabels()[h.ID()];
-    if(l.fLab[0]>=0 ) lb[nla++]= l.fLab[0];
-    if(l.fLab[1]>=0 ) lb[nla++]= l.fLab[1];
-    if(l.fLab[2]>=0 ) lb[nla++]= l.fLab[2];
+    if ( l.fLab[0] >= 0 ) lb[nla++] = l.fLab[0];
+    if ( l.fLab[1] >= 0 ) lb[nla++] = l.fLab[1];
+    if ( l.fLab[2] >= 0 ) lb[nla++] = l.fLab[2];
     //std::cout<<ihit<<":  "<<l.fLab[0]<<" "<<l.fLab[1]<<" "<<l.fLab[2]<<std::endl;
   }
-  sort( lb, lb+nla );
-  Int_t labmax = -1, labcur=-1, lmax = 0, lcurr=0, nh=0;
+  sort( lb, lb + nla );
+  int labmax = -1, labcur = -1, lmax = 0, lcurr = 0, nh = 0;
   //std::cout<<"MC track IDs :"<<std::endl;
-  for( Int_t i=0; i<nla; i++ ){
-    if( lb[i]!=labcur ){
-      if( 0 && i>0 && lb[i-1]>=0 ){    
-       AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lb[i-1]];
-       std::cout<<lb[i-1]<<": nhits="<<nh<<", pdg="<< mc.PDG()<<", Pt="<<mc.Pt()<<", P="<<mc.P()
-                <<", par="<<mc.Par()[0]<<" "<<mc.Par()[1]<<" "<<mc.Par()[2]
-                <<" "<<mc.Par()[3]<<" "<<mc.Par()[4]<<" "<<mc.Par()[5]<<" "<<mc.Par()[6]<<std::endl;
-       
+  for ( int i = 0; i < nla; i++ ) {
+    if ( lb[i] != labcur ) {
+      if ( 0 && i > 0 && lb[i-1] >= 0 ) {
+        AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lb[i-1]];
+        std::cout << lb[i-1] << ": nhits=" << nh << ", pdg=" << mc.PDG() << ", Pt=" << mc.Pt() << ", P=" << mc.P()
+                  << ", par=" << mc.Par()[0] << " " << mc.Par()[1] << " " << mc.Par()[2]
+                  << " " << mc.Par()[3] << " " << mc.Par()[4] << " " << mc.Par()[5] << " " << mc.Par()[6] << std::endl;
+
       }
-      nh=0;
-      if( labcur>=0 && lmax<lcurr ){
-       lmax = lcurr;
-       labmax = labcur;
+      nh = 0;
+      if ( labcur >= 0 && lmax < lcurr ) {
+        lmax = lcurr;
+        labmax = labcur;
       }
       labcur = lb[i];
       lcurr = 0;
@@ -647,231 +649,231 @@ Int_t AliHLTTPCCADisplay::GetTrackMC( const AliHLTTPCCADisplayTmpHit *vHits, Int
     lcurr++;
     nh++;
   }
-  if( 0 && nla-1>0 && lb[nla-1]>=0 ){  
+  if ( 0 && nla - 1 > 0 && lb[nla-1] >= 0 ) {
     AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lb[nla-1]];
-    std::cout<<lb[nla-1]<<": nhits="<<nh<<", pdg="<< mc.PDG()<<", Pt="<<mc.Pt()<<", P="<<mc.P()
-            <<", par="<<mc.Par()[0]<<" "<<mc.Par()[1]<<" "<<mc.Par()[2]
-            <<" "<<mc.Par()[3]<<" "<<mc.Par()[4]<<" "<<mc.Par()[5]<<" "<<mc.Par()[6]<<std::endl;
-    
+    std::cout << lb[nla-1] << ": nhits=" << nh << ", pdg=" << mc.PDG() << ", Pt=" << mc.Pt() << ", P=" << mc.P()
+              << ", par=" << mc.Par()[0] << " " << mc.Par()[1] << " " << mc.Par()[2]
+              << " " << mc.Par()[3] << " " << mc.Par()[4] << " " << mc.Par()[5] << " " << mc.Par()[6] << std::endl;
+
   }
-  if( labcur>=0 && lmax<lcurr ){
+  if ( labcur >= 0 && lmax < lcurr ) {
     lmax = lcurr;
     labmax = labcur;
   }
   lmax = 0;
-  for( Int_t ihit=0; ihit<NHits; ihit++){
+  for ( int ihit = 0; ihit < NHits; ihit++ ) {
     AliHLTTPCCAGBHit &h = tracker.Hits()[vHits[ihit].ID()];
     AliHLTTPCCAPerformance::AliHLTTPCCAHitLabel &l = fPerf->HitLabels()[h.ID()];
-    if( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax 
-       ) lmax++;
+    if ( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax
+       ) lmax++;
   }
   label = labmax;
-  purity = ( (NHits>0) ?double(lmax)/double(NHits) :0 );
-  if( lb ) delete[] lb;
-  if( purity<.9 ) label = -1;
+  purity = ( ( NHits > 0 ) ? double( lmax ) / double( NHits ) : 0 );
+  if ( lb ) delete[] lb;
+  if ( purity < .9 ) label = -1;
   return label;
 }
 
-Bool_t AliHLTTPCCADisplay::DrawTrack( AliHLTTPCCATrackParam t, Double_t Alpha, const AliHLTTPCCADisplayTmpHit *vHits, 
-                                   Int_t NHits, Int_t color, Int_t width, Bool_t pPoint )
+bool AliHLTTPCCADisplay::DrawTrack( AliHLTTPCCATrackParam t, double Alpha, const AliHLTTPCCADisplayTmpHit *vHits,
+                                      int NHits, int color, int width, bool pPoint )
 {
   // draw track
 
-  if(NHits<2 ) return 0;
+  if ( NHits < 2 ) return 0;
 
   AliHLTTPCCAGBTracker &tracker = *fGB;
-  if( width<0 ) width = 2;
+  if ( width < 0 ) width = 2;
 
-  if(fDrawOnlyRef ){
-    Int_t lab = GetTrackMC(vHits, NHits);
-    if( lab<0 ) return 0;
+  if ( fDrawOnlyRef ) {
+    int lab = GetTrackMC( vHits, NHits );
+    if ( lab < 0 ) return 0;
     AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lab];
-    if(mc.P()<1) return 0;
+    if ( mc.P() < 1 ) return 0;
   }
 
-  if( color < 0 ){
+  if ( color < 0 ) {
     //color = GetColorZ( (vz[0]+vz[mHits-1])/2. );
     //color = GetColorK(t.GetKappa());
-    Int_t lab = GetTrackMC(vHits, NHits);
-    color = GetColor( lab +1 );
-    if( lab>=0 ){
+    int lab = GetTrackMC( vHits, NHits );
+    color = GetColor( lab + 1 );
+    if ( lab >= 0 ) {
       AliHLTTPCCAMCTrack &mc = fPerf->MCTracks()[lab];
-      if( mc.P()>=1. ) color = kRed;   
-    }  
+      if ( mc.P() >= 1. ) color = kRed;
+    }
   }
 
-  if( t.SinPhi()>.999 )  t.SetSinPhi( .999 );
-  else if( t.SinPhi()<-.999 )  t.SetSinPhi( -.999 );
+  if ( t.SinPhi() > .999 )  t.SetSinPhi( .999 );
+  else if ( t.SinPhi() < -.999 )  t.SetSinPhi( -.999 );
 
-  //  Int_t iSlice = fSlice->Param().ISlice();
+  //  int iSlice = fSlice->Param().ISlice();
 
   //sort(vHits, vHits + NHits, AliHLTTPCCADisplayTmpHit::CompareHitZ );
 
-  Double_t vx[2000], vy[2000], vz[2000];
-  Int_t mHits = 0;
+  double vx[2000], vy[2000], vz[2000];
+  int mHits = 0;
 
-  //Int_t oldSlice = -1;
-  Double_t alpha = ( TMath::Abs(Alpha+1)<1.e-4 ) ?fSlice->Param().Alpha() :Alpha;
+  //int oldSlice = -1;
+  double alpha = ( TMath::Abs( Alpha + 1 ) < 1.e-4 ) ? fSlice->Param().Alpha() : Alpha;
   AliHLTTPCCATrackParam tt = t;
 
-  for( Int_t iHit=0; iHit<NHits; iHit++ ){
+  for ( int iHit = 0; iHit < NHits; iHit++ ) {
 
     AliHLTTPCCAGBHit &h = tracker.Hits()[vHits[iHit].ID()];
 
-    Double_t hCos = TMath::Cos( alpha - tracker.Slices()[h.ISlice()].Param().Alpha());
-    Double_t hSin = TMath::Sin( alpha - tracker.Slices()[h.ISlice()].Param().Alpha());
-    Double_t x0=h.X(), y0=h.Y(), z1=h.Z();
-    Double_t x1 = x0*hCos + y0*hSin;
-    Double_t y1 = y0*hCos - x0*hSin;      
+    double hCos = TMath::Cos( alpha - tracker.Slices()[h.ISlice()].Param().Alpha() );
+    double hSin = TMath::Sin( alpha - tracker.Slices()[h.ISlice()].Param().Alpha() );
+    double x0 = h.X(), y0 = h.Y(), z1 = h.Z();
+    double x1 = x0 * hCos + y0 * hSin;
+    double y1 = y0 * hCos - x0 * hSin;
 
     {
-      Double_t dx = x1-tt.X();
-      Double_t dy = y1-tt.Y();
-      if( dx*dx+dy*dy>1. ){
-       Double_t dalpha = TMath::ATan2( dy, dx );
-       if( tt.Rotate(dalpha ) ){
-         alpha+=dalpha;
-         hCos = TMath::Cos( alpha - tracker.Slices()[h.ISlice()].Param().Alpha());
-         hSin = TMath::Sin( alpha - tracker.Slices()[h.ISlice()].Param().Alpha());
-         x1 = x0*hCos + y0*hSin;
-         y1 = y0*hCos - x0*hSin;      
-       }
+      double dx = x1 - tt.X();
+      double dy = y1 - tt.Y();
+      if ( dx*dx + dy*dy > 1. ) {
+        double dalpha = TMath::ATan2( dy, dx );
+        if ( tt.Rotate( dalpha ) ) {
+          alpha += dalpha;
+          hCos = TMath::Cos( alpha - tracker.Slices()[h.ISlice()].Param().Alpha() );
+          hSin = TMath::Sin( alpha - tracker.Slices()[h.ISlice()].Param().Alpha() );
+          x1 = x0 * hCos + y0 * hSin;
+          y1 = y0 * hCos - x0 * hSin;
+        }
       }
     }
     SetSliceTransform( alpha );
 
-    //t.GetDCAPoint( x1, y1, z1, x1, y1, z1 );      
-  std::cout<<"mark 3"<<std::endl;
-    Bool_t ok = tt.TransportToX(x1,.999);
-  std::cout<<"mark 4"<<std::endl;
-  if( 1||ok ){    
+    //t.GetDCAPoint( x1, y1, z1, x1, y1, z1 );
+    std::cout << "mark 3" << std::endl;
+    bool ok = tt.TransportToX( x1, .999 );
+    std::cout << "mark 4" << std::endl;
+    if ( 1 || ok ) {
       x1 = tt.X();
       y1 = tt.Y();
       z1 = tt.Z();
     }
 
-    Slice2View(x1, y1, &x1, &y1 );
+    Slice2View( x1, y1, &x1, &y1 );
     vx[mHits] = x1;
     vy[mHits] = y1;
     vz[mHits] = z1;
     mHits++;
-    for( int j=0; j<0; j++ ){
-      x0=h.X()+j; y0=h.Y(); z1=h.Z();
-      x1 = x0*hCos + y0*hSin;
-      y1 = y0*hCos - x0*hSin;
-      ok = tt.TransportToX(x1,.999);
-      if( ok ){    
-       x1 = tt.X();
-       y1 = tt.Y();
-       z1 = tt.Z();
+    for ( int j = 0; j < 0; j++ ) {
+      x0 = h.X() + j; y0 = h.Y(); z1 = h.Z();
+      x1 = x0 * hCos + y0 * hSin;
+      y1 = y0 * hCos - x0 * hSin;
+      ok = tt.TransportToX( x1, .999 );
+      if ( ok ) {
+        x1 = tt.X();
+        y1 = tt.Y();
+        z1 = tt.Z();
       }
-      
-      Slice2View(x1, y1, &x1, &y1 );
+
+      Slice2View( x1, y1, &x1, &y1 );
       vx[mHits] = x1;
       vy[mHits] = y1;
       vz[mHits] = z1;
       mHits++;
     }
   }
-  if( pPoint ){
-    Double_t x1=t.X(), y1=t.Y(), z1=t.Z();
-    Double_t a = ( TMath::Abs(Alpha+1)<1.e-4 ) ?fSlice->Param().Alpha() :Alpha;
+  if ( pPoint ) {
+    double x1 = t.X(), y1 = t.Y(), z1 = t.Z();
+    double a = ( TMath::Abs( Alpha + 1 ) < 1.e-4 ) ? fSlice->Param().Alpha() : Alpha;
     SetSliceTransform( a );
 
-    Slice2View(x1, y1, &x1, &y1 );
-    Double_t dx = x1 - vx[0];
-    Double_t dy = y1 - vy[0];
+    Slice2View( x1, y1, &x1, &y1 );
+    double dx = x1 - vx[0];
+    double dy = y1 - vy[0];
     //std::cout<<x1<<" "<<y1<<" "<<vx[0]<<" "<<vy[0]<<" "<<dx<<" "<<dy<<std::endl;
-    Double_t d0 = dx*dx + dy*dy;
+    double d0 = dx * dx + dy * dy;
     dx = x1 - vx[mHits-1];
     dy = y1 - vy[mHits-1];
     //std::cout<<x1<<" "<<y1<<" "<<vx[mHits-1]<<" "<<vy[mHits-1]<<" "<<dx<<" "<<dy<<std::endl;
-    Double_t d1 = dx*dx + dy*dy;
+    double d1 = dx * dx + dy * dy;
     //std::cout<<"d0, d1="<<d0<<" "<<d1<<std::endl;
-    if( d1<d0 ){
+    if ( d1 < d0 ) {
       vx[mHits] = x1;
       vy[mHits] = y1;
-      vz[mHits] = z1;   
+      vz[mHits] = z1;
       mHits++;
     } else {
-      for( Int_t i = mHits; i>0; i-- ){
-       vx[i] = vx[i-1];
-       vy[i] = vy[i-1];
-       vz[i] = vz[i-1];
+      for ( int i = mHits; i > 0; i-- ) {
+        vx[i] = vx[i-1];
+        vy[i] = vy[i-1];
+        vz[i] = vz[i-1];
       }
       vx[0] = x1;
       vy[0] = y1;
-      vz[0] = z1;   
+      vz[0] = z1;
       mHits++;
-    }  
+    }
   }
-  
-
-  fLine.SetLineColor(color);
-  fLine.SetLineWidth(width);    
-  fArc.SetFillStyle(0);
-  fArc.SetLineColor(color);    
-  fArc.SetLineWidth(width);        
-  TPolyLine pl;   
-  pl.SetLineColor(color); 
-  pl.SetLineWidth(width);
+
+
+  fLine.SetLineColor( color );
+  fLine.SetLineWidth( width );
+  fArc.SetFillStyle( 0 );
+  fArc.SetLineColor( color );
+  fArc.SetLineWidth( width );
+  TPolyLine pl;
+  pl.SetLineColor( color );
+  pl.SetLineWidth( width );
   TPolyLine plZ;
-  plZ.SetLineColor(color); 
-  plZ.SetLineWidth(width);
-   
-  fMarker.SetMarkerSize(width/2.);
-  fMarker.SetMarkerColor(color);
+  plZ.SetLineColor( color );
+  plZ.SetLineWidth( width );
+
+  fMarker.SetMarkerSize( width / 2. );
+  fMarker.SetMarkerColor( color );
 
   fYX->cd();
-  pl.DrawPolyLine(mHits,vx,vy);
+  pl.DrawPolyLine( mHits, vx, vy );
   {
-    fMarker.DrawMarker(vx[0],vy[0]);
-    fMarker.DrawMarker(vx[mHits-1],vy[mHits-1]);
+    fMarker.DrawMarker( vx[0], vy[0] );
+    fMarker.DrawMarker( vx[mHits-1], vy[mHits-1] );
   }
   fZX->cd();
-  plZ.DrawPolyLine(mHits,vz,vy);
-  fMarker.DrawMarker(vz[0],vy[0]);
-  fMarker.DrawMarker(vz[mHits-1],vy[mHits-1]);
-  
-  fLine.SetLineWidth(1);   
+  plZ.DrawPolyLine( mHits, vz, vy );
+  fMarker.DrawMarker( vz[0], vy[0] );
+  fMarker.DrawMarker( vz[mHits-1], vy[mHits-1] );
+
+  fLine.SetLineWidth( 1 );
   return 1;
 }
 
 
-Bool_t AliHLTTPCCADisplay::DrawTracklet( AliHLTTPCCATrackParam &track, const Int_t *hitstore, Int_t color, Int_t width, Bool_t pPoint )
+bool AliHLTTPCCADisplay::DrawTracklet( AliHLTTPCCATrackParam &track, const int *hitstore, int color, int width, bool pPoint )
 {
   // draw tracklet
   AliHLTTPCCAGBTracker &tracker = *fGB;
   AliHLTTPCCADisplayTmpHit vHits[200];
-  Int_t nHits = 0; 
-  for( Int_t iRow=0; iRow<fSlice->Param().NRows(); iRow++ ){
-    Int_t iHit = hitstore[iRow];
-    if( iHit<0 ) continue;    
-    const AliHLTTPCCARow &row = fSlice->Row(iRow);
-    Int_t id = fSlice->HitInputIDs()[row.FirstHit()+iHit];
-    Int_t iGBHit = tracker.FirstSliceHit()[fSlice->Param().ISlice()]+id;
+  int nHits = 0;
+  for ( int iRow = 0; iRow < fSlice->Param().NRows(); iRow++ ) {
+    int iHit = hitstore[iRow];
+    if ( iHit < 0 ) continue;
+    const AliHLTTPCCARow &row = fSlice->Row( iRow );
+    int id = fSlice->HitInputIDs()[row.FirstHit()+iHit];
+    int iGBHit = tracker.FirstSliceHit()[fSlice->Param().ISlice()] + id;
     AliHLTTPCCAGBHit &h = tracker.Hits()[iGBHit];
     vHits[nHits].SetID( iGBHit );
     vHits[nHits].SetS( 0 );
     vHits[nHits].SetZ( h.Z() );
     nHits++;
   }
-  return DrawTrack( track, -1, vHits, nHits, color,width,pPoint );
+  return DrawTrack( track, -1, vHits, nHits, color, width, pPoint );
 }
 
 
-void AliHLTTPCCADisplay::DrawSliceOutTrack( AliHLTTPCCATrackParam &t, Double_t alpha, Int_t itr, Int_t color, Int_t width )
+void AliHLTTPCCADisplay::DrawSliceOutTrack( AliHLTTPCCATrackParam &t, double alpha, int itr, int color, int width )
 {
   // draw slice track
-  
+
   AliHLTTPCCAOutTrack &track = fSlice->OutTracks()[itr];
-  if( track.NHits()<2 ) return;
+  if ( track.NHits() < 2 ) return;
 
   AliHLTTPCCAGBTracker &tracker = *fGB;
   AliHLTTPCCADisplayTmpHit vHits[200];
 
-  for( Int_t ih=0; ih<track.NHits(); ih++ ){
-    Int_t id = tracker.FirstSliceHit()[fSlice->Param().ISlice()] + fSlice->OutTrackHits()[track.FirstHitRef()+ih];  
+  for ( int ih = 0; ih < track.NHits(); ih++ ) {
+    int id = tracker.FirstSliceHit()[fSlice->Param().ISlice()] + fSlice->OutTrackHits()[track.FirstHitRef()+ih];
     AliHLTTPCCAGBHit &h = tracker.Hits()[id];
     vHits[ih].SetID( id );
     vHits[ih].SetS( 0 );
@@ -881,18 +883,18 @@ void AliHLTTPCCADisplay::DrawSliceOutTrack( AliHLTTPCCATrackParam &t, Double_t a
   DrawTrack( t, alpha, vHits, track.NHits(), color, width, 1 );
 }
 
-void AliHLTTPCCADisplay::DrawSliceOutTrack( Int_t itr, Int_t color, Int_t width )
+void AliHLTTPCCADisplay::DrawSliceOutTrack( int itr, int color, int width )
 {
   // draw slice track
-  
+
   AliHLTTPCCAOutTrack &track = fSlice->OutTracks()[itr];
-  if( track.NHits()<2 ) return;
+  if ( track.NHits() < 2 ) return;
 
   AliHLTTPCCAGBTracker &tracker = *fGB;
   AliHLTTPCCADisplayTmpHit vHits[200];
 
-  for( Int_t ih=0; ih<track.NHits(); ih++ ){
-    Int_t id = tracker.FirstSliceHit()[fSlice->Param().ISlice()] + fSlice->OutTrackHits()[track.FirstHitRef()+ih];  
+  for ( int ih = 0; ih < track.NHits(); ih++ ) {
+    int id = tracker.FirstSliceHit()[fSlice->Param().ISlice()] + fSlice->OutTrackHits()[track.FirstHitRef()+ih];
     AliHLTTPCCAGBHit &h = tracker.Hits()[id];
     vHits[ih].SetID( id );
     vHits[ih].SetS( 0 );
@@ -903,44 +905,44 @@ void AliHLTTPCCADisplay::DrawSliceOutTrack( Int_t itr, Int_t color, Int_t width
 }
 
 
-void AliHLTTPCCADisplay::DrawSliceTrack( Int_t itr, Int_t color )
+void AliHLTTPCCADisplay::DrawSliceTrack( int itr, int color )
 {
   // draw slice track
-  
+
   AliHLTTPCCATrack &track = fSlice->Tracks()[itr];
-  if( track.NHits()<2 ) return;
+  if ( track.NHits() < 2 ) return;
 
   AliHLTTPCCAGBTracker &tracker = *fGB;
-  AliHLTTPCCADisplayTmpHit vHits[200];  
-  for( Int_t ith=0; ith<track.NHits(); ith++ ){
-    Int_t ic = (fSlice->TrackHits()[track.FirstHitID()+ith]);
-    const AliHLTTPCCARow &row = fSlice->ID2Row(ic);
-    Int_t ih = fSlice->ID2IHit(ic);
+  AliHLTTPCCADisplayTmpHit vHits[200];
+  for ( int ith = 0; ith < track.NHits(); ith++ ) {
+    int ic = ( fSlice->TrackHits()[track.FirstHitID()+ith] );
+    const AliHLTTPCCARow &row = fSlice->ID2Row( ic );
+    int ih = fSlice->ID2IHit( ic );
     int id = fSlice->HitInputIDs()[row.FirstHit()+ih];
-    Int_t gbID = tracker.FirstSliceHit()[fSlice->Param().ISlice()] + id;
+    int gbID = tracker.FirstSliceHit()[fSlice->Param().ISlice()] + id;
     AliHLTTPCCAGBHit &h = tracker.Hits()[gbID];
     vHits[ith].SetID( gbID );
     vHits[ith].SetS( 0 );
     vHits[ith].SetZ( h.Z() );
   }
 
-  DrawTrack( track.Param(), -1, vHits, track.NHits(), color,-1 );
+  DrawTrack( track.Param(), -1, vHits, track.NHits(), color, -1 );
   //track.Param().Print();
 }
 
 
-void AliHLTTPCCADisplay::DrawGBTrack( Int_t itr, Int_t color, Int_t width )
+void AliHLTTPCCADisplay::DrawGBTrack( int itr, int color, int width )
 {
   // draw global track
 
   AliHLTTPCCAGBTracker &tracker = *fGB;
   AliHLTTPCCADisplayTmpHit vHits[1000];
-  
+
   AliHLTTPCCAGBTrack &track = tracker.Tracks()[itr];
-  if( track.NHits()<2 ) return;
+  if ( track.NHits() < 2 ) return;
 
-  for( Int_t ih=0; ih<track.NHits(); ih++ ){
-    Int_t i = tracker.TrackHits()[ track.FirstHitRef() + ih];
+  for ( int ih = 0; ih < track.NHits(); ih++ ) {
+    int i = tracker.TrackHits()[ track.FirstHitRef() + ih];
     AliHLTTPCCAGBHit &h = tracker.Hits()[i];
     vHits[ih].SetID( i );
     vHits[ih].SetS( 0 );
@@ -951,142 +953,142 @@ void AliHLTTPCCADisplay::DrawGBTrack( Int_t itr, Int_t color, Int_t width )
 }
 
 
-void AliHLTTPCCADisplay::DrawGBTrackFast( AliHLTTPCCAGBTracker &tracker, Int_t itr, Int_t color )
+void AliHLTTPCCADisplay::DrawGBTrackFast( AliHLTTPCCAGBTracker &tracker, int itr, int color )
 {
   // draw global track
-  
+
   AliHLTTPCCAGBTrack &track = tracker.Tracks()[itr];
-  if( track.NHits()<2 ) return;
-  Int_t width = 1;
+  if ( track.NHits() < 2 ) return;
+  int width = 1;
 
   AliHLTTPCCADisplayTmpHit *vHits = new AliHLTTPCCADisplayTmpHit[track.NHits()];
   AliHLTTPCCATrackParam t = track.Param();
-  
-  for( Int_t ih=0; ih<track.NHits(); ih++ ){
-    Int_t i = tracker.TrackHits()[ track.FirstHitRef() + ih];
-    AliHLTTPCCAGBHit *h = &(tracker.Hits()[i]);
+
+  for ( int ih = 0; ih < track.NHits(); ih++ ) {
+    int i = tracker.TrackHits()[ track.FirstHitRef() + ih];
+    AliHLTTPCCAGBHit *h = &( tracker.Hits()[i] );
     vHits[ih].SetID( i );
     vHits[ih].SetS( 0 );
     vHits[ih].SetZ( h->Z() );
-  }  
+  }
 
-  sort(vHits, vHits + track.NHits(), AliHLTTPCCADisplayTmpHit::CompareHitZ );
-  Int_t colorY = color;
+  sort( vHits, vHits + track.NHits(), AliHLTTPCCADisplayTmpHit::CompareHitZ );
+  int colorY = color;
   {
     AliHLTTPCCAGBHit &h1 = tracker.Hits()[ vHits[0].ID()];
     AliHLTTPCCAGBHit &h2 = tracker.Hits()[ vHits[track.NHits()-1].ID()];
-    if( color<0 ) color = GetColorZ( (h1.Z()+h2.Z())/2. );
-    Double_t gx1, gy1, gx2, gy2;
-    Slice2View(h1.X(), h1.Y(), &gx1, &gy1 );
-    Slice2View(h2.X(), h2.Y(), &gx2, &gy2 );
-    if( colorY<0 ) colorY = GetColorY( (gy1+gy2)/2. );
-    color = colorY = GetColorK(t.GetQPt());
+    if ( color < 0 ) color = GetColorZ( ( h1.Z() + h2.Z() ) / 2. );
+    double gx1, gy1, gx2, gy2;
+    Slice2View( h1.X(), h1.Y(), &gx1, &gy1 );
+    Slice2View( h2.X(), h2.Y(), &gx2, &gy2 );
+    if ( colorY < 0 ) colorY = GetColorY( ( gy1 + gy2 ) / 2. );
+    color = colorY = GetColorK( t.GetQPt() );
   }
 
-  fMarker.SetMarkerColor(color);//kBlue);
-  fMarker.SetMarkerSize(1.);
-  fLine.SetLineColor(color);
-  fLine.SetLineWidth(width);    
-  fArc.SetFillStyle(0);
-  fArc.SetLineColor(color);    
-  fArc.SetLineWidth(width);        
+  fMarker.SetMarkerColor( color );//kBlue);
+  fMarker.SetMarkerSize( 1. );
+  fLine.SetLineColor( color );
+  fLine.SetLineWidth( width );
+  fArc.SetFillStyle( 0 );
+  fArc.SetLineColor( color );
+  fArc.SetLineWidth( width );
   TPolyLine pl;
-  pl.SetLineColor(colorY);
-  pl.SetLineWidth(width);
+  pl.SetLineColor( colorY );
+  pl.SetLineWidth( width );
 
-  Int_t oldSlice = -1;
-  Double_t alpha = track.Alpha();
+  int oldSlice = -1;
+  double alpha = track.Alpha();
   // YX
   {
 
     AliHLTTPCCAGBHit &h1 = tracker.Hits()[vHits[0].ID()];
     AliHLTTPCCAGBHit &h2 = tracker.Hits()[vHits[track.NHits()-1].ID()];
-    Float_t x1, y1, z1, x2, y2, z2;
-    Double_t vx1, vy1, vx2, vy2;
-    
-    if( h1.ISlice() != oldSlice ){
-      t.Rotate( tracker.Slices()[h1.ISlice()].Param().Alpha() - alpha);
+    float x1, y1, z1, x2, y2, z2;
+    double vx1, vy1, vx2, vy2;
+
+    if ( h1.ISlice() != oldSlice ) {
+      t.Rotate( tracker.Slices()[h1.ISlice()].Param().Alpha() - alpha );
       oldSlice = h1.ISlice();
       alpha = tracker.Slices()[h1.ISlice()].Param().Alpha();
-      SetSliceTransform( &(tracker.Slices()[oldSlice]) );
+      SetSliceTransform( &( tracker.Slices()[oldSlice] ) );
     }
-    t.GetDCAPoint( h1.X(), h1.Y(), h1.Z(), x1, y1, z1, fSlice->Param().Bz()  );  
-    Slice2View(x1, y1, &vx1, &vy1 );
+    t.GetDCAPoint( h1.X(), h1.Y(), h1.Z(), x1, y1, z1, fSlice->Param().Bz()  );
+    Slice2View( x1, y1, &vx1, &vy1 );
 
-    if( h2.ISlice() != oldSlice ){
-      t.Rotate( tracker.Slices()[h2.ISlice()].Param().Alpha() - alpha);
+    if ( h2.ISlice() != oldSlice ) {
+      t.Rotate( tracker.Slices()[h2.ISlice()].Param().Alpha() - alpha );
       oldSlice = h2.ISlice();
       alpha = tracker.Slices()[h2.ISlice()].Param().Alpha();
-      SetSliceTransform( &(tracker.Slices()[oldSlice]) );
+      SetSliceTransform( &( tracker.Slices()[oldSlice] ) );
     }
     t.GetDCAPoint( h2.X(), h2.Y(), h2.Z(), x2, y2, z2, fSlice->Param().Bz()  );
-    Slice2View(x2, y2, &vx2, &vy2 );
-    
-    Double_t x0 = t.GetX();
-    Double_t y0 = t.GetY();
-    Double_t sinPhi = t.GetSinPhi();
-    Double_t k = t.GetKappa( fSlice->Param().Bz() );
-    Double_t ex = t.GetCosPhi();
-    Double_t ey = sinPhi;
-    if( TMath::Abs(k)>1.e-4 ){
-      
+    Slice2View( x2, y2, &vx2, &vy2 );
+
+    double x0 = t.GetX();
+    double y0 = t.GetY();
+    double sinPhi = t.GetSinPhi();
+    double k = t.GetKappa( fSlice->Param().Bz() );
+    double ex = t.GetCosPhi();
+    double ey = sinPhi;
+
+    if ( TMath::Abs( k ) > 1.e-4 ) {
+
       fYX->cd();
 
-      Double_t r = 1/TMath::Abs(k);
-      Double_t xc = x0 -ey*(1/k);
-      Double_t yc = y0 +ex*(1/k);
-     
-      Double_t vx, vy;
+      double r = 1 / TMath::Abs( k );
+      double xc = x0 - ey * ( 1 / k );
+      double yc = y0 + ex * ( 1 / k );
+
+      double vx, vy;
       Slice2View( xc, yc, &vx, &vy );
-      
-      Double_t a1 = TMath::ATan2(vy1-vy, vx1-vx)/TMath::Pi()*180.;
-      Double_t a2 = TMath::ATan2(vy2-vy, vx2-vx)/TMath::Pi()*180.;
-      if( a1<0 ) a1+=360;
-      if( a2<0 ) a2+=360;
-      if( a2<a1 ) a2+=360;
-      Double_t da = TMath::Abs(a2-a1);
-      if( da>360 ) da-= 360;
-      if( da>180 ){
-       da = a1;
-       a1 = a2;
-       a2 = da;
-       if( a2<a1 ) a2+=360;    
+
+      double a1 = TMath::ATan2( vy1 - vy, vx1 - vx ) / TMath::Pi() * 180.;
+      double a2 = TMath::ATan2( vy2 - vy, vx2 - vx ) / TMath::Pi() * 180.;
+      if ( a1 < 0 ) a1 += 360;
+      if ( a2 < 0 ) a2 += 360;
+      if ( a2 < a1 ) a2 += 360;
+      double da = TMath::Abs( a2 - a1 );
+      if ( da > 360 ) da -= 360;
+      if ( da > 180 ) {
+        da = a1;
+        a1 = a2;
+        a2 = da;
+        if ( a2 < a1 ) a2 += 360;
       }
-      fArc.DrawArc(vx,vy,r, a1,a2,"only");
+      fArc.DrawArc( vx, vy, r, a1, a2, "only" );
       //fArc.DrawArc(vx,vy,r, 0,360,"only");
-   } else {
+    } else {
       fYX->cd();
-      fLine.DrawLine(vx1,vy1, vx2, vy2 );
+      fLine.DrawLine( vx1, vy1, vx2, vy2 );
     }
   }
 
   // ZX
-  Double_t py[track.NHits()], pz[track.NHits()];
+  double py[track.NHits()], pz[track.NHits()];
 
-  for( Int_t iHit=0; iHit<track.NHits(); iHit++ ){
+  for ( int iHit = 0; iHit < track.NHits(); iHit++ ) {
 
     AliHLTTPCCAGBHit &h1 = tracker.Hits()[vHits[iHit].ID()];
-    Float_t x1, y1, z1;
-    Double_t vx1, vy1;    
-    if( h1.ISlice() != oldSlice ){
-      t.Rotate( tracker.Slices()[h1.ISlice()].Param().Alpha() - alpha);
+    float x1, y1, z1;
+    double vx1, vy1;
+    if ( h1.ISlice() != oldSlice ) {
+      t.Rotate( tracker.Slices()[h1.ISlice()].Param().Alpha() - alpha );
       oldSlice = h1.ISlice();
       alpha = tracker.Slices()[h1.ISlice()].Param().Alpha();
-      SetSliceTransform( &(tracker.Slices()[oldSlice]) );
+      SetSliceTransform( &( tracker.Slices()[oldSlice] ) );
     }
-    t.GetDCAPoint( h1.X(), h1.Y(), h1.Z(), x1, y1, z1, fSlice->Param().Bz()  );  
-    Slice2View(x1, y1, &vx1, &vy1 );
+    t.GetDCAPoint( h1.X(), h1.Y(), h1.Z(), x1, y1, z1, fSlice->Param().Bz()  );
+    Slice2View( x1, y1, &vx1, &vy1 );
     py[iHit] = vy1;
     pz[iHit] = z1;
   }
 
 
   fZX->cd();
-  pl.DrawPolyLine(track.NHits(),pz,py);    
-  
-  fLine.SetLineWidth(1);     
-  delete[] vHits;  
+  pl.DrawPolyLine( track.NHits(), pz, py );
+
+  fLine.SetLineWidth( 1 );
+  delete[] vHits;
 }
 
 
@@ -1094,30 +1096,30 @@ void AliHLTTPCCADisplay::DrawGBTrackFast( AliHLTTPCCAGBTracker &tracker, Int_t i
 
 
 #ifdef XXXX
 
 
 
-void AliHLTTPCCADisplay::DrawMergedHit( Int_t iRow, Int_t iHit, Int_t color )
+
+void AliHLTTPCCADisplay::DrawMergedHit( int iRow, int iHit, int color )
 {
   // connect two cells on display
 
 #ifdef XXX
-  
-  const AliHLTTPCCARow &row = fSlice->Row(iRow);
+
+  const AliHLTTPCCARow &row = fSlice->Row( iRow );
   AliHLTTPCCAHit &h = row.Hits()[iHit];
   AliHLTTPCCAHit &hyz = row.HitsYZ()[iHit];
 
-  Double_t x = row.X();
-  Double_t y = hyz.Y();
-  Double_t z = hyz.Z();
-  Double_t x1 = x, x2 = x;
-  Double_t y1 = y, y2 = y;
-  Double_t z1 = z, z2 = z;
-  Int_t iRow1 = iRow, iHit1 = iHit;
-  Int_t iRow2 = iRow, iHit2 = iHit;
+  double x = row.X();
+  double y = hyz.Y();
+  double z = hyz.Z();
+  double x1 = x, x2 = x;
+  double y1 = y, y2 = y;
+  double z1 = z, z2 = z;
+  int iRow1 = iRow, iHit1 = iHit;
+  int iRow2 = iRow, iHit2 = iHit;
 
-  if( fSlice->HitLinksDown()[]>=0 ){    
+  if ( fSlice->HitLinksDown()[] >= 0 ) {
     iRow1 = iRow - 1;
     iHit1 = h.LinkDown();
     AliHLTTPCCARow &row1 = fSlice->Rows()[iRow1];
@@ -1126,8 +1128,8 @@ void AliHLTTPCCADisplay::DrawMergedHit( Int_t iRow, Int_t iHit, Int_t color )
     y1 = h1.Y();
     z1 = h1.Z();
   }
-  if( h.LinkUp()>=0 ){    
-    iRow2 = iRow+1;
+  if ( h.LinkUp() >= 0 ) {
+    iRow2 = iRow + 1;
     iHit2 = h.LinkUp();
     AliHLTTPCCARow &row2 = fSlice->Rows()[iRow2];
     AliHLTTPCCAHitYZ &h2 = row2.HitsYZ()[iHit2];
@@ -1135,52 +1137,52 @@ void AliHLTTPCCADisplay::DrawMergedHit( Int_t iRow, Int_t iHit, Int_t color )
     y2 = h2.Y();
     z2 = h2.Z();
   }
-  if( color<0 ) color = GetColorZ( (z+z1+z2)/3. );
+  if ( color < 0 ) color = GetColorZ( ( z + z1 + z2 ) / 3. );
 
 
-  Slice2View(x,y, &x, &y );
-  Slice2View(x1,y1, &x1, &y1 );
-  Slice2View(x2,y2, &x2, &y2 );
+  Slice2View( x, y, &x, &y );
+  Slice2View( x1, y1, &x1, &y1 );
+  Slice2View( x2, y2, &x2, &y2 );
 
-  Double_t lx[] = { x1, x, x2 };
-  Double_t ly[] = { y1, y, y2 };
-  Double_t lz[] = { z1, z, z2 };
+  double lx[] = { x1, x, x2 };
+  double ly[] = { y1, y, y2 };
+  double lz[] = { z1, z, z2 };
 
-  fPLine.SetLineColor(color);    
-  fPLine.SetLineWidth(1);        
+  fPLine.SetLineColor( color );
+  fPLine.SetLineWidth( 1 );
   //fPLine.SetFillColor(color);
-  fPLine.SetFillStyle(-1);
+  fPLine.SetFillStyle( -1 );
+
   fYX->cd();
-  fPLine.DrawPolyLine(3, lx, ly );
+  fPLine.DrawPolyLine( 3, lx, ly );
   fZX->cd();
-  fPLine.DrawPolyLine(3, lz, ly );   
+  fPLine.DrawPolyLine( 3, lz, ly );
   DrawHit( iRow, iHit, color );
   DrawHit( iRow1, iHit1, color );
-  DrawHit( iRow2, iHit2, color ); 
+  DrawHit( iRow2, iHit2, color );
 #endif
 }
 
 
-void AliHLTTPCCADisplay::DrawTrack( AliHLTTPCCATrack &track, Int_t color, Bool_t DrawHits )
+void AliHLTTPCCADisplay::DrawTrack( AliHLTTPCCATrack &track, int color, bool DrawHits )
 {
   // draw track
-  
-  if( track.NHits()<2 ) return;
-  Int_t width = 2;
+
+  if ( track.NHits() < 2 ) return;
+  int width = 2;
 
   AliHLTTPCCADisplayTmpHit *vHits = new AliHLTTPCCADisplayTmpHit[track.NHits()];
   AliHLTTPCCATrackParam &t = track.Param();
 
-  Int_t iID = track.FirstHitID();
-  Int_t nhits = 0;
-  { 
-    Int_t iHit = 0;
-    for( Int_t ih=0; ih<track.NHits(); ih++ ){
-      Int_t i = fSlice->TrackHits()[iID];
-      AliHLTTPCCAHit *h = &(fSlice->ID2Hit( i )); 
-      AliHLTTPCCARow &row = fSlice->ID2Row(i);
-      vHits[iHit].ID() = i;    
+  int iID = track.FirstHitID();
+  int nhits = 0;
+  {
+    int iHit = 0;
+    for ( int ih = 0; ih < track.NHits(); ih++ ) {
+      int i = fSlice->TrackHits()[iID];
+      AliHLTTPCCAHit *h = &( fSlice->ID2Hit( i ) );
+      AliHLTTPCCARow &row = fSlice->ID2Row( i );
+      vHits[iHit].ID() = i;
       vHits[iHit].S() = t.GetS( row.X(), h->Y() );
       vHits[iHit].Z() = h->Z();
       iHit++;
@@ -1188,157 +1190,156 @@ void AliHLTTPCCADisplay::DrawTrack( AliHLTTPCCATrack &track, Int_t color, Bool_t
       iID++;
     }
   }
-  sort(vHits, vHits + track.NHits(), AliHLTTPCCADisplayTmpHit::CompareHitZ );
+  sort( vHits, vHits + track.NHits(), AliHLTTPCCADisplayTmpHit::CompareHitZ );
   //cout<<"Draw track, nhits = "<<nhits<<endl;
   {
-    AliHLTTPCCAHit &c1 = fSlice->ID2Hit(vHits[0].ID());
-    AliHLTTPCCAHit &c2 = fSlice->ID2Hit(vHits[track.NHits()-1].ID());
-    if( color<0 ) color = GetColorZ( (c1.Z()+c2.Z())/2. );
+    AliHLTTPCCAHit &c1 = fSlice->ID2Hit( vHits[0].ID() );
+    AliHLTTPCCAHit &c2 = fSlice->ID2Hit( vHits[track.NHits()-1].ID() );
+    if ( color < 0 ) color = GetColorZ( ( c1.Z() + c2.Z() ) / 2. );
   }
-  
-  fMarker.SetMarkerColor(color);//kBlue);
-  fMarker.SetMarkerSize(1.);
+
+  fMarker.SetMarkerColor( color );//kBlue);
+  fMarker.SetMarkerSize( 1. );
   /*
-  for( Int_t i=0; i<3; i++){    
-    AliHLTTPCCAHit &c1 = fSlice->ID2Hit(track.HitID()[i]);    
+  for( int i=0; i<3; i++){
+    AliHLTTPCCAHit &c1 = fSlice->ID2Hit(track.HitID()[i]);
     AliHLTTPCCARow &row1 = fSlice->ID2Row(track.HitID()[i]);
-    Double_t vx1, vy1;
-    Slice2View(row1.X(), c1.Y(), &vx1, &vy1 ); 
+    double vx1, vy1;
+    Slice2View(row1.X(), c1.Y(), &vx1, &vy1 );
     fYX->cd();
     fMarker.DrawMarker(vx1,vy1);
     fZX->cd();
     fMarker.DrawMarker(c1.Z(),vy1);
   }
   */
-  
+
   //DrawTrackletPoint( fSlice->ID2Point(track.PointID()[0]).Param(), kBlack);//color );
   //DrawTrackletPoint( fSlice->ID2Point(track.PointID()[1]).Param(), kBlack);//color );
   //cout<<"DrawTrack end points x = "<<fSlice->ID2Point(track.PointID()[0]).Param().GetX()<<" "<<fSlice->ID2Point(track.PointID()[1]).Param().GetX()<<endl;
-  for( Int_t iHit=0; iHit<track.NHits()-1; iHit++ )
-  {
-    AliHLTTPCCAHit &c1 = fSlice->ID2Hit(vHits[iHit].ID());
-    AliHLTTPCCAHit &c2 = fSlice->ID2Hit(vHits[iHit+1].ID());
-    AliHLTTPCCARow &row1 = fSlice->ID2Row(vHits[iHit].ID());
-    AliHLTTPCCARow &row2 = fSlice->ID2Row(vHits[iHit+1].ID());
-    Float_t x1, y1, z1, x2, y2, z2;    
-    t.GetDCAPoint( row1.X(), c1.Y(), c1.Z(), x1, y1, z1,fSlice->Param().Bz()  );
-    t.GetDCAPoint( row2.X(), c2.Y(), c2.Z(), x2, y2, z2,fSlice->Param().Bz()  );
+  for ( int iHit = 0; iHit < track.NHits() - 1; iHit++ ) {
+    AliHLTTPCCAHit &c1 = fSlice->ID2Hit( vHits[iHit].ID() );
+    AliHLTTPCCAHit &c2 = fSlice->ID2Hit( vHits[iHit+1].ID() );
+    AliHLTTPCCARow &row1 = fSlice->ID2Row( vHits[iHit].ID() );
+    AliHLTTPCCARow &row2 = fSlice->ID2Row( vHits[iHit+1].ID() );
+    float x1, y1, z1, x2, y2, z2;
+    t.GetDCAPoint( row1.X(), c1.Y(), c1.Z(), x1, y1, z1, fSlice->Param().Bz()  );
+    t.GetDCAPoint( row2.X(), c2.Y(), c2.Z(), x2, y2, z2, fSlice->Param().Bz()  );
 
     //if( color<0 ) color = GetColorZ( (z1+z2)/2. );
-    Double_t vx1, vy1, vx2, vy2;
-    Slice2View(x1, y1, &vx1, &vy1 );
-    Slice2View(x2, y2, &vx2, &vy2 );
-    
+    double vx1, vy1, vx2, vy2;
+    Slice2View( x1, y1, &vx1, &vy1 );
+    Slice2View( x2, y2, &vx2, &vy2 );
+
     fLine.SetLineColor( color );
     fLine.SetLineWidth( width );
-    
-    Double_t x0 = t.GetX();
-    Double_t y0 = t.GetY();
-    Double_t sinPhi = t.GetSinPhi();
-    Double_t k = t.GetKappa();
-    Double_t ex = t.GetCosPhi();
-    Double_t ey = sinPhi;
-    if( TMath::Abs(k)>1.e-4 ){
-
-      fArc.SetFillStyle(0);
-      fArc.SetLineColor(color);    
-      fArc.SetLineWidth(width);        
-      
+
+    double x0 = t.GetX();
+    double y0 = t.GetY();
+    double sinPhi = t.GetSinPhi();
+    double k = t.GetKappa();
+    double ex = t.GetCosPhi();
+    double ey = sinPhi;
+
+    if ( TMath::Abs( k ) > 1.e-4 ) {
+
+      fArc.SetFillStyle( 0 );
+      fArc.SetLineColor( color );
+      fArc.SetLineWidth( width );
+
       fYX->cd();
 
-      Double_t r = 1/TMath::Abs(k);
-      Double_t xc = x0 -ey*(1/k);
-      Double_t yc = y0 +ex*(1/k);
-     
-      Double_t vx, vy;
+      double r = 1 / TMath::Abs( k );
+      double xc = x0 - ey * ( 1 / k );
+      double yc = y0 + ex * ( 1 / k );
+
+      double vx, vy;
       Slice2View( xc, yc, &vx, &vy );
-      
-      Double_t a1 = TMath::ATan2(vy1-vy, vx1-vx)/TMath::Pi()*180.;
-      Double_t a2 = TMath::ATan2(vy2-vy, vx2-vx)/TMath::Pi()*180.;
-      if( a1<0 ) a1+=360;
-      if( a2<0 ) a2+=360;
-      if( a2<a1 ) a2+=360;
-      Double_t da = TMath::Abs(a2-a1);
-      if( da>360 ) da-= 360;
-      if( da>180 ){
-       da = a1;
-       a1 = a2;
-       a2 = da;
-       if( a2<a1 ) a2+=360;    
+
+      double a1 = TMath::ATan2( vy1 - vy, vx1 - vx ) / TMath::Pi() * 180.;
+      double a2 = TMath::ATan2( vy2 - vy, vx2 - vx ) / TMath::Pi() * 180.;
+      if ( a1 < 0 ) a1 += 360;
+      if ( a2 < 0 ) a2 += 360;
+      if ( a2 < a1 ) a2 += 360;
+      double da = TMath::Abs( a2 - a1 );
+      if ( da > 360 ) da -= 360;
+      if ( da > 180 ) {
+        da = a1;
+        a1 = a2;
+        a2 = da;
+        if ( a2 < a1 ) a2 += 360;
       }
-      fArc.DrawArc(vx,vy,r, a1,a2,"only");
+      fArc.DrawArc( vx, vy, r, a1, a2, "only" );
       //fArc.DrawArc(vx,vy,r, 0,360,"only");
-   } else {
+    } else {
       fYX->cd();
-      fLine.DrawLine(vx1,vy1, vx2, vy2 );
+      fLine.DrawLine( vx1, vy1, vx2, vy2 );
     }
   }
 
-  for( Int_t iHit=0; iHit<track.NHits()-1; iHit++ ){
-    AliHLTTPCCAHit &c1 = fSlice->ID2Hit(vHits[iHit].ID());
-    AliHLTTPCCAHit &c2 = fSlice->ID2Hit(vHits[iHit+1].ID());
-    AliHLTTPCCARow &row1 = fSlice->ID2Row(vHits[iHit].ID());
-    AliHLTTPCCARow &row2 = fSlice->ID2Row(vHits[iHit+1].ID());
-    
+  for ( int iHit = 0; iHit < track.NHits() - 1; iHit++ ) {
+    AliHLTTPCCAHit &c1 = fSlice->ID2Hit( vHits[iHit].ID() );
+    AliHLTTPCCAHit &c2 = fSlice->ID2Hit( vHits[iHit+1].ID() );
+    AliHLTTPCCARow &row1 = fSlice->ID2Row( vHits[iHit].ID() );
+    AliHLTTPCCARow &row2 = fSlice->ID2Row( vHits[iHit+1].ID() );
+
     //if( DrawHits ) ConnectHits( fSlice->ID2IRow(vHits[iHit].ID()),c1,
     //fSlice->ID2IRow(vHits[iHit+1].ID()),c2, color );
-    Float_t x1, y1, z1, x2, y2, z2;
-    t.GetDCAPoint( row1.X(), c1.Y(), c1.Z(), x1, y1, z1,fSlice->Param().Bz()  );
-    t.GetDCAPoint( row2.X(), c2.Y(), c2.Z(), x2, y2, z2,fSlice->Param().Bz()  );
-
-    Double_t vx1, vy1, vx2, vy2;
-    Slice2View(x1, y1, &vx1, &vy1 );
-    Slice2View(x2, y2, &vx2, &vy2 );
-    
-    fLine.SetLineColor(color);
-    fLine.SetLineWidth(width);    
-    
+    float x1, y1, z1, x2, y2, z2;
+    t.GetDCAPoint( row1.X(), c1.Y(), c1.Z(), x1, y1, z1, fSlice->Param().Bz()  );
+    t.GetDCAPoint( row2.X(), c2.Y(), c2.Z(), x2, y2, z2, fSlice->Param().Bz()  );
+
+    double vx1, vy1, vx2, vy2;
+    Slice2View( x1, y1, &vx1, &vy1 );
+    Slice2View( x2, y2, &vx2, &vy2 );
+
+    fLine.SetLineColor( color );
+    fLine.SetLineWidth( width );
+
     fZX->cd();
-    fLine.DrawLine(z1,vy1, z2, vy2 ); 
+    fLine.DrawLine( z1, vy1, z2, vy2 );
   }
-  fLine.SetLineWidth(1);     
-  delete[] vHits;  
+  fLine.SetLineWidth( 1 );
+  delete[] vHits;
 }
 
 
-void AliHLTTPCCADisplay::DrawTrackletPoint( AliHLTTPCCATrackParam &t, Int_t color )
+void AliHLTTPCCADisplay::DrawTrackletPoint( AliHLTTPCCATrackParam &t, int color )
 {
   // draw tracklet point
 
-  Double_t x = t.GetX();
-  Double_t y = t.GetY();
-  Double_t sinPhi = t.GetSinPhi();
-  Double_t z = t.GetZ();
-  Double_t dzds = t.GetDzDs();
-  Double_t ex = t.GetCosPhi();
-  Double_t ey = sinPhi;
-
-  Int_t width = 1;
-
-  if( color<0 ) color = GetColorZ( t.GetZ() );
-    
-  fMarker.SetMarkerColor(color);
-  fMarker.SetMarkerSize(.5);
-  fLine.SetLineWidth(width);  
-  fLine.SetLineColor(color);
-
-  Double_t vx, vy, vex, vey, vdx, vdy;
-  Double_t dz = TMath::Sqrt(t.GetErr2Z());
-  Slice2View( x, y, &vx, &vy ); 
-  Slice2View( ex, ey, &vex, &vey ); 
-  Slice2View( 0, TMath::Sqrt(t.GetErr2Y())*3.5, &vdx, &vdy);
-  Double_t d = TMath::Sqrt(vex*vex+vey*vey);
-  vex/=d;
-  vey/=d;
+  double x = t.GetX();
+  double y = t.GetY();
+  double sinPhi = t.GetSinPhi();
+  double z = t.GetZ();
+  double dzds = t.GetDzDs();
+  double ex = t.GetCosPhi();
+  double ey = sinPhi;
+
+  int width = 1;
+
+  if ( color < 0 ) color = GetColorZ( t.GetZ() );
+
+  fMarker.SetMarkerColor( color );
+  fMarker.SetMarkerSize( .5 );
+  fLine.SetLineWidth( width );
+  fLine.SetLineColor( color );
+
+  double vx, vy, vex, vey, vdx, vdy;
+  double dz = TMath::Sqrt( t.GetErr2Z() );
+  Slice2View( x, y, &vx, &vy );
+  Slice2View( ex, ey, &vex, &vey );
+  Slice2View( 0, TMath::Sqrt( t.GetErr2Y() )*3.5, &vdx, &vdy );
+  double d = TMath::Sqrt( vex * vex + vey * vey );
+  vex /= d;
+  vey /= d;
   fYX->cd();
-  fMarker.DrawMarker(vx,vy);
-  fLine.DrawLine(vx,vy,vx+vex*4, vy+vey*4);
-  fLine.DrawLine(vx-vdx,vy-vdy, vx+vdx, vy+vdy );
+  fMarker.DrawMarker( vx, vy );
+  fLine.DrawLine( vx, vy, vx + vex*4, vy + vey*4 );
+  fLine.DrawLine( vx - vdx, vy - vdy, vx + vdx, vy + vdy );
   fZX->cd();
-  fMarker.DrawMarker(z,vy);
-  fLine.DrawLine(z,vy,z+dzds*4, vy+vey*4);
-  fLine.DrawLine(z-3.5*dz,vy-vdy, z+3.5*dz, vy+vdy ); 
-  fLine.SetLineWidth(1);
+  fMarker.DrawMarker( z, vy );
+  fLine.DrawLine( z, vy, z + dzds*4, vy + vey*4 );
+  fLine.DrawLine( z - 3.5*dz, vy - vdy, z + 3.5*dz, vy + vdy );
+  fLine.SetLineWidth( 1 );
 }
 #endif //XXXX
index 75fa0d8c8ce1f90f763130594525553df9b2be1f..4b9e7402de341cc035332c3b8841f50f44334fe7 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 //  *************************************************************************
-//  This file is property of and copyright by the ALICE HLT Project         * 
+//  This file is property of and copyright by the ALICE HLT Project         *
 //  ALICE Experiment at CERN, All rights reserved.                          *
 //  See cxx source for full Copyright notice                                *
 //                                                                          *
@@ -36,92 +36,92 @@ class TCanvas;
 class AliHLTTPCCADisplay
 {
 
- public:
-  
-  class AliHLTTPCCADisplayTmpHit;
-
-  static AliHLTTPCCADisplay &Instance();
-  
-  AliHLTTPCCADisplay();
-  AliHLTTPCCADisplay( const AliHLTTPCCADisplay& );
-  const AliHLTTPCCADisplay& operator=(const AliHLTTPCCADisplay&) const ;
-
-  virtual ~AliHLTTPCCADisplay();
-
-  void Init();
-  void Update();
-  void ClearView();
-  void Ask();
-  void SetSliceView();
-  void SetTPCView();
-  void SetCurrentSlice( AliHLTTPCCATracker *slice ); 
-  void SetGB( AliHLTTPCCAGBTracker * const GBTracker );   
-  void Set2Slices( AliHLTTPCCATracker * const slice );
-
-  Int_t GetColor( Int_t i ) const;
-  Int_t GetColorZ( Double_t z ) const ;
-  Int_t GetColorY( Double_t y ) const ;
-  Int_t GetColorK( Double_t k ) const ;
-  void Global2View( Double_t x, Double_t y, Double_t *xv, Double_t *yv ) const ;
-  void Slice2View( Double_t x, Double_t y, Double_t *xv, Double_t *yv ) const ;
-  Int_t GetTrackMC( const AliHLTTPCCADisplayTmpHit *vHits, Int_t NHits );
-
-  void DrawTPC();
-  void DrawSlice( AliHLTTPCCATracker *slice, Bool_t DrawRows=0 ); 
-  void DrawSliceOutTrack( Int_t itr, Int_t color=-1, Int_t width = -1  );
-  void DrawSliceOutTrack( AliHLTTPCCATrackParam &t, Double_t Alpha, Int_t itr, Int_t color=-1, Int_t width = -1  );
-  void DrawSliceTrack( Int_t itr, Int_t color=-1);
-  Bool_t DrawTrack( AliHLTTPCCATrackParam t, Double_t Alpha, const AliHLTTPCCADisplayTmpHit *vHits, 
-                   Int_t NHits, Int_t color=-1, Int_t width=-1, Bool_t pPoint=0 );
-
-  void DrawGBTrack( Int_t itr, Int_t color=-1, Int_t width=-1 );
-  void DrawGBTrackFast( AliHLTTPCCAGBTracker &tracker, Int_t itr, Int_t color=-1 );
-  Bool_t DrawTracklet( AliHLTTPCCATrackParam &track, const Int_t *hitstore, Int_t color=-1, Int_t width=-1, Bool_t pPoint=0 );
-  void DrawGBHit( AliHLTTPCCAGBTracker &tracker, Int_t iHit, Int_t color=-1, Size_t width =-1 );
-  void DrawGBHits( AliHLTTPCCAGBTracker &tracker, Int_t color=-1, Size_t width =-1 );
-
-  void DrawSliceHit( Int_t iRow,Int_t iHit, Int_t color=-1, Size_t width=-1 );
-  void DrawSliceHits(Int_t color=-1, Size_t width=-1 );
-  void DrawSliceLinks(Int_t colorUp=-1, Int_t colorDn=-1,Int_t width=-1 );
-  void DrawSliceLink(Int_t iRow, Int_t iHit, Int_t colorUp=-1, Int_t colorDn=-1,Int_t width=-1 );
 public:
+
+    class AliHLTTPCCADisplayTmpHit;
+
+    static AliHLTTPCCADisplay &Instance();
+
+    AliHLTTPCCADisplay();
+    AliHLTTPCCADisplay( const AliHLTTPCCADisplay& );
+    const AliHLTTPCCADisplay& operator=( const AliHLTTPCCADisplay& ) const ;
+
+    virtual ~AliHLTTPCCADisplay();
+
+    void Init();
+    void Update();
+    void ClearView();
+    void Ask();
+    void SetSliceView();
+    void SetTPCView();
+    void SetCurrentSlice( AliHLTTPCCATracker *slice );
+    void SetGB( AliHLTTPCCAGBTracker * const GBTracker );
+    void Set2Slices( AliHLTTPCCATracker * const slice );
+
+    int GetColor( int i ) const;
+    int GetColorZ( double z ) const ;
+    int GetColorY( double y ) const ;
+    int GetColorK( double k ) const ;
+    void Global2View( double x, double y, double *xv, double *yv ) const ;
+    void Slice2View( double x, double y, double *xv, double *yv ) const ;
+    int GetTrackMC( const AliHLTTPCCADisplayTmpHit *vHits, int NHits );
+
+    void DrawTPC();
+    void DrawSlice( AliHLTTPCCATracker *slice, bool DrawRows = 0 );
+    void DrawSliceOutTrack( int itr, int color = -1, int width = -1  );
+    void DrawSliceOutTrack( AliHLTTPCCATrackParam &t, double Alpha, int itr, int color = -1, int width = -1  );
+    void DrawSliceTrack( int itr, int color = -1 );
+    bool DrawTrack( AliHLTTPCCATrackParam t, double Alpha, const AliHLTTPCCADisplayTmpHit *vHits,
+                      int NHits, int color = -1, int width = -1, bool pPoint = 0 );
+
+    void DrawGBTrack( int itr, int color = -1, int width = -1 );
+    void DrawGBTrackFast( AliHLTTPCCAGBTracker &tracker, int itr, int color = -1 );
+    bool DrawTracklet( AliHLTTPCCATrackParam &track, const int *hitstore, int color = -1, int width = -1, bool pPoint = 0 );
+
+    void DrawGBHit( AliHLTTPCCAGBTracker &tracker, int iHit, int color = -1, Size_t width = -1 );
+    void DrawGBHits( AliHLTTPCCAGBTracker &tracker, int color = -1, Size_t width = -1 );
+
+    void DrawSliceHit( int iRow, int iHit, int color = -1, Size_t width = -1 );
+    void DrawSliceHits( int color = -1, Size_t width = -1 );
+    void DrawSliceLinks( int colorUp = -1, int colorDn = -1, int width = -1 );
+    void DrawSliceLink( int iRow, int iHit, int colorUp = -1, int colorDn = -1, int width = -1 );
 
 #ifdef XXXX
 
-  void DrawMergedHit( Int_t iRow, Int_t iHit, Int_t color=-1 );
+    void DrawMergedHit( int iRow, int iHit, int color = -1 );
 
-  void DrawTrack( AliHLTTPCCATrack &track, Int_t color=-1, Bool_t DrawCells=1 );
-  void DrawTrackletPoint( AliHLTTPCCATrackParam &t, Int_t color=-1 );
+    void DrawTrack( AliHLTTPCCATrack &track, int color = -1, bool DrawCells = 1 );
+    void DrawTrackletPoint( AliHLTTPCCATrackParam &t, int color = -1 );
 #endif // XXXX
 
-  void SetSliceTransform( Double_t alpha );
+    void SetSliceTransform( double alpha );
 
-  void SetSliceTransform( AliHLTTPCCATracker *slice );
+    void SetSliceTransform( AliHLTTPCCATracker *slice );
 
-  TCanvas *CanvasYX() const { return fYX; }
-  TCanvas *CanvasZX() const { return fZX; }
+    TCanvas *CanvasYX() const { return fYX; }
+    TCanvas *CanvasZX() const { return fZX; }
 
- protected:
 protected:
 
-  TCanvas *fYX, *fZX;               // two views
-  Bool_t fAsk;                      // flag to ask for the pressing key
-  Bool_t fSliceView;               // switch between slice/TPC zoom
-  AliHLTTPCCATracker *fSlice;      // current CA tracker, includes slice geometry
-  AliHLTTPCCAGBTracker *fGB;      // the global tracker
-  AliHLTTPCCAPerformance *fPerf; // Performance class (mc labels etc)
-  Double_t fCos, fSin, fZMin, fZMax, fYMin, fYMax;// view parameters
-  Double_t fSliceCos, fSliceSin;        // current slice angle
-  Double_t fRInnerMin, fRInnerMax, fROuterMin, fROuterMax,fTPCZMin, fTPCZMax; // view parameters
+    TCanvas *fYX, *fZX;               // two views
+    bool fAsk;                      // flag to ask for the pressing key
+    bool fSliceView;               // switch between slice/TPC zoom
+    AliHLTTPCCATracker *fSlice;      // current CA tracker, includes slice geometry
+    AliHLTTPCCAGBTracker *fGB;      // the global tracker
+    AliHLTTPCCAPerformance *fPerf; // Performance class (mc labels etc)
+    double fCos, fSin, fZMin, fZMax, fYMin, fYMax;// view parameters
+    double fSliceCos, fSliceSin;        // current slice angle
+    double fRInnerMin, fRInnerMax, fROuterMin, fROuterMax, fTPCZMin, fTPCZMax; // view parameters
 
-  TArc fArc;       // parameters of drawing objects are copied from this members
-  TLine fLine;     //!
-  TPolyLine fPLine;//!
-  TMarker fMarker; //!
-  TBox fBox;       //!
-  TCrown fCrown;   //!
-  TLatex fLatex;   //!
+    TArc fArc;       // parameters of drawing objects are copied from this members
+    TLine fLine;     //!
+    TPolyLine fPLine;//!
+    TMarker fMarker; //!
+    TBox fBox;       //!
+    TCrown fCrown;   //!
+    TLatex fLatex;   //!
 
-  Bool_t fDrawOnlyRef; // draw only clusters from ref. mc tracks
+    bool fDrawOnlyRef; // draw only clusters from ref. mc tracks
 
 };
 
index 9519cf5ec64d9f51de3c846f322323aee6258005..300b80b7e71e4e24c38d5c2ebb2a2ca80340da8c 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 
 //ClassImp(AliHLTTPCCAGBHit)
 
-Bool_t AliHLTTPCCAGBHit::Compare(const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b)
+bool AliHLTTPCCAGBHit::Compare( const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b )
 {
   //* Comparison function for sorting hits
-  if( a.fISlice<b.fISlice ) return 1;
-  if( a.fISlice>b.fISlice ) return 0;
-  if( a.fIRow<b.fIRow ) return 1;
-  if( a.fIRow>b.fIRow ) return 0;
-  return (a.fZ < b.fZ);
+  if ( a.fISlice < b.fISlice ) return 1;
+  if ( a.fISlice > b.fISlice ) return 0;
+  if ( a.fIRow < b.fIRow ) return 1;
+  if ( a.fIRow > b.fIRow ) return 0;
+  return ( a.fZ < b.fZ );
 }
index 495d7da2da13220edb4e016482280352843dfc58..687e062e77697db63efbc57a147290396c134958 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAGBHit
 {
- public:
-  AliHLTTPCCAGBHit()
-    :fX(0),fY(0),fZ(0),fErrX(0),fErrY(0),fErrZ(0),fAmp(0),
-    fISlice(0), fIRow(0), fID(0), fIsUsed(0){}
-
-  virtual ~AliHLTTPCCAGBHit(){}
-
-  Float_t X() const { return fX; }
-  Float_t Y() const { return fY; } 
-  Float_t Z() const { return fZ; } 
-
-  Float_t ErrX() const { return fErrX; }
-  Float_t ErrY() const { return fErrY; }
-  Float_t ErrZ() const { return fErrZ; }
-  Float_t Amp()  const { return fAmp; }
-
-  Int_t ISlice() const { return fISlice; }
-  Int_t IRow() const { return fIRow; }
-  Int_t ID() const { return fID; }
-  Bool_t IsUsed() const { return fIsUsed; };
-
-  void SetX( Float_t v ){  fX = v; }
-  void SetY( Float_t v ){  fY = v; } 
-  void SetZ( Float_t v ){  fZ = v; } 
-  void SetErrX( Float_t v ){  fErrX = v; }
-  void SetErrY( Float_t v ){  fErrY = v; }
-  void SetErrZ( Float_t v ){  fErrZ = v; }
-  void SetAmp( Float_t v ) {  fAmp = v; }
-  void SetISlice( Int_t v ){  fISlice = v; }
-  void SetIRow( Int_t v ){  fIRow = v; }
-  void SetID( Int_t v ){  fID = v; }
-  void SetIsUsed( Bool_t v ){  fIsUsed = v; };
-
-  static Bool_t Compare(const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b);
-
-  static Bool_t CompareRowDown(const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b){
-    return ( a.fIRow>b.fIRow );
-  }
-  static Bool_t ComparePRowDown(const AliHLTTPCCAGBHit *a, const AliHLTTPCCAGBHit *b){
-    return ( a->fIRow>b->fIRow );
-  }
-
- protected:
-
-  Float_t fX; //* X position
-  Float_t fY; //* Y position
-  Float_t fZ; //* Z position
-
-  Float_t fErrX; //* X position error
-  Float_t fErrY; //* Y position error
-  Float_t fErrZ; //* Z position error
-
-  Float_t fAmp;   //* Maximal amplitude
-  Int_t fISlice; //* slice number
-  Int_t fIRow;   //* row number
-  Int_t fID;     //* external ID (id of AliTPCcluster) 
-  Bool_t fIsUsed; //* is used by GBTracks
-
-  //ClassDef(AliHLTTPCCAGBHit,1);
 public:
+    AliHLTTPCCAGBHit()
+        : fX( 0 ), fY( 0 ), fZ( 0 ), fErrX( 0 ), fErrY( 0 ), fErrZ( 0 ), fAmp( 0 ),
+        fISlice( 0 ), fIRow( 0 ), fID( 0 ), fIsUsed( 0 ) {}
+
+    virtual ~AliHLTTPCCAGBHit() {}
+
+    float X() const { return fX; }
+    float Y() const { return fY; }
+    float Z() const { return fZ; }
+
+    float ErrX() const { return fErrX; }
+    float ErrY() const { return fErrY; }
+    float ErrZ() const { return fErrZ; }
+    float Amp()  const { return fAmp; }
+
+    int ISlice() const { return fISlice; }
+    int IRow() const { return fIRow; }
+    int ID() const { return fID; }
+    bool IsUsed() const { return fIsUsed; };
+
+    void SetX( float v ) {  fX = v; }
+    void SetY( float v ) {  fY = v; }
+    void SetZ( float v ) {  fZ = v; }
+    void SetErrX( float v ) {  fErrX = v; }
+    void SetErrY( float v ) {  fErrY = v; }
+    void SetErrZ( float v ) {  fErrZ = v; }
+    void SetAmp( float v ) {  fAmp = v; }
+    void SetISlice( int v ) {  fISlice = v; }
+    void SetIRow( int v ) {  fIRow = v; }
+    void SetID( int v ) {  fID = v; }
+    void SetIsUsed( bool v ) {  fIsUsed = v; };
+
+    static bool Compare( const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b );
+
+    static bool CompareRowDown( const AliHLTTPCCAGBHit &a, const AliHLTTPCCAGBHit &b ) {
+      return ( a.fIRow > b.fIRow );
+    }
+    static bool ComparePRowDown( const AliHLTTPCCAGBHit *a, const AliHLTTPCCAGBHit *b ) {
+      return ( a->fIRow > b->fIRow );
+    }
+
 protected:
+
+    float fX; //* X position
+    float fY; //* Y position
+    float fZ; //* Z position
+
+    float fErrX; //* X position error
+    float fErrY; //* Y position error
+    float fErrZ; //* Z position error
+
+    float fAmp;   //* Maximal amplitude
+    int fISlice; //* slice number
+    int fIRow;   //* row number
+    int fID;     //* external ID (id of AliTPCcluster)
+    bool fIsUsed; //* is used by GBTracks
+
+    //ClassDef(AliHLTTPCCAGBHit,1);
 
 };
 
index 978475e29bd625e128efe74ed0e5ac43437e0cc4..bff6027034973a5c1f5e2dde8d7d35f9ef37dc79 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
@@ -21,9 +21,9 @@
 
 #include "AliHLTTPCCAGBTrack.h"
 
-ClassImp(AliHLTTPCCAGBTrack)
+ClassImp( AliHLTTPCCAGBTrack )
+
 void AliHLTTPCCAGBTrack::Dummy() const
-{ 
+{
   //* do nothing
 }
index 8ad0d4676b25df983b423150bd5c9aac87488aa5..f60dc6c6893c7f65b3dceb5b720276df5f5ae363 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAGBTrack
 {
- public:
 public:
 
-  AliHLTTPCCAGBTrack():fFirstHitRef(0),fNHits(0),fParam(),fAlpha(0),fDeDx(0){ ; }
-  virtual ~AliHLTTPCCAGBTrack(){ ; }
+    AliHLTTPCCAGBTrack(): fFirstHitRef( 0 ), fNHits( 0 ), fParam(), fAlpha( 0 ), fDeDx( 0 ) { ; }
+    virtual ~AliHLTTPCCAGBTrack() { ; }
 
-  Int_t NHits()               const { return fNHits; }
-  Int_t FirstHitRef()         const { return fFirstHitRef; }
-  const AliHLTTPCCATrackParam &Param() const { return fParam; }
-  Float_t Alpha()            const { return fAlpha; }
-  Float_t DeDx()             const { return fDeDx; } 
+    int NHits()               const { return fNHits; }
+    int FirstHitRef()         const { return fFirstHitRef; }
+    const AliHLTTPCCATrackParam &Param() const { return fParam; }
+    float Alpha()            const { return fAlpha; }
+    float DeDx()             const { return fDeDx; }
 
 
-  void SetNHits( Int_t v )                 {  fNHits = v; }
-  void SetFirstHitRef( Int_t v )           {  fFirstHitRef = v; }
-  void SetParam( const AliHLTTPCCATrackParam &v ) {  fParam = v; }
-  void SetAlpha( Float_t v )               {  fAlpha = v; }
-  void SetDeDx( Float_t v )                {  fDeDx = v; } 
+    void SetNHits( int v )                 {  fNHits = v; }
+    void SetFirstHitRef( int v )           {  fFirstHitRef = v; }
+    void SetParam( const AliHLTTPCCATrackParam &v ) {  fParam = v; }
+    void SetAlpha( float v )               {  fAlpha = v; }
+    void SetDeDx( float v )                {  fDeDx = v; }
 
 
-  static Bool_t ComparePNClusters( const AliHLTTPCCAGBTrack *a, const AliHLTTPCCAGBTrack *b){
-    return (a->fNHits > b->fNHits);
-  }
+    static bool ComparePNClusters( const AliHLTTPCCAGBTrack *a, const AliHLTTPCCAGBTrack *b ) {
+      return ( a->fNHits > b->fNHits );
+    }
 
- protected:
-  
-  Int_t fFirstHitRef;        // index of the first hit reference in track->hit reference array
-  Int_t fNHits;              // number of track hits
-  AliHLTTPCCATrackParam fParam;// fitted track parameters
-  Float_t fAlpha;             //* Alpha angle of the parametrerisation
-  Float_t fDeDx;              //* DE/DX 
+  protected:
 
- private:
+    int fFirstHitRef;        // index of the first hit reference in track->hit reference array
+    int fNHits;              // number of track hits
+    AliHLTTPCCATrackParam fParam;// fitted track parameters
+    float fAlpha;             //* Alpha angle of the parametrerisation
+    float fDeDx;              //* DE/DX
 
-  void Dummy() const; // to make rulechecker happy by having something in .cxx file
+  private:
 
-  ClassDef(AliHLTTPCCAGBTrack,1)
+    void Dummy() const; // to make rulechecker happy by having something in .cxx file
+
+    ClassDef( AliHLTTPCCAGBTrack, 1 )
 };
 
 
index b93889c8e7157d4c8fe6ff1f5a7b4dd7de248f1a..f9ef1dd96ab55870cf38160e6fe0dadafea4621c 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 
 
 AliHLTTPCCAGBTracker::AliHLTTPCCAGBTracker()
-  :
-    fSlices(0), 
-    fNSlices(0), 
-    fHits(0),
-    fExt2IntHitID(0),
-    fNHits(0),
-    fTrackHits(0), 
-    fTracks(0), 
-    fNTracks(0),
-    fMerger(0),    
-    fTime(0),
-    fStatNEvents(0),
-    fSliceTrackerTime(0)
+    :
+    fSlices( 0 ),
+    fNSlices( 0 ),
+    fHits( 0 ),
+    fExt2IntHitID( 0 ),
+    fNHits( 0 ),
+    fTrackHits( 0 ),
+    fTracks( 0 ),
+    fNTracks( 0 ),
+    fMerger( 0 ),
+    fTime( 0 ),
+    fStatNEvents( 0 ),
+    fSliceTrackerTime( 0 )
 {
   //* constructor
-  for( Int_t i=0; i<20; i++ ) fStatTime[i] = 0;
+  for ( int i = 0; i < 20; i++ ) fStatTime[i] = 0;
   fMerger = new AliHLTTPCCAMerger;
 }
 
-AliHLTTPCCAGBTracker::AliHLTTPCCAGBTracker(const AliHLTTPCCAGBTracker&)
-  : 
-    fSlices(0), 
-    fNSlices(0), 
-    fHits(0),
-    fExt2IntHitID(0),
-    fNHits(0),
-    fTrackHits(0), 
-    fTracks(0), 
-    fNTracks(0),
-    fMerger(0),
-    fTime(0),
-    fStatNEvents(0),
-    fSliceTrackerTime(0)
+AliHLTTPCCAGBTracker::AliHLTTPCCAGBTracker( const AliHLTTPCCAGBTracker& )
+    :
+    fSlices( 0 ),
+    fNSlices( 0 ),
+    fHits( 0 ),
+    fExt2IntHitID( 0 ),
+    fNHits( 0 ),
+    fTrackHits( 0 ),
+    fTracks( 0 ),
+    fNTracks( 0 ),
+    fMerger( 0 ),
+    fTime( 0 ),
+    fStatNEvents( 0 ),
+    fSliceTrackerTime( 0 )
 {
   //* dummy
 }
 
-const AliHLTTPCCAGBTracker &AliHLTTPCCAGBTracker::operator=(const AliHLTTPCCAGBTracker&) const
+const AliHLTTPCCAGBTracker &AliHLTTPCCAGBTracker::operator=( const AliHLTTPCCAGBTracker& ) const
 {
   //* dummy
   return *this;
@@ -86,59 +86,59 @@ AliHLTTPCCAGBTracker::~AliHLTTPCCAGBTracker()
 {
   //* destructor
   StartEvent();
-  if( fSlices ) delete[] fSlices;
-  fSlices=0;
+  if ( fSlices ) delete[] fSlices;
+  fSlices = 0;
   delete fMerger;
 }
 
-void AliHLTTPCCAGBTracker::SetNSlices( Int_t N )
+void AliHLTTPCCAGBTracker::SetNSlices( int N )
 {
   //* set N of slices
   StartEvent();
   fNSlices = N;
-  if( fSlices ) delete[] fSlices;
-  fSlices=0;
+  if ( fSlices ) delete[] fSlices;
+  fSlices = 0;
   fSlices = new AliHLTTPCCATracker[N];
 }
 
 void AliHLTTPCCAGBTracker::StartEvent()
 {
   //* clean up track and hit arrays
-  if( fTrackHits ) delete[] fTrackHits;
+  if ( fTrackHits ) delete[] fTrackHits;
   fTrackHits = 0;
-  if( fTracks ) delete[] fTracks;
+  if ( fTracks ) delete[] fTracks;
   fTracks = 0;
-  if( fHits ) delete[] fHits;
-  fHits=0;
-  if( fExt2IntHitID ) delete[] fExt2IntHitID;
+  if ( fHits ) delete[] fHits;
+  fHits = 0;
+  if ( fExt2IntHitID ) delete[] fExt2IntHitID;
   fExt2IntHitID = 0;
   fNHits = 0;
   fNTracks = 0;
-  for( Int_t i=0; i<fNSlices; i++) fSlices[i].StartEvent();
+  for ( int i = 0; i < fNSlices; i++ ) fSlices[i].StartEvent();
 }
 
 
-void AliHLTTPCCAGBTracker::SetNHits( Int_t nHits )
+void AliHLTTPCCAGBTracker::SetNHits( int nHits )
 {
   //* set the number of hits
-  if( fHits ) delete[] fHits;
+  if ( fHits ) delete[] fHits;
   fHits = 0;
-  if( fExt2IntHitID ) delete[] fExt2IntHitID;
+  if ( fExt2IntHitID ) delete[] fExt2IntHitID;
   fExt2IntHitID = 0;
   fHits = new AliHLTTPCCAGBHit[ nHits ];
-  fExt2IntHitID = new Int_t[ nHits ];
+  fExt2IntHitID = new int[ nHits ];
   fNHits = 0;
-}  
+}
 
-void AliHLTTPCCAGBTracker::ReadHit( Float_t x, Float_t y, Float_t z, 
-                                   Float_t errY, Float_t errZ, Float_t amp,
-                                   Int_t ID, Int_t iSlice, Int_t iRow )
+void AliHLTTPCCAGBTracker::ReadHit( float x, float y, float z,
+                                    float errY, float errZ, float amp,
+                                    int ID, int iSlice, int iRow )
 {
   //* read the hit to local array
   AliHLTTPCCAGBHit &hit = fHits[fNHits];
   hit.SetX( x );
   hit.SetY( y );
-  hit.SetZ( z );  
+  hit.SetZ( z );
   hit.SetErrX( 1.e-4 );//fSlices[iSlice].Param().ErrX();
   hit.SetErrY( errY );
   hit.SetErrZ( errZ );
@@ -147,91 +147,91 @@ void AliHLTTPCCAGBTracker::ReadHit( Float_t x, Float_t y, Float_t z,
   hit.SetISlice( iSlice );
   hit.SetIRow( iRow );
   hit.SetIsUsed( 0 );
-  fNHits++;  
+  fNHits++;
 }
 
 void AliHLTTPCCAGBTracker::FindTracks()
 {
   //* main tracking routine
   fTime = 0;
-  fStatNEvents++;  
+  fStatNEvents++;
 
 #ifdef DRAW
-  AliHLTTPCCADisplay::Instance().SetGB(this);
+  AliHLTTPCCADisplay::Instance().SetGB( this );
   AliHLTTPCCADisplay::Instance().SetTPCView();
   AliHLTTPCCADisplay::Instance().DrawTPC();
   AliHLTTPCCADisplay::Instance().Ask();
 #endif //DRAW  
 
-  
-  std::sort(fHits,fHits+fNHits, AliHLTTPCCAGBHit::Compare );  
 
-  for( Int_t i=0; i<fNHits; i++ )  fExt2IntHitID[fHits[i].ID()] = i;
+  std::sort( fHits, fHits + fNHits, AliHLTTPCCAGBHit::Compare );
+
+  for ( int i = 0; i < fNHits; i++ )  fExt2IntHitID[fHits[i].ID()] = i;
 
   // Read hits, row by row
 
-  Int_t nHitsTotal = fNHits;
-  Float_t *hitX = new Float_t [nHitsTotal];
-  Float_t *hitY = new Float_t [nHitsTotal];
-  Float_t *hitZ = new Float_t [nHitsTotal];
+  int nHitsTotal = fNHits;
+  float *hitX = new float [nHitsTotal];
+  float *hitY = new float [nHitsTotal];
+  float *hitZ = new float [nHitsTotal];
 
-  Int_t *sliceNHits = new Int_t[ fNSlices ];
-  Int_t **rowNHits = new Int_t* [fNSlices];
-  for( Int_t i=0; i<fNSlices; i++ ) rowNHits[i] = new Int_t[200];
+  int *sliceNHits = new int[ fNSlices ];
+  int **rowNHits = new int* [fNSlices];
+  for ( int i = 0; i < fNSlices; i++ ) rowNHits[i] = new int[200];
 
-  for( Int_t is=0; is<fNSlices; is++ ){
+  for ( int is = 0; is < fNSlices; is++ ) {
     sliceNHits[is] = 0;
-    for( Int_t ir=0; ir<200; ir++ ) rowNHits[is][ir] = 0;    
+    for ( int ir = 0; ir < 200; ir++ ) rowNHits[is][ir] = 0;
   }
 
-  for( Int_t ih=0; ih<nHitsTotal; ih++){
-    AliHLTTPCCAGBHit &h = fHits[ih];    
+  for ( int ih = 0; ih < nHitsTotal; ih++ ) {
+    AliHLTTPCCAGBHit &h = fHits[ih];
     sliceNHits[h.ISlice()]++;
     rowNHits[h.ISlice()][h.IRow()]++;
   }
-  
-  Int_t firstSliceHit = 0;
-  for( Int_t is=0; is<fNSlices; is++ ){
+
+  int firstSliceHit = 0;
+  for ( int is = 0; is < fNSlices; is++ ) {
     fFirstSliceHit[is] = firstSliceHit;
-    Int_t rowFirstHits[200];
-    Int_t firstRowHit = 0;
-    for( Int_t ir=0; ir<200; ir++ ){
+    int rowFirstHits[200];
+    int firstRowHit = 0;
+    for ( int ir = 0; ir < 200; ir++ ) {
       rowFirstHits[ir] = firstRowHit;
-      for( Int_t ih=0; ih<rowNHits[is][ir]; ih++){
-       AliHLTTPCCAGBHit &h = fHits[firstSliceHit + firstRowHit + ih];    
-       hitX[firstRowHit + ih] = h.X();
-       hitY[firstRowHit + ih] = h.Y();
-       hitZ[firstRowHit + ih] = h.Z(); 
+      for ( int ih = 0; ih < rowNHits[is][ir]; ih++ ) {
+        AliHLTTPCCAGBHit &h = fHits[firstSliceHit + firstRowHit + ih];
+        hitX[firstRowHit + ih] = h.X();
+        hitY[firstRowHit + ih] = h.Y();
+        hitZ[firstRowHit + ih] = h.Z();
       }
-      firstRowHit+=rowNHits[is][ir];
-    }    
+      firstRowHit += rowNHits[is][ir];
+    }
     fSlices[is].ReadEvent( rowFirstHits, &*rowNHits[is], hitX, hitY, hitZ, sliceNHits[is] );
-   
-    //Int_t data[ rowNHits[is]]
+
+    //int data[ rowNHits[is]]
     //AliHLTTPCCAEventHeader event;
 
-    firstSliceHit+=sliceNHits[is];
+    firstSliceHit += sliceNHits[is];
   }
 
-  if( sliceNHits ) delete[] sliceNHits;
-  if( rowNHits ){
-    for( Int_t i=0; i<fNSlices; i++ ) delete[] rowNHits[i];
+  if ( sliceNHits ) delete[] sliceNHits;
+  if ( rowNHits ) {
+    for ( int i = 0; i < fNSlices; i++ ) delete[] rowNHits[i];
     delete[] rowNHits;
   }
 
   delete[] hitX;
   hitX = 0;
-  if( hitY ) delete[] hitY;
-  hitY=0;
-  if( hitZ ) delete[] hitZ;
-  hitZ=0;
-  if( fNHits<=0 ) return;
+  if ( hitY ) delete[] hitY;
+  hitY = 0;
+  if ( hitZ ) delete[] hitZ;
+  hitZ = 0;
+
+  if ( fNHits <= 0 ) return;
 
   TStopwatch timer1;
   TStopwatch timer2;
   //std::cout<<"Start CA reconstruction"<<std::endl;
-  for( Int_t iSlice=0; iSlice<fNSlices; iSlice++ ){
+  for ( int iSlice = 0; iSlice < fNSlices; iSlice++ ) {
     //std::cout<<"Reconstruct slice "<<iSlice<<std::endl;
     TStopwatch timer;
     AliHLTTPCCATracker &slice = fSlices[iSlice];
@@ -240,31 +240,31 @@ void AliHLTTPCCAGBTracker::FindTracks()
     //fTime+= timer.CpuTime();
     //blaTime+= timer.CpuTime();
     fStatTime[0] += timer.CpuTime();
-    fStatTime[1]+=slice.Timer(0);
-    fStatTime[2]+=slice.Timer(1);
-    fStatTime[3]+=slice.Timer(2);
-    fStatTime[4]+=slice.Timer(3);
-    fStatTime[5]+=slice.Timer(4);
-    fStatTime[6]+=slice.Timer(5);
-    fStatTime[7]+=slice.Timer(6);
-    fStatTime[8]+=slice.Timer(7);
+    fStatTime[1] += slice.Timer( 0 );
+    fStatTime[2] += slice.Timer( 1 );
+    fStatTime[3] += slice.Timer( 2 );
+    fStatTime[4] += slice.Timer( 3 );
+    fStatTime[5] += slice.Timer( 4 );
+    fStatTime[6] += slice.Timer( 5 );
+    fStatTime[7] += slice.Timer( 6 );
+    fStatTime[8] += slice.Timer( 7 );
   }
 
   timer2.Stop();
   //std::cout<<"blaTime = "<<timer2.CpuTime()*1.e3<<std::endl;
   fSliceTrackerTime = timer2.CpuTime();
-  
+
   //std::cout<<"Start CA merging"<<std::endl;
 
   TStopwatch timerMerge;
-  Merge(); 
+  Merge();
   timerMerge.Stop();
-  fStatTime[9]+=timerMerge.CpuTime();  
+  fStatTime[9] += timerMerge.CpuTime();
   //fTime+=timerMerge.CpuTime();
   //std::cout<<"Merge time = "<<timerMerge.CpuTime()*1.e3<<"ms"<<std::endl;
   //std::cout<<"End CA merging"<<std::endl;
   timer1.Stop();
-  fTime+= timer1.CpuTime();
+  fTime += timer1.CpuTime();
 
 #ifdef DRAW
   AliHLTTPCCADisplay::Instance().Ask();
@@ -273,24 +273,24 @@ void AliHLTTPCCAGBTracker::FindTracks()
 
 void AliHLTTPCCAGBTracker::Merge()
 {
-  // test 
+  // test
 
 #ifdef DRAW
   AliHLTTPCCADisplay &disp = AliHLTTPCCADisplay::Instance();
   AliHLTTPCCADisplay::Instance().SetTPCView();
   AliHLTTPCCADisplay::Instance().DrawTPC();
   AliHLTTPCCADisplay::Instance().DrawGBHits( *this );
-  disp.Ask(); 
-  std::cout<<"Slice tracks:"<<std::endl;
-  for( Int_t iSlice=0; iSlice<fNSlices; iSlice++ ){
+  disp.Ask();
+  std::cout << "Slice tracks:" << std::endl;
+  for ( int iSlice = 0; iSlice < fNSlices; iSlice++ ) {
     AliHLTTPCCATracker &slice = fSlices[iSlice];
-    disp.SetCurrentSlice(&slice);    
-    for( Int_t itr=0; itr<*slice.NOutTracks(); itr++ ){
+    disp.SetCurrentSlice( &slice );
+    for ( int itr = 0; itr < *slice.NOutTracks(); itr++ ) {
       disp.DrawSliceOutTrack( itr, kBlue, 2. );
     }
   }
   //AliHLTTPCCADisplay::Instance().DrawGBHits( *this );
-  disp.Ask(); 
+  disp.Ask();
 #endif //DRAW  
 
 
@@ -299,26 +299,26 @@ void AliHLTTPCCAGBTracker::Merge()
   merger.Clear();
   merger.SetSliceParam( fSlices[0].Param() );
 
-  for( Int_t i=0; i<fNSlices; i++ ) {
+  for ( int i = 0; i < fNSlices; i++ ) {
     merger.SetSliceData( i, fSlices[i].Output() );
   }
 
   merger.Reconstruct();
 
-  const AliHLTTPCCAMergerOutput &out = *(merger.Output());
-  
-  
-  if( fTrackHits ) delete[] fTrackHits;
+  const AliHLTTPCCAMergerOutput &out = *( merger.Output() );
+
+
+  if ( fTrackHits ) delete[] fTrackHits;
   fTrackHits = 0;
-  if(fTracks ) delete[] fTracks;
+  if ( fTracks ) delete[] fTracks;
   fTracks = 0;
-  fTrackHits = new Int_t [out.NTrackClusters()];
-  fTracks = new AliHLTTPCCAGBTrack[out.NTracks()];  
+  fTrackHits = new int [out.NTrackClusters()];
+  fTracks = new AliHLTTPCCAGBTrack[out.NTracks()];
   fNTracks = 0;
 
-  Int_t nTrackHits = 0;
-  
-  for( Int_t itr=0; itr<out.NTracks(); itr++ ){
+  int nTrackHits = 0;
+
+  for ( int itr = 0; itr < out.NTracks(); itr++ ) {
     const AliHLTTPCCAMergedTrack &track = out.Track( itr );
 
     AliHLTTPCCAGBTrack &trackGB = fTracks[fNTracks];
@@ -328,26 +328,26 @@ void AliHLTTPCCAGBTracker::Merge()
     trackGB.SetAlpha( track.InnerAlpha() );
     trackGB.SetDeDx( 0 );
 
-    for( Int_t icl=0; icl<track.NClusters(); icl++ ){
-      UInt_t  iDsrc = out.ClusterIDsrc( track.FirstClusterRef() + icl );
-      UInt_t iSlice = AliHLTTPCCADataCompressor::IDsrc2ISlice( iDsrc );
-      UInt_t iRow   = AliHLTTPCCADataCompressor::IDsrc2IRow( iDsrc );
-      UInt_t iClu   = AliHLTTPCCADataCompressor::IDsrc2IClu( iDsrc );    
-      fTrackHits[nTrackHits+icl] = fFirstSliceHit[iSlice] + fSlices[iSlice].Row(iRow).FirstHit() + iClu;
-    }              
-    nTrackHits+= track.NClusters();
+    for ( int icl = 0; icl < track.NClusters(); icl++ ) {
+      unsigned int  iDsrc = out.ClusterIDsrc( track.FirstClusterRef() + icl );
+      unsigned int iSlice = AliHLTTPCCADataCompressor::IDsrc2ISlice( iDsrc );
+      unsigned int iRow   = AliHLTTPCCADataCompressor::IDsrc2IRow( iDsrc );
+      unsigned int iClu   = AliHLTTPCCADataCompressor::IDsrc2IClu( iDsrc );
+      fTrackHits[nTrackHits+icl] = fFirstSliceHit[iSlice] + fSlices[iSlice].Row( iRow ).FirstHit() + iClu;
+    }
+    nTrackHits += track.NClusters();
     fNTracks++;
   }
 
 #ifdef DRAW
-  std::cout<<"Global tracks: "<<std::endl;
+  std::cout << "Global tracks: " << std::endl;
   AliHLTTPCCADisplay::Instance().ClearView();
   AliHLTTPCCADisplay::Instance().SetTPCView();
   AliHLTTPCCADisplay::Instance().DrawTPC();
   AliHLTTPCCADisplay::Instance().DrawGBHits( *this );
-  for( Int_t itr=0; itr<fNTracks; itr++ ){
-    std::cout<<itr<<" nhits= "<<fTracks[itr].NHits()<<std::endl;
-    AliHLTTPCCADisplay::Instance().DrawGBTrack( itr, kBlue, 2. );    
+  for ( int itr = 0; itr < fNTracks; itr++ ) {
+    std::cout << itr << " nhits= " << fTracks[itr].NHits() << std::endl;
+    AliHLTTPCCADisplay::Instance().DrawGBTrack( itr, kBlue, 2. );
     //AliHLTTPCCADisplay::Instance().Ask();
   }
   AliHLTTPCCADisplay::Instance().Ask();
@@ -357,47 +357,47 @@ void AliHLTTPCCAGBTracker::Merge()
 
 
 
-Bool_t AliHLTTPCCAGBTracker::FitTrack( AliHLTTPCCATrackParam &T, AliHLTTPCCATrackParam t0, 
-                                      Float_t &Alpha, Int_t hits[], Int_t &NTrackHits,
-                                      Bool_t dir )
+bool AliHLTTPCCAGBTracker::FitTrack( AliHLTTPCCATrackParam &T, AliHLTTPCCATrackParam t0,
+                                       float &Alpha, int hits[], int &NTrackHits,
+                                       bool dir )
 {
   // Fit the track
-  
+
   //return fMerger->FitTrack( T, Alpha, t0, Alpha, hits, NTrackHits, dir );
 
-  Float_t alpha0 = Alpha;
+  float alpha0 = Alpha;
 
   AliHLTTPCCATrackParam::AliHLTTPCCATrackFitParam fitPar;
   AliHLTTPCCATrackParam t = t0;
-  AliHLTTPCCATrackLinearisation l(t0);
+  AliHLTTPCCATrackLinearisation l( t0 );
+
+  bool first = 1;
 
-  Bool_t first = 1;
   t.CalculateFitParameters( fitPar );
 
-  Int_t hitsNew[1000];
-  Int_t nHitsNew = 0;
+  int hitsNew[1000];
+  int nHitsNew = 0;
 
-  for( Int_t ihit=0; ihit<NTrackHits; ihit++){
-    
-    Int_t jhit = dir ?(NTrackHits-1-ihit) :ihit;
+  for ( int ihit = 0; ihit < NTrackHits; ihit++ ) {
+
+    int jhit = dir ? ( NTrackHits - 1 - ihit ) : ihit;
     AliHLTTPCCAGBHit &h = fHits[hits[jhit]];
 
-    Int_t iSlice = h.ISlice();
+    int iSlice = h.ISlice();
 
-    Float_t sliceAlpha =  fSlices[0].Param().Alpha( iSlice );
+    float sliceAlpha =  fSlices[0].Param().Alpha( iSlice );
 
-    if( CAMath::Abs( sliceAlpha - alpha0)>1.e-4 ){
-      if( ! t.Rotate(  sliceAlpha - alpha0, l, .999 ) ) continue;
+    if ( CAMath::Abs( sliceAlpha - alpha0 ) > 1.e-4 ) {
+      if ( ! t.Rotate(  sliceAlpha - alpha0, l, .999 ) ) continue;
       alpha0 = sliceAlpha;
     }
 
-    //Float_t x = fSliceParam.RowX( h.IRow() );
-    Float_t x = h.X();
-    
-    if( !t.TransportToXWithMaterial( x, l, fitPar, fSlices[0].Param().GetBz(t) ) ) continue;
-    
-    if( first ){
+    //float x = fSliceParam.RowX( h.IRow() );
+    float x = h.X();
+
+    if ( !t.TransportToXWithMaterial( x, l, fitPar, fSlices[0].Param().GetBz( t ) ) ) continue;
+
+    if ( first ) {
       t.SetCov( 0, 10 );
       t.SetCov( 1,  0 );
       t.SetCov( 2, 10 );
@@ -408,48 +408,48 @@ Bool_t AliHLTTPCCAGBTracker::FitTrack( AliHLTTPCCATrackParam &T, AliHLTTPCCATrac
       t.SetCov( 7,  0 );
       t.SetCov( 8,  0 );
       t.SetCov( 9,  1 );
-      t.SetCov(10,  0 );
-      t.SetCov(11,  0 );
-      t.SetCov(12,  0 );
-      t.SetCov(13,  0 );
-      t.SetCov(14,  10 );
+      t.SetCov( 10,  0 );
+      t.SetCov( 11,  0 );
+      t.SetCov( 12,  0 );
+      t.SetCov( 13,  0 );
+      t.SetCov( 14,  10 );
       t.SetChi2( 0 );
       t.SetNDF( -5 );
       t.CalculateFitParameters( fitPar );
     }
 
-    
-    Float_t err2Y, err2Z;
+
+    float err2Y, err2Z;
     fSlices[0].Param().GetClusterErrors2( h.IRow(), h.Z(), l.SinPhi(), l.CosPhi(), l.DzDs(), err2Y, err2Z );
-    if( !t.Filter( h.Y(), h.Z(), err2Y, err2Z ) ) continue;                
+    if ( !t.Filter( h.Y(), h.Z(), err2Y, err2Z ) ) continue;
 
     first = 0;
 
     hitsNew[nHitsNew++] = hits[jhit];
   }
-  
-  if( CAMath::Abs(t.QPt())<1.e-8 ) t.SetQPt( 1.e-8 );
-  
-  Bool_t ok=1;
-  
-  const Float_t *c = t.Cov();
-  for( Int_t i=0; i<15; i++ ) ok = ok && finite(c[i]);
-  for( Int_t i=0; i<5; i++ ) ok = ok && finite(t.Par()[i]);
-  ok = ok && (t.GetX()>50);
-  
-  if( c[0]<=0 || c[2]<=0 || c[5]<=0 || c[9]<=0 || c[14]<=0 ) ok = 0;
-  if( c[0]>5. || c[2]>5. || c[5]>2. || c[9]>2 || c[14]>2. ) ok = 0;
-  
-  if( CAMath::Abs(t.SinPhi())>.99 ) ok = 0;
-  else if( l.CosPhi()>=0 ) t.SetSignCosPhi( 1 );
+
+  if ( CAMath::Abs( t.QPt() ) < 1.e-8 ) t.SetQPt( 1.e-8 );
+
+  bool ok = 1;
+
+  const float *c = t.Cov();
+  for ( int i = 0; i < 15; i++ ) ok = ok && finite( c[i] );
+  for ( int i = 0; i < 5; i++ ) ok = ok && finite( t.Par()[i] );
+  ok = ok && ( t.GetX() > 50 );
+
+  if ( c[0] <= 0 || c[2] <= 0 || c[5] <= 0 || c[9] <= 0 || c[14] <= 0 ) ok = 0;
+  if ( c[0] > 5. || c[2] > 5. || c[5] > 2. || c[9] > 2 || c[14] > 2. ) ok = 0;
+
+  if ( CAMath::Abs( t.SinPhi() ) > .99 ) ok = 0;
+  else if ( l.CosPhi() >= 0 ) t.SetSignCosPhi( 1 );
   else t.SetSignCosPhi( -1 );
-  
-  if( ok ){
+
+  if ( ok ) {
     T = t;
     Alpha = alpha0;
     NTrackHits = nHitsNew;
-    for( Int_t i=0; i<NTrackHits; i++ ){
-      hits[dir ?(NTrackHits-1-i) :i] = hitsNew[i];
+    for ( int i = 0; i < NTrackHits; i++ ) {
+      hits[dir ?( NTrackHits-1-i ) :i] = hitsNew[i];
     }
   }
   return ok;
@@ -460,8 +460,8 @@ Bool_t AliHLTTPCCAGBTracker::FitTrack( AliHLTTPCCATrackParam &T, AliHLTTPCCATrac
 void AliHLTTPCCAGBTracker::WriteSettings( std::ostream &out ) const
 {
   //* write settings to the file
-  out<< NSlices()<<std::endl;  
-  for( Int_t iSlice=0; iSlice<NSlices(); iSlice++ ){    
+  out << NSlices() << std::endl;
+  for ( int iSlice = 0; iSlice < NSlices(); iSlice++ ) {
     fSlices[iSlice].Param().WriteSettings( out );
   }
 }
@@ -469,13 +469,13 @@ void AliHLTTPCCAGBTracker::WriteSettings( std::ostream &out ) const
 void AliHLTTPCCAGBTracker::ReadSettings( std::istream &in )
 {
   //* Read settings from the file
-  Int_t nSlices=0;
+  int nSlices = 0;
   in >> nSlices;
   SetNSlices( nSlices );
-  for( Int_t iSlice=0; iSlice<NSlices(); iSlice++ ){    
+  for ( int iSlice = 0; iSlice < NSlices(); iSlice++ ) {
     AliHLTTPCCAParam param;
     param.ReadSettings ( in );
-    fSlices[iSlice].Initialize( param ); 
+    fSlices[iSlice].Initialize( param );
   }
 }
 
@@ -483,115 +483,115 @@ void AliHLTTPCCAGBTracker::WriteEvent( std::ostream &out ) const
 {
   // write event to the file
 
-  out<<NHits()<<std::endl;
-  for (Int_t ih=0; ih<NHits(); ih++) {
+  out << NHits() << std::endl;
+  for ( int ih = 0; ih < NHits(); ih++ ) {
     AliHLTTPCCAGBHit &h = fHits[ih];
-    out<<h.X()<<" ";
-    out<<h.Y()<<" ";
-    out<<h.Z()<<" ";
-    out<<h.ErrY()<<" ";
-    out<<h.ErrZ()<<" ";
-    out<<h.Amp()<<" ";
-    out<<h.ID()<<" ";
-    out<<h.ISlice()<<" ";
-    out<<h.IRow()<<std::endl;
+    out << h.X() << " ";
+    out << h.Y() << " ";
+    out << h.Z() << " ";
+    out << h.ErrY() << " ";
+    out << h.ErrZ() << " ";
+    out << h.Amp() << " ";
+    out << h.ID() << " ";
+    out << h.ISlice() << " ";
+    out << h.IRow() << std::endl;
   }
 }
 
-void AliHLTTPCCAGBTracker::ReadEvent( std::istream &in ) 
+void AliHLTTPCCAGBTracker::ReadEvent( std::istream &in )
 {
-  //* Read event from file 
+  //* Read event from file
 
   StartEvent();
-  Int_t nHits;
+  int nHits;
   in >> nHits;
-  SetNHits(nHits);
-  for (Int_t i=0; i<nHits; i++) {
-    Float_t x, y, z, errY, errZ;
-    Float_t amp;
-    Int_t id, iSlice, iRow;
-    in>>x>>y>>z>>errY>>errZ>>amp>>id>>iSlice>>iRow;
+  SetNHits( nHits );
+  for ( int i = 0; i < nHits; i++ ) {
+    float x, y, z, errY, errZ;
+    float amp;
+    int id, iSlice, iRow;
+    in >> x >> y >> z >> errY >> errZ >> amp >> id >> iSlice >> iRow;
     ReadHit( x, y, z, errY, errZ, amp, id, iSlice, iRow );
   }
 }
 
-void AliHLTTPCCAGBTracker::WriteTracks( std::ostream &out ) const 
+void AliHLTTPCCAGBTracker::WriteTracks( std::ostream &out ) const
 {
-  //* Write tracks to file 
+  //* Write tracks to file
 
-  out<<fSliceTrackerTime<<std::endl;
-  Int_t nTrackHits = 0;
-  for( Int_t itr=0; itr<fNTracks; itr++ ){
-    nTrackHits+=fTracks[itr].NHits();
+  out << fSliceTrackerTime << std::endl;
+  int nTrackHits = 0;
+  for ( int itr = 0; itr < fNTracks; itr++ ) {
+    nTrackHits += fTracks[itr].NHits();
   }
-  out<<nTrackHits<<std::endl;
-  for( Int_t ih=0; ih<nTrackHits; ih++ ){
-    out<< fTrackHits[ih]<<" ";
+  out << nTrackHits << std::endl;
+  for ( int ih = 0; ih < nTrackHits; ih++ ) {
+    out << fTrackHits[ih] << " ";
   }
-  out<<std::endl;
-  
-  out<<NTracks()<<std::endl;
-  for( Int_t itr=0; itr<fNTracks; itr++ ){
-    AliHLTTPCCAGBTrack &t = fTracks[itr];    
-    const AliHLTTPCCATrackParam &p = t.Param();        
-    out<< t.NHits()<<" ";
-    out<< t.FirstHitRef()<<" ";
-    out<< t.Alpha()<<" ";
-    out<< t.DeDx()<<std::endl;
-    out<< p.GetX()<<" ";
-    out<< p.GetCosPhi()<<" ";
-    out<< p.GetChi2()<<" ";
-    out<< p.GetNDF()<<std::endl;
-    for( Int_t i=0; i<5; i++ ) out<<p.GetPar()[i]<<" ";
-    out<<std::endl;
-    for( Int_t i=0; i<15; i++ ) out<<p.GetCov()[i]<<" ";
-    out<<std::endl;
+  out << std::endl;
+
+  out << NTracks() << std::endl;
+  for ( int itr = 0; itr < fNTracks; itr++ ) {
+    AliHLTTPCCAGBTrack &t = fTracks[itr];
+    const AliHLTTPCCATrackParam &p = t.Param();
+    out << t.NHits() << " ";
+    out << t.FirstHitRef() << " ";
+    out << t.Alpha() << " ";
+    out << t.DeDx() << std::endl;
+    out << p.GetX() << " ";
+    out << p.GetCosPhi() << " ";
+    out << p.GetChi2() << " ";
+    out << p.GetNDF() << std::endl;
+    for ( int i = 0; i < 5; i++ ) out << p.GetPar()[i] << " ";
+    out << std::endl;
+    for ( int i = 0; i < 15; i++ ) out << p.GetCov()[i] << " ";
+    out << std::endl;
   }
 }
 
 void AliHLTTPCCAGBTracker::ReadTracks( std::istream &in )
 {
-  //* Read tracks  from file 
+  //* Read tracks  from file
 
-  in>>fTime;
+  in >> fTime;
   fSliceTrackerTime = fTime;
-  fStatTime[0]+=fTime;
+  fStatTime[0] += fTime;
   fStatNEvents++;
-  if( fTrackHits ) delete[] fTrackHits;
-  fTrackHits = 0;  
-  Int_t nTrackHits = 0;
+  if ( fTrackHits ) delete[] fTrackHits;
+  fTrackHits = 0;
+  int nTrackHits = 0;
   in >> nTrackHits;
-  fTrackHits = new Int_t [nTrackHits];
-  for( Int_t ih=0; ih<nTrackHits; ih++ ){
+  fTrackHits = new int [nTrackHits];
+  for ( int ih = 0; ih < nTrackHits; ih++ ) {
     in >> TrackHits()[ih];
   }
-  if( fTracks ) delete[] fTracks;
-  fTracks = 0;  
+  if ( fTracks ) delete[] fTracks;
+  fTracks = 0;
   in >> fNTracks;
   fTracks = new AliHLTTPCCAGBTrack[fNTracks];
-  for( Int_t itr=0; itr<NTracks(); itr++ ){
-    AliHLTTPCCAGBTrack &t = Tracks()[itr];    
+  for ( int itr = 0; itr < NTracks(); itr++ ) {
+    AliHLTTPCCAGBTrack &t = Tracks()[itr];
     AliHLTTPCCATrackParam p;
-    Int_t i;
-    Float_t f;
-    in>>i;
-    t.SetNHits(i);
-    in>>i;
+    int i;
+    float f;
+    in >> i;
+    t.SetNHits( i );
+    in >> i;
     t.SetFirstHitRef( i );
-    in>>f;
-    t.SetAlpha(f);
-    in>>f;
+    in >> f;
+    t.SetAlpha( f );
+    in >> f;
     t.SetDeDx( f );
-    in>>f;
+    in >> f;
     p.SetX( f );
-    in>>f;
+    in >> f;
     p.SetSignCosPhi( f );
-    in>>f;
+    in >> f;
     p.SetChi2( f );
-    in>>i;
+    in >> i;
     p.SetNDF( i );
-    for( Int_t j=0; j<5; j++ ){ in>>f; p.SetPar( j, f); }
-    for( Int_t j=0; j<15; j++ ){ in>>f; p.SetCov(j,f); }
-    t.SetParam(p);     
+    for ( int j = 0; j < 5; j++ ) { in >> f; p.SetPar( j, f ); }
+    for ( int j = 0; j < 15; j++ ) { in >> f; p.SetCov( j, f ); }
+    t.SetParam( p );
   }
 }
index 1f648815503c234ee2b40eb9b007e53b837416b9..b4f89955bb7cd09109ad0fcfe95fae23d9f75ca3 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -26,13 +26,13 @@ class  AliHLTTPCCAMerger;
 
 /**
  * @class AliHLTTPCCAGBTracker
- * 
+ *
  * Global Cellular Automaton-based HLT tracker for TPC detector
  * The class reconstructs tracks in the whole TPC
- * It calls the AliHLTTPCCATracker slice tracker and constructs 
- * the global TPC tracks by merging the slice tracks 
+ * It calls the AliHLTTPCCATracker slice tracker and constructs
+ * the global TPC tracks by merging the slice tracks
  *
- * The tracker is designed stand-alone. 
+ * The tracker is designed stand-alone.
  * It will be integrated to the HLT framework via AliHLTTPCCAGBTrackerComponent interface,
  * and to off-line framework via TPC/AliTPCtrackerCA class
  * The class is under construction.
@@ -41,73 +41,73 @@ class  AliHLTTPCCAMerger;
 class AliHLTTPCCAGBTracker
 {
 
-public:
+  public:
 
-  AliHLTTPCCAGBTracker();
-  AliHLTTPCCAGBTracker(const AliHLTTPCCAGBTracker&);
-  const AliHLTTPCCAGBTracker &operator=(const AliHLTTPCCAGBTracker&) const;
+    AliHLTTPCCAGBTracker();
+    AliHLTTPCCAGBTracker( const AliHLTTPCCAGBTracker& );
+    const AliHLTTPCCAGBTracker &operator=( const AliHLTTPCCAGBTracker& ) const;
 
-  ~AliHLTTPCCAGBTracker();
+    ~AliHLTTPCCAGBTracker();
 
-  void StartEvent();
-  void SetNSlices( Int_t N );
-  void SetNHits( Int_t nHits );
+    void StartEvent();
+    void SetNSlices( int N );
+    void SetNHits( int nHits );
 
-  void ReadHit( Float_t x, Float_t y, Float_t z, 
-               Float_t ErrY, Float_t ErrZ, Float_t amp,
-               Int_t ID, Int_t iSlice, Int_t iRow );
+    void ReadHit( float x, float y, float z,
+                  float ErrY, float ErrZ, float amp,
+                  int ID, int iSlice, int iRow );
 
-  void FindTracks();
+    void FindTracks();
 
-  void Merge();
+    void Merge();
 
-  AliHLTTPCCATracker *Slices() const { return fSlices; }
-  AliHLTTPCCAGBHit *Hits() const { return fHits; }
-  Int_t Ext2IntHitID( Int_t i ) const { return fExt2IntHitID[i]; }
+    AliHLTTPCCATracker *Slices() const { return fSlices; }
+    AliHLTTPCCAGBHit *Hits() const { return fHits; }
+    int Ext2IntHitID( int i ) const { return fExt2IntHitID[i]; }
 
-  Int_t NHits() const { return fNHits; }
-  Int_t NSlices() const { return fNSlices; }
-  Double_t Time() const { return fTime; }
-  Double_t StatTime( Int_t iTimer ) const { return fStatTime[iTimer]; }
-  Int_t StatNEvents() const { return fStatNEvents; }
-  Int_t NTracks() const { return fNTracks; }
-  AliHLTTPCCAGBTrack *Tracks() const { return fTracks; }
-  Int_t *TrackHits() const { return fTrackHits; }
+    int NHits() const { return fNHits; }
+    int NSlices() const { return fNSlices; }
+    double Time() const { return fTime; }
+    double StatTime( int iTimer ) const { return fStatTime[iTimer]; }
+    int StatNEvents() const { return fStatNEvents; }
+    int NTracks() const { return fNTracks; }
+    AliHLTTPCCAGBTrack *Tracks() const { return fTracks; }
+    int *TrackHits() const { return fTrackHits; }
 
-  Bool_t FitTrack( AliHLTTPCCATrackParam &T, AliHLTTPCCATrackParam t0, 
-                  Float_t &Alpha, Int_t hits[], Int_t &NTrackHits, 
-                  Bool_t dir );
+    bool FitTrack( AliHLTTPCCATrackParam &T, AliHLTTPCCATrackParam t0,
+                     float &Alpha, int hits[], int &NTrackHits,
+                     bool dir );
 
-  void WriteSettings( std::ostream &out ) const;
-  void ReadSettings( std::istream &in );
-  void WriteEvent( std::ostream &out ) const;
-  void ReadEvent( std::istream &in );
-  void WriteTracks( std::ostream &out ) const;
-  void ReadTracks( std::istream &in );
+    void WriteSettings( std::ostream &out ) const;
+    void ReadSettings( std::istream &in );
+    void WriteEvent( std::ostream &out ) const;
+    void ReadEvent( std::istream &in );
+    void WriteTracks( std::ostream &out ) const;
+    void ReadTracks( std::istream &in );
 
-  Double_t SliceTrackerTime() const { return fSliceTrackerTime; }
-  void SetSliceTrackerTime( Double_t v ){ fSliceTrackerTime = v; }
-  const Int_t *FirstSliceHit() const { return fFirstSliceHit; }
+    double SliceTrackerTime() const { return fSliceTrackerTime; }
+    void SetSliceTrackerTime( double v ) { fSliceTrackerTime = v; }
+    const int *FirstSliceHit() const { return fFirstSliceHit; }
 
 
-protected:
+  protected:
 
-  AliHLTTPCCATracker *fSlices; //* array of slice trackers
-  Int_t fNSlices;              //* N slices
-  AliHLTTPCCAGBHit *fHits;     //* hit array
-  Int_t *fExt2IntHitID;        //* array of internal hit indices
-  Int_t fNHits;                //* N hits in event
-  Int_t *fTrackHits;           //* track->hits reference array
-  AliHLTTPCCAGBTrack *fTracks; //* array of tracks
-  Int_t fNTracks;              //* N tracks
-  AliHLTTPCCAMerger *fMerger;  //* global merger
+    AliHLTTPCCATracker *fSlices; //* array of slice trackers
+    int fNSlices;              //* N slices
+    AliHLTTPCCAGBHit *fHits;     //* hit array
+    int *fExt2IntHitID;        //* array of internal hit indices
+    int fNHits;                //* N hits in event
+    int *fTrackHits;           //* track->hits reference array
+    AliHLTTPCCAGBTrack *fTracks; //* array of tracks
+    int fNTracks;              //* N tracks
+    AliHLTTPCCAMerger *fMerger;  //* global merger
 
-  Double_t fTime; //* total time
-  Double_t fStatTime[20]; //* timers 
-  Int_t fStatNEvents;    //* n events proceed
-  Int_t fFirstSliceHit[100]; // hit array
+    double fTime; //* total time
+    double fStatTime[20]; //* timers
+    int fStatNEvents;    //* n events proceed
+    int fFirstSliceHit[100]; // hit array
 
-  Double_t fSliceTrackerTime; // reco time of the slice tracker;
+    double fSliceTrackerTime; // reco time of the slice tracker;
 
 };
 
index 1bf13f28e8b5737598c4217894a1c5f968aa9a83..c948b5dc5c5b3585c91dfa202afca71b0cbbc00f 100644 (file)
@@ -1,5 +1,5 @@
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
@@ -61,7 +61,7 @@ ClassImp( AliHLTTPCCAGlobalMergerComponent )
 AliHLTTPCCAGlobalMergerComponent AliHLTTPCCAGlobalMergerComponent::fgAliHLTTPCCAGlobalMergerComponent;
 
 AliHLTTPCCAGlobalMergerComponent::AliHLTTPCCAGlobalMergerComponent()
-  : fGlobalMerger( 0 ), fSolenoidBz(5)
+    : fGlobalMerger( 0 ), fSolenoidBz( 5 )
 {
   // see header file for class documentation
 }
@@ -116,50 +116,50 @@ int AliHLTTPCCAGlobalMergerComponent::DoInit( int argc, const char** argv )
   fGlobalMerger = new AliHLTTPCCAMerger();
 
   AliHLTTPCCAParam param;
-  
+
   {
     // get gemetry
-    Int_t iSec = 0;
-    Float_t inRmin = 83.65; 
-    Float_t outRmax = 247.7;
-    Float_t plusZmin = 0.0529937; 
-    Float_t plusZmax = 249.778; 
-    Float_t minusZmin = -249.645; 
-    Float_t minusZmax = -0.0799937; 
-    Float_t dalpha = 0.349066;
-    Float_t alpha = 0.174533 + dalpha*iSec;    
-    Bool_t zPlus = (iSec<18 );
-    Float_t zMin =  zPlus ?plusZmin :minusZmin;
-    Float_t zMax =  zPlus ?plusZmax :minusZmax;
-    Int_t nRows = AliHLTTPCTransform::GetNRows();        
-    Float_t padPitch = 0.4;
-    Float_t sigmaZ = 0.228808;    
-    Float_t *rowX = new Float_t [nRows];
-    for( Int_t irow=0; irow<nRows; irow++){
+    int iSec = 0;
+    float inRmin = 83.65;
+    float outRmax = 247.7;
+    float plusZmin = 0.0529937;
+    float plusZmax = 249.778;
+    float minusZmin = -249.645;
+    float minusZmax = -0.0799937;
+    float dalpha = 0.349066;
+    float alpha = 0.174533 + dalpha * iSec;
+    bool zPlus = ( iSec < 18 );
+    float zMin =  zPlus ? plusZmin : minusZmin;
+    float zMax =  zPlus ? plusZmax : minusZmax;
+    int nRows = AliHLTTPCTransform::GetNRows();
+    float padPitch = 0.4;
+    float sigmaZ = 0.228808;
+    float *rowX = new float [nRows];
+    for ( int irow = 0; irow < nRows; irow++ ) {
       rowX[irow] = AliHLTTPCTransform::Row2X( irow );
     }
-     
+
     param.Initialize( iSec, nRows, rowX, alpha, dalpha,
-                     inRmin, outRmax, zMin, zMax, padPitch, sigmaZ, fSolenoidBz );    
+                      inRmin, outRmax, zMin, zMax, padPitch, sigmaZ, fSolenoidBz );
     delete[] rowX;
   }
 
 
   fGlobalMerger->SetSliceParam( param );
 
-  Int_t iResult = 0;
+  int iResult = 0;
 
-  TString arguments=""; 
-  for (int i=0; i<argc; i++) {
-    TString argument=argv[i];
-    if (!arguments.IsNull()) arguments+=" ";
-    arguments+=argument;
+  TString arguments = "";
+  for ( int i = 0; i < argc; i++ ) {
+    TString argument = argv[i];
+    if ( !arguments.IsNull() ) arguments += " ";
+    arguments += argument;
   }
-  if (!arguments.IsNull()) {
-    iResult=Configure(arguments.Data());
+  if ( !arguments.IsNull() ) {
+    iResult = Configure( arguments.Data() );
   } else {
-    iResult=Reconfigure(NULL, NULL);
-  }  
+    iResult = Reconfigure( NULL, NULL );
+  }
   return iResult;
 }
 
@@ -173,17 +173,17 @@ int AliHLTTPCCAGlobalMergerComponent::DoDeinit()
 }
 
 int AliHLTTPCCAGlobalMergerComponent::DoEvent( const AliHLTComponentEventData &evtData,
-                                              const AliHLTComponentBlockData *blocks, AliHLTComponentTriggerData &/*trigData*/,
+    const AliHLTComponentBlockData *blocks, AliHLTComponentTriggerData &/*trigData*/,
     AliHLTUInt8_t *outputPtr, AliHLTUInt32_t &size, AliHLTComponentBlockDataList &outputBlocks )
 {
   // see header file for class documentation
   int iResult = 0;
-  UInt_t maxBufferSize = size;
+  unsigned int maxBufferSize = size;
 
   size = 0;
 
   if ( !outputPtr ) {
-      return -ENOSPC;
+    return -ENOSPC;
   }
   if ( !IsDataEvent() ) {
     return 0;
@@ -200,7 +200,7 @@ int AliHLTTPCCAGlobalMergerComponent::DoEvent( const AliHLTComponentEventData &e
     int slice = AliHLTTPCDefinitions::GetMinSliceNr( *block );
     if ( slice < 0 || slice >= AliHLTTPCTransform::GetNSlice() ) {
       HLTError( "invalid slice number %d extracted from specification 0x%08lx,  skipping block of type %s",
-          slice, block->fSpecification, DataType2Text(block->fDataType).c_str() );
+                slice, block->fSpecification, DataType2Text( block->fDataType ).c_str() );
       // just remember the error, if there are other valid blocks ignore the error, return code otherwise
       iResult = -EBADF;
       continue;
@@ -208,8 +208,8 @@ int AliHLTTPCCAGlobalMergerComponent::DoEvent( const AliHLTComponentEventData &e
 
     if ( slice != AliHLTTPCDefinitions::GetMaxSliceNr( *block ) ) {
       // the code was not written for/ never used with multiple slices in one data block/ specification
-      HLTWarning("specification 0x%08lx indicates multiple slices in data block %s: never used before, please audit the code",
-          block->fSpecification, DataType2Text(block->fDataType).c_str());
+      HLTWarning( "specification 0x%08lx indicates multiple slices in data block %s: never used before, please audit the code",
+                  block->fSpecification, DataType2Text( block->fDataType ).c_str() );
     }
     AliHLTTPCCASliceOutput *sliceOut =  reinterpret_cast<AliHLTTPCCASliceOutput *>( block->fPtr );
     sliceOut->SetPointers();
@@ -222,18 +222,18 @@ int AliHLTTPCCAGlobalMergerComponent::DoEvent( const AliHLTComponentEventData &e
 
   // Fill output tracks
 
-  UInt_t mySize = 0;
+  unsigned int mySize = 0;
 
   {
     // check if there was enough space in the output buffer
 
-    Int_t nTracks = mergerOutput->NTracks();
+    int nTracks = mergerOutput->NTracks();
 
     AliHLTTPCTrackArray array( nTracks );
 
-    Int_t nClusters=0;
-    for( Int_t itr=0; itr<nTracks; itr++){
+    int nClusters = 0;
+    for ( int itr = 0; itr < nTracks; itr++ ) {
+
       // convert AliHLTTPCCAMergedTrack to AliHLTTPCTrack
 
       const AliHLTTPCCAMergedTrack &track = mergerOutput->Track( itr );
@@ -242,70 +242,70 @@ int AliHLTTPCCAGlobalMergerComponent::DoEvent( const AliHLTComponentEventData &e
       // first convert to AliExternalTrackParam ( Kappa to Pt )
 
       AliExternalTrackParam tp, tpEnd;
-      AliHLTTPCCATrackConvertor::GetExtParam( track.InnerParam(), tp, 0 );      
-      AliHLTTPCCATrackConvertor::GetExtParam( track.OuterParam(), tpEnd, 0 );      
+      AliHLTTPCCATrackConvertor::GetExtParam( track.InnerParam(), tp, 0 );
+      AliHLTTPCCATrackConvertor::GetExtParam( track.OuterParam(), tpEnd, 0 );
 
       // set parameters, with rotation to global coordinates
-      
-      out.SetCharge((Int_t ) tp.GetSign());
-      out.SetPt( TMath::Abs(tp.GetSignedPt()) );
-      out.SetPsi( fmod( TMath::ASin( tp.GetSnp() ) + track.InnerAlpha() ,2*TMath::Pi() ) );
+
+      out.SetCharge( ( int ) tp.GetSign() );
+      out.SetPt( TMath::Abs( tp.GetSignedPt() ) );
+      out.SetPsi( fmod( TMath::ASin( tp.GetSnp() ) + track.InnerAlpha() , 2*TMath::Pi() ) );
       out.SetTgl( tp.GetTgl() );
       {
-       Float_t sinA = TMath::Sin( track.InnerAlpha() );
-       Float_t cosA = TMath::Cos( track.InnerAlpha() );
-       
-       out.SetFirstPoint( tp.GetX()*cosA - tp.GetY()*sinA,
-                          tp.GetX()*sinA + tp.GetY()*cosA, 
-                          tp.GetZ() );
+        float sinA = TMath::Sin( track.InnerAlpha() );
+        float cosA = TMath::Cos( track.InnerAlpha() );
+
+        out.SetFirstPoint( tp.GetX()*cosA - tp.GetY()*sinA,
+                           tp.GetX()*sinA + tp.GetY()*cosA,
+                           tp.GetZ() );
       }
-      
+
       {
-       Float_t sinA = TMath::Sin( track.OuterAlpha() );
-       Float_t cosA = TMath::Cos( track.OuterAlpha() );
-       
-       out.SetLastPoint( tpEnd.GetX()*cosA - tpEnd.GetY()*sinA,
-                         tpEnd.GetX()*sinA + tpEnd.GetY()*cosA, 
-                         tpEnd.GetZ() );
+        float sinA = TMath::Sin( track.OuterAlpha() );
+        float cosA = TMath::Cos( track.OuterAlpha() );
+
+        out.SetLastPoint( tpEnd.GetX()*cosA - tpEnd.GetY()*sinA,
+                          tpEnd.GetX()*sinA + tpEnd.GetY()*cosA,
+                          tpEnd.GetZ() );
       }
 
       // set parameter errors w/o rotation, as it is done in AliHLTTPCTrackArray
 
-      out.SetY0err(tp.GetSigmaY2());
-      out.SetZ0err(tp.GetSigmaZ2());
-      Float_t h = -out.GetPt()*out.GetPt();
+      out.SetY0err( tp.GetSigmaY2() );
+      out.SetZ0err( tp.GetSigmaZ2() );
+      float h = -out.GetPt() * out.GetPt();
       out.SetPterr( h*h*tp.GetSigma1Pt2() );
-      h = 1./TMath::Sqrt(1-out.GetSnp()*out.GetSnp());
-      out.SetPsierr(h*h*tp.GetSigmaSnp2());
-      out.SetTglerr(tp.GetSigmaTgl2());  
+      h = 1. / TMath::Sqrt( 1 - out.GetSnp() * out.GetSnp() );
+      out.SetPsierr( h*h*tp.GetSigmaSnp2() );
+      out.SetTglerr( tp.GetSigmaTgl2() );
+
       // set cluster ID's
 
-      UInt_t hitID[1000];
-      for( Int_t i=0; i<track.NClusters(); i++ ) hitID[i] = mergerOutput->ClusterIDsrc(track.FirstClusterRef()+i);
+      unsigned int hitID[1000];
+      for ( int i = 0; i < track.NClusters(); i++ ) hitID[i] = mergerOutput->ClusterIDsrc( track.FirstClusterRef() + i );
 
       out.SetNHits( track.NClusters() );
       out.SetHits( track.NClusters(), hitID );
-      
-      out.SetSector(-1);
+
+      out.SetSector( -1 );
       out.CalculateHelix();
-      if( !out.CheckConsistency() )  *(array.NextTrack()) = out;      
-      nClusters+=track.NClusters();
+      if ( !out.CheckConsistency() )  *( array.NextTrack() ) = out;
+      nClusters += track.NClusters();
     }
 
-    
-    if ( sizeof(AliHLTTPCTrackletData) + nTracks*sizeof(AliHLTTPCTrackSegmentData) + nClusters*sizeof(UInt_t)
-        > maxBufferSize ){
+
+    if ( sizeof( AliHLTTPCTrackletData ) + nTracks*sizeof( AliHLTTPCTrackSegmentData ) + nClusters*sizeof( unsigned int )
+         > maxBufferSize ) {
       iResult = -ENOSPC;
     } else {
-      AliHLTTPCTrackletData *outPtr = (AliHLTTPCTrackletData*)(outputPtr);
-      UInt_t nOutTracks = 0;
+      AliHLTTPCTrackletData *outPtr = ( AliHLTTPCTrackletData* )( outputPtr );
+      unsigned int nOutTracks = 0;
       mySize = array.WriteTracks( nOutTracks, outPtr->fTracklets );
-      mySize += sizeof(AliHLTTPCTrackletData);
+      mySize += sizeof( AliHLTTPCTrackletData );
       outPtr->fTrackletCnt = nOutTracks;
     }
   }
-  
+
   AliHLTComponentBlockData resultData;
   FillBlockData( resultData );
   resultData.fOffset = 0;
@@ -321,74 +321,72 @@ int AliHLTTPCCAGlobalMergerComponent::DoEvent( const AliHLTComponentEventData &e
 
 
 
-Int_t AliHLTTPCCAGlobalMergerComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/)
+int AliHLTTPCCAGlobalMergerComponent::Reconfigure( const char* /*cdbEntry*/, const char* /*chainId*/ )
 {
   // see header file for class documentation
 
 
-  HLTWarning("TODO: dummy Reconfigure() method" );
+  HLTWarning( "TODO: dummy Reconfigure() method" );
   return 0;
   /*
 
-  Int_t iResult=0;
+  int iResult=0;
   const char* pathBField=kAliHLTCDBSolenoidBz;
-  
+
   if (pathBField) {
     HLTInfo("reconfigure B-Field from entry %s, chain id %s", pathBField,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
     AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(pathBField);//,GetRunNo());
     if (pEntry) {
       TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
       if (pString) {
-       HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
-       iResult=Configure(pString->GetString().Data());
+  HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
+  iResult=Configure(pString->GetString().Data());
       } else {
-       HLTError("configuration object \"%s\" has wrong type, required TObjString", pathBField);
+  HLTError("configuration object \"%s\" has wrong type, required TObjString", pathBField);
       }
     } else {
       HLTError("cannot fetch object \"%s\" from CDB", pathBField);
     }
-  }  
-  return iResult;  
-*/
+  }
+  return iResult;
+  */
 }
 
 
-Int_t AliHLTTPCCAGlobalMergerComponent::Configure( const char* arguments )
+int AliHLTTPCCAGlobalMergerComponent::Configure( const char* arguments )
 {
   //* Set parameters
 
-  Int_t iResult=0;
-  if (!arguments) return iResult;
-  
-  TString allArgs=arguments;
+  int iResult = 0;
+  if ( !arguments ) return iResult;
+
+  TString allArgs = arguments;
   TString argument;
-  Int_t bMissingParam=0;
-  
-  TObjArray* pTokens=allArgs.Tokenize(" ");
+  int bMissingParam = 0;
 
-  Int_t nArgs =  pTokens ?pTokens->GetEntries() :0;
+  TObjArray* pTokens = allArgs.Tokenize( " " );
 
-  for (int i=0; i<nArgs; i++ ){
-    argument=((TObjString*)pTokens->At(i))->GetString();
-    if (argument.IsNull()){
-    }
-    else if (argument.CompareTo("-solenoidBz")==0 ){
-      if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; 
-      fSolenoidBz = ((TObjString*)pTokens->At(i))->GetString().Atof();
-      HLTInfo("Magnetic Field set to: %f", fSolenoidBz );
-    }
-    else {
-      HLTError("Unknown option %s ", argument.Data());
-      iResult=-EINVAL;
+  int nArgs =  pTokens ? pTokens->GetEntries() : 0;
+
+  for ( int i = 0; i < nArgs; i++ ) {
+    argument = ( ( TObjString* )pTokens->At( i ) )->GetString();
+    if ( argument.IsNull() ) {
+    } else if ( argument.CompareTo( "-solenoidBz" ) == 0 ) {
+      if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
+      fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof();
+      HLTInfo( "Magnetic Field set to: %f", fSolenoidBz );
+    else {
+      HLTError( "Unknown option %s ", argument.Data() );
+      iResult = -EINVAL;
     }
   }
   delete pTokens;
 
-  if (bMissingParam) {
-    HLTError("Specifier missed for %s", argument.Data());    
-    iResult=-EINVAL;
+  if ( bMissingParam ) {
+    HLTError( "Specifier missed for %s", argument.Data() );
+    iResult = -EINVAL;
   }
 
   return iResult;
 }
-  
+
index 2651af1175d98a1050ce0160117b653a0b6fbc8d..b554abfcecc42f5a7e7a134a986812d17fdfa534 100644 (file)
@@ -1,5 +1,5 @@
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -84,19 +84,19 @@ class AliHLTTPCCAGlobalMergerComponent : public AliHLTProcessor
     int DoDeinit();
 
     /** reconfigure **/
-    Int_t Reconfigure(const char* cdbEntry, const char* chainId);
+    int Reconfigure( const char* cdbEntry, const char* chainId );
 
     /**
      * @copydoc @ref AliHLTProcessor::DoEvent
      */
     int DoEvent( const AliHLTComponentEventData &evtData, const AliHLTComponentBlockData *blocks,
-        AliHLTComponentTriggerData &trigData, AliHLTUInt8_t *outputPtr,
-        AliHLTUInt32_t &size, AliHLTComponentBlockDataList &outputBlocks );
+                 AliHLTComponentTriggerData &trigData, AliHLTUInt8_t *outputPtr,
+                 AliHLTUInt32_t &size, AliHLTComponentBlockDataList &outputBlocks );
 
     using AliHLTProcessor::DoEvent;
 
   private:
-    
+
     static AliHLTTPCCAGlobalMergerComponent fgAliHLTTPCCAGlobalMergerComponent;
 
     // disable copy
@@ -104,12 +104,12 @@ class AliHLTTPCCAGlobalMergerComponent : public AliHLTProcessor
     AliHLTTPCCAGlobalMergerComponent &operator=( const AliHLTTPCCAGlobalMergerComponent & );
 
     /** set configuration parameters **/
-    Int_t Configure( const char* arguments );
+    int Configure( const char* arguments );
 
     /** the global merger object */
     AliHLTTPCCAMerger *fGlobalMerger; //!
 
-    Double_t fSolenoidBz;  // magnetic field  
+    double fSolenoidBz;  // magnetic field
 
     ClassDef( AliHLTTPCCAGlobalMergerComponent, 0 )
 };
index 2f546aef56b14f3d16e9dce92ac6b6323fcb03e9..89ab7434b9bf89c73ba7922dc1849c14c5a8fa80 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLTTPCCAMath.h"
 #include <iostream>
 
-GPUd() void AliHLTTPCCAGrid::Create( Float_t yMin, Float_t yMax, Float_t zMin, Float_t zMax, UInt_t n )
+GPUd() void AliHLTTPCCAGrid::Create( float yMin, float yMax, float zMin, float zMax, unsigned int n )
 {
   //* Create the grid
-  
-  fYMin = CAMath::Min(yMin,yMax);
-  fYMax = CAMath::Max(yMin,yMax)+.1;
-  fZMin = CAMath::Min(zMin,zMax);
-  fZMax = CAMath::Max(zMin,zMax)+.1;
-  fNy = (UInt_t) CAMath::Sqrt( CAMath::Abs( (Float_t) n ) );
-  fNy = CAMath::Max(fNy,1);
+
+  fYMin = CAMath::Min( yMin, yMax );
+  fYMax = CAMath::Max( yMin, yMax ) + .1;
+  fZMin = CAMath::Min( zMin, zMax );
+  fZMax = CAMath::Max( zMin, zMax ) + .1;
+  fNy = ( unsigned int ) CAMath::Sqrt( CAMath::Abs( ( float ) n ) );
+  fNy = CAMath::Max( fNy, 1 );
   fNz = fNy;
-  fN = fNy*fNz;
-  fStepYInv = (fYMax - fYMin);
-  fStepZInv = (fZMax - fZMin);
-  //Int_t ky = (fNy>1) ?fNy-1 :1;
-  //Int_t kz = (fNz>1) ?fNz-1 :1;
-  fStepYInv =  ( fStepYInv>1.e-4 ) ?fNy/fStepYInv :1;
-  fStepZInv =  ( fStepZInv>1.e-4 ) ?fNz/fStepZInv :1;
+  fN = fNy * fNz;
+  fStepYInv = ( fYMax - fYMin );
+  fStepZInv = ( fZMax - fZMin );
+  //int ky = (fNy>1) ?fNy-1 :1;
+  //int kz = (fNz>1) ?fNz-1 :1;
+  fStepYInv =  ( fStepYInv > 1.e-4 ) ? fNy / fStepYInv : 1;
+  fStepZInv =  ( fStepZInv > 1.e-4 ) ? fNz / fStepZInv : 1;
 }
 
-GPUd() void AliHLTTPCCAGrid::Create( Float_t yMin, Float_t yMax, Float_t zMin, Float_t zMax, Float_t sy, Float_t sz )
+GPUd() void AliHLTTPCCAGrid::Create( float yMin, float yMax, float zMin, float zMax, float sy, float sz )
 {
   //* Create the grid
-  
-  fYMin = CAMath::Min(yMin,yMax);
-  fYMax = CAMath::Max(yMin,yMax)+.1;
-  fZMin = CAMath::Min(zMin,zMax);
-  fZMax = CAMath::Max(zMin,zMax)+.1;
-  fStepYInv = 1./sy;
-  fStepZInv = 1./sz;
 
-  fNy = (UInt_t) ( (fYMax - fYMin)*fStepYInv + 1 );
-  fNz = (UInt_t) ( (fZMax - fZMin)*fStepZInv + 1 );
-  fYMax = fYMin + fNy*sy; 
-  fZMax = fZMin + fNz*sz; 
-  fN = fNy*fNz;
+  fYMin = CAMath::Min( yMin, yMax );
+  fYMax = CAMath::Max( yMin, yMax ) + .1;
+  fZMin = CAMath::Min( zMin, zMax );
+  fZMax = CAMath::Max( zMin, zMax ) + .1;
+  fStepYInv = 1. / sy;
+  fStepZInv = 1. / sz;
+
+  fNy = ( unsigned int ) ( ( fYMax - fYMin ) * fStepYInv + 1 );
+  fNz = ( unsigned int ) ( ( fZMax - fZMin ) * fStepZInv + 1 );
+  fYMax = fYMin + fNy * sy;
+  fZMax = fZMin + fNz * sz;
+  fN = fNy * fNz;
 }
 
-GPUd() UInt_t AliHLTTPCCAGrid::GetBin( Float_t Y, Float_t Z ) const
+GPUd() unsigned int AliHLTTPCCAGrid::GetBin( float Y, float Z ) const
 {
   //* get the bin pointer
-  
-  Int_t bbY = (Int_t) CAMath::FMulRZ( Y-fYMin, fStepYInv );
-  Int_t bbZ = (Int_t) CAMath::FMulRZ( Z-fZMin, fStepZInv );
-  if( bbY<0 ) bbY = 0;
-  else if( bbY>=(Int_t)fNy ) bbY = fNy - 1;  
-  if( bbZ<0 ) bbZ = 0;
-  else if( bbZ>=(Int_t)fNz ) bbZ = fNz - 1;
-  Int_t bin = CAMath::Mul24(bbZ,fNy) + bbY;    
-  return (UInt_t) bin;
+
+  int bbY = ( int ) CAMath::FMulRZ( Y - fYMin, fStepYInv );
+  int bbZ = ( int ) CAMath::FMulRZ( Z - fZMin, fStepZInv );
+  if ( bbY < 0 ) bbY = 0;
+  else if ( bbY >= ( int )fNy ) bbY = fNy - 1;
+  if ( bbZ < 0 ) bbZ = 0;
+  else if ( bbZ >= ( int )fNz ) bbZ = fNz - 1;
+  int bin = CAMath::Mul24( bbZ, fNy ) + bbY;
+  return ( unsigned int ) bin;
 }
 
-GPUd() void AliHLTTPCCAGrid::GetBin( Float_t Y, Float_t Z, UInt_t &bY, UInt_t &bZ ) const
+GPUd() void AliHLTTPCCAGrid::GetBin( float Y, float Z, unsigned int &bY, unsigned int &bZ ) const
 {
   //* get the bin pointer
 
-  Int_t bbY = (Int_t) ( (Y-fYMin)*fStepYInv );
-  Int_t bbZ = (Int_t) ( (Z-fZMin)*fStepZInv );  
-  
-  if( bbY<0 ) bbY = 0;
-  else if( bbY>=(Int_t)fNy ) bbY = fNy - 1;  
-  if( bbZ<0 ) bbZ = 0;
-  else if( bbZ>=(Int_t)fNz ) bbZ = fNz - 1;
-  bY = (UInt_t) bbY;
-  bZ = (UInt_t) bbZ;
+  int bbY = ( int ) ( ( Y - fYMin ) * fStepYInv );
+  int bbZ = ( int ) ( ( Z - fZMin ) * fStepZInv );
+
+  if ( bbY < 0 ) bbY = 0;
+  else if ( bbY >= ( int )fNy ) bbY = fNy - 1;
+  if ( bbZ < 0 ) bbZ = 0;
+  else if ( bbZ >= ( int )fNz ) bbZ = fNz - 1;
+  bY = ( unsigned int ) bbY;
+  bZ = ( unsigned int ) bbZ;
 }
index eb61e7692dd1d36795bb426135d8f9cc64c958f0..2825d75da54c57be4235938be126b09b8ea2c33e 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAGrid
 {
- public:
-  
-  GPUd() void Create( Float_t yMin, Float_t yMax, Float_t zMin, Float_t zMax, UInt_t n );
-  GPUd() void Create( Float_t yMin, Float_t yMax, Float_t zMin, Float_t zMax, Float_t sy, Float_t sz  );
-  
-  GPUd() UInt_t GetBin( Float_t Y, Float_t Z ) const;
-  GPUd() void GetBin( Float_t Y, Float_t Z, UInt_t &bY, UInt_t &bZ ) const ;
-  
-  GPUd() UInt_t GetBinNoCheck( Float_t Y, Float_t Z ) const {
-    UInt_t bY = (UInt_t) ( (Y-fYMin)*fStepYInv );
-    UInt_t bZ = (UInt_t) ( (Z-fZMin)*fStepZInv );
-    return bZ*fNy + bY;
-  }
-  
-  GPUd() void GetBinNoCheck( Float_t Y, Float_t Z, UInt_t &bY, UInt_t &bZ ) const {
-    bY = (UInt_t) ( (Y-fYMin)*fStepYInv );
-    bZ = (UInt_t) ( (Z-fZMin)*fStepZInv );    
-  }
+  public:
 
+    GPUd() void Create( float yMin, float yMax, float zMin, float zMax, unsigned int n );
+    GPUd() void Create( float yMin, float yMax, float zMin, float zMax, float sy, float sz  );
 
-  GPUd() UInt_t  N()        const { return fN;  }
-  GPUd() UInt_t  Ny()       const { return fNy; }
-  GPUd() UInt_t  Nz()       const { return fNz; }
-  GPUd() Float_t YMin()     const { return fYMin; }
-  GPUd() Float_t YMax()     const { return fYMax; }
-  GPUd() Float_t ZMin()     const { return fZMin; }
-  GPUd() Float_t ZMax()     const { return fZMax; }
-  GPUd() Float_t StepYInv() const { return fStepYInv; }
-  GPUd() Float_t StepZInv() const { return fStepZInv; }
+    GPUd() unsigned int GetBin( float Y, float Z ) const;
+    GPUd() void GetBin( float Y, float Z, unsigned int &bY, unsigned int &bZ ) const ;
 
-private:
+    GPUd() unsigned int GetBinNoCheck( float Y, float Z ) const {
+      unsigned int bY = ( unsigned int ) ( ( Y - fYMin ) * fStepYInv );
+      unsigned int bZ = ( unsigned int ) ( ( Z - fZMin ) * fStepZInv );
+      return bZ*fNy + bY;
+    }
 
-  UInt_t fNy;        //* N bins in Y
-  UInt_t fNz;        //* N bins in Z
-  UInt_t fN;         //* total N bins
-  Float_t fYMin;     //* minimal Y value
-  Float_t fYMax;     //* maximal Y value
-  Float_t fZMin;     //* minimal Z value
-  Float_t fZMax;     //* maximal Z value
-  Float_t fStepYInv; //* inverse bin size in Y
-  Float_t fStepZInv; //* inverse bin size in Z
+    GPUd() void GetBinNoCheck( float Y, float Z, unsigned int &bY, unsigned int &bZ ) const {
+      bY = ( unsigned int ) ( ( Y - fYMin ) * fStepYInv );
+      bZ = ( unsigned int ) ( ( Z - fZMin ) * fStepZInv );
+    }
+
+
+    GPUd() unsigned int  N()        const { return fN;  }
+    GPUd() unsigned int  Ny()       const { return fNy; }
+    GPUd() unsigned int  Nz()       const { return fNz; }
+    GPUd() float YMin()     const { return fYMin; }
+    GPUd() float YMax()     const { return fYMax; }
+    GPUd() float ZMin()     const { return fZMin; }
+    GPUd() float ZMax()     const { return fZMax; }
+    GPUd() float StepYInv() const { return fStepYInv; }
+    GPUd() float StepZInv() const { return fStepZInv; }
+
+  private:
+
+    unsigned int fNy;        //* N bins in Y
+    unsigned int fNz;        //* N bins in Z
+    unsigned int fN;         //* total N bins
+    float fYMin;     //* minimal Y value
+    float fYMax;     //* maximal Y value
+    float fZMin;     //* minimal Z value
+    float fZMax;     //* maximal Z value
+    float fStepYInv; //* inverse bin size in Y
+    float fStepZInv; //* inverse bin size in Z
 
 };
 
index 9ea624f00b41f8f3d60e39682ecadee3a191d8de..2e400597a5ec541017ce54c3ac2ef8b8464eecd8 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAHit
 {
-public:
-  
-  GPUhd() Float_t Y() const   { return fY;    }
-  GPUhd() Float_t Z() const  { return fZ;    }
-
-  GPUhd() void SetY( Float_t v ){ fY = v;    }
-  GPUhd() void SetZ( Float_t v ){ fZ = v;    }
-  
-protected:
-  
-  Float_t fY, fZ;       // Y and Z position of the TPC cluster
-  
+  public:
+
+    GPUhd() float Y() const   { return fY;    }
+    GPUhd() float Z() const  { return fZ;    }
+
+    GPUhd() void SetY( float v ) { fY = v;    }
+    GPUhd() void SetZ( float v ) { fZ = v;    }
+
+  protected:
+
+    float fY, fZ;       // Y and Z position of the TPC cluster
+
 };
 
 
index 5dde989d6337925d098cbc8dbbb6259ef7613d01..178db6915af71b97bcbc63f88990e54a3c1fd505 100644 (file)
@@ -1,5 +1,5 @@
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLTTPCCAHit.h"
 
 /*
-GPUd() void AliHLTTPCCAHitAreaInit( AliHLTTPCCAHitArea &a,  AliHLTTPCCAGrid &grid, const UShort_t *content, UInt_t hitoffset, Float_t y, Float_t z, Float_t dy, Float_t dz )
-{ 
+GPUd() void AliHLTTPCCAHitAreaInit( AliHLTTPCCAHitArea &a,  AliHLTTPCCAGrid &grid, const unsigned short *content, unsigned int hitoffset, float y, float z, float dy, float dz )
+{
   // initialisation
 
   a.HitOffset() = hitoffset;
   a.Y() = y;
   a.Z() = z;
-  a.MinZ() = z-dz; 
+  a.MinZ() = z-dz;
   a.MaxZ() = z+dz;
   a.MinY() = y-dy;
   a.MaxY() = y+dy;
-  UInt_t bYmin, bZmin, bYmax;  
+  unsigned int bYmin, bZmin, bYmax;
   grid.GetBin(a.MinY(), a.MinZ(), bYmin, bZmin);
-  grid.GetBin(a.MaxY(), a.MaxZ(), bYmax, a.BZmax());  
+  grid.GetBin(a.MaxY(), a.MaxZ(), bYmax, a.BZmax());
   a.BDY() = bYmax - bYmin + 1;
   a.Ny() = grid.Ny();
   a.IndYmin() = bZmin*a.Ny() + bYmin;
   a.Iz() = bZmin;
   a.HitYfst() = content[a.IndYmin()];
-  a.HitYlst() = content[a.IndYmin() + a.BDY()];    
-  a.Ih() = a.HitYfst(); 
+  a.HitYlst() = content[a.IndYmin() + a.BDY()];
+  a.Ih() = a.HitYfst();
 }
 */
 
 
-GPUd() void AliHLTTPCCAHitArea::Init( const AliHLTTPCCAGrid &grid, const UShort_t *content, UInt_t hitoffset, Float_t y, Float_t z, Float_t dy, Float_t dz )
-{ 
+GPUd() void AliHLTTPCCAHitArea::Init( const AliHLTTPCCAGrid &grid, const unsigned short *content, unsigned int hitoffset, float y, float z, float dy, float dz )
+{
   //initialisation
 
   fHitOffset = hitoffset;
   fY = y;
   fZ = z;
-  fMinZ = z-dz; 
-  fMaxZ = z+dz;
-  fMinY = y-dy;
-  fMaxY = y+dy;
-  UInt_t bYmin, bZmin, bYmax;  
-  grid.GetBin( fMinY, fMinZ, bYmin, bZmin);
-  grid.GetBin( fMaxY, fMaxZ, bYmax, fBZmax);  
+  fMinZ = z - dz;
+  fMaxZ = z + dz;
+  fMinY = y - dy;
+  fMaxY = y + dy;
+  unsigned int bYmin, bZmin, bYmax;
+  grid.GetBin( fMinY, fMinZ, bYmin, bZmin );
+  grid.GetBin( fMaxY, fMaxZ, bYmax, fBZmax );
   fBDY = bYmax - bYmin + 1;
   fNy = grid.Ny();
-  fIndYmin = bZmin*fNy + bYmin;
+  fIndYmin = bZmin * fNy + bYmin;
   fIz = bZmin;
   fHitYfst = content[fIndYmin];
-  fHitYlst = content[fIndYmin + fBDY];    
-  fIh = fHitYfst; 
+  fHitYlst = content[fIndYmin + fBDY];
+  fIh = fHitYfst;
 }
 
 
-GPUd() Int_t AliHLTTPCCAHitArea::GetNext(AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const UShort_t *content, AliHLTTPCCAHit &h)
-{    
+GPUd() int AliHLTTPCCAHitArea::GetNext( AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const unsigned short *content, AliHLTTPCCAHit &h )
+{
   // get next hit index
-  Float_t y0 = row.Grid().YMin();
-  Float_t z0 = row.Grid().ZMin();
-  Float_t stepY = row.HstepY();
-  Float_t stepZ = row.HstepZ();
+  float y0 = row.Grid().YMin();
+  float z0 = row.Grid().ZMin();
+  float stepY = row.HstepY();
+  float stepZ = row.HstepZ();
   const uint4* tmpint4 = tracker.RowData() + row.FullOffset();
-  const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
+  const ushort2 *hits = reinterpret_cast<const ushort2*>( tmpint4 );
 
-  Int_t ret = -1;
-  do{
-    while( fIh>=fHitYlst ){
-      if( fIz>=fBZmax ) return -1;
+  int ret = -1;
+  do {
+    while ( fIh >= fHitYlst ) {
+      if ( fIz >= fBZmax ) return -1;
       fIz++;
       fIndYmin += fNy;
       fHitYfst = content[fIndYmin];
@@ -96,39 +96,39 @@ GPUd() Int_t AliHLTTPCCAHitArea::GetNext(AliHLTTPCCATracker &tracker, const AliH
       h.SetY( y0 + hh.x*stepY );
       h.SetZ( z0 + hh.y*stepZ );
     }
-    //h = tracker.Hits()[ fHitOffset + fIh ];    
-    
-    if( 1 && (h.Z()>fMaxZ || h.Z()<fMinZ || h.Y()<fMinY || h.Y()>fMaxY )){ //SG!!!
+    //h = tracker.Hits()[ fHitOffset + fIh ];
+
+    if ( 1 && ( h.Z() > fMaxZ || h.Z() < fMinZ || h.Y() < fMinY || h.Y() > fMaxY ) ) { //SG!!!
       fIh++;
       continue;
     }
     ret = fIh;
     fIh++;
     break;
-  } while(1);
-  return ret; 
+  } while ( 1 );
+  return ret;
 }
 
 
 
-GPUd() Int_t AliHLTTPCCAHitArea::GetBest(AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const UShort_t *content, AliHLTTPCCAHit &h)
+GPUd() int AliHLTTPCCAHitArea::GetBest( AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const unsigned short *content, AliHLTTPCCAHit &h )
 {
   // get closest hit in the area
-  Int_t best = -1;
-  Float_t ds = 1.e10;
-  do{
+  int best = -1;
+  float ds = 1.e10;
+  do {
     AliHLTTPCCAHit hh;
-    Int_t ih=GetNext( tracker, row, content, hh ); 
-    if( ih<0 ) break;
-    Float_t dy = hh.Y() - fY;
-    Float_t dz = hh.Z() - fZ;
-    Float_t dds = dy*dy+dz*dz;
-    if( dds<ds ){
+    int ih = GetNext( tracker, row, content, hh );
+    if ( ih < 0 ) break;
+    float dy = hh.Y() - fY;
+    float dz = hh.Z() - fZ;
+    float dds = dy * dy + dz * dz;
+    if ( dds < ds ) {
       ds = dds;
       best = ih;
       h = hh;
     }
-  }while(1);
+  } while ( 1 );
 
   return best;
 }
index 18c4cc3c525c8cf92e63680ace30bd195801859e..b6ce9a3549d7ad9d467ae6070cf9c5ee7a1f7320 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id: AliHLTTPCCARow.h 27042 2008-07-02 12:06:02Z richterm $
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -24,35 +24,35 @@ class AliHLTTPCCARow;
  */
 class AliHLTTPCCAHitArea
 {
-public:
-  
-  GPUd() void Init( const AliHLTTPCCAGrid &grid, const UShort_t *content, UInt_t hitoffset, Float_t y, Float_t z, Float_t dy, Float_t dz );
-
-  GPUd() Int_t GetNext(AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const UShort_t *content,AliHLTTPCCAHit &h);
-
-  GPUd() Int_t GetBest(AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const UShort_t *content,AliHLTTPCCAHit &h );
-
-  GPUhd() Float_t Y() const { return fY;}
-  GPUhd() Float_t Z() const { return fZ;}
-  GPUhd() Float_t MinZ() const { return fMinZ;}
-  GPUhd() Float_t MaxZ() const { return fMaxZ;}
-  GPUhd() Float_t MinY() const { return fMinY;}
-  GPUhd() Float_t MaxY() const { return fMaxY;}
-  GPUhd() UInt_t  BZmax() const { return fBZmax;}
-  GPUhd() UInt_t  BDY() const { return fBDY;}
-  GPUhd() UInt_t  IndYmin() const { return fIndYmin;}
-  GPUhd() UInt_t  Iz() const { return fIz;}
-  GPUhd() UInt_t  HitYfst() const { return fHitYfst;}
-  GPUhd() UInt_t  HitYlst() const { return fHitYlst;}
-  GPUhd() UInt_t  Ih() const { return fIh;}
-  GPUhd() UInt_t  Ny() const { return fNy;}
-  GPUhd() UInt_t  HitOffset() const { return fHitOffset;}
+  public:
+
+    GPUd() void Init( const AliHLTTPCCAGrid &grid, const unsigned short *content, unsigned int hitoffset, float y, float z, float dy, float dz );
+
+    GPUd() int GetNext( AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const unsigned short *content, AliHLTTPCCAHit &h );
+
+    GPUd() int GetBest( AliHLTTPCCATracker &tracker, const AliHLTTPCCARow &row, const unsigned short *content, AliHLTTPCCAHit &h );
+
+    GPUhd() float Y() const { return fY;}
+    GPUhd() float Z() const { return fZ;}
+    GPUhd() float MinZ() const { return fMinZ;}
+    GPUhd() float MaxZ() const { return fMaxZ;}
+    GPUhd() float MinY() const { return fMinY;}
+    GPUhd() float MaxY() const { return fMaxY;}
+    GPUhd() unsigned int  BZmax() const { return fBZmax;}
+    GPUhd() unsigned int  BDY() const { return fBDY;}
+    GPUhd() unsigned int  IndYmin() const { return fIndYmin;}
+    GPUhd() unsigned int  Iz() const { return fIz;}
+    GPUhd() unsigned int  HitYfst() const { return fHitYfst;}
+    GPUhd() unsigned int  HitYlst() const { return fHitYlst;}
+    GPUhd() unsigned int  Ih() const { return fIh;}
+    GPUhd() unsigned int  Ny() const { return fNy;}
+    GPUhd() unsigned int  HitOffset() const { return fHitOffset;}
 
   protected:
 
-  Float_t fY, fZ, fMinZ, fMaxZ, fMinY, fMaxY;    // search coordinates
-  UInt_t fBZmax, fBDY, fIndYmin, fIz, fHitYfst, fHitYlst, fIh, fNy; // !
-  UInt_t fHitOffset; // global hit offset
+    float fY, fZ, fMinZ, fMaxZ, fMinY, fMaxY;    // search coordinates
+    unsigned int fBZmax, fBDY, fIndYmin, fIz, fHitYfst, fHitYlst, fIh, fNy; // !
+    unsigned int fHitOffset; // global hit offset
 };
 
 #endif
index e96acfba600b55927f3a0ebf8786c4e5d1b79d89..64d14cbd3680692c31155729c9373299ec0ef1ca 100644 (file)
@@ -1,6 +1,6 @@
 // $Id: AliHLTTPCCAMCPoint.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
@@ -21,7 +21,7 @@
 
 
 AliHLTTPCCAMCPoint::AliHLTTPCCAMCPoint()
-  : fX(0), fY(0), fZ(0), fSx(0), fSy(0), fSz(0), fTime(0), fISlice(0), fTrackID(0)
+    : fX( 0 ), fY( 0 ), fZ( 0 ), fSx( 0 ), fSy( 0 ), fSz( 0 ), fTime( 0 ), fISlice( 0 ), fTrackID( 0 )
 {
   //* Default constructor
 }
index 9eea00f96926eddd2cc3e6d2720d998223bc3150..5cbfaecc237659536a2045ad939d355142ab429c 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAMCPoint
 {
- public:
-
-  AliHLTTPCCAMCPoint();
-
-  Float_t  X()           const { return fX; }
-  Float_t  Y()           const { return fY; }
-  Float_t  Z()           const { return fZ; }
-  Float_t  Sx()          const { return fSx; }
-  Float_t  Sy()          const { return fSy; }
-  Float_t  Sz()          const { return fSz; }
-  Float_t  Time()        const { return fTime; }
-  Int_t    ISlice()      const { return fISlice; }
-  Int_t    TrackID()     const { return fTrackID; }
-
-  void SetX( Float_t v )           { fX=v; }
-  void SetY( Float_t v )           { fY=v; }
-  void SetZ( Float_t v )           { fZ=v; }
-  void SetSx( Float_t v )          { fSx=v; }
-  void SetSy( Float_t v )          { fSy=v; }
-  void SetSz( Float_t v )          { fSz=v; }
-  void SetTime( Float_t v )        { fTime=v; }
-  void SetISlice( Int_t v )      { fISlice=v; }
-  void SetTrackID( Int_t v )     { fTrackID=v; }
-
-  static Bool_t Compare( const AliHLTTPCCAMCPoint &p1, const AliHLTTPCCAMCPoint &p2 )
-    {
-      return (p1.fTrackID < p2.fTrackID);
+  public:
+
+    AliHLTTPCCAMCPoint();
+
+    float  X()           const { return fX; }
+    float  Y()           const { return fY; }
+    float  Z()           const { return fZ; }
+    float  Sx()          const { return fSx; }
+    float  Sy()          const { return fSy; }
+    float  Sz()          const { return fSz; }
+    float  Time()        const { return fTime; }
+    int    ISlice()      const { return fISlice; }
+    int    TrackID()     const { return fTrackID; }
+
+    void SetX( float v )           { fX = v; }
+    void SetY( float v )           { fY = v; }
+    void SetZ( float v )           { fZ = v; }
+    void SetSx( float v )          { fSx = v; }
+    void SetSy( float v )          { fSy = v; }
+    void SetSz( float v )          { fSz = v; }
+    void SetTime( float v )        { fTime = v; }
+    void SetISlice( int v )      { fISlice = v; }
+    void SetTrackID( int v )     { fTrackID = v; }
+
+    static bool Compare( const AliHLTTPCCAMCPoint &p1, const AliHLTTPCCAMCPoint &p2 ) {
+      return ( p1.fTrackID < p2.fTrackID );
     }
-  
- protected:
-
-  Float_t fX;         //* global X position
-  Float_t fY;         //* global Y position
-  Float_t fZ;         //* global Z position
-  Float_t fSx;        //* slice X position
-  Float_t fSy;        //* slice Y position
-  Float_t fSz;        //* slice Z position
-  Float_t fTime;      //* time 
-  Int_t   fISlice;    //* slice number
-  Int_t   fTrackID;   //* mc track number
+
 protected:
+
+    float fX;         //* global X position
+    float fY;         //* global Y position
+    float fZ;         //* global Z position
+    float fSx;        //* slice X position
+    float fSy;        //* slice Y position
+    float fSz;        //* slice Z position
+    float fTime;      //* time
+    int   fISlice;    //* slice number
+    int   fTrackID;   //* mc track number
 };
 
 #endif
index 3064cdb906e4acedd483979834aade87aa1f029b..ae302ce65eddc8926aa47127778df9a97ec7d239 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 
 
 AliHLTTPCCAMCTrack::AliHLTTPCCAMCTrack()
-  : fPDG(0), fP(0), fPt(0), fNHits(0), fNMCPoints(0), fFirstMCPointID(0), fNReconstructed(0), fSet(0), fNTurns(0)
+    : fPDG( 0 ), fP( 0 ), fPt( 0 ), fNHits( 0 ), fNMCPoints( 0 ), fFirstMCPointID( 0 ), fNReconstructed( 0 ), fSet( 0 ), fNTurns( 0 )
 {
   //* Default constructor
 }
 
 
 AliHLTTPCCAMCTrack::AliHLTTPCCAMCTrack( const TParticle *part )
-  : fPDG(0), fP(0), fPt(0), fNHits(0), fNMCPoints(0), fFirstMCPointID(0), fNReconstructed(0), fSet(0), fNTurns(0)
+    : fPDG( 0 ), fP( 0 ), fPt( 0 ), fNHits( 0 ), fNMCPoints( 0 ), fFirstMCPointID( 0 ), fNReconstructed( 0 ), fSet( 0 ), fNTurns( 0 )
 {
   //* Constructor from TParticle
 
-  for( Int_t i=0; i<7; i++ ) fPar[i] = 0;
-  for( Int_t i=0; i<7; i++ ) fTPCPar[i] = 0;
+  for ( int i = 0; i < 7; i++ ) fPar[i] = 0;
+  for ( int i = 0; i < 7; i++ ) fTPCPar[i] = 0;
   fP = 0;
   fPt = 0;
 
-  if( !part ) return;
+  if ( !part ) return;
   TLorentzVector mom, vtx;
-  part->ProductionVertex(vtx);
-  part->Momentum(mom);
+  part->ProductionVertex( vtx );
+  part->Momentum( mom );
   fPar[0] = part->Vx();
   fPar[1] = part->Vy();
   fPar[2] = part->Vz();
   fP = part->P();
   fPt = part->Pt();
-  Double_t pi = ( fP >1.e-4 ) ?1./fP :0;
-  fPar[3] = part->Px()*pi;
-  fPar[4] = part->Py()*pi;
-  fPar[5] = part->Pz()*pi;
+  double pi = ( fP > 1.e-4 ) ? 1. / fP : 0;
+  fPar[3] = part->Px() * pi;
+  fPar[4] = part->Py() * pi;
+  fPar[5] = part->Pz() * pi;
   fPar[6] = 0;
-  fPDG  = part->GetPdgCode();    
-  if ( CAMath::Abs(fPDG) < 100000 ){
-    TParticlePDG *pPDG = TDatabasePDG::Instance()->GetParticle(fPDG);
-    if( pPDG ) fPar[6] = pPDG->Charge()/3.0*pi;
+  fPDG  = part->GetPdgCode();
+  if ( CAMath::Abs( fPDG ) < 100000 ) {
+    TParticlePDG *pPDG = TDatabasePDG::Instance()->GetParticle( fPDG );
+    if ( pPDG ) fPar[6] = pPDG->Charge() / 3.0 * pi;
   }
 }
 
-void AliHLTTPCCAMCTrack::SetTPCPar( Float_t X, Float_t Y, Float_t Z,
-                                   Float_t Px, Float_t Py, Float_t Pz )
+void AliHLTTPCCAMCTrack::SetTPCPar( float X, float Y, float Z,
+                                    float Px, float Py, float Pz )
 {
   //* Set parameters at TPC entrance
 
-  for( Int_t i=0; i<7; i++ ) fTPCPar[i] = 0;
+  for ( int i = 0; i < 7; i++ ) fTPCPar[i] = 0;
 
   fTPCPar[0] = X;
   fTPCPar[1] = Y;
   fTPCPar[2] = Z;
-  Double_t p = CAMath::Sqrt(Px*Px + Py*Py + Pz*Pz);
-  Double_t pi = ( p >1.e-4 ) ?1./p :0;
-  fTPCPar[3] = Px*pi;
-  fTPCPar[4] = Py*pi;
-  fTPCPar[5] = Pz*pi;
+  double p = CAMath::Sqrt( Px * Px + Py * Py + Pz * Pz );
+  double pi = ( p > 1.e-4 ) ? 1. / p : 0;
+  fTPCPar[3] = Px * pi;
+  fTPCPar[4] = Py * pi;
+  fTPCPar[5] = Pz * pi;
   fTPCPar[6] = 0;
-  if ( CAMath::Abs(fPDG) < 100000 ){
-    TParticlePDG *pPDG = TDatabasePDG::Instance()->GetParticle(fPDG);
-    if( pPDG ) fTPCPar[6] = pPDG->Charge()/3.0*pi;
+  if ( CAMath::Abs( fPDG ) < 100000 ) {
+    TParticlePDG *pPDG = TDatabasePDG::Instance()->GetParticle( fPDG );
+    if ( pPDG ) fTPCPar[6] = pPDG->Charge() / 3.0 * pi;
   }
 }
index d2c9d0775754ba38bb514e0f6bc3075cef29eb35..14c326e3b9fc470e2ff8f00868554487e5fee8f8 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -20,51 +20,51 @@ class TParticle;
  */
 class AliHLTTPCCAMCTrack
 {
- public:
 public:
 
-  AliHLTTPCCAMCTrack();
-  AliHLTTPCCAMCTrack( const TParticle *part );
+    AliHLTTPCCAMCTrack();
+    AliHLTTPCCAMCTrack( const TParticle *part );
 
-  void SetTPCPar( Float_t X, Float_t Y, Float_t Z, Float_t Px, Float_t Py, Float_t Pz );
+    void SetTPCPar( float X, float Y, float Z, float Px, float Py, float Pz );
 
-  Int_t     PDG()            const { return fPDG;}
-  const Double_t *Par()            const { return fPar; }
-  const Double_t *TPCPar()         const { return fTPCPar; }
-  Double_t  P()              const { return fP; }
-  Double_t  Pt()             const { return fPt; }
-  
-  Int_t     NHits()          const { return fNHits;}
-  Int_t     NMCPoints()      const { return fNMCPoints;}
-  Int_t     FirstMCPointID() const { return fFirstMCPointID;}
-  Int_t     NReconstructed() const { return fNReconstructed; }
-  Int_t     Set()            const { return fSet; }
-  Int_t     NTurns()         const { return fNTurns; }
+    int     PDG()            const { return fPDG;}
+    const double *Par()            const { return fPar; }
+    const double *TPCPar()         const { return fTPCPar; }
+    double  P()              const { return fP; }
+    double  Pt()             const { return fPt; }
 
-  void SetP ( Float_t v )          { fP = v; }
-  void SetPt( Float_t v )          { fPt = v; }
-  void SetPDG( Int_t v )         { fPDG = v; }
-  void SetPar( Int_t i, Double_t v)             { fPar[i] = v; }
-  void SetTPCPar( Int_t i, Double_t v)          { fTPCPar[i] = v; }
-  void SetNHits( Int_t v )         { fNHits = v; }
-  void SetNMCPoints( Int_t v)      { fNMCPoints = v; }
-  void SetFirstMCPointID( Int_t v ){ fFirstMCPointID = v;}
-  void SetNReconstructed( Int_t v ){ fNReconstructed = v; }
-  void SetSet( Int_t v )           { fSet = v; }
-  void SetNTurns( Int_t v )        { fNTurns = v; }
-  
- protected:
+    int     NHits()          const { return fNHits;}
+    int     NMCPoints()      const { return fNMCPoints;}
+    int     FirstMCPointID() const { return fFirstMCPointID;}
+    int     NReconstructed() const { return fNReconstructed; }
+    int     Set()            const { return fSet; }
+    int     NTurns()         const { return fNTurns; }
+
+    void SetP ( float v )          { fP = v; }
+    void SetPt( float v )          { fPt = v; }
+    void SetPDG( int v )         { fPDG = v; }
+    void SetPar( int i, double v )             { fPar[i] = v; }
+    void SetTPCPar( int i, double v )          { fTPCPar[i] = v; }
+    void SetNHits( int v )         { fNHits = v; }
+    void SetNMCPoints( int v )      { fNMCPoints = v; }
+    void SetFirstMCPointID( int v ) { fFirstMCPointID = v;}
+    void SetNReconstructed( int v ) { fNReconstructed = v; }
+    void SetSet( int v )           { fSet = v; }
+    void SetNTurns( int v )        { fNTurns = v; }
+
+  protected:
+
+    int    fPDG;            //* particle pdg code
+    double fPar[7];         //* x,y,z,ex,ey,ez,q/p
+    double fTPCPar[7];      //* x,y,z,ex,ey,ez,q/p at TPC entrance (x=y=0 means no information)
+    double fP, fPt;         //* momentum and transverse momentum
+    int    fNHits;          //* N TPC clusters
+    int    fNMCPoints;      //* N MC points
+    int    fFirstMCPointID; //* id of the first MC point in the points array
+    int    fNReconstructed; //* how many times is reconstructed
+    int    fSet;            //* set of tracks 0-OutSet, 1-ExtraSet, 2-RefSet
+    int    fNTurns;         //* N of turns in the current sector
 
-  Int_t    fPDG;            //* particle pdg code
-  Double_t fPar[7];         //* x,y,z,ex,ey,ez,q/p
-  Double_t fTPCPar[7];      //* x,y,z,ex,ey,ez,q/p at TPC entrance (x=y=0 means no information)
-  Double_t fP, fPt;         //* momentum and transverse momentum
-  Int_t    fNHits;          //* N TPC clusters
-  Int_t    fNMCPoints;      //* N MC points 
-  Int_t    fFirstMCPointID; //* id of the first MC point in the points array
-  Int_t    fNReconstructed; //* how many times is reconstructed
-  Int_t    fSet;            //* set of tracks 0-OutSet, 1-ExtraSet, 2-RefSet 
-  Int_t    fNTurns;         //* N of turns in the current sector
-  
 };
 
 #endif
index c52364bc32e8c72f8fab0a8de3619fed586819ec..66783d58232e3126f94005347a25199d308ff643 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAMath
 {
-public:
-  GPUd() static float2 MakeFloat2(float x, float y );
-
-  GPUd() static Float_t Min(Float_t x, Float_t y);
-  GPUd() static Float_t Max(Float_t x, Float_t y);
-  GPUd() static Int_t Min(Int_t x, Int_t y);
-  GPUd() static Int_t Max(Int_t x, Int_t y);
-  GPUd() static Float_t Sqrt(Float_t x );
-  GPUd() static Float_t Abs(Float_t x );
-  GPUd() static Double_t Abs(Double_t x );
-  GPUd() static Int_t Abs(Int_t x );
-  GPUd() static Float_t ASin(Float_t x );
-  GPUd() static Float_t ATan2( Float_t y, Float_t x );
-  GPUd() static Float_t Sin( Float_t x );
-  GPUd() static Float_t Cos( Float_t x );
-  GPUd() static Float_t Tan( Float_t x );
-  GPUd() static Float_t Copysign( Float_t x, Float_t y );  
-  GPUd() static Float_t TwoPi(){ return 6.28319; }
-  GPUd() static Float_t Pi(){ return 3.1415926535897; }
-  GPUd() static Int_t Nint(Float_t x );
-  GPUd() static Bool_t Finite(Float_t x );
-
-  GPUd()  static Int_t AtomicExch( Int_t *addr, Int_t val);
-  GPUd()  static Int_t AtomicAdd ( Int_t *addr, Int_t val);
-  GPUd()  static Int_t AtomicMax ( Int_t *addr, Int_t val);
-  GPUd()  static Int_t AtomicMin ( Int_t *addr, Int_t val);
-  GPUd()  static Int_t Mul24( Int_t a, Int_t b );
-  GPUd()  static Float_t FMulRZ( Float_t a, Float_t b );
+  public:
+    GPUd() static float2 MakeFloat2( float x, float y );
+
+    GPUd() static float Min( float x, float y );
+    GPUd() static float Max( float x, float y );
+    GPUd() static int Min( int x, int y );
+    GPUd() static int Max( int x, int y );
+    GPUd() static float Sqrt( float x );
+    GPUd() static float Abs( float x );
+    GPUd() static double Abs( double x );
+    GPUd() static int Abs( int x );
+    GPUd() static float ASin( float x );
+    GPUd() static float ATan2( float y, float x );
+    GPUd() static float Sin( float x );
+    GPUd() static float Cos( float x );
+    GPUd() static float Tan( float x );
+    GPUd() static float Copysign( float x, float y );
+    GPUd() static float TwoPi() { return 6.28319; }
+    GPUd() static float Pi() { return 3.1415926535897; }
+    GPUd() static int Nint( float x );
+    GPUd() static bool Finite( float x );
+
+    GPUd()  static int AtomicExch( int *addr, int val );
+    GPUd()  static int AtomicAdd ( int *addr, int val );
+    GPUd()  static int AtomicMax ( int *addr, int val );
+    GPUd()  static int AtomicMin ( int *addr, int val );
+    GPUd()  static int Mul24( int a, int b );
+    GPUd()  static float FMulRZ( float a, float b );
 };
 
 typedef AliHLTTPCCAMath CAMath;
@@ -65,168 +65,168 @@ typedef AliHLTTPCCAMath CAMath;
 #define choice(c1,c2,c3) c3
 #endif
 
-GPUd() inline float2 AliHLTTPCCAMath::MakeFloat2(float x, float y )
+GPUd() inline float2 AliHLTTPCCAMath::MakeFloat2( float x, float y )
 {
 #if !defined( HLTCA_GPUCODE )
-  float2 ret = {x,y};
+  float2 ret = {x, y};
   return ret;
 #else
-  return make_float2(x,y);
+  return make_float2( x, y );
 #endif
 }
 
 
-GPUd() inline Int_t AliHLTTPCCAMath::Nint(Float_t x)
-{  
+GPUd() inline int AliHLTTPCCAMath::Nint( float x )
+{
 #if defined(HLTCA_STANDALONE) || defined( HLTCA_GPUCODE )
-  Int_t i;
-  if (x >= 0) {
-    i = int(x + 0.5);
-    if (x + 0.5 == Float_t(i) && i & 1) i--;
+  int i;
+  if ( x >= 0 ) {
+    i = int( x + 0.5 );
+    if ( x + 0.5 == float( i ) && i & 1 ) i--;
   } else {
-    i = int(x - 0.5);
-    if (x - 0.5 == Float_t(i) && i & 1) i++;    
+    i = int( x - 0.5 );
+    if ( x - 0.5 == float( i ) && i & 1 ) i++;
   }
   return i;
 #else
-  return TMath::Nint(x);
+  return TMath::Nint( x );
 #endif
 }
 
-GPUd() inline Bool_t AliHLTTPCCAMath::Finite(Float_t x)
-{  
-  return choice( 1, finite(x), finite(x) );
+GPUd() inline bool AliHLTTPCCAMath::Finite( float x )
+{
+  return choice( 1, finite( x ), finite( x ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::ATan2(Float_t y, Float_t x)
-{ 
-  return choice(atan2f(y,x), atan2(y,x), TMath::ATan2(y,x) );
+GPUd() inline float AliHLTTPCCAMath::ATan2( float y, float x )
+{
+  return choice( atan2f( y, x ), atan2( y, x ), TMath::ATan2( y, x ) );
 }
 
 
-GPUd() inline Float_t AliHLTTPCCAMath::Copysign(Float_t x, Float_t y)
-{ 
+GPUd() inline float AliHLTTPCCAMath::Copysign( float x, float y )
+{
 #if defined( HLTCA_GPUCODE )
-  return copysignf(x,y);
+  return copysignf( x, y );
 #else
-  x = CAMath::Abs(x);
-  return (y>=0) ?x : -x;
+  x = CAMath::Abs( x );
+  return ( y >= 0 ) ? x : -x;
 #endif
 }
 
 
-GPUd() inline Float_t AliHLTTPCCAMath::Sin(Float_t x)
-{ 
-  return choice( sinf(x), sin(x), TMath::Sin(x) );
+GPUd() inline float AliHLTTPCCAMath::Sin( float x )
+{
+  return choice( sinf( x ), sin( x ), TMath::Sin( x ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::Cos(Float_t x)
-{ 
-  return choice( cosf(x), cos(x), TMath::Cos(x) );
+GPUd() inline float AliHLTTPCCAMath::Cos( float x )
+{
+  return choice( cosf( x ), cos( x ), TMath::Cos( x ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::Tan(Float_t x)
-{ 
-  return choice( tanf(x), tan(x), TMath::Tan(x) );
+GPUd() inline float AliHLTTPCCAMath::Tan( float x )
+{
+  return choice( tanf( x ), tan( x ), TMath::Tan( x ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::Min(Float_t x, Float_t y)
-{ 
-  return choice( fminf(x,y),  (x<y ?x :y), TMath::Min(x,y) );
+GPUd() inline float AliHLTTPCCAMath::Min( float x, float y )
+{
+  return choice( fminf( x, y ),  ( x < y ? x : y ), TMath::Min( x, y ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::Max(Float_t x, Float_t y)
-{ 
-  return choice( fmaxf(x,y),  (x>y ?x :y), TMath::Max(x,y) );
+GPUd() inline float AliHLTTPCCAMath::Max( float x, float y )
+{
+  return choice( fmaxf( x, y ),  ( x > y ? x : y ), TMath::Max( x, y ) );
 }
 
-GPUd() inline Int_t AliHLTTPCCAMath::Min(Int_t x, Int_t y)
-{ 
-  return choice( min(x,y),  (x<y ?x :y), TMath::Min(x,y) );
+GPUd() inline int AliHLTTPCCAMath::Min( int x, int y )
+{
+  return choice( min( x, y ),  ( x < y ? x : y ), TMath::Min( x, y ) );
 }
 
-GPUd() inline Int_t AliHLTTPCCAMath::Max(Int_t x, Int_t y)
-{ 
-  return choice( max(x,y),  (x>y ?x :y), TMath::Max(x,y) );
+GPUd() inline int AliHLTTPCCAMath::Max( int x, int y )
+{
+  return choice( max( x, y ),  ( x > y ? x : y ), TMath::Max( x, y ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::Sqrt(Float_t x )
-{ 
-  return choice( sqrtf(x), sqrt(x), TMath::Sqrt(x) );
+GPUd() inline float AliHLTTPCCAMath::Sqrt( float x )
+{
+  return choice( sqrtf( x ), sqrt( x ), TMath::Sqrt( x ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::Abs(Float_t x )
-{ 
-  return choice( fabsf(x), fabs(x), TMath::Abs(x) );
+GPUd() inline float AliHLTTPCCAMath::Abs( float x )
+{
+  return choice( fabsf( x ), fabs( x ), TMath::Abs( x ) );
 }
 
-GPUd() inline Double_t AliHLTTPCCAMath::Abs(Double_t x )
-{ 
-  return choice( fabs(x), fabs(x), TMath::Abs(x) );
+GPUd() inline double AliHLTTPCCAMath::Abs( double x )
+{
+  return choice( fabs( x ), fabs( x ), TMath::Abs( x ) );
 }
 
-GPUd() inline Int_t AliHLTTPCCAMath::Abs(Int_t x )
-{ 
-  return choice( abs(x), (x>=0 ?x :-x), TMath::Abs(x) );
+GPUd() inline int AliHLTTPCCAMath::Abs( int x )
+{
+  return choice( abs( x ), ( x >= 0 ? x : -x ), TMath::Abs( x ) );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::ASin(Float_t x )
-{ 
-  return choice( asinf(x), asin(x), TMath::ASin(x) );
+GPUd() inline float AliHLTTPCCAMath::ASin( float x )
+{
+  return choice( asinf( x ), asin( x ), TMath::ASin( x ) );
 }
 
 
-GPUd() inline Int_t AliHLTTPCCAMath::Mul24( Int_t a, Int_t b )
+GPUd() inline int AliHLTTPCCAMath::Mul24( int a, int b )
 {
-  return choice( __mul24(a,b), a*b, a*b );
+  return choice( __mul24( a, b ), a*b, a*b );
 }
 
-GPUd() inline Float_t AliHLTTPCCAMath::FMulRZ( Float_t a, Float_t b )
+GPUd() inline float AliHLTTPCCAMath::FMulRZ( float a, float b )
 {
-  return choice( __fmul_rz(a,b), a*b, a*b );
+  return choice( __fmul_rz( a, b ), a*b, a*b );
 }
 
 
-GPUd()  inline Int_t AliHLTTPCCAMath::AtomicExch( Int_t *addr, Int_t val)
+GPUd()  inline int AliHLTTPCCAMath::AtomicExch( int *addr, int val )
 {
 #if defined( HLTCA_GPUCODE )
-  return ::atomicExch(addr, val );
-#else  
-  Int_t old = *addr;
+  return ::atomicExch( addr, val );
+#else
+  int old = *addr;
   *addr = val;
   return old;
 #endif
 }
 
-GPUd()  inline Int_t AliHLTTPCCAMath::AtomicAdd ( Int_t *addr, Int_t val)
+GPUd()  inline int AliHLTTPCCAMath::AtomicAdd ( int *addr, int val )
 {
 #if defined( HLTCA_GPUCODE )
-  return ::atomicAdd(addr, val );
-#else  
-  Int_t old = *addr;
+  return ::atomicAdd( addr, val );
+#else
+  int old = *addr;
   *addr += val;
   return old;
 #endif
 }
 
-GPUd()  inline Int_t AliHLTTPCCAMath::AtomicMax ( Int_t *addr, Int_t val)
+GPUd()  inline int AliHLTTPCCAMath::AtomicMax ( int *addr, int val )
 {
 #if defined( HLTCA_GPUCODE )
-  return ::atomicMax(addr, val );
-#else  
-  Int_t old = *addr;
-  if( *addr< val ) *addr = val;
+  return ::atomicMax( addr, val );
+#else
+  int old = *addr;
+  if ( *addr < val ) *addr = val;
   return old;
 #endif
 }
 
-GPUd()  inline Int_t AliHLTTPCCAMath::AtomicMin ( Int_t *addr, Int_t val)
+GPUd()  inline int AliHLTTPCCAMath::AtomicMin ( int *addr, int val )
 {
 #if defined( HLTCA_GPUCODE )
-  return ::atomicMin(addr, val );
-#else  
-  Int_t old = *addr;
-  if( *addr> val ) *addr = val;
+  return ::atomicMin( addr, val );
+#else
+  int old = *addr;
+  if ( *addr > val ) *addr = val;
   return old;
 #endif
 }
index 771c4e3c35ead9706b43d4dc222d496246ea352d..1c8b6d096fd78f8d4e642e74c13ed529a2998287 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -16,9 +16,9 @@
  * @class AliHLTTPCCAMergedTrack
  * AliHLTTPCCAMergedTrack class is used to store TPC tracks,
  * which are reconstructed by the TPCCATracker slice tracker.
- * 
+ *
  * The class contains:
- * - fitted track parameters at its first row, the covariance matrix, \Chi^2, NDF (number of degrees of freedom ) 
+ * - fitted track parameters at its first row, the covariance matrix, \Chi^2, NDF (number of degrees of freedom )
  * - n of clusters assigned to the track
  * - index of its first cluster in corresponding cluster arrays
  *
  */
 class AliHLTTPCCAMergedTrack
 {
- public:
-
-  GPUhd() Int_t NClusters()                         const { return fNClusters;       }
-  GPUhd() Int_t FirstClusterRef()                   const { return fFirstClusterRef; }
-  GPUhd() const AliHLTTPCCATrackParam &InnerParam() const { return fInnerParam;      }
-  GPUhd() const AliHLTTPCCATrackParam &OuterParam() const { return fOuterParam;      }
-  GPUhd() Float_t InnerAlpha()                      const { return fInnerAlpha;      }
-  GPUhd() Float_t OuterAlpha()                      const { return fOuterAlpha;      }
-
-  GPUhd() void SetNClusters      ( Int_t v )                  { fNClusters = v;       }
-  GPUhd() void SetFirstClusterRef( Int_t v )                  { fFirstClusterRef = v; }
-  GPUhd() void SetInnerParam( const AliHLTTPCCATrackParam &v) { fInnerParam = v;      }
-  GPUhd() void SetOuterParam( const AliHLTTPCCATrackParam &v) { fOuterParam = v;      }
-  GPUhd() void SetInnerAlpha( Float_t v )                       { fInnerAlpha = v;      }
-  GPUhd() void SetOuterAlpha( Float_t v )                       { fOuterAlpha = v;      }
-
- private:
-  
-  AliHLTTPCCATrackParam fInnerParam; //* fitted track parameters at the TPC inner radius
-  AliHLTTPCCATrackParam fOuterParam; //* fitted track parameters at the TPC outer radius
-  Float_t fInnerAlpha;               //* alpha angle for the inner parameters
-  Float_t fOuterAlpha;               //* alpha angle for the outer parameters
-  Int_t fFirstClusterRef;            //* index of the first track cluster in corresponding cluster arrays
-  Int_t fNClusters;                  //* number of track clusters
 public:
+
+    GPUhd() int NClusters()                         const { return fNClusters;       }
+    GPUhd() int FirstClusterRef()                   const { return fFirstClusterRef; }
+    GPUhd() const AliHLTTPCCATrackParam &InnerParam() const { return fInnerParam;      }
+    GPUhd() const AliHLTTPCCATrackParam &OuterParam() const { return fOuterParam;      }
+    GPUhd() float InnerAlpha()                      const { return fInnerAlpha;      }
+    GPUhd() float OuterAlpha()                      const { return fOuterAlpha;      }
+
+    GPUhd() void SetNClusters      ( int v )                  { fNClusters = v;       }
+    GPUhd() void SetFirstClusterRef( int v )                  { fFirstClusterRef = v; }
+    GPUhd() void SetInnerParam( const AliHLTTPCCATrackParam &v ) { fInnerParam = v;      }
+    GPUhd() void SetOuterParam( const AliHLTTPCCATrackParam &v ) { fOuterParam = v;      }
+    GPUhd() void SetInnerAlpha( float v )                       { fInnerAlpha = v;      }
+    GPUhd() void SetOuterAlpha( float v )                       { fOuterAlpha = v;      }
+
 private:
+
+    AliHLTTPCCATrackParam fInnerParam; //* fitted track parameters at the TPC inner radius
+    AliHLTTPCCATrackParam fOuterParam; //* fitted track parameters at the TPC outer radius
+    float fInnerAlpha;               //* alpha angle for the inner parameters
+    float fOuterAlpha;               //* alpha angle for the outer parameters
+    int fFirstClusterRef;            //* index of the first track cluster in corresponding cluster arrays
+    int fNClusters;                  //* number of track clusters
 };
 
 
index 869713e197716facaa031d01c87a3219063bdaaa..c7b61ea79ba8977c996cbfb0457abd50dbecc3cb 100644 (file)
@@ -1,6 +1,6 @@
 // $Id: AliHLTTPCCAMerger.cxx 30732 2009-01-22 23:02:02Z sgorbuno $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 
 class AliHLTTPCCAMerger::AliHLTTPCCAClusterInfo
 {
-  
-public:
-  
-  UInt_t  ISlice()    const { return fISlice;    }
-  UInt_t  IRow()      const { return fIRow;      }
-  UInt_t  IClu()      const { return fIClu;      }
-  UChar_t PackedAmp() const { return fPackedAmp; }
-  Float_t X()         const { return fX;         }
-  Float_t Y()         const { return fY;         }
-  Float_t Z()         const { return fZ;         }
-  Float_t Err2Y()     const { return fErr2Y;     }
-  Float_t Err2Z()     const { return fErr2Z;     }
-    
-  void SetISlice    ( UInt_t v  ) { fISlice    = v; }
-  void SetIRow      ( UInt_t v  ) { fIRow      = v; }
-  void SetIClu      ( UInt_t v  ) { fIClu      = v; }
-  void SetPackedAmp ( UChar_t v ) { fPackedAmp = v; }
-  void SetX         ( Float_t v ) { fX         = v; } 
-  void SetY         ( Float_t v ) { fY         = v; } 
-  void SetZ         ( Float_t v ) { fZ         = v; } 
-  void SetErr2Y     ( Float_t v ) { fErr2Y     = v; } 
-  void SetErr2Z     ( Float_t v ) { fErr2Z     = v; } 
-  
-private:
-  
-  UInt_t fISlice;            // slice number
-  UInt_t fIRow;              // row number
-  UInt_t fIClu;              // cluster number
-  UChar_t fPackedAmp; // packed cluster amplitude
-  Float_t fX;                // x position (slice coord.system)
-  Float_t fY;                // y position (slice coord.system)
-  Float_t fZ;                // z position (slice coord.system)
-  Float_t fErr2Y;            // Squared measurement error of y position
-  Float_t fErr2Z;            // Squared measurement error of z position
+
+  public:
+
+    unsigned int  ISlice()    const { return fISlice;    }
+    unsigned int  IRow()      const { return fIRow;      }
+    unsigned int  IClu()      const { return fIClu;      }
+    UChar_t PackedAmp() const { return fPackedAmp; }
+    float X()         const { return fX;         }
+    float Y()         const { return fY;         }
+    float Z()         const { return fZ;         }
+    float Err2Y()     const { return fErr2Y;     }
+    float Err2Z()     const { return fErr2Z;     }
+
+    void SetISlice    ( unsigned int v  ) { fISlice    = v; }
+    void SetIRow      ( unsigned int v  ) { fIRow      = v; }
+    void SetIClu      ( unsigned int v  ) { fIClu      = v; }
+    void SetPackedAmp ( UChar_t v ) { fPackedAmp = v; }
+    void SetX         ( float v ) { fX         = v; }
+    void SetY         ( float v ) { fY         = v; }
+    void SetZ         ( float v ) { fZ         = v; }
+    void SetErr2Y     ( float v ) { fErr2Y     = v; }
+    void SetErr2Z     ( float v ) { fErr2Z     = v; }
+
+  private:
+
+    unsigned int fISlice;            // slice number
+    unsigned int fIRow;              // row number
+    unsigned int fIClu;              // cluster number
+    UChar_t fPackedAmp; // packed cluster amplitude
+    float fX;                // x position (slice coord.system)
+    float fY;                // y position (slice coord.system)
+    float fZ;                // z position (slice coord.system)
+    float fErr2Y;            // Squared measurement error of y position
+    float fErr2Z;            // Squared measurement error of z position
 };
 
 
 class AliHLTTPCCAMerger::AliHLTTPCCASliceTrackInfo
 {
 
-public:
-
-  const AliHLTTPCCATrackParam &InnerParam() const { return fInnerParam;      }
-  const AliHLTTPCCATrackParam &OuterParam() const { return fOuterParam;      }  
-  Float_t InnerAlpha()                      const { return fInnerAlpha;      }
-  Float_t OuterAlpha()                      const { return fOuterAlpha;      }
-  Int_t   NClusters()                       const { return fNClusters;       }
-  Int_t   FirstClusterRef()                 const { return fFirstClusterRef; }
-  Int_t   PrevNeighbour()                   const { return fPrevNeighbour;   }
-  Int_t   NextNeighbour()                   const { return fNextNeighbour;   }
-  Bool_t  Used()                            const { return fUsed;            }
-  
-  void SetInnerParam( const AliHLTTPCCATrackParam &v ) { fInnerParam = v;      }
-  void SetOuterParam( const AliHLTTPCCATrackParam &v ) { fOuterParam = v;      }
-  void SetInnerAlpha( Float_t v )                      { fInnerAlpha = v;      }
-  void SetOuterAlpha( Float_t v )                      { fOuterAlpha = v;      }
-  void SetNClusters ( Int_t v )                        { fNClusters = v;       }
-  void SetFirstClusterRef( Int_t v )                   { fFirstClusterRef = v; }
-  void SetPrevNeighbour( Int_t v )                     { fPrevNeighbour = v;   }
-  void SetNextNeighbour( Int_t v )                     { fNextNeighbour = v;   }
-  void SetUsed( Bool_t v )                             { fUsed = v;            }
-
-private:
-
-  AliHLTTPCCATrackParam fInnerParam; // inner parameters
-  AliHLTTPCCATrackParam fOuterParam; // outer parameters
-  Float_t fInnerAlpha;               // alpha angle for inner parameters
-  Float_t fOuterAlpha;               // alpha angle for outer parameters
-  Int_t fNClusters;                  // N clusters
-  Int_t fFirstClusterRef;  // index of the first track cluster in the global cluster array
-  Int_t fPrevNeighbour;    // neighbour in the previous slise
-  Int_t fNextNeighbour;    // neighbour in the next slise
-  Bool_t fUsed;            // is the slice track already merged
+  public:
+
+    const AliHLTTPCCATrackParam &InnerParam() const { return fInnerParam;      }
+    const AliHLTTPCCATrackParam &OuterParam() const { return fOuterParam;      }
+    float InnerAlpha()                      const { return fInnerAlpha;      }
+    float OuterAlpha()                      const { return fOuterAlpha;      }
+    int   NClusters()                       const { return fNClusters;       }
+    int   FirstClusterRef()                 const { return fFirstClusterRef; }
+    int   PrevNeighbour()                   const { return fPrevNeighbour;   }
+    int   NextNeighbour()                   const { return fNextNeighbour;   }
+    bool  Used()                            const { return fUsed;            }
+
+    void SetInnerParam( const AliHLTTPCCATrackParam &v ) { fInnerParam = v;      }
+    void SetOuterParam( const AliHLTTPCCATrackParam &v ) { fOuterParam = v;      }
+    void SetInnerAlpha( float v )                      { fInnerAlpha = v;      }
+    void SetOuterAlpha( float v )                      { fOuterAlpha = v;      }
+    void SetNClusters ( int v )                        { fNClusters = v;       }
+    void SetFirstClusterRef( int v )                   { fFirstClusterRef = v; }
+    void SetPrevNeighbour( int v )                     { fPrevNeighbour = v;   }
+    void SetNextNeighbour( int v )                     { fNextNeighbour = v;   }
+    void SetUsed( bool v )                             { fUsed = v;            }
+
+  private:
+
+    AliHLTTPCCATrackParam fInnerParam; // inner parameters
+    AliHLTTPCCATrackParam fOuterParam; // outer parameters
+    float fInnerAlpha;               // alpha angle for inner parameters
+    float fOuterAlpha;               // alpha angle for outer parameters
+    int fNClusters;                  // N clusters
+    int fFirstClusterRef;  // index of the first track cluster in the global cluster array
+    int fPrevNeighbour;    // neighbour in the previous slise
+    int fNextNeighbour;    // neighbour in the next slise
+    bool fUsed;            // is the slice track already merged
 
 };
 
@@ -120,43 +120,43 @@ private:
 class AliHLTTPCCAMerger::AliHLTTPCCABorderTrack
 {
 
-public:
-  const AliHLTTPCCATrackParam &Param() const { return fParam;     }
-  Int_t   TrackID()                    const { return fTrackID;   }
-  Int_t   NClusters()                  const { return fNClusters; }
-  Int_t   IRow()                       const { return fIRow;      }
-  Float_t X()                          const { return fX;         }
-  Bool_t  OK()                         const { return fOK;        }
-  
-  void SetParam     ( const AliHLTTPCCATrackParam &v ) { fParam     = v; }
-  void SetTrackID   ( Int_t v )                        { fTrackID   = v; }
-  void SetNClusters ( Int_t v )                        { fNClusters = v; }
-  void SetIRow      ( Int_t v )                        { fIRow      = v; }
-  void SetX         ( Float_t v )                      { fX         = v; }
-  void SetOK        ( Bool_t v )                       { fOK        = v; }
-
-private:
-
-  AliHLTTPCCATrackParam fParam;  // track parameters at the border
-  Int_t   fTrackID;              // track index
-  Int_t   fNClusters;            // n clusters
-  Int_t   fIRow;                 // row number of the closest cluster
-  Float_t fX;                    // X coordinate of the closest cluster
-  Bool_t  fOK;                   // is the track rotated and extrapolated correctly
+  public:
+
+    const AliHLTTPCCATrackParam &Param() const { return fParam;     }
+    int   TrackID()                    const { return fTrackID;   }
+    int   NClusters()                  const { return fNClusters; }
+    int   IRow()                       const { return fIRow;      }
+    float X()                          const { return fX;         }
+    bool  OK()                         const { return fOK;        }
+
+    void SetParam     ( const AliHLTTPCCATrackParam &v ) { fParam     = v; }
+    void SetTrackID   ( int v )                        { fTrackID   = v; }
+    void SetNClusters ( int v )                        { fNClusters = v; }
+    void SetIRow      ( int v )                        { fIRow      = v; }
+    void SetX         ( float v )                      { fX         = v; }
+    void SetOK        ( bool v )                       { fOK        = v; }
+
+  private:
+
+    AliHLTTPCCATrackParam fParam;  // track parameters at the border
+    int   fTrackID;              // track index
+    int   fNClusters;            // n clusters
+    int   fIRow;                 // row number of the closest cluster
+    float fX;                    // X coordinate of the closest cluster
+    bool  fOK;                   // is the track rotated and extrapolated correctly
 
 };
 
 
 
 AliHLTTPCCAMerger::AliHLTTPCCAMerger()
-  :
-  fSliceParam(),
-  fOutput(0),  
-  fTrackInfos(0),
-  fMaxTrackInfos(0),
-  fClusterInfos(0),
-  fMaxClusterInfos(0)
+    :
+    fSliceParam(),
+    fOutput( 0 ),
+    fTrackInfos( 0 ),
+    fMaxTrackInfos( 0 ),
+    fClusterInfos( 0 ),
+    fMaxClusterInfos( 0 )
 {
   //* constructor
   Clear();
@@ -164,10 +164,10 @@ AliHLTTPCCAMerger::AliHLTTPCCAMerger()
 
 /*
 AliHLTTPCCAMerger::AliHLTTPCCAMerger(const AliHLTTPCCAMerger&)
-  : 
+  :
   fSliceParam(),
   fkSlices(0),
-  fOutput(0),  
+  fOutput(0),
   fTrackInfos(0),
   fMaxTrackInfos(0),
   fClusterInfos(0),
@@ -184,9 +184,9 @@ const AliHLTTPCCAMerger &AliHLTTPCCAMerger::operator=(const AliHLTTPCCAMerger&)
 AliHLTTPCCAMerger::~AliHLTTPCCAMerger()
 {
   //* destructor
-  if( fTrackInfos ) delete[] fTrackInfos;
-  if( fClusterInfos ) delete[] fClusterInfos;
-  if( fOutput ) delete[] ((char*)(fOutput));
+  if ( fTrackInfos ) delete[] fTrackInfos;
+  if ( fClusterInfos ) delete[] fClusterInfos;
+  if ( fOutput ) delete[] ( ( char* )( fOutput ) );
 }
 
 void AliHLTTPCCAMerger::Clear()
@@ -215,104 +215,104 @@ void AliHLTTPCCAMerger::UnpackSlices()
   //* unpack the cluster information from the slice tracks and initialize track info array
 
   // get N tracks and N clusters in event
-  
-  Int_t nTracksTotal=0;
-  Int_t nTrackClustersTotal=0;
-  for( Int_t iSlice=0; iSlice<fgkNSlices; iSlice++ ){
-    if( !fkSlices[iSlice] ) continue;
-    nTracksTotal+=fkSlices[iSlice]->NTracks();
-    nTrackClustersTotal+=fkSlices[iSlice]->NTrackClusters();    
+
+  int nTracksTotal = 0;
+  int nTrackClustersTotal = 0;
+  for ( int iSlice = 0; iSlice < fgkNSlices; iSlice++ ) {
+    if ( !fkSlices[iSlice] ) continue;
+    nTracksTotal += fkSlices[iSlice]->NTracks();
+    nTrackClustersTotal += fkSlices[iSlice]->NTrackClusters();
   }
 
   // book/clean memory if necessary
   {
-    if( nTracksTotal>fMaxTrackInfos || ( fMaxTrackInfos>100 && nTracksTotal< 0.5*fMaxTrackInfos ) ){
-      if( fTrackInfos ) delete[] fTrackInfos;
-      fMaxTrackInfos = (Int_t ) (nTracksTotal*1.2);
+    if ( nTracksTotal > fMaxTrackInfos || ( fMaxTrackInfos > 100 && nTracksTotal < 0.5*fMaxTrackInfos ) ) {
+      if ( fTrackInfos ) delete[] fTrackInfos;
+      fMaxTrackInfos = ( int ) ( nTracksTotal * 1.2 );
       fTrackInfos = new AliHLTTPCCASliceTrackInfo[fMaxTrackInfos];
     }
 
-    if( nTrackClustersTotal>fMaxClusterInfos || ( fMaxClusterInfos>1000 && nTrackClustersTotal< 0.5*fMaxClusterInfos ) ){
-      if( fClusterInfos ) delete[] fClusterInfos;
-      fMaxClusterInfos = (Int_t ) (nTrackClustersTotal*1.2);
+    if ( nTrackClustersTotal > fMaxClusterInfos || ( fMaxClusterInfos > 1000 && nTrackClustersTotal < 0.5*fMaxClusterInfos ) ) {
+      if ( fClusterInfos ) delete[] fClusterInfos;
+      fMaxClusterInfos = ( int ) ( nTrackClustersTotal * 1.2 );
       fClusterInfos = new AliHLTTPCCAClusterInfo [fMaxClusterInfos];
     }
 
-    if( fOutput ) delete[] ( (char*)(fOutput));
-    Int_t size = fOutput->EstimateSize(nTracksTotal, nTrackClustersTotal);
-    fOutput = (AliHLTTPCCAMergerOutput*)(new float2[size/sizeof(float2)+1]);
+    if ( fOutput ) delete[] ( ( char* )( fOutput ) );
+    int size = fOutput->EstimateSize( nTracksTotal, nTrackClustersTotal );
+    fOutput = ( AliHLTTPCCAMergerOutput* )( new float2[size/sizeof( float2 )+1] );
   }
 
   // unpack track and cluster information
-  
-  Int_t nTracksCurrent = 0; 
-  Int_t nClustersCurrent = 0;
 
-  for( Int_t iSlice=0; iSlice<fgkNSlices; iSlice++ ){
+  int nTracksCurrent = 0;
+  int nClustersCurrent = 0;
+
+  for ( int iSlice = 0; iSlice < fgkNSlices; iSlice++ ) {
 
     fSliceTrackInfoStart[ iSlice ] = nTracksCurrent;
     fSliceNTrackInfos[ iSlice ] = 0;
-    if( !fkSlices[iSlice] ) continue;
 
-    const AliHLTTPCCASliceOutput &slice = *(fkSlices[iSlice]);
+    if ( !fkSlices[iSlice] ) continue;
 
-    for( Int_t itr=0; itr<slice.NTracks(); itr++ ){
+    const AliHLTTPCCASliceOutput &slice = *( fkSlices[iSlice] );
+
+    for ( int itr = 0; itr < slice.NTracks(); itr++ ) {
 
       const AliHLTTPCCASliceTrack &sTrack = slice.Track( itr );
       AliHLTTPCCATrackParam t0 = sTrack.Param();
-      Int_t nCluNew = 0;
-      
-      for( Int_t iTrClu=0; iTrClu<sTrack.NClusters(); iTrClu++ ){
-
-       // unpack cluster information
-
-       AliHLTTPCCAClusterInfo &clu = fClusterInfos[nClustersCurrent + nCluNew];
-       Int_t ic = sTrack.FirstClusterRef() + iTrClu;
-
-       clu.SetISlice( iSlice );
-       clu.SetIRow( AliHLTTPCCADataCompressor::IDrc2IRow( slice.ClusterIDrc( ic ) ) );
-       clu.SetIClu( AliHLTTPCCADataCompressor::IDrc2IClu( slice.ClusterIDrc( ic ) ) ); 
-       clu.SetPackedAmp( slice.ClusterPackedAmp( ic ) );
-       float2 yz = slice.ClusterUnpackedYZ( ic );
-       clu.SetX( slice.ClusterUnpackedX( ic ) );
-       clu.SetY( yz.x );
-       clu.SetZ( yz.y );
-
-       if( !t0.TransportToX( fSliceParam.RowX( clu.IRow() ), fSliceParam.GetBz(t0), .999 ) ) continue;
-
-       Float_t err2Y, err2Z;
-       fSliceParam.GetClusterErrors2( clu.IRow(), clu.Z(), t0.SinPhi(), t0.GetCosPhi(), t0.DzDs(), err2Y, err2Z );
-       
-       clu.SetErr2Y( err2Y );
-       clu.SetErr2Z( err2Z );
-       nCluNew++ ;
+      int nCluNew = 0;
+
+      for ( int iTrClu = 0; iTrClu < sTrack.NClusters(); iTrClu++ ) {
+
+        // unpack cluster information
+
+        AliHLTTPCCAClusterInfo &clu = fClusterInfos[nClustersCurrent + nCluNew];
+        int ic = sTrack.FirstClusterRef() + iTrClu;
+
+        clu.SetISlice( iSlice );
+        clu.SetIRow( AliHLTTPCCADataCompressor::IDrc2IRow( slice.ClusterIDrc( ic ) ) );
+        clu.SetIClu( AliHLTTPCCADataCompressor::IDrc2IClu( slice.ClusterIDrc( ic ) ) );
+        clu.SetPackedAmp( slice.ClusterPackedAmp( ic ) );
+        float2 yz = slice.ClusterUnpackedYZ( ic );
+        clu.SetX( slice.ClusterUnpackedX( ic ) );
+        clu.SetY( yz.x );
+        clu.SetZ( yz.y );
+
+        if ( !t0.TransportToX( fSliceParam.RowX( clu.IRow() ), fSliceParam.GetBz( t0 ), .999 ) ) continue;
+
+        float err2Y, err2Z;
+        fSliceParam.GetClusterErrors2( clu.IRow(), clu.Z(), t0.SinPhi(), t0.GetCosPhi(), t0.DzDs(), err2Y, err2Z );
+
+        clu.SetErr2Y( err2Y );
+        clu.SetErr2Z( err2Z );
+        nCluNew++ ;
       }
 
-      if( nCluNew<.8*sTrack.NClusters() ) continue;
-      
-      // refit the track 
-      
-      Int_t hits[1000];
-      Int_t nHits = nCluNew; 
-      for( Int_t i=0; i<nHits; i++ ) hits[i] = nClustersCurrent + i;
+      if ( nCluNew < .8*sTrack.NClusters() ) continue;
+
+      // refit the track
+
+      int hits[1000];
+      int nHits = nCluNew;
+      for ( int i = 0; i < nHits; i++ ) hits[i] = nClustersCurrent + i;
 
       AliHLTTPCCATrackParam startPoint = sTrack.Param();
       AliHLTTPCCATrackParam endPoint = startPoint;
-      Float_t startAlpha = fSliceParam.Alpha( iSlice );
-      Float_t endAlpha = startAlpha;
-      if( !FitTrack( endPoint, endAlpha, startPoint, startAlpha, hits, nHits, 0 ) ) continue;
+      float startAlpha = fSliceParam.Alpha( iSlice );
+      float endAlpha = startAlpha;
+
+      if ( !FitTrack( endPoint, endAlpha, startPoint, startAlpha, hits, nHits, 0 ) ) continue;
 
       startPoint = endPoint;
       startAlpha = endAlpha;
-      if( !FitTrack( startPoint, startAlpha, endPoint, endAlpha, hits, nHits, 1 ) ) continue;
+      if ( !FitTrack( startPoint, startAlpha, endPoint, endAlpha, hits, nHits, 1 ) ) continue;
 
-      if( nHits<.8*sTrack.NClusters() ) continue;
+      if ( nHits < .8*sTrack.NClusters() ) continue;
 
       // store the track
-      
-      AliHLTTPCCASliceTrackInfo &track = fTrackInfos[nTracksCurrent];      
+
+      AliHLTTPCCASliceTrackInfo &track = fTrackInfos[nTracksCurrent];
 
       track.SetInnerParam( startPoint );
       track.SetInnerAlpha( startAlpha );
@@ -323,12 +323,12 @@ void AliHLTTPCCAMerger::UnpackSlices()
       track.SetPrevNeighbour( -1 );
       track.SetNextNeighbour( -1 );
       track.SetUsed( 0 );
-      
-      for( Int_t i=0; i<nHits; i++ ) 
-       fClusterInfos[nClustersCurrent + i] = fClusterInfos[hits[i]];
+
+      for ( int i = 0; i < nHits; i++ )
+        fClusterInfos[nClustersCurrent + i] = fClusterInfos[hits[i]];
       nTracksCurrent++;
       fSliceNTrackInfos[ iSlice ]++;
-      nClustersCurrent+=nHits;      
+      nClustersCurrent += nHits;
     }
     //std::cout<<"Unpack slice "<<iSlice<<": ntracks "<<slice.NTracks()<<"/"<<fSliceNTrackInfos[iSlice]<<std::endl;
   }
@@ -336,43 +336,43 @@ void AliHLTTPCCAMerger::UnpackSlices()
 
 
 
-Bool_t AliHLTTPCCAMerger::FitTrack( AliHLTTPCCATrackParam &T, Float_t &Alpha, 
-                                   AliHLTTPCCATrackParam t0, Float_t Alpha0, 
-                                   Int_t hits[], Int_t &NTrackHits, Bool_t dir )
+bool AliHLTTPCCAMerger::FitTrack( AliHLTTPCCATrackParam &T, float &Alpha,
+                                    AliHLTTPCCATrackParam t0, float Alpha0,
+                                    int hits[], int &NTrackHits, bool dir )
 {
   // Fit the track
 
   AliHLTTPCCATrackParam::AliHLTTPCCATrackFitParam fitPar;
   AliHLTTPCCATrackParam t = t0;
-  AliHLTTPCCATrackLinearisation l(t0);
+  AliHLTTPCCATrackLinearisation l( t0 );
+
+  bool first = 1;
 
-  Bool_t first = 1;
   t.CalculateFitParameters( fitPar );
 
-  Int_t hitsNew[1000];
-  Int_t nHitsNew = 0;
+  int hitsNew[1000];
+  int nHitsNew = 0;
+
+  for ( int ihit = 0; ihit < NTrackHits; ihit++ ) {
 
-  for( Int_t ihit=0; ihit<NTrackHits; ihit++){
-    
-    Int_t jhit = dir ?(NTrackHits-1-ihit) :ihit;
+    int jhit = dir ? ( NTrackHits - 1 - ihit ) : ihit;
     AliHLTTPCCAClusterInfo &h = fClusterInfos[hits[jhit]];
 
-    Int_t iSlice = h.ISlice();
+    int iSlice = h.ISlice();
 
-    Float_t sliceAlpha =  fSliceParam.Alpha( iSlice );
+    float sliceAlpha =  fSliceParam.Alpha( iSlice );
 
-    if( CAMath::Abs( sliceAlpha - Alpha0)>1.e-4 ){
-      if( ! t.Rotate(  sliceAlpha - Alpha0, l, .999 ) ) continue;
+    if ( CAMath::Abs( sliceAlpha - Alpha0 ) > 1.e-4 ) {
+      if ( ! t.Rotate(  sliceAlpha - Alpha0, l, .999 ) ) continue;
       Alpha0 = sliceAlpha;
     }
 
-    //Float_t x = fSliceParam.RowX( h.IRow() );
-    Float_t x = h.X();
-    
-    if( !t.TransportToXWithMaterial( x, l, fitPar, fSliceParam.GetBz(t) ) ) continue;
-    
-    if( first ){
+    //float x = fSliceParam.RowX( h.IRow() );
+    float x = h.X();
+
+    if ( !t.TransportToXWithMaterial( x, l, fitPar, fSliceParam.GetBz( t ) ) ) continue;
+
+    if ( first ) {
       t.SetCov( 0, 10 );
       t.SetCov( 1,  0 );
       t.SetCov( 2, 10 );
@@ -383,234 +383,234 @@ Bool_t AliHLTTPCCAMerger::FitTrack( AliHLTTPCCATrackParam &T, Float_t &Alpha,
       t.SetCov( 7,  0 );
       t.SetCov( 8,  0 );
       t.SetCov( 9,  1 );
-      t.SetCov(10,  0 );
-      t.SetCov(11,  0 );
-      t.SetCov(12,  0 );
-      t.SetCov(13,  0 );
-      t.SetCov(14,  10 );
+      t.SetCov( 10,  0 );
+      t.SetCov( 11,  0 );
+      t.SetCov( 12,  0 );
+      t.SetCov( 13,  0 );
+      t.SetCov( 14,  10 );
       t.SetChi2( 0 );
       t.SetNDF( -5 );
       t.CalculateFitParameters( fitPar );
     }
-  
-    if( !t.Filter( h.Y(), h.Z(), h.Err2Y(), h.Err2Z() ) ) continue;                
+
+    if ( !t.Filter( h.Y(), h.Z(), h.Err2Y(), h.Err2Z() ) ) continue;
 
     first = 0;
 
     hitsNew[nHitsNew++] = hits[jhit];
   }
-  
-  if( CAMath::Abs(t.QPt())<1.e-8 ) t.SetQPt( 1.e-8 );
-  
-  Bool_t ok=1;
-  
-  const Float_t *c = t.Cov();
-  for( Int_t i=0; i<15; i++ ) ok = ok && finite(c[i]);
-  for( Int_t i=0; i<5; i++ ) ok = ok && finite(t.Par()[i]);
-  ok = ok && (t.GetX()>50);
-  
-  if( c[0]<=0 || c[2]<=0 || c[5]<=0 || c[9]<=0 || c[14]<=0 ) ok = 0;
-  if( c[0]>5. || c[2]>5. || c[5]>2. || c[9]>2 || c[14]>2. ) ok = 0;
-  
-  if( CAMath::Abs(t.SinPhi())>.99 ) ok = 0;
-  else if( l.CosPhi()>=0 ) t.SetSignCosPhi( 1 );
+
+  if ( CAMath::Abs( t.QPt() ) < 1.e-8 ) t.SetQPt( 1.e-8 );
+
+  bool ok = 1;
+
+  const float *c = t.Cov();
+  for ( int i = 0; i < 15; i++ ) ok = ok && finite( c[i] );
+  for ( int i = 0; i < 5; i++ ) ok = ok && finite( t.Par()[i] );
+  ok = ok && ( t.GetX() > 50 );
+
+  if ( c[0] <= 0 || c[2] <= 0 || c[5] <= 0 || c[9] <= 0 || c[14] <= 0 ) ok = 0;
+  if ( c[0] > 5. || c[2] > 5. || c[5] > 2. || c[9] > 2 || c[14] > 2. ) ok = 0;
+
+  if ( CAMath::Abs( t.SinPhi() ) > .99 ) ok = 0;
+  else if ( l.CosPhi() >= 0 ) t.SetSignCosPhi( 1 );
   else t.SetSignCosPhi( -1 );
 
-  if( ok ){
+  if ( ok ) {
     T = t;
     Alpha = Alpha0;
     NTrackHits = nHitsNew;
-    for( Int_t i=0; i<NTrackHits; i++ ){
-      hits[dir ?(NTrackHits-1-i) :i] = hitsNew[i];
+    for ( int i = 0; i < NTrackHits; i++ ) {
+      hits[dir ?( NTrackHits-1-i ) :i] = hitsNew[i];
     }
   }
   return ok;
 }
 
 
-Float_t AliHLTTPCCAMerger::GetChi2( Float_t x1, Float_t y1, Float_t a00, Float_t a10, Float_t a11, 
-                                   Float_t x2, Float_t y2, Float_t b00, Float_t b10, Float_t b11  )
+float AliHLTTPCCAMerger::GetChi2( float x1, float y1, float a00, float a10, float a11,
+                                    float x2, float y2, float b00, float b10, float b11  )
 {
-  //* Calculate Chi2/ndf deviation   
+  //* Calculate Chi2/ndf deviation
+
+  float d[2] = { x1 - x2, y1 - y2 };
 
-  Float_t d[2]={ x1-x2, y1-y2 };
+  float mSi[3] = { a00 + b00, a10 + b10, a11 + b11 };
 
-  Float_t mSi[3] = { a00 + b00, a10 + b10, a11 + b11 };
+  float s = ( mSi[0] * mSi[2] - mSi[1] * mSi[1] );
 
-  Float_t s = ( mSi[0]*mSi[2] - mSi[1]*mSi[1] );
+  if ( s < 1.E-10 ) return 10000.;
 
-  if( s < 1.E-10 ) return 10000.;
-    
-  Float_t mS[3] = { mSi[2], -mSi[1], mSi[0] };      
+  float mS[3] = { mSi[2], -mSi[1], mSi[0] };
 
   return TMath::Abs( ( ( mS[0]*d[0] + mS[1]*d[1] )*d[0]
-                      +(mS[1]*d[0] + mS[2]*d[1] )*d[1] )/s/2);
+                       + ( mS[1]*d[0] + mS[2]*d[1] )*d[1] ) / s / 2 );
 
 }
 
-  
 
-void AliHLTTPCCAMerger::MakeBorderTracks( Int_t iSlice, Int_t iBorder, AliHLTTPCCABorderTrack B[], Int_t &nB )
+
+void AliHLTTPCCAMerger::MakeBorderTracks( int iSlice, int iBorder, AliHLTTPCCABorderTrack B[], int &nB )
 {
   //* prepare slice tracks for merging with next/previous/same sector
-  //* each track transported to the border line, 
-  //* in some cases both inner and outer parameters of the track are transported 
-
-  static int statAll=0, statOK=0;  
-  nB = 0;  
-  Float_t dAlpha = fSliceParam.DAlpha() /2;
-  Float_t x0 = 0;
-
-  if( iBorder==0 ){ // transport to the left age of the sector and rotate horisontally
-    dAlpha = dAlpha - CAMath::Pi()/2 ;
-  } else if( iBorder==1 ){ //  transport to the right age of the sector and rotate horisontally
-    dAlpha = -dAlpha - CAMath::Pi()/2 ;  
-  } else if( iBorder==2 ){ // transport to the left age of the sector and rotate vertically
+  //* each track transported to the border line,
+  //* in some cases both inner and outer parameters of the track are transported
+
+  static int statAll = 0, statOK = 0;
+  nB = 0;
+  float dAlpha = fSliceParam.DAlpha() / 2;
+  float x0 = 0;
+
+  if ( iBorder == 0 ) { // transport to the left age of the sector and rotate horisontally
+    dAlpha = dAlpha - CAMath::Pi() / 2 ;
+  } else if ( iBorder == 1 ) { //  transport to the right age of the sector and rotate horisontally
+    dAlpha = -dAlpha - CAMath::Pi() / 2 ;
+  } else if ( iBorder == 2 ) { // transport to the left age of the sector and rotate vertically
     dAlpha = dAlpha;
     x0 = fSliceParam.RowX( 63 );
-  }else if( iBorder==3 ){ // transport to the right age of the sector and rotate vertically
+  } else if ( iBorder == 3 ) { // transport to the right age of the sector and rotate vertically
     dAlpha = -dAlpha;
     x0 =  fSliceParam.RowX( 63 );
-  } else if( iBorder==4 ){ // transport to the middle of the sector, w/o rotation
+  } else if ( iBorder == 4 ) { // transport to the middle of the sector, w/o rotation
     dAlpha = 0;
-    x0 = fSliceParam.RowX(63);
+    x0 = fSliceParam.RowX( 63 );
   }
 
-  for (Int_t itr=0; itr<fSliceNTrackInfos[iSlice]; itr++) {
+  for ( int itr = 0; itr < fSliceNTrackInfos[iSlice]; itr++ ) {
 
     const AliHLTTPCCASliceTrackInfo &track = fTrackInfos[ fSliceTrackInfoStart[iSlice] + itr ];
 
     AliHLTTPCCATrackParam t0 = track.InnerParam();
     AliHLTTPCCATrackParam t1 = track.OuterParam();
 
-    const Float_t maxSin = CAMath::Sin(60./180.*CAMath::Pi());
+    const float maxSin = CAMath::Sin( 60. / 180.*CAMath::Pi() );
+
+    bool ok0 = t0.Rotate( dAlpha, maxSin );
+    bool ok1 = t1.Rotate( dAlpha, maxSin );
 
-    Bool_t ok0 = t0.Rotate( dAlpha, maxSin );
-    Bool_t ok1 = t1.Rotate( dAlpha, maxSin );
-    
-    Bool_t do0 = ok0;
-    Bool_t do1 = ok1 && ( !ok0 || t1.SignCosPhi()*t0.SignCosPhi()<0 );
-    
-    if( ok0 && !do1 && ok1 && (t1.X() < t0.X()) ){
+    bool do0 = ok0;
+    bool do1 = ok1 && ( !ok0 || t1.SignCosPhi() * t0.SignCosPhi() < 0 );
+
+    if ( ok0 && !do1 && ok1 && ( t1.X() < t0.X() ) ) {
       do0 = 0;
       do1 = 1;
     }
 
-    if( do0 ){
+    if ( do0 ) {
       AliHLTTPCCABorderTrack &b = B[nB];
       b.SetX( t0.GetX() );
-      if( t0.TransportToX( x0, fSliceParam.GetBz(t0), maxSin ) ){
-       b.SetOK( 1 );
-       b.SetTrackID( itr );
-       b.SetNClusters( track.NClusters() );
-       b.SetIRow( fClusterInfos[ track.FirstClusterRef() + 0 ].IRow() );
-       b.SetParam( t0 );
-       nB++;
+      if ( t0.TransportToX( x0, fSliceParam.GetBz( t0 ), maxSin ) ) {
+        b.SetOK( 1 );
+        b.SetTrackID( itr );
+        b.SetNClusters( track.NClusters() );
+        b.SetIRow( fClusterInfos[ track.FirstClusterRef() + 0 ].IRow() );
+        b.SetParam( t0 );
+        nB++;
       }
     }
-    if( do1 ){
+    if ( do1 ) {
       AliHLTTPCCABorderTrack &b = B[nB];
       b.SetX( t1.GetX() );
-      if( t1.TransportToX( x0, fSliceParam.GetBz(t1), maxSin ) ){
-       b.SetOK( 1 );
-       b.SetTrackID( itr );
-       b.SetNClusters( track.NClusters() );
-       b.SetIRow( fClusterInfos[ track.FirstClusterRef() + track.NClusters()-1 ].IRow() );
-       b.SetParam( t1 );  
-       nB++;
+      if ( t1.TransportToX( x0, fSliceParam.GetBz( t1 ), maxSin ) ) {
+        b.SetOK( 1 );
+        b.SetTrackID( itr );
+        b.SetNClusters( track.NClusters() );
+        b.SetIRow( fClusterInfos[ track.FirstClusterRef() + track.NClusters()-1 ].IRow() );
+        b.SetParam( t1 );
+        nB++;
       }
     }
-    if( do0 || do1 ) statOK++;
+    if ( do0 || do1 ) statOK++;
     statAll++;
   }
 }
 
 
 
-void AliHLTTPCCAMerger::SplitBorderTracks( Int_t iSlice1, AliHLTTPCCABorderTrack B1[], Int_t N1,
-                                          Int_t iSlice2, AliHLTTPCCABorderTrack B2[], Int_t N2 
-                                          )
+void AliHLTTPCCAMerger::SplitBorderTracks( int iSlice1, AliHLTTPCCABorderTrack B1[], int N1,
+    int iSlice2, AliHLTTPCCABorderTrack B2[], int N2
+                                         )
 {
   //* split two sets of tracks
 
-  Float_t factor2ys = 1.;//1.5;//SG!!!
-  Float_t factor2zt = 1.;//1.5;//SG!!!
-  Float_t factor2k = 2.0;//2.2;
+  float factor2ys = 1.;//1.5;//SG!!!
+  float factor2zt = 1.;//1.5;//SG!!!
+  float factor2k = 2.0;//2.2;
 
-  factor2k  = 3.5*3.5*factor2k*factor2k;
-  factor2ys = 3.5*3.5*factor2ys*factor2ys;
-  factor2zt = 3.5*3.5*factor2zt*factor2zt;
+  factor2k  = 3.5 * 3.5 * factor2k * factor2k;
+  factor2ys = 3.5 * 3.5 * factor2ys * factor2ys;
+  factor2zt = 3.5 * 3.5 * factor2zt * factor2zt;
 
-  Int_t minNPartHits = 10;//SG!!!
-  Int_t minNTotalHits = 20;
+  int minNPartHits = 10;//SG!!!
+  int minNTotalHits = 20;
 
-  //Float_t maxDX = fSliceParam.RowX(40) -  fSliceParam.RowX(0);
+  //float maxDX = fSliceParam.RowX(40) -  fSliceParam.RowX(0);
 
-  for (Int_t i1=0; i1<N1; i1++) {      
+  for ( int i1 = 0; i1 < N1; i1++ ) {
     AliHLTTPCCABorderTrack &b1 = B1[i1];
-    if( !b1.OK() ) continue;
-    if( b1.NClusters() < minNPartHits ) continue;
+    if ( !b1.OK() ) continue;
+    if ( b1.NClusters() < minNPartHits ) continue;
     const AliHLTTPCCATrackParam &t1 = b1.Param();
-    Int_t iBest2 = -1;
-    Int_t lBest2 = 0;
-    Int_t start2 = (iSlice1!=iSlice2) ?0 :i1+1;
-    for (Int_t i2=start2; i2<N2; i2++) {
+    int iBest2 = -1;
+    int lBest2 = 0;
+    int start2 = ( iSlice1 != iSlice2 ) ? 0 : i1 + 1;
+    for ( int i2 = start2; i2 < N2; i2++ ) {
       AliHLTTPCCABorderTrack &b2 = B2[i2];
-      if( !b2.OK() ) continue;
-      if( b2.NClusters() < minNPartHits ) continue;
-      if( b2.NClusters() < lBest2 ) continue;
-      if( b1.NClusters() + b2.NClusters() < minNTotalHits ) continue;
+      if ( !b2.OK() ) continue;
+      if ( b2.NClusters() < minNPartHits ) continue;
+      if ( b2.NClusters() < lBest2 ) continue;
+      if ( b1.NClusters() + b2.NClusters() < minNTotalHits ) continue;
 
       //if( TMath::Abs(b1.fX - b2.fX)>maxDX ) continue;
 
       const AliHLTTPCCATrackParam &t2 = b2.Param();
 
-      Float_t c= t2.SignCosPhi()*t1.SignCosPhi()>=0 ?1 :-1;
-      Float_t dk = t2.QPt() - c*t1.QPt(); 
-      Float_t s2k = t2.Err2QPt() + t1.Err2QPt();
-      
-      if( dk*dk>factor2k*s2k ) continue;     
+      float c = t2.SignCosPhi() * t1.SignCosPhi() >= 0 ? 1 : -1;
+      float dk = t2.QPt() - c * t1.QPt();
+      float s2k = t2.Err2QPt() + t1.Err2QPt();
+
+      if ( dk*dk > factor2k*s2k ) continue;
+
+
+      float chi2ys = GetChi2( t1.Y(), c * t1.SinPhi(), t1.Cov()[0], c * t1.Cov()[3], t1.Cov()[5],
+                                t2.Y(),  t2.SinPhi(), t2.Cov()[0],  t2.Cov()[3], t2.Cov()[5] );
 
+      if ( chi2ys > factor2ys ) continue;
 
-      Float_t chi2ys = GetChi2( t1.Y(),c*t1.SinPhi(),t1.Cov()[0],c*t1.Cov()[3],t1.Cov()[5], 
-                               t2.Y(),  t2.SinPhi(),t2.Cov()[0],  t2.Cov()[3],t2.Cov()[5] );
+      float chi2zt = GetChi2( t1.Z(), c * t1.DzDs(), t1.Cov()[2], c * t1.Cov()[7], t1.Cov()[9],
+                                t2.Z(),  t2.DzDs(), t2.Cov()[2],  t2.Cov()[7], t2.Cov()[9] );
 
-      if( chi2ys>factor2ys ) continue;
+      if ( chi2zt > factor2zt ) continue;
 
-      Float_t chi2zt = GetChi2( t1.Z(),c*t1.DzDs(),t1.Cov()[2],c*t1.Cov()[7],t1.Cov()[9], 
-                               t2.Z(),  t2.DzDs(),t2.Cov()[2],  t2.Cov()[7],t2.Cov()[9] );
-            
-      if( chi2zt>factor2zt ) continue;
-      
       lBest2 = b2.NClusters();
       iBest2 = b2.TrackID();
     }
-      
-    if( iBest2 <0 ) continue;
-
-    AliHLTTPCCASliceTrackInfo &newTrack1 = fTrackInfos[fSliceTrackInfoStart[iSlice1]+b1.TrackID() ];    
-    AliHLTTPCCASliceTrackInfo &newTrack2 = fTrackInfos[fSliceTrackInfoStart[iSlice2]+iBest2 ];
-
-    Int_t old1 = newTrack2.PrevNeighbour();
-  
-    if( old1 >= 0 ){
-      AliHLTTPCCASliceTrackInfo &oldTrack1 = fTrackInfos[fSliceTrackInfoStart[iSlice1]+old1];
-      if( oldTrack1.NClusters()  < newTrack1.NClusters() ){
-       newTrack2.SetPrevNeighbour(-1);
-       oldTrack1.SetNextNeighbour(-1); 
+
+    if ( iBest2 < 0 ) continue;
+
+    AliHLTTPCCASliceTrackInfo &newTrack1 = fTrackInfos[fSliceTrackInfoStart[iSlice1] + b1.TrackID() ];
+    AliHLTTPCCASliceTrackInfo &newTrack2 = fTrackInfos[fSliceTrackInfoStart[iSlice2] + iBest2 ];
+
+    int old1 = newTrack2.PrevNeighbour();
+
+    if ( old1 >= 0 ) {
+      AliHLTTPCCASliceTrackInfo &oldTrack1 = fTrackInfos[fSliceTrackInfoStart[iSlice1] + old1];
+      if ( oldTrack1.NClusters()  < newTrack1.NClusters() ) {
+        newTrack2.SetPrevNeighbour( -1 );
+        oldTrack1.SetNextNeighbour( -1 );
       } else continue;
     }
-    Int_t old2 = newTrack1.NextNeighbour();
-    if( old2 >= 0 ){
-      AliHLTTPCCASliceTrackInfo &oldTrack2 = fTrackInfos[fSliceTrackInfoStart[iSlice2]+old2];
-      if( oldTrack2.NClusters() < newTrack2.NClusters() ){
-       oldTrack2.SetPrevNeighbour(-1);
+    int old2 = newTrack1.NextNeighbour();
+    if ( old2 >= 0 ) {
+      AliHLTTPCCASliceTrackInfo &oldTrack2 = fTrackInfos[fSliceTrackInfoStart[iSlice2] + old2];
+      if ( oldTrack2.NClusters() < newTrack2.NClusters() ) {
+        oldTrack2.SetPrevNeighbour( -1 );
       } else continue;
     }
-    newTrack1.SetNextNeighbour(iBest2); 
-    newTrack2.SetPrevNeighbour(b1.TrackID());  
-  }  
-  
+    newTrack1.SetNextNeighbour( iBest2 );
+    newTrack2.SetPrevNeighbour( b1.TrackID() );
+  }
+
 }
 
 
@@ -624,79 +624,79 @@ void AliHLTTPCCAMerger::Merging()
 
 
   // for each slice set number of the next neighbouring slice
-     
-  Int_t nextSlice[100], prevSlice[100];
 
-  for( Int_t iSlice=0; iSlice<fgkNSlices; iSlice++ ){
+  int nextSlice[100], prevSlice[100];
+
+  for ( int iSlice = 0; iSlice < fgkNSlices; iSlice++ ) {
     nextSlice[iSlice] = iSlice + 1;
     prevSlice[iSlice] = iSlice - 1;
   }
-  Int_t mid = fgkNSlices/2 - 1 ;
-  Int_t last = fgkNSlices - 1 ;
-  if( mid<0 ) mid = 0; // to avoid compiler warning
-  if( last<0 ) last = 0; // 
+  int mid = fgkNSlices / 2 - 1 ;
+  int last = fgkNSlices - 1 ;
+  if ( mid < 0 ) mid = 0; // to avoid compiler warning
+  if ( last < 0 ) last = 0; //
   nextSlice[ mid ] = 0;
   prevSlice[ 0 ] = mid;
-  nextSlice[ last ] = fgkNSlices/2;
+  nextSlice[ last ] = fgkNSlices / 2;
   prevSlice[ fgkNSlices/2 ] = last;
-  
-  Int_t maxNSliceTracks = 0;
-  for( Int_t iSlice=0; iSlice<fgkNSlices; iSlice++ ){
-    if( maxNSliceTracks < fSliceNTrackInfos[iSlice] ) maxNSliceTracks = fSliceNTrackInfos[iSlice];
+
+  int maxNSliceTracks = 0;
+  for ( int iSlice = 0; iSlice < fgkNSlices; iSlice++ ) {
+    if ( maxNSliceTracks < fSliceNTrackInfos[iSlice] ) maxNSliceTracks = fSliceNTrackInfos[iSlice];
   }
-  
-  if(1){// merging track segments withing one slice 
-    
+
+  if ( 1 ) {// merging track segments withing one slice
+
     AliHLTTPCCABorderTrack bord[maxNSliceTracks*10];
-    
+
     AliHLTTPCCASliceTrackInfo *tmpT = new AliHLTTPCCASliceTrackInfo[maxNSliceTracks];
     AliHLTTPCCAClusterInfo *tmpH = new AliHLTTPCCAClusterInfo[fMaxClusterInfos];
 
-    for( Int_t iSlice=0; iSlice<fgkNSlices; iSlice++ ){
-
-      Int_t nBord=0;
-      MakeBorderTracks( iSlice, 4, bord, nBord );   
-      SplitBorderTracks( iSlice, bord, nBord, iSlice, bord, nBord );    
-
-      Int_t nTr=0, nH=0;
-      Int_t sliceFirstClusterRef = 0;
-      for( Int_t itr=0; itr<fSliceNTrackInfos[iSlice]; itr++ ){
-       AliHLTTPCCASliceTrackInfo &track = fTrackInfos[ fSliceTrackInfoStart[iSlice]+itr];
-       if( itr==0 ) sliceFirstClusterRef = track.FirstClusterRef();
-       track.SetPrevNeighbour( -1 );
-       if( track.NextNeighbour() == -2 ){
-         track.SetNextNeighbour( -1 );
-         continue;
-       }
-       AliHLTTPCCASliceTrackInfo &trackNew = tmpT[nTr];
-       trackNew = track;
-       trackNew.SetFirstClusterRef( sliceFirstClusterRef + nH);
-
-       for( Int_t ih=0; ih<track.NClusters(); ih++ ) tmpH[nH+ih] = fClusterInfos[track.FirstClusterRef()+ih];
-       nTr++;
-       nH+=track.NClusters();
-
-       int jtr =  track.NextNeighbour();
-
-       if( jtr<0 ) continue;
-       AliHLTTPCCASliceTrackInfo &neighTrack = fTrackInfos[ fSliceTrackInfoStart[iSlice]+jtr];
-       
-       track.SetNextNeighbour(-1);
-       neighTrack.SetNextNeighbour(-2);
-
-       for( Int_t ih=0; ih<neighTrack.NClusters(); ih++ ) 
-         tmpH[nH+ih] = fClusterInfos[neighTrack.FirstClusterRef()+ih];
-
-       trackNew.SetNClusters( trackNew.NClusters() + neighTrack.NClusters() );
-       trackNew.SetNextNeighbour( -1 );
-       nH+=neighTrack.NClusters();
-       if( neighTrack.InnerParam().X() < track.InnerParam().X() ) trackNew.SetInnerParam( neighTrack.InnerParam());
-       if( neighTrack.OuterParam().X() > track.OuterParam().X() ) trackNew.SetOuterParam( neighTrack.OuterParam());
+    for ( int iSlice = 0; iSlice < fgkNSlices; iSlice++ ) {
+
+      int nBord = 0;
+      MakeBorderTracks( iSlice, 4, bord, nBord );
+      SplitBorderTracks( iSlice, bord, nBord, iSlice, bord, nBord );
+
+      int nTr = 0, nH = 0;
+      int sliceFirstClusterRef = 0;
+      for ( int itr = 0; itr < fSliceNTrackInfos[iSlice]; itr++ ) {
+        AliHLTTPCCASliceTrackInfo &track = fTrackInfos[ fSliceTrackInfoStart[iSlice] + itr];
+        if ( itr == 0 ) sliceFirstClusterRef = track.FirstClusterRef();
+        track.SetPrevNeighbour( -1 );
+        if ( track.NextNeighbour() == -2 ) {
+          track.SetNextNeighbour( -1 );
+          continue;
+        }
+        AliHLTTPCCASliceTrackInfo &trackNew = tmpT[nTr];
+        trackNew = track;
+        trackNew.SetFirstClusterRef( sliceFirstClusterRef + nH );
+
+        for ( int ih = 0; ih < track.NClusters(); ih++ ) tmpH[nH+ih] = fClusterInfos[track.FirstClusterRef()+ih];
+        nTr++;
+        nH += track.NClusters();
+
+        int jtr =  track.NextNeighbour();
+
+        if ( jtr < 0 ) continue;
+        AliHLTTPCCASliceTrackInfo &neighTrack = fTrackInfos[ fSliceTrackInfoStart[iSlice] + jtr];
+
+        track.SetNextNeighbour( -1 );
+        neighTrack.SetNextNeighbour( -2 );
+
+        for ( int ih = 0; ih < neighTrack.NClusters(); ih++ )
+          tmpH[nH+ih] = fClusterInfos[neighTrack.FirstClusterRef()+ih];
+
+        trackNew.SetNClusters( trackNew.NClusters() + neighTrack.NClusters() );
+        trackNew.SetNextNeighbour( -1 );
+        nH += neighTrack.NClusters();
+        if ( neighTrack.InnerParam().X() < track.InnerParam().X() ) trackNew.SetInnerParam( neighTrack.InnerParam() );
+        if ( neighTrack.OuterParam().X() > track.OuterParam().X() ) trackNew.SetOuterParam( neighTrack.OuterParam() );
       }
-      
+
       fSliceNTrackInfos[iSlice] = nTr;
-      for( Int_t itr=0; itr<nTr; itr++ ) fTrackInfos[ fSliceTrackInfoStart[iSlice]+itr] = tmpT[itr];
-      for( Int_t ih=0; ih<nH; ih++ ) fClusterInfos[sliceFirstClusterRef + ih] = tmpH[ih];
+      for ( int itr = 0; itr < nTr; itr++ ) fTrackInfos[ fSliceTrackInfoStart[iSlice] + itr] = tmpT[itr];
+      for ( int ih = 0; ih < nH; ih++ ) fClusterInfos[sliceFirstClusterRef + ih] = tmpH[ih];
 
     }
     delete[] tmpT;
@@ -704,184 +704,184 @@ void AliHLTTPCCAMerger::Merging()
   }
 
 
-  //* merging tracks between slices      
+  //* merging tracks between slices
+
 
-  
   // arrays for the rotated track parameters
 
-  AliHLTTPCCABorderTrack 
-    *bCurr0 = new AliHLTTPCCABorderTrack[maxNSliceTracks*10], 
-    *bNext0 = new AliHLTTPCCABorderTrack[maxNSliceTracks*10],
-    *bCurr = new AliHLTTPCCABorderTrack[maxNSliceTracks*10], 
-    *bNext = new AliHLTTPCCABorderTrack[maxNSliceTracks*10];
+  AliHLTTPCCABorderTrack
+  *bCurr0 = new AliHLTTPCCABorderTrack[maxNSliceTracks*10],
+  *bNext0 = new AliHLTTPCCABorderTrack[maxNSliceTracks*10],
+  *bCurr = new AliHLTTPCCABorderTrack[maxNSliceTracks*10],
+  *bNext = new AliHLTTPCCABorderTrack[maxNSliceTracks*10];
+
+  for ( int iSlice = 0; iSlice < fgkNSlices; iSlice++ ) {
 
-  for( Int_t iSlice=0; iSlice<fgkNSlices; iSlice++ ){
-    
-    Int_t jSlice = nextSlice[iSlice];
-    
-    Int_t nCurr0 = 0, nNext0 = 0;
-    Int_t nCurr = 0, nNext = 0;
+    int jSlice = nextSlice[iSlice];
+
+    int nCurr0 = 0, nNext0 = 0;
+    int nCurr = 0, nNext = 0;
 
     MakeBorderTracks( iSlice, 0, bCurr, nCurr );
     MakeBorderTracks( jSlice, 1, bNext, nNext );
     MakeBorderTracks( iSlice, 2, bCurr0, nCurr0 );
     MakeBorderTracks( jSlice, 3, bNext0, nNext0 );
-    
-    SplitBorderTracks( iSlice, bCurr0, nCurr0, jSlice, bNext0, nNext0 );   
-    SplitBorderTracks( iSlice, bCurr, nCurr, jSlice, bNext, nNext );    
+
+    SplitBorderTracks( iSlice, bCurr0, nCurr0, jSlice, bNext0, nNext0 );
+    SplitBorderTracks( iSlice, bCurr, nCurr, jSlice, bNext, nNext );
   }
 
-  if( bCurr0 ) delete[] bCurr0;
-  if( bNext0 ) delete[] bNext0;
-  if( bCurr  ) delete[] bCurr;
-  if( bNext  ) delete[] bNext;  
+  if ( bCurr0 ) delete[] bCurr0;
+  if ( bNext0 ) delete[] bNext0;
+  if ( bCurr  ) delete[] bCurr;
+  if ( bNext  ) delete[] bNext;
 
 
-  //static Int_t nRejected = 0;
-    
-  Int_t nOutTracks = 0;
-  Int_t nOutTrackClusters = 0;
+  //static int nRejected = 0;
+
+  int nOutTracks = 0;
+  int nOutTrackClusters = 0;
 
   AliHLTTPCCAMergedTrack *outTracks = new AliHLTTPCCAMergedTrack[fMaxTrackInfos];
-  UInt_t   *outClusterIDsrc = new UInt_t [fMaxClusterInfos];
+  unsigned int   *outClusterIDsrc = new unsigned int [fMaxClusterInfos];
   UChar_t  *outClusterPackedAmp = new UChar_t [fMaxClusterInfos];
-  
-  for( Int_t iSlice = 0; iSlice<fgkNSlices; iSlice++ ){
 
-    for( Int_t itr=0; itr<fSliceNTrackInfos[iSlice]; itr++ ){
+  for ( int iSlice = 0; iSlice < fgkNSlices; iSlice++ ) {
+
+    for ( int itr = 0; itr < fSliceNTrackInfos[iSlice]; itr++ ) {
 
-      AliHLTTPCCASliceTrackInfo &track = fTrackInfos[fSliceTrackInfoStart[iSlice]+itr];
+      AliHLTTPCCASliceTrackInfo &track = fTrackInfos[fSliceTrackInfoStart[iSlice] + itr];
 
-      if( track.Used() ) continue;
-      if( track.PrevNeighbour()>=0 ) continue;
+      if ( track.Used() ) continue;
+      if ( track.PrevNeighbour() >= 0 ) continue;
 
       AliHLTTPCCATrackParam startPoint = track.InnerParam(), endPoint = track.OuterParam();
-      Float_t startAlpha = track.InnerAlpha(), endAlpha = track.OuterAlpha();      
+      float startAlpha = track.InnerAlpha(), endAlpha = track.OuterAlpha();
 
-      Int_t hits[2000];
-      Int_t firstHit = 1000;
-      Int_t nHits = 0;
-      Int_t jSlice = iSlice;
-      Int_t jtr = itr;
+      int hits[2000];
+      int firstHit = 1000;
+      int nHits = 0;
+      int jSlice = iSlice;
+      int jtr = itr;
 
       {
-       track.SetUsed( 1 );
-       for( Int_t jhit=0; jhit<track.NClusters(); jhit++){
-         Int_t id = track.FirstClusterRef() + jhit;
-         hits[firstHit+jhit] = id;
-       }
-       nHits=track.NClusters();
-       jtr = track.NextNeighbour();
-       jSlice = nextSlice[iSlice];                     
+        track.SetUsed( 1 );
+        for ( int jhit = 0; jhit < track.NClusters(); jhit++ ) {
+          int id = track.FirstClusterRef() + jhit;
+          hits[firstHit+jhit] = id;
+        }
+        nHits = track.NClusters();
+        jtr = track.NextNeighbour();
+        jSlice = nextSlice[iSlice];
       }
 
-      while( jtr >=0 ){
-       AliHLTTPCCASliceTrackInfo &segment = fTrackInfos[fSliceTrackInfoStart[jSlice]+jtr];
-       if( segment.Used() ) break;
-       segment.SetUsed( 1 );
-       Bool_t dir = 0;
-       Int_t startHit = firstHit+ nHits;
-       Float_t d00 = startPoint.GetDistXZ2(segment.InnerParam() );
-       Float_t d01 = startPoint.GetDistXZ2(segment.OuterParam() );
-       Float_t d10 = endPoint.GetDistXZ2(segment.InnerParam() );
-       Float_t d11 = endPoint.GetDistXZ2(segment.OuterParam() );
-       if( d00<=d01 && d00<=d10 && d00<=d11 ){
-         startPoint = segment.OuterParam();
-         startAlpha = segment.OuterAlpha();
-         dir = 1;
-         firstHit -= segment.NClusters();
-         startHit = firstHit;
-       }else if( d01<=d10 && d01<=d11 ){
-         startPoint = segment.InnerParam();
-         startAlpha = segment.InnerAlpha();
-         dir = 0;
-         firstHit -= segment.NClusters();
-         startHit = firstHit;
-       }else if( d10<=d11 ){
-         endPoint = segment.OuterParam();
-         endAlpha = segment.OuterAlpha();
-         dir = 0;
-       }else{
-         endPoint = segment.InnerParam();
-         endAlpha = segment.InnerAlpha();
-         dir = 1;
-       }
-       
-       for( Int_t jhit=0; jhit<segment.NClusters(); jhit++){
-         Int_t id = segment.FirstClusterRef() + jhit;
-         hits[startHit+(dir ?(segment.NClusters()-1-jhit) :jhit)] = id;
-       }
-       nHits+=segment.NClusters();
-       jtr = segment.NextNeighbour();
-       jSlice = nextSlice[jSlice];                     
+      while ( jtr >= 0 ) {
+        AliHLTTPCCASliceTrackInfo &segment = fTrackInfos[fSliceTrackInfoStart[jSlice] + jtr];
+        if ( segment.Used() ) break;
+        segment.SetUsed( 1 );
+        bool dir = 0;
+        int startHit = firstHit + nHits;
+        float d00 = startPoint.GetDistXZ2( segment.InnerParam() );
+        float d01 = startPoint.GetDistXZ2( segment.OuterParam() );
+        float d10 = endPoint.GetDistXZ2( segment.InnerParam() );
+        float d11 = endPoint.GetDistXZ2( segment.OuterParam() );
+        if ( d00 <= d01 && d00 <= d10 && d00 <= d11 ) {
+          startPoint = segment.OuterParam();
+          startAlpha = segment.OuterAlpha();
+          dir = 1;
+          firstHit -= segment.NClusters();
+          startHit = firstHit;
+        } else if ( d01 <= d10 && d01 <= d11 ) {
+          startPoint = segment.InnerParam();
+          startAlpha = segment.InnerAlpha();
+          dir = 0;
+          firstHit -= segment.NClusters();
+          startHit = firstHit;
+        } else if ( d10 <= d11 ) {
+          endPoint = segment.OuterParam();
+          endAlpha = segment.OuterAlpha();
+          dir = 0;
+        } else {
+          endPoint = segment.InnerParam();
+          endAlpha = segment.InnerAlpha();
+          dir = 1;
+        }
+
+        for ( int jhit = 0; jhit < segment.NClusters(); jhit++ ) {
+          int id = segment.FirstClusterRef() + jhit;
+          hits[startHit+( dir ?( segment.NClusters()-1-jhit ) :jhit )] = id;
+        }
+        nHits += segment.NClusters();
+        jtr = segment.NextNeighbour();
+        jSlice = nextSlice[jSlice];
       }
 
-      if( endPoint.X() < startPoint.X() ){ // swap
-       for( Int_t i=0; i<nHits; i++ ) hits[i] = hits[firstHit+nHits-1-i];
-       firstHit = 0;
+      if ( endPoint.X() < startPoint.X() ) { // swap
+        for ( int i = 0; i < nHits; i++ ) hits[i] = hits[firstHit+nHits-1-i];
+        firstHit = 0;
       }
-      
-      if( nHits < 30 ) continue;     //SG!!!
 
-      // refit 
+      if ( nHits < 30 ) continue;    //SG!!!
+
+      // refit
 
       // need best t0!!!SG
 
       endPoint = startPoint;
-      if( !FitTrack( endPoint, endAlpha, startPoint, startAlpha, hits+firstHit, nHits, 0 ) ) continue;
-      if( !FitTrack( startPoint, startAlpha, endPoint, endAlpha, hits+firstHit, nHits, 1 ) ) continue;
+      if ( !FitTrack( endPoint, endAlpha, startPoint, startAlpha, hits + firstHit, nHits, 0 ) ) continue;
+      if ( !FitTrack( startPoint, startAlpha, endPoint, endAlpha, hits + firstHit, nHits, 1 ) ) continue;
+
+      if ( nHits < 30 ) continue;    //SG!!!
 
-      if( nHits < 30 ) continue;     //SG!!!    
-      
       AliHLTTPCCATrackParam &p = startPoint;
-      
+
       {
-       Double_t xTPC=83.65; //SG!!!
-       Double_t dAlpha = 0.00609235;
-       AliHLTTPCCATrackParam::AliHLTTPCCATrackFitParam fitPar;
-       p.CalculateFitParameters( fitPar );
-       
-       if( p.TransportToXWithMaterial( xTPC, fitPar, fSliceParam.GetBz( p ) ) ){
-         Double_t y=p.GetY();
-         Double_t ymax=xTPC*CAMath::Tan(dAlpha/2.); 
-         if (y > ymax) {
-           if( p.Rotate( dAlpha ) ){ startAlpha+=dAlpha;  p.TransportToXWithMaterial( xTPC, fitPar, fSliceParam.GetBz(p) ); }
-         } else if (y <-ymax) {
-           if( p.Rotate( -dAlpha ) ){  startAlpha-=dAlpha; p.TransportToXWithMaterial( xTPC, fitPar, fSliceParam.GetBz(p) );}
-         }
-       }
+        double xTPC = 83.65; //SG!!!
+        double dAlpha = 0.00609235;
+        AliHLTTPCCATrackParam::AliHLTTPCCATrackFitParam fitPar;
+        p.CalculateFitParameters( fitPar );
+
+        if ( p.TransportToXWithMaterial( xTPC, fitPar, fSliceParam.GetBz( p ) ) ) {
+          double y = p.GetY();
+          double ymax = xTPC * CAMath::Tan( dAlpha / 2. );
+          if ( y > ymax ) {
+            if ( p.Rotate( dAlpha ) ) { startAlpha += dAlpha;  p.TransportToXWithMaterial( xTPC, fitPar, fSliceParam.GetBz( p ) ); }
+          } else if ( y < -ymax ) {
+            if ( p.Rotate( -dAlpha ) ) {  startAlpha -= dAlpha; p.TransportToXWithMaterial( xTPC, fitPar, fSliceParam.GetBz( p ) );}
+          }
+        }
       }
-      
+
       {
-       Bool_t ok=1;
-       
-       const Float_t *c = p.Cov();
-       for( Int_t i=0; i<15; i++ ) ok = ok && finite(c[i]);
-       for( Int_t i=0; i<5; i++ ) ok = ok && finite(p.Par()[i]);
-       ok = ok && (p.GetX()>50);
-       
-       if( c[0]<=0 || c[2]<=0 || c[5]<=0 || c[9]<=0 || c[14]<=0 ) ok = 0;
-       if( c[0]>5. || c[2]>5. || c[5]>2. || c[9]>2 || c[14]>2 ) ok = 0;
-       if(!ok) continue;       
+        bool ok = 1;
+
+        const float *c = p.Cov();
+        for ( int i = 0; i < 15; i++ ) ok = ok && finite( c[i] );
+        for ( int i = 0; i < 5; i++ ) ok = ok && finite( p.Par()[i] );
+        ok = ok && ( p.GetX() > 50 );
+
+        if ( c[0] <= 0 || c[2] <= 0 || c[5] <= 0 || c[9] <= 0 || c[14] <= 0 ) ok = 0;
+        if ( c[0] > 5. || c[2] > 5. || c[5] > 2. || c[9] > 2 || c[14] > 2 ) ok = 0;
+        if ( !ok ) continue;
       }
 
       AliHLTTPCCAMergedTrack &mergedTrack = outTracks[nOutTracks];
-      mergedTrack.SetNClusters(nHits);
-      mergedTrack.SetFirstClusterRef(nOutTrackClusters);
-      mergedTrack.SetInnerParam(startPoint);
-      mergedTrack.SetInnerAlpha(startAlpha);
-      mergedTrack.SetOuterParam(endPoint);
-      mergedTrack.SetOuterAlpha(endAlpha);
-      for( Int_t i = 0; i<nHits; i++ ){
-       AliHLTTPCCAClusterInfo &clu = fClusterInfos[hits[firstHit+i]];
-       outClusterIDsrc[nOutTrackClusters+i] = 
-         AliHLTTPCCADataCompressor::ISliceIRowIClu2IDsrc(clu.ISlice(), clu.IRow(), clu.IClu());
-       outClusterPackedAmp[nOutTrackClusters+i]=clu.PackedAmp();
+      mergedTrack.SetNClusters( nHits );
+      mergedTrack.SetFirstClusterRef( nOutTrackClusters );
+      mergedTrack.SetInnerParam( startPoint );
+      mergedTrack.SetInnerAlpha( startAlpha );
+      mergedTrack.SetOuterParam( endPoint );
+      mergedTrack.SetOuterAlpha( endAlpha );
+
+      for ( int i = 0; i < nHits; i++ ) {
+        AliHLTTPCCAClusterInfo &clu = fClusterInfos[hits[firstHit+i]];
+        outClusterIDsrc[nOutTrackClusters+i] =
+          AliHLTTPCCADataCompressor::ISliceIRowIClu2IDsrc( clu.ISlice(), clu.IRow(), clu.IClu() );
+        outClusterPackedAmp[nOutTrackClusters+i] = clu.PackedAmp();
       }
-      
+
       nOutTracks++;
-      nOutTrackClusters+= nHits;
+      nOutTrackClusters += nHits;
     }
   }
 
@@ -889,13 +889,13 @@ void AliHLTTPCCAMerger::Merging()
   fOutput->SetNTrackClusters( nOutTrackClusters );
   fOutput->SetPointers();
 
-  for( Int_t itr=0; itr<nOutTracks; itr++ ) fOutput->SetTrack( itr, outTracks[itr] );
+  for ( int itr = 0; itr < nOutTracks; itr++ ) fOutput->SetTrack( itr, outTracks[itr] );
 
-  for( Int_t ic=0; ic<nOutTrackClusters; ic++ ){
+  for ( int ic = 0; ic < nOutTrackClusters; ic++ ) {
     fOutput->SetClusterIDsrc( ic, outClusterIDsrc[ic] );
     fOutput->SetClusterPackedAmp( ic, outClusterPackedAmp[ic] );
   }
+
   delete[] outTracks;
   delete[] outClusterIDsrc;
   delete[] outClusterPackedAmp;
index eebb864ead4e0687381af187b1a0dc1daf5896a2..034a9dfc86ef9c45a4d102ee2a88a8b93c8ab629 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -24,58 +24,58 @@ class AliHLTTPCCAMergerOutput;
 
 /**
  * @class AliHLTTPCCAMerger
- * 
+ *
  */
 class AliHLTTPCCAMerger
 {
 
-public:
-
-  AliHLTTPCCAMerger();
-  ~AliHLTTPCCAMerger();
-
-  void SetSliceParam( const AliHLTTPCCAParam &v ){ fSliceParam = v; }
-
-  void Clear();
-  void SetSliceData( int index, const AliHLTTPCCASliceOutput *SliceData );
-  void Reconstruct();
-
-  const AliHLTTPCCAMergerOutput * Output() const { return fOutput; }
-  
-  Bool_t FitTrack( AliHLTTPCCATrackParam &T, Float_t &Alpha, 
-                  AliHLTTPCCATrackParam t0, Float_t Alpha0, Int_t hits[], Int_t &NHits,  Bool_t dir=0 );
-
- private:
-
-  AliHLTTPCCAMerger(const AliHLTTPCCAMerger&);
-  const AliHLTTPCCAMerger &operator=(const AliHLTTPCCAMerger&) const;
-  
-  class AliHLTTPCCAClusterInfo;
-  class AliHLTTPCCASliceTrackInfo;
-  class AliHLTTPCCABorderTrack;
-
-  void MakeBorderTracks( Int_t iSlice, Int_t iBorder, AliHLTTPCCABorderTrack B[], Int_t &nB);
-  void SplitBorderTracks( Int_t iSlice1, AliHLTTPCCABorderTrack B1[], Int_t N1,
-                         Int_t iSlice2, AliHLTTPCCABorderTrack B2[], Int_t N2 );
-
-  static Float_t GetChi2( Float_t x1, Float_t y1, Float_t a00, Float_t a10, Float_t a11, 
-                         Float_t x2, Float_t y2, Float_t b00, Float_t b10, Float_t b11  );
-
-  void UnpackSlices();
-  void Merging();
-   
-
-  
-  static const Int_t fgkNSlices = 36;       //* N slices 
-  AliHLTTPCCAParam fSliceParam;           //* slice parameters (geometry, calibr, etc.)
-  const AliHLTTPCCASliceOutput *fkSlices[fgkNSlices]; //* array of input slice tracks
-  AliHLTTPCCAMergerOutput *fOutput;       //* array of output merged tracks  
-  AliHLTTPCCASliceTrackInfo *fTrackInfos; //* additional information for slice tracks
-  Int_t fMaxTrackInfos;                   //* booked size of fTrackInfos array
-  AliHLTTPCCAClusterInfo *fClusterInfos;  //* information about track clusters
-  Int_t fMaxClusterInfos;                 //* booked size of fClusterInfos array
-  Int_t fSliceTrackInfoStart[fgkNSlices];   //* slice starting index in fTrackInfos array;
-  Int_t fSliceNTrackInfos[fgkNSlices];                //* N of slice track infos in fTrackInfos array;
+  public:
+
+    AliHLTTPCCAMerger();
+    ~AliHLTTPCCAMerger();
+
+    void SetSliceParam( const AliHLTTPCCAParam &v ) { fSliceParam = v; }
+
+    void Clear();
+    void SetSliceData( int index, const AliHLTTPCCASliceOutput *SliceData );
+    void Reconstruct();
+
+    const AliHLTTPCCAMergerOutput * Output() const { return fOutput; }
+
+    bool FitTrack( AliHLTTPCCATrackParam &T, float &Alpha,
+                     AliHLTTPCCATrackParam t0, float Alpha0, int hits[], int &NHits,  bool dir = 0 );
+
 private:
+
+    AliHLTTPCCAMerger( const AliHLTTPCCAMerger& );
+    const AliHLTTPCCAMerger &operator=( const AliHLTTPCCAMerger& ) const;
+
+    class AliHLTTPCCAClusterInfo;
+    class AliHLTTPCCASliceTrackInfo;
+    class AliHLTTPCCABorderTrack;
+
+    void MakeBorderTracks( int iSlice, int iBorder, AliHLTTPCCABorderTrack B[], int &nB );
+    void SplitBorderTracks( int iSlice1, AliHLTTPCCABorderTrack B1[], int N1,
+                            int iSlice2, AliHLTTPCCABorderTrack B2[], int N2 );
+
+    static float GetChi2( float x1, float y1, float a00, float a10, float a11,
+                            float x2, float y2, float b00, float b10, float b11  );
+
+    void UnpackSlices();
+    void Merging();
+
+
+
+    static const int fgkNSlices = 36;       //* N slices
+    AliHLTTPCCAParam fSliceParam;           //* slice parameters (geometry, calibr, etc.)
+    const AliHLTTPCCASliceOutput *fkSlices[fgkNSlices]; //* array of input slice tracks
+    AliHLTTPCCAMergerOutput *fOutput;       //* array of output merged tracks
+    AliHLTTPCCASliceTrackInfo *fTrackInfos; //* additional information for slice tracks
+    int fMaxTrackInfos;                   //* booked size of fTrackInfos array
+    AliHLTTPCCAClusterInfo *fClusterInfos;  //* information about track clusters
+    int fMaxClusterInfos;                 //* booked size of fClusterInfos array
+    int fSliceTrackInfoStart[fgkNSlices];   //* slice starting index in fTrackInfos array;
+    int fSliceNTrackInfos[fgkNSlices];                //* N of slice track infos in fTrackInfos array;
 };
 
 #endif
index c4341a372978c3c0c5bea5c0ccd30b2ace96abbc..87761820b2c4bc6bd37300928aed67d6cb9094b1 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  * and transport the output to AliHLTTPCCAMerger{Component}
  *
  * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
- * This includes the reconstructed track parameters and some compressed information 
+ * This includes the reconstructed track parameters and some compressed information
  * about the assigned clusters: clusterId, position and amplitude.
  *
  */
 class AliHLTTPCCAMergerOutput
 {
- public:
 public:
 
-  AliHLTTPCCAMergerOutput()
-    :fNTracks(0), fNTrackClusters(0),fTracks(0),fClusterIDsrc(0),fClusterPackedAmp(0) {}
+    AliHLTTPCCAMergerOutput()
+        : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterIDsrc( 0 ), fClusterPackedAmp( 0 ) {}
 
-  AliHLTTPCCAMergerOutput( const AliHLTTPCCAMergerOutput & )
-    :fNTracks(0), fNTrackClusters(0),fTracks(0),fClusterIDsrc(0),fClusterPackedAmp(0) {}
-  
-  const AliHLTTPCCAMergerOutput& operator=( const AliHLTTPCCAMergerOutput &/*v*/ ) const { 
-    return *this; 
-  }
+    AliHLTTPCCAMergerOutput( const AliHLTTPCCAMergerOutput & )
+        : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterIDsrc( 0 ), fClusterPackedAmp( 0 ) {}
 
-  ~AliHLTTPCCAMergerOutput(){}
+    const AliHLTTPCCAMergerOutput& operator=( const AliHLTTPCCAMergerOutput &/*v*/ ) const {
+      return *this;
+    }
 
+    ~AliHLTTPCCAMergerOutput() {}
 
-  GPUhd() Int_t NTracks()                    const { return fNTracks;              }
-  GPUhd() Int_t NTrackClusters()             const { return fNTrackClusters;       }
 
-  GPUhd() const AliHLTTPCCAMergedTrack &Track( Int_t i ) const { return fTracks[i]; }
-  GPUhd() UInt_t   ClusterIDsrc     ( Int_t i )  const { return fClusterIDsrc[i]; }
-  GPUhd() UChar_t  ClusterPackedAmp( Int_t i )  const { return fClusterPackedAmp[i]; }
+    GPUhd() int NTracks()                    const { return fNTracks;              }
+    GPUhd() int NTrackClusters()             const { return fNTrackClusters;       }
 
-  GPUhd() static Int_t EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters );
-  GPUhd() void SetPointers();
+    GPUhd() const AliHLTTPCCAMergedTrack &Track( int i ) const { return fTracks[i]; }
+    GPUhd() unsigned int   ClusterIDsrc     ( int i )  const { return fClusterIDsrc[i]; }
+    GPUhd() UChar_t  ClusterPackedAmp( int i )  const { return fClusterPackedAmp[i]; }
 
-  GPUhd() void SetNTracks       ( Int_t v )  { fNTracks = v;        }
-  GPUhd() void SetNTrackClusters( Int_t v )  { fNTrackClusters = v; }
+    GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters );
+    GPUhd() void SetPointers();
 
-  GPUhd() void SetTrack( Int_t i, const AliHLTTPCCAMergedTrack &v ) {  fTracks[i] = v; }
-  GPUhd() void SetClusterIDsrc( Int_t i, UInt_t v ) {  fClusterIDsrc[i] = v; }
-  GPUhd() void SetClusterPackedAmp( Int_t i, UChar_t v ) {  fClusterPackedAmp[i] = v; }
+    GPUhd() void SetNTracks       ( int v )  { fNTracks = v;        }
+    GPUhd() void SetNTrackClusters( int v )  { fNTrackClusters = v; }
 
- private:
-  
-  Int_t fNTracks;                 // number of reconstructed tracks
-  Int_t fNTrackClusters;          // total number of track clusters
-  AliHLTTPCCAMergedTrack *fTracks; // pointer to reconstructed tracks
-  UInt_t   *fClusterIDsrc;         // pointer to cluster IDs ( packed IRow and ICluster)
-  UChar_t  *fClusterPackedAmp;    // pointer to packed cluster amplitudes
+    GPUhd() void SetTrack( int i, const AliHLTTPCCAMergedTrack &v ) {  fTracks[i] = v; }
+    GPUhd() void SetClusterIDsrc( int i, unsigned int v ) {  fClusterIDsrc[i] = v; }
+    GPUhd() void SetClusterPackedAmp( int i, UChar_t v ) {  fClusterPackedAmp[i] = v; }
+
+  private:
+
+    int fNTracks;                 // number of reconstructed tracks
+    int fNTrackClusters;          // total number of track clusters
+    AliHLTTPCCAMergedTrack *fTracks; // pointer to reconstructed tracks
+    unsigned int   *fClusterIDsrc;         // pointer to cluster IDs ( packed IRow and ICluster)
+    UChar_t  *fClusterPackedAmp;    // pointer to packed cluster amplitudes
 
 };
 
 
 
-GPUhd() inline Int_t AliHLTTPCCAMergerOutput::EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters )
+GPUhd() inline int AliHLTTPCCAMergerOutput::EstimateSize( int nOfTracks, int nOfTrackClusters )
 {
   // calculate the amount of memory [bytes] needed for the event
 
-  const Int_t kClusterDataSize = sizeof(UInt_t) + sizeof(UChar_t);
+  const int kClusterDataSize = sizeof( unsigned int ) + sizeof( UChar_t );
 
-  return sizeof(AliHLTTPCCAMergerOutput) + sizeof(AliHLTTPCCAMergedTrack)*nOfTracks + kClusterDataSize*nOfTrackClusters;
+  return sizeof( AliHLTTPCCAMergerOutput ) + sizeof( AliHLTTPCCAMergedTrack )*nOfTracks + kClusterDataSize*nOfTrackClusters;
 }
 
 
@@ -84,9 +84,9 @@ GPUhd() inline void AliHLTTPCCAMergerOutput::SetPointers()
 {
   // set all pointers
 
-  fTracks            = (AliHLTTPCCAMergedTrack*)((&fClusterPackedAmp)+1);
-  fClusterIDsrc      = (UInt_t*)  ( fTracks            + fNTracks );
-  fClusterPackedAmp  = (UChar_t*) ( fClusterIDsrc + fNTrackClusters );
+  fTracks            = ( AliHLTTPCCAMergedTrack* )( ( &fClusterPackedAmp ) + 1 );
+  fClusterIDsrc      = ( unsigned int* )  ( fTracks            + fNTracks );
+  fClusterPackedAmp  = ( UChar_t* ) ( fClusterIDsrc + fNTrackClusters );
 }
 
 #endif
index febd74794cc40c467b852a6dd3ca74019d34c4b8..41e485b098e2b702b4c06d92050a0864a1929789 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id: AliHLTTPCCANeighboursCleaner.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLTTPCCAMath.h"
 #include "AliHLTTPCCATracker.h"
 
-GPUd() void AliHLTTPCCANeighboursCleaner::Thread 
-( Int_t /*nBlocks*/, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
+GPUd() void AliHLTTPCCANeighboursCleaner::Thread
+( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker )
 {
   // *
   // * kill link to the neighbour if the neighbour is not pointed to the cluster
   // *
 
-  if( iSync==0 )
-    {
-      if( iThread==0 ){
-       s.fNRows = tracker.Param().NRows();
-       s.fIRow = iBlock+2;
-       if( s.fIRow <= s.fNRows-3 ){
-         s.fIRowUp = s.fIRow+2;
-         s.fIRowDn = s.fIRow-2;          
-         s.fFirstHit = tracker.Row(s.fIRow).FirstHit(); 
-         const AliHLTTPCCARow &row = tracker.Row(s.fIRow);
-         const AliHLTTPCCARow &rowUp = tracker.Row(s.fIRowUp);
-         const AliHLTTPCCARow &rowDn = tracker.Row(s.fIRowDn);
-         s.fHitLinkUp = ((Short_t*)(tracker.RowData() + row.FullOffset())) + row.FullLinkOffset();
-         s.fHitLinkDn = s.fHitLinkUp + row.NHits();
-         s.fDnHitLinkUp = ((Short_t*)(tracker.RowData() + rowDn.FullOffset())) + rowDn.FullLinkOffset();
-         s.fUpHitLinkDn = ((Short_t*)(tracker.RowData() + rowUp.FullOffset())) + rowUp.FullLinkOffset() + rowUp.NHits();
+  if ( iSync == 0 ) {
+    if ( iThread == 0 ) {
+      s.fNRows = tracker.Param().NRows();
+      s.fIRow = iBlock + 2;
+      if ( s.fIRow <= s.fNRows - 3 ) {
+        s.fIRowUp = s.fIRow + 2;
+        s.fIRowDn = s.fIRow - 2;
+        s.fFirstHit = tracker.Row( s.fIRow ).FirstHit();
+        const AliHLTTPCCARow &row = tracker.Row( s.fIRow );
+        const AliHLTTPCCARow &rowUp = tracker.Row( s.fIRowUp );
+        const AliHLTTPCCARow &rowDn = tracker.Row( s.fIRowDn );
+        s.fHitLinkUp = ( ( short* )( tracker.RowData() + row.FullOffset() ) ) + row.FullLinkOffset();
+        s.fHitLinkDn = s.fHitLinkUp + row.NHits();
+        s.fDnHitLinkUp = ( ( short* )( tracker.RowData() + rowDn.FullOffset() ) ) + rowDn.FullLinkOffset();
+        s.fUpHitLinkDn = ( ( short* )( tracker.RowData() + rowUp.FullOffset() ) ) + rowUp.FullLinkOffset() + rowUp.NHits();
 
-         s.fNHits = tracker.Row(s.fIRow).NHits();
-       }
+        s.fNHits = tracker.Row( s.fIRow ).NHits();
       }
-    } 
-  else if( iSync==1 )
-    {
-      if( s.fIRow <= s.fNRows-3 ){
+    }
+  } else if ( iSync == 1 ) {
+    if ( s.fIRow <= s.fNRows - 3 ) {
 
-       for( Int_t ih=iThread; ih<s.fNHits; ih+=nThreads ){
-         Int_t up = s.fHitLinkUp[ih];
-         if( up>=0 ){
-           Short_t upDn = s.fUpHitLinkDn[up];
-           if( (upDn!=ih) ) s.fHitLinkUp[ih]= -1;
-         }       
-         Int_t dn = s.fHitLinkDn[ih];
-         if( dn>=0 ){
-           Short_t dnUp = s.fDnHitLinkUp[dn];
-           if( dnUp!=ih ) s.fHitLinkDn[ih]= -1;
-         }
-       }
+      for ( int ih = iThread; ih < s.fNHits; ih += nThreads ) {
+        int up = s.fHitLinkUp[ih];
+        if ( up >= 0 ) {
+          short upDn = s.fUpHitLinkDn[up];
+          if ( ( upDn != ih ) ) s.fHitLinkUp[ih] = -1;
+        }
+        int dn = s.fHitLinkDn[ih];
+        if ( dn >= 0 ) {
+          short dnUp = s.fDnHitLinkUp[dn];
+          if ( dnUp != ih ) s.fHitLinkDn[ih] = -1;
+        }
       }
     }
+  }
 }
 
index 80e30afe6b5dfacb5acbb47096d9fbcef81d2fe4..b5bac26c619d248c9a6f6309886ffec7eea46ed9 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -16,39 +16,39 @@ class AliHLTTPCCATracker;
 
 /**
  * @class AliHLTTPCCANeighboursCleaner
- * 
+ *
  */
 class AliHLTTPCCANeighboursCleaner
 {
- public:
-  class AliHLTTPCCASharedMemory
 public:
+    class AliHLTTPCCASharedMemory
     {
-     friend class AliHLTTPCCANeighboursCleaner;
-    public:
+        friend class AliHLTTPCCANeighboursCleaner;
+      public:
 #if !defined(HLTCA_GPUCODE)
-      AliHLTTPCCASharedMemory()
-       :fIRow(0),fIRowUp(0),fIRowDn(0),fNRows(0),fNHits(0),fHitLinkDn(0),fHitLinkUp(0),fUpHitLinkDn(0),fDnHitLinkUp(0),fFirstHit(0){}
-      AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/) 
-       :fIRow(0),fIRowUp(0),fIRowDn(0),fNRows(0),fNHits(0),fHitLinkDn(0),fHitLinkUp(0),fUpHitLinkDn(0),fDnHitLinkUp(0),fFirstHit(0) {}
-      AliHLTTPCCASharedMemory& operator=(const AliHLTTPCCASharedMemory& /*dummy*/){ return *this; }
+        AliHLTTPCCASharedMemory()
+            : fIRow( 0 ), fIRowUp( 0 ), fIRowDn( 0 ), fNRows( 0 ), fNHits( 0 ), fHitLinkDn( 0 ), fHitLinkUp( 0 ), fUpHitLinkDn( 0 ), fDnHitLinkUp( 0 ), fFirstHit( 0 ) {}
+        AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ )
+            : fIRow( 0 ), fIRowUp( 0 ), fIRowDn( 0 ), fNRows( 0 ), fNHits( 0 ), fHitLinkDn( 0 ), fHitLinkUp( 0 ), fUpHitLinkDn( 0 ), fDnHitLinkUp( 0 ), fFirstHit( 0 ) {}
+        AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; }
 #endif
-    protected:
-      Int_t fIRow; // current row index
-      Int_t fIRowUp; // current row index
-      Int_t fIRowDn; // current row index
-      Int_t fNRows; // number of rows
-      Int_t fNHits; // number of hits
-      Short_t *fHitLinkDn; // links to the previous row
-      Short_t *fHitLinkUp; // links to the next row
-      Short_t *fUpHitLinkDn; // links from next row
-      Short_t *fDnHitLinkUp; // links from previous row
-      Int_t fFirstHit; // index of the first row hit in global arrays 
+      protected:
+        int fIRow; // current row index
+        int fIRowUp; // current row index
+        int fIRowDn; // current row index
+        int fNRows; // number of rows
+        int fNHits; // number of hits
+        short *fHitLinkDn; // links to the previous row
+        short *fHitLinkUp; // links to the next row
+        short *fUpHitLinkDn; // links from next row
+        short *fDnHitLinkUp; // links from previous row
+        int fFirstHit; // index of the first row hit in global arrays
     };
 
-  GPUd() static Int_t NThreadSyncPoints(){ return 1; }  
+    GPUd() static int NThreadSyncPoints() { return 1; }
 
-  GPUd() static void Thread( Int_t /*nBlocks*/, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
-                            AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
+    GPUd() static void Thread( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync,
+                               AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
 };
 
 
index 4a2986bc90a192f9a56fee1125ea64135a4bae23..ff1d3ee5003562c612f7d38e0ef95a542f3f723b 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id: AliHLTTPCCANeighboursFinder1.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #endif
 
 GPUd() void AliHLTTPCCANeighboursFinder::Thread
-( Int_t /*nBlocks*/, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
+( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker )
 {
   //* find neighbours
-  
-  if( iSync==0 )
-    {
-      if( iThread==0 ){
-       s.fNRows = tracker.Param().NRows();
-       s.fIRow = iBlock;
-       if( s.fIRow < s.fNRows ){
-         const AliHLTTPCCARow &row = tracker.Row(s.fIRow);
-         s.fFirst = row.FirstHit();
-         s.fNHits = row.NHits();
-
-         s.fHitLinkUp = ((Short_t*)(tracker.RowData() + row.FullOffset())) + row.FullLinkOffset();
-         s.fHitLinkDn = s.fHitLinkUp + row.NHits();
-
-         if( (s.fIRow>=2) && (s.fIRow<=s.fNRows-3) ){
-           s.fIRowUp = s.fIRow+2;
-           s.fIRowDn = s.fIRow-2; 
-           s.fFirstDn = tracker.Row(s.fIRowDn).FirstHit();
-           s.fFirstUp = tracker.Row(s.fIRowUp).FirstHit();
-           float xDn = tracker.Row(s.fIRowDn).X();
-           float x = tracker.Row(s.fIRow).X();
-           float xUp = tracker.Row(s.fIRowUp).X();
-           s.fUpNHits = tracker.Row(s.fIRowUp).NHits();
-           s.fDnNHits = s.fFirst - s.fFirstDn;
-           s.fUpDx = xUp - x;
-           s.fDnDx = xDn - x;
-           s.fUpTx = xUp/x;
-           s.fDnTx = xDn/x;
-           s.fGridUp = tracker.Row(s.fIRowUp).Grid();
-           s.fGridDn = tracker.Row(s.fIRowDn).Grid();
-         }
-       }
+
+  if ( iSync == 0 ) {
+    if ( iThread == 0 ) {
+      s.fNRows = tracker.Param().NRows();
+      s.fIRow = iBlock;
+      if ( s.fIRow < s.fNRows ) {
+        const AliHLTTPCCARow &row = tracker.Row( s.fIRow );
+        s.fFirst = row.FirstHit();
+        s.fNHits = row.NHits();
+
+        s.fHitLinkUp = ( ( short* )( tracker.RowData() + row.FullOffset() ) ) + row.FullLinkOffset();
+        s.fHitLinkDn = s.fHitLinkUp + row.NHits();
+
+        if ( ( s.fIRow >= 2 ) && ( s.fIRow <= s.fNRows - 3 ) ) {
+          s.fIRowUp = s.fIRow + 2;
+          s.fIRowDn = s.fIRow - 2;
+          s.fFirstDn = tracker.Row( s.fIRowDn ).FirstHit();
+          s.fFirstUp = tracker.Row( s.fIRowUp ).FirstHit();
+          float xDn = tracker.Row( s.fIRowDn ).X();
+          float x = tracker.Row( s.fIRow ).X();
+          float xUp = tracker.Row( s.fIRowUp ).X();
+          s.fUpNHits = tracker.Row( s.fIRowUp ).NHits();
+          s.fDnNHits = s.fFirst - s.fFirstDn;
+          s.fUpDx = xUp - x;
+          s.fDnDx = xDn - x;
+          s.fUpTx = xUp / x;
+          s.fDnTx = xDn / x;
+          s.fGridUp = tracker.Row( s.fIRowUp ).Grid();
+          s.fGridDn = tracker.Row( s.fIRowDn ).Grid();
+        }
       }
-    } 
-  else if( iSync==1 )
-    {
-      if( s.fIRow < s.fNRows ){
-       if( (s.fIRow==0) || (s.fIRow==s.fNRows-1) || (s.fIRow==1) || (s.fIRow==s.fNRows-2) ){
-         for( Int_t ih=iThread; ih<s.fNHits; ih+=nThreads ){
-           s.fHitLinkUp[ih] = -1;
-           s.fHitLinkDn[ih] = -1;
-         }
-       }else {
-         const AliHLTTPCCARow &rowUp = tracker.Row(s.fIRowUp);
-         const AliHLTTPCCARow &rowDn = tracker.Row(s.fIRowDn);
-         const UShort_t *gContentUp = (reinterpret_cast<const UShort_t*>(tracker.RowData() + rowUp.FullOffset())) + rowUp.FullGridOffset();
-         const UShort_t *gContentDn = (reinterpret_cast<const UShort_t*>(tracker.RowData() + rowDn.FullOffset())) + rowDn.FullGridOffset();
-         
-         for( UInt_t ih=iThread; ih<s.fGridUp.N()+s.fGridUp.Ny()+2; ih+=nThreads ){
-           s.fGridContentUp[ih] = gContentUp[ih];
-         }
-         for( UInt_t ih=iThread; ih<s.fGridDn.N()+s.fGridDn.Ny()+2; ih+=nThreads ){
-           s.fGridContentDn[ih] = gContentDn[ih];
-         }
-       }
+    }
+  } else if ( iSync == 1 ) {
+    if ( s.fIRow < s.fNRows ) {
+      if ( ( s.fIRow == 0 ) || ( s.fIRow == s.fNRows - 1 ) || ( s.fIRow == 1 ) || ( s.fIRow == s.fNRows - 2 ) ) {
+        for ( int ih = iThread; ih < s.fNHits; ih += nThreads ) {
+          s.fHitLinkUp[ih] = -1;
+          s.fHitLinkDn[ih] = -1;
+        }
+      } else {
+        const AliHLTTPCCARow &rowUp = tracker.Row( s.fIRowUp );
+        const AliHLTTPCCARow &rowDn = tracker.Row( s.fIRowDn );
+        const unsigned short *gContentUp = ( reinterpret_cast<const unsigned short*>( tracker.RowData() + rowUp.FullOffset() ) ) + rowUp.FullGridOffset();
+        const unsigned short *gContentDn = ( reinterpret_cast<const unsigned short*>( tracker.RowData() + rowDn.FullOffset() ) ) + rowDn.FullGridOffset();
+
+        for ( unsigned int ih = iThread; ih < s.fGridUp.N() + s.fGridUp.Ny() + 2; ih += nThreads ) {
+          s.fGridContentUp[ih] = gContentUp[ih];
+        }
+        for ( unsigned int ih = iThread; ih < s.fGridDn.N() + s.fGridDn.Ny() + 2; ih += nThreads ) {
+          s.fGridContentDn[ih] = gContentDn[ih];
+        }
       }
     }
-  else if( iSync==2 )
-    {
-      if( (s.fIRow<=1) || (s.fIRow >= s.fNRows-2) ) return;
-      //const float kAreaSize = 3;     
-      float chi2Cut = 3.*3.*4*(s.fUpDx*s.fUpDx + s.fDnDx*s.fDnDx );
-      const float kAreaSize = 3;     
-      //float chi2Cut = 3.*3.*(s.fUpDx*s.fUpDx + s.fDnDx*s.fDnDx ); //SG
-      const Int_t kMaxN = 20;
-      
-      const AliHLTTPCCARow &row = tracker.Row(s.fIRow);
-      const AliHLTTPCCARow &rowUp = tracker.Row(s.fIRowUp);
-      const AliHLTTPCCARow &rowDn = tracker.Row(s.fIRowDn);
-      float y0 = row.Grid().YMin();
-      float z0 = row.Grid().ZMin();
-      float stepY = row.HstepY();
-      float stepZ = row.HstepZ();
-      const uint4* tmpint4 = tracker.RowData() + row.FullOffset();
-      const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
-
-      for( Int_t ih=iThread; ih<s.fNHits; ih+=nThreads ){      
-
-       UShort_t *neighUp = s.fB[iThread];
-       float2 *yzUp = s.fA[iThread];
-       //UShort_t neighUp[5];
-       //float2 yzUp[5];
-
-       Int_t linkUp = -1;
-       Int_t linkDn = -1;
-       
-       if( s.fDnNHits>0 && s.fUpNHits>0 ){
-         
-         Int_t nNeighUp = 0;
-         AliHLTTPCCAHit h0;
-         {
-           ushort2 hh = hits[ih];
-           h0.SetY( y0 + hh.x*stepY );
-           h0.SetZ( z0 + hh.y*stepZ );
-         }
-         //h0 = tracker.Hits()[ s.fFirst + ih ];         
-
-         float y = h0.Y(); 
-         float z = h0.Z(); 
-
-         AliHLTTPCCAHitArea areaDn, areaUp;
-         areaUp.Init( s.fGridUp,  s.fGridContentUp,s.fFirstUp, y*s.fUpTx, z*s.fUpTx, kAreaSize, kAreaSize );
-         areaDn.Init( s.fGridDn,  s.fGridContentDn,s.fFirstDn, y*s.fDnTx, z*s.fDnTx, kAreaSize, kAreaSize );
-         
-         do{
-           AliHLTTPCCAHit h;
-           Int_t i = areaUp.GetNext( tracker, rowUp,s.fGridContentUp, h );
-           if( i<0 ) break;          
-           neighUp[nNeighUp] = (UShort_t) i;
-           yzUp[nNeighUp] = CAMath::MakeFloat2( s.fDnDx*(h.Y()-y), s.fDnDx*(h.Z()-z) );
-           if( ++nNeighUp>=kMaxN ) break;
-         }while(1);
-         
-         Int_t nNeighDn=0;
-         
-         if( nNeighUp>0 ){
-
-           Int_t bestDn=-1, bestUp=-1;
-           float bestD=1.e10;
-
-           do{
-             AliHLTTPCCAHit h;
-             Int_t i = areaDn.GetNext( tracker, rowDn,s.fGridContentDn,h );
-             if( i<0 ) break;
-             
-             nNeighDn++;
-             float2 yzdn = CAMath::MakeFloat2( s.fUpDx*(h.Y()-y), s.fUpDx*(h.Z()-z) );
-             
-             for( Int_t iUp=0; iUp<nNeighUp; iUp++ ){
-               float2 yzup = yzUp[iUp];
-               float dy = yzdn.x - yzup.x;
-               float dz = yzdn.y - yzup.y;
-               float d = dy*dy + dz*dz;
-               if( d<bestD ){
-                 bestD = d;
-                 bestDn = i;
-                 bestUp = iUp;
-               }               
-             }
-           }while(1);            
-
-           if( bestD <= chi2Cut ){      
-             linkUp = neighUp[bestUp];
-             linkDn = bestDn;      
-           }
-         }
+  } else if ( iSync == 2 ) {
+    if ( ( s.fIRow <= 1 ) || ( s.fIRow >= s.fNRows - 2 ) ) return;
+
+    //const float kAreaSize = 3;
+    float chi2Cut = 3.*3.*4 * ( s.fUpDx * s.fUpDx + s.fDnDx * s.fDnDx );
+    const float kAreaSize = 3;
+    //float chi2Cut = 3.*3.*(s.fUpDx*s.fUpDx + s.fDnDx*s.fDnDx ); //SG
+    const int kMaxN = 20;
+
+    const AliHLTTPCCARow &row = tracker.Row( s.fIRow );
+    const AliHLTTPCCARow &rowUp = tracker.Row( s.fIRowUp );
+    const AliHLTTPCCARow &rowDn = tracker.Row( s.fIRowDn );
+    float y0 = row.Grid().YMin();
+    float z0 = row.Grid().ZMin();
+    float stepY = row.HstepY();
+    float stepZ = row.HstepZ();
+    const uint4* tmpint4 = tracker.RowData() + row.FullOffset();
+    const ushort2 *hits = reinterpret_cast<const ushort2*>( tmpint4 );
+
+    for ( int ih = iThread; ih < s.fNHits; ih += nThreads ) {
+
+      unsigned short *neighUp = s.fB[iThread];
+      float2 *yzUp = s.fA[iThread];
+      //unsigned short neighUp[5];
+      //float2 yzUp[5];
+
+      int linkUp = -1;
+      int linkDn = -1;
+
+      if ( s.fDnNHits > 0 && s.fUpNHits > 0 ) {
+
+        int nNeighUp = 0;
+        AliHLTTPCCAHit h0;
+        {
+          ushort2 hh = hits[ih];
+          h0.SetY( y0 + hh.x*stepY );
+          h0.SetZ( z0 + hh.y*stepZ );
+        }
+        //h0 = tracker.Hits()[ s.fFirst + ih ];
+
+        float y = h0.Y();
+        float z = h0.Z();
+
+        AliHLTTPCCAHitArea areaDn, areaUp;
+        areaUp.Init( s.fGridUp,  s.fGridContentUp, s.fFirstUp, y*s.fUpTx, z*s.fUpTx, kAreaSize, kAreaSize );
+        areaDn.Init( s.fGridDn,  s.fGridContentDn, s.fFirstDn, y*s.fDnTx, z*s.fDnTx, kAreaSize, kAreaSize );
+
+        do {
+          AliHLTTPCCAHit h;
+          int i = areaUp.GetNext( tracker, rowUp, s.fGridContentUp, h );
+          if ( i < 0 ) break;
+          neighUp[nNeighUp] = ( unsigned short ) i;
+          yzUp[nNeighUp] = CAMath::MakeFloat2( s.fDnDx * ( h.Y() - y ), s.fDnDx * ( h.Z() - z ) );
+          if ( ++nNeighUp >= kMaxN ) break;
+        } while ( 1 );
+
+        int nNeighDn = 0;
+
+        if ( nNeighUp > 0 ) {
+
+          int bestDn = -1, bestUp = -1;
+          float bestD = 1.e10;
+
+          do {
+            AliHLTTPCCAHit h;
+            int i = areaDn.GetNext( tracker, rowDn, s.fGridContentDn, h );
+            if ( i < 0 ) break;
+
+            nNeighDn++;
+            float2 yzdn = CAMath::MakeFloat2( s.fUpDx * ( h.Y() - y ), s.fUpDx * ( h.Z() - z ) );
+
+            for ( int iUp = 0; iUp < nNeighUp; iUp++ ) {
+              float2 yzup = yzUp[iUp];
+              float dy = yzdn.x - yzup.x;
+              float dz = yzdn.y - yzup.y;
+              float d = dy * dy + dz * dz;
+              if ( d < bestD ) {
+                bestD = d;
+                bestDn = i;
+                bestUp = iUp;
+              }
+            }
+          } while ( 1 );
+
+          if ( bestD <= chi2Cut ) {
+            linkUp = neighUp[bestUp];
+            linkDn = bestDn;
+          }
+        }
 #ifdef DRAW
-         std::cout<<"n NeighUp = "<<nNeighUp<<", n NeighDn = "<<nNeighDn<<std::endl;
-#endif   
+        std::cout << "n NeighUp = " << nNeighUp << ", n NeighDn = " << nNeighDn << std::endl;
+#endif
 
-       }
-       
-       s.fHitLinkUp[ih] = linkUp;
-       s.fHitLinkDn[ih] = linkDn;
+      }
+
+      s.fHitLinkUp[ih] = linkUp;
+      s.fHitLinkDn[ih] = linkDn;
 #ifdef DRAW
-       std::cout<<"Links for row "<<s.fIRow<<", hit "<<ih<<": "<<linkUp<<" "<<linkDn<<std::endl;
-       if( s.fIRow==22 && ih==5 )
-         {
-         AliHLTTPCCADisplay::Instance().DrawSliceLink(s.fIRow, ih, -1, -1, 1);  
-         AliHLTTPCCADisplay::Instance().DrawSliceHit(s.fIRow, ih, kBlue, 1.);
-         AliHLTTPCCADisplay::Instance().Ask();
-       }
-#endif
+      std::cout << "Links for row " << s.fIRow << ", hit " << ih << ": " << linkUp << " " << linkDn << std::endl;
+      if ( s.fIRow == 22 && ih == 5 ) {
+        AliHLTTPCCADisplay::Instance().DrawSliceLink( s.fIRow, ih, -1, -1, 1 );
+        AliHLTTPCCADisplay::Instance().DrawSliceHit( s.fIRow, ih, kBlue, 1. );
+        AliHLTTPCCADisplay::Instance().Ask();
       }
+#endif
     }
+  }
 }
 
index fed7cc0e02368ebe0d3c81736f9afe33ad2fea49..21fbc29175c47fa62e153d13db4c2b7fd7890796 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -16,54 +16,52 @@ class AliHLTTPCCATracker;
 
 /**
  * @class AliHLTTPCCANeighboursFinder
- * 
+ *
  */
 class AliHLTTPCCANeighboursFinder
 {
- public:
-  class AliHLTTPCCASharedMemory
 public:
+    class AliHLTTPCCASharedMemory
     {
-  friend class AliHLTTPCCANeighboursFinder;
-    public:
+        friend class AliHLTTPCCANeighboursFinder;
+      public:
 #if !defined(HLTCA_GPUCODE)
-      AliHLTTPCCASharedMemory()
-       : fGridUp(), fGridDn(), fNHits(0), fUpNHits(0), fDnNHits(0), fUpDx(0), fDnDx(0), fUpTx(0), fDnTx(0), fIRow(0), fIRowUp(0), fIRowDn(0), fFirst(0), fFirstDn(0), fFirstUp(0), fNRows(0), fHitLinkUp(0), fHitLinkDn(0)
-      {}
+        AliHLTTPCCASharedMemory()
+            : fGridUp(), fGridDn(), fNHits( 0 ), fUpNHits( 0 ), fDnNHits( 0 ), fUpDx( 0 ), fDnDx( 0 ), fUpTx( 0 ), fDnTx( 0 ), fIRow( 0 ), fIRowUp( 0 ), fIRowDn( 0 ), fFirst( 0 ), fFirstDn( 0 ), fFirstUp( 0 ), fNRows( 0 ), fHitLinkUp( 0 ), fHitLinkDn( 0 ) {}
 
-      AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/) 
-       : fGridUp(), fGridDn(), fNHits(0), fUpNHits(0), fDnNHits(0), fUpDx(0), fDnDx(0), fUpTx(0), fDnTx(0), fIRow(0), fIRowUp(0), fIRowDn(0), fFirst(0), fFirstDn(0), fFirstUp(0), fNRows(0), fHitLinkUp(0), fHitLinkDn(0)
-      {}
-      AliHLTTPCCASharedMemory& operator=(const AliHLTTPCCASharedMemory& /*dummy*/){ return *this; }
+        AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ )
+            : fGridUp(), fGridDn(), fNHits( 0 ), fUpNHits( 0 ), fDnNHits( 0 ), fUpDx( 0 ), fDnDx( 0 ), fUpTx( 0 ), fDnTx( 0 ), fIRow( 0 ), fIRowUp( 0 ), fIRowDn( 0 ), fFirst( 0 ), fFirstDn( 0 ), fFirstUp( 0 ), fNRows( 0 ), fHitLinkUp( 0 ), fHitLinkDn( 0 ) {}
+        AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; }
 #endif
-    protected:
-      AliHLTTPCCAGrid fGridUp; // grid for the next row
-      AliHLTTPCCAGrid fGridDn; // grid for the previous row
-      Int_t fNHits; // n hits
-      Int_t fUpNHits; // n hits in the next row
-      Int_t fDnNHits; // n hits in the prev row
-      Float_t fUpDx; // x distance to the next row
-      Float_t fDnDx; // x distance to the previous row
-      Float_t fUpTx; // normalized x distance to the next row
-      Float_t fDnTx; // normalized x distance to the previous row
-      Int_t fIRow; // row number
-      Int_t fIRowUp; // next row number 
-      Int_t fIRowDn;// previous row number 
-      Int_t fFirst; // index of the first hit
-      Int_t fFirstDn; // index of the first hit in the next row
-      Int_t fFirstUp;// index of the first hit in the previous row
-      Int_t fNRows; // number of rows
-      Short_t *fHitLinkUp; // links to the next row
-      Short_t *fHitLinkDn; // links to the previous  row
-      float2 fA[256][20]; // temp memory
-      UShort_t fB[256][20]; // temp memory
-      UShort_t fGridContentUp[7000]; // grid content for the next row
-      UShort_t fGridContentDn[7000];// grid content for the previous row
+      protected:
+        AliHLTTPCCAGrid fGridUp; // grid for the next row
+        AliHLTTPCCAGrid fGridDn; // grid for the previous row
+        int fNHits; // n hits
+        int fUpNHits; // n hits in the next row
+        int fDnNHits; // n hits in the prev row
+        float fUpDx; // x distance to the next row
+        float fDnDx; // x distance to the previous row
+        float fUpTx; // normalized x distance to the next row
+        float fDnTx; // normalized x distance to the previous row
+        int fIRow; // row number
+        int fIRowUp; // next row number
+        int fIRowDn;// previous row number
+        int fFirst; // index of the first hit
+        int fFirstDn; // index of the first hit in the next row
+        int fFirstUp;// index of the first hit in the previous row
+        int fNRows; // number of rows
+        short *fHitLinkUp; // links to the next row
+        short *fHitLinkDn; // links to the previous  row
+        float2 fA[256][20]; // temp memory
+        unsigned short fB[256][20]; // temp memory
+        unsigned short fGridContentUp[7000]; // grid content for the next row
+        unsigned short fGridContentDn[7000];// grid content for the previous row
     };
-  
-  GPUd() static Int_t NThreadSyncPoints(){ return 2; }  
 
-  GPUd() static void Thread( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
-                            AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
+    GPUd() static int NThreadSyncPoints() { return 2; }
+
+    GPUd() static void Thread( int nBlocks, int nThreads, int iBlock, int iThread, int iSync,
+                               AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
 
 };
 
index 44bd43008bbaf759b026d1c008a7cac897b7c99c..1ff71514a68ebe6808a5541356c58de021ee2732 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
@@ -21,9 +21,9 @@
 #include "AliHLTTPCCAOutTrack.h"
 
 
-ClassImp(AliHLTTPCCAOutTrack)
+ClassImp( AliHLTTPCCAOutTrack )
 
-GPUh() void AliHLTTPCCAOutTrack::Dummy() const 
+GPUh() void AliHLTTPCCAOutTrack::Dummy() const
 {
   //* do nothing
 }
index b3a213634c33835eb0e743101c71b39e4e9e696c..0c1553c617e8cf0319da872a5bbf1016ff9202c9 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAOutTrack
 {
- public:
 public:
 
-  AliHLTTPCCAOutTrack():fFirstHitRef(0),fNHits(0),fStartPoint(),fEndPoint(),fOrigTrackID(0){}
-  virtual ~AliHLTTPCCAOutTrack(){}
+    AliHLTTPCCAOutTrack(): fFirstHitRef( 0 ), fNHits( 0 ), fStartPoint(), fEndPoint(), fOrigTrackID( 0 ) {}
+    virtual ~AliHLTTPCCAOutTrack() {}
 
-  GPUhd() Int_t NHits()               const { return fNHits; }
-  GPUhd() Int_t FirstHitRef()         const { return fFirstHitRef; }
+    GPUhd() int NHits()               const { return fNHits; }
+    GPUhd() int FirstHitRef()         const { return fFirstHitRef; }
 
-  GPUhd() const AliHLTTPCCATrackParam &StartPoint() const { return fStartPoint; }
-  GPUhd() const AliHLTTPCCATrackParam &EndPoint()   const { return fEndPoint; }
-  GPUhd() Int_t OrigTrackID()                const { return fOrigTrackID; }
+    GPUhd() const AliHLTTPCCATrackParam &StartPoint() const { return fStartPoint; }
+    GPUhd() const AliHLTTPCCATrackParam &EndPoint()   const { return fEndPoint; }
+    GPUhd() int OrigTrackID()                const { return fOrigTrackID; }
 
-  GPUhd() void SetNHits( Int_t v )               { fNHits = v; }
-  GPUhd() void SetFirstHitRef( Int_t v)         { fFirstHitRef = v; }
+    GPUhd() void SetNHits( int v )               { fNHits = v; }
+    GPUhd() void SetFirstHitRef( int v )         { fFirstHitRef = v; }
 
-  GPUhd() void SetStartPoint( const AliHLTTPCCATrackParam &v) { fStartPoint = v; }
-  GPUhd() void SetEndPoint( const AliHLTTPCCATrackParam &v)   { fEndPoint = v; }
-  GPUhd() void SetOrigTrackID( Int_t v)                { fOrigTrackID = v; }
+    GPUhd() void SetStartPoint( const AliHLTTPCCATrackParam &v ) { fStartPoint = v; }
+    GPUhd() void SetEndPoint( const AliHLTTPCCATrackParam &v )   { fEndPoint = v; }
+    GPUhd() void SetOrigTrackID( int v )                { fOrigTrackID = v; }
 
- protected:
-  
-  Int_t fFirstHitRef;   //* index of the first hit reference in track->hit reference array
-  Int_t fNHits;         //* number of track hits
-  AliHLTTPCCATrackParam fStartPoint; //* fitted track parameters at the start point
-  AliHLTTPCCATrackParam fEndPoint;   //* fitted track parameters at the start point
-  Int_t fOrigTrackID;                //* index of the original slice track
+  protected:
 
- private:
+    int fFirstHitRef;   //* index of the first hit reference in track->hit reference array
+    int fNHits;         //* number of track hits
+    AliHLTTPCCATrackParam fStartPoint; //* fitted track parameters at the start point
+    AliHLTTPCCATrackParam fEndPoint;   //* fitted track parameters at the start point
+    int fOrigTrackID;                //* index of the original slice track
 
-  void Dummy() const; // to make rulechecker happy by having something in .cxx file
+  private:
 
-  ClassDef(AliHLTTPCCAOutTrack,1)
+    void Dummy() const; // to make rulechecker happy by having something in .cxx file
+
+    ClassDef( AliHLTTPCCAOutTrack, 1 )
 };
 
 
index 5a25d9e81bdb20324d0990fa10bc17d301ac85cb..02d94d2e6dbde39ea06d23c27a13f5c87d1373fe 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLTTPCCAMath.h"
 
 
-#if !defined(HLTCA_GPUCODE)  
+#if !defined(HLTCA_GPUCODE)
 
 GPUd() AliHLTTPCCAParam::AliHLTTPCCAParam()
-  : fISlice(0),fNRows(63),fAlpha(0.174533), fDAlpha(0.349066),
-    fCosAlpha(0), fSinAlpha(0), fAngleMin(0), fAngleMax(0), fRMin(83.65), fRMax(133.3),
-    fZMin(0.0529937), fZMax(249.778), fErrX(0), fErrY(0), fErrZ(0.228808),fPadPitch(0.4),fBz(-5.), 
-    fHitPickUpFactor(1.),
-    fMaxTrackMatchDRow(4), fTrackConnectionFactor(3.5), fTrackChiCut(3.5), fTrackChi2Cut(10)
+    : fISlice( 0 ), fNRows( 63 ), fAlpha( 0.174533 ), fDAlpha( 0.349066 ),
+    fCosAlpha( 0 ), fSinAlpha( 0 ), fAngleMin( 0 ), fAngleMax( 0 ), fRMin( 83.65 ), fRMax( 133.3 ),
+    fZMin( 0.0529937 ), fZMax( 249.778 ), fErrX( 0 ), fErrY( 0 ), fErrZ( 0.228808 ), fPadPitch( 0.4 ), fBz( -5. ),
+    fHitPickUpFactor( 1. ),
+    fMaxTrackMatchDRow( 4 ), fTrackConnectionFactor( 3.5 ), fTrackChiCut( 3.5 ), fTrackChi2Cut( 10 )
 {
   // constructor
   fParamS0Par[0][0][0] = 0.00047013;
@@ -75,29 +75,29 @@ GPUd() AliHLTTPCCAParam::AliHLTTPCCAParam()
   fParamS0Par[1][2][5] = 0.000425504;
   fParamS0Par[1][2][6] = 20.9294;
 
-  const Double_t kCLight = 0.000299792458;
-  
-  fPolinomialFieldBz[0] = kCLight* 4.99643;
-  fPolinomialFieldBz[1] = kCLight* -2.27193e-06;
-  fPolinomialFieldBz[2] = kCLight* 0.000116475; 
-  fPolinomialFieldBz[3] = kCLight* -1.49956e-06; 
-  fPolinomialFieldBz[4] = kCLight* -1.01721e-07; 
-  fPolinomialFieldBz[5] = kCLight* 4.85701e-07; 
+  const double kCLight = 0.000299792458;
+
+  fPolinomialFieldBz[0] = kCLight * 4.99643;
+  fPolinomialFieldBz[1] = kCLight * -2.27193e-06;
+  fPolinomialFieldBz[2] = kCLight * 0.000116475;
+  fPolinomialFieldBz[3] = kCLight * -1.49956e-06;
+  fPolinomialFieldBz[4] = kCLight * -1.01721e-07;
+  fPolinomialFieldBz[5] = kCLight * 4.85701e-07;
 
   Update();
 }
 #endif
 
-GPUd() void AliHLTTPCCAParam::Initialize( Int_t iSlice, 
-                                  Int_t nRows, Float_t rowX[],
-                                  Float_t alpha, Float_t dAlpha,
-                                  Float_t rMin, Float_t rMax,
-                                  Float_t zMin, Float_t zMax,
-                                  Float_t padPitch, Float_t zSigma,
-                                  Float_t bz
-                                  )
+GPUd() void AliHLTTPCCAParam::Initialize( int iSlice,
+    int nRows, float rowX[],
+    float alpha, float dAlpha,
+    float rMin, float rMax,
+    float zMin, float zMax,
+    float padPitch, float zSigma,
+    float bz
+                                        )
 {
-  // initialization 
+  // initialization
   fISlice = iSlice;
   fAlpha = alpha;
   fDAlpha = dAlpha;
@@ -110,7 +110,7 @@ GPUd() void AliHLTTPCCAParam::Initialize( Int_t iSlice,
   fErrZ = zSigma;
   fBz = bz;
   fNRows = nRows;
-  for( Int_t irow=0; irow<nRows; irow++ ){
+  for ( int irow = 0; irow < nRows; irow++ ) {
     fRowX[irow] = rowX[irow];
   }
 
@@ -120,92 +120,92 @@ GPUd() void AliHLTTPCCAParam::Initialize( Int_t iSlice,
 GPUd() void AliHLTTPCCAParam::Update()
 {
   // update of calculated values
-  fCosAlpha = CAMath::Cos(fAlpha);
-  fSinAlpha = CAMath::Sin(fAlpha);
-  fAngleMin = fAlpha - fDAlpha/2.;
-  fAngleMax = fAlpha + fDAlpha/2.;
-  fErrX = fPadPitch/CAMath::Sqrt(12.);
+  fCosAlpha = CAMath::Cos( fAlpha );
+  fSinAlpha = CAMath::Sin( fAlpha );
+  fAngleMin = fAlpha - fDAlpha / 2.;
+  fAngleMax = fAlpha + fDAlpha / 2.;
+  fErrX = fPadPitch / CAMath::Sqrt( 12. );
   fTrackChi2Cut = fTrackChiCut * fTrackChiCut;
 }
 
-GPUd() void AliHLTTPCCAParam::Slice2Global( Float_t x, Float_t y,  Float_t z, 
-                                    Float_t *X, Float_t *Y,  Float_t *Z ) const
-{  
+GPUd() void AliHLTTPCCAParam::Slice2Global( float x, float y,  float z,
+    float *X, float *Y,  float *Z ) const
+{
   // conversion of coorinates sector->global
-  *X = x*fCosAlpha - y*fSinAlpha;
-  *Y = y*fCosAlpha + x*fSinAlpha;
+  *X = x * fCosAlpha - y * fSinAlpha;
+  *Y = y * fCosAlpha + x * fSinAlpha;
   *Z = z;
 }
-GPUd() void AliHLTTPCCAParam::Global2Slice( Float_t X, Float_t Y,  Float_t Z, 
-                                    Float_t *x, Float_t *y,  Float_t *z ) const
+
+GPUd() void AliHLTTPCCAParam::Global2Slice( float X, float Y,  float Z,
+    float *x, float *y,  float *z ) const
 {
   // conversion of coorinates global->sector
-  *x = X*fCosAlpha + Y*fSinAlpha;
-  *y = Y*fCosAlpha - X*fSinAlpha;
+  *x = X * fCosAlpha + Y * fSinAlpha;
+  *y = Y * fCosAlpha - X * fSinAlpha;
   *z = Z;
 }
 
-GPUd() Float_t AliHLTTPCCAParam::GetClusterError2( Int_t yz, Int_t type, Float_t z, Float_t angle ) const
+GPUd() float AliHLTTPCCAParam::GetClusterError2( int yz, int type, float z, float angle ) const
 {
   //* recalculate the cluster error wih respect to the track slope
-  Float_t angle2 = angle*angle;
-  const Float_t *c = fParamS0Par[yz][type];
-  Float_t v = c[0] + z*(c[1] + c[3]*z) + angle2*(c[2] + angle2*c[4] + c[5]*z );
-  return CAMath::Abs(v); 
+  float angle2 = angle * angle;
+  const float *c = fParamS0Par[yz][type];
+  float v = c[0] + z * ( c[1] + c[3] * z ) + angle2 * ( c[2] + angle2 * c[4] + c[5] * z );
+  return CAMath::Abs( v );
 }
 
-GPUd() void AliHLTTPCCAParam::GetClusterErrors2( Int_t iRow, Float_t z, Float_t sinPhi, Float_t cosPhi, Float_t DzDs, Float_t &Err2Y, Float_t &Err2Z ) const
+GPUd() void AliHLTTPCCAParam::GetClusterErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const
 {
   //
   // Use calibrated cluster error from OCDB
   //
 
-  z = CAMath::Abs((250.-0.275)-CAMath::Abs(z));
-  Int_t    type = (iRow<63) ? 0: ( (iRow>126) ? 1:2 );
-  Float_t cosPhiInv = CAMath::Abs(cosPhi)>1.e-2 ?1./cosPhi :0;
-  Float_t angleY = sinPhi*cosPhiInv ;
-  Float_t angleZ = DzDs*cosPhiInv ; // SG was bug??? 
+  z = CAMath::Abs( ( 250. - 0.275 ) - CAMath::Abs( z ) );
+  int    type = ( iRow < 63 ) ? 0 : ( ( iRow > 126 ) ? 1 : 2 );
+  float cosPhiInv = CAMath::Abs( cosPhi ) > 1.e-2 ? 1. / cosPhi : 0;
+  float angleY = sinPhi * cosPhiInv ;
+  float angleZ = DzDs * cosPhiInv ; // SG was bug???
 
-  Err2Y = GetClusterError2(0,type, z,angleY);  
-  Err2Z = GetClusterError2(1,type, z,angleZ);
+  Err2Y = GetClusterError2( 0, type, z, angleY );
+  Err2Z = GetClusterError2( 1, type, z, angleZ );
 }
 
 
-GPUh() void AliHLTTPCCAParam::WriteSettings( std::ostream &out ) const 
+GPUh() void AliHLTTPCCAParam::WriteSettings( std::ostream &out ) const
 {
   // write settings to the file
-  out << fISlice<<std::endl;
-  out << fNRows<<std::endl;
-  out << fAlpha<<std::endl;
-  out << fDAlpha<<std::endl;
-  out << fCosAlpha<<std::endl;
-  out << fSinAlpha<<std::endl;
-  out << fAngleMin<<std::endl;
-  out << fAngleMax<<std::endl;
-  out << fRMin<<std::endl;
-  out << fRMax<<std::endl;
-  out << fZMin<<std::endl;
-  out << fZMax<<std::endl;
-  out << fErrX<<std::endl;
-  out << fErrY<<std::endl;
-  out << fErrZ<<std::endl;
-  out << fPadPitch<<std::endl;
-  out << fBz<<std::endl;
-  out << fHitPickUpFactor<<std::endl;
-  out << fMaxTrackMatchDRow<<std::endl;
-  out << fTrackConnectionFactor<<std::endl;
-  out << fTrackChiCut<<std::endl;
-  out << fTrackChi2Cut<<std::endl;
-  for( Int_t iRow = 0; iRow<fNRows; iRow++ ){
-    out << fRowX[iRow]<<std::endl;
+  out << fISlice << std::endl;
+  out << fNRows << std::endl;
+  out << fAlpha << std::endl;
+  out << fDAlpha << std::endl;
+  out << fCosAlpha << std::endl;
+  out << fSinAlpha << std::endl;
+  out << fAngleMin << std::endl;
+  out << fAngleMax << std::endl;
+  out << fRMin << std::endl;
+  out << fRMax << std::endl;
+  out << fZMin << std::endl;
+  out << fZMax << std::endl;
+  out << fErrX << std::endl;
+  out << fErrY << std::endl;
+  out << fErrZ << std::endl;
+  out << fPadPitch << std::endl;
+  out << fBz << std::endl;
+  out << fHitPickUpFactor << std::endl;
+  out << fMaxTrackMatchDRow << std::endl;
+  out << fTrackConnectionFactor << std::endl;
+  out << fTrackChiCut << std::endl;
+  out << fTrackChi2Cut << std::endl;
+  for ( int iRow = 0; iRow < fNRows; iRow++ ) {
+    out << fRowX[iRow] << std::endl;
   }
-  out<<std::endl;
-  for( Int_t i=0; i<2; i++ )
-    for( Int_t j=0; j<3; j++ )
-      for( Int_t k=0; k<7; k++ )
-       out << fParamS0Par[i][j][k]<<std::endl;
-  out<<std::endl;
+  out << std::endl;
+  for ( int i = 0; i < 2; i++ )
+    for ( int j = 0; j < 3; j++ )
+      for ( int k = 0; k < 7; k++ )
+        out << fParamS0Par[i][j][k] << std::endl;
+  out << std::endl;
 }
 
 GPUh() void AliHLTTPCCAParam::ReadSettings( std::istream &in )
@@ -234,11 +234,11 @@ GPUh() void AliHLTTPCCAParam::ReadSettings( std::istream &in )
   in >> fTrackConnectionFactor;
   in >> fTrackChiCut;
   in >> fTrackChi2Cut;
-  for( Int_t iRow = 0; iRow<fNRows; iRow++ ){
+  for ( int iRow = 0; iRow < fNRows; iRow++ ) {
     in >> fRowX[iRow];
   }
-  for( Int_t i=0; i<2; i++ )
-    for( Int_t j=0; j<3; j++ )
-      for( Int_t k=0; k<7; k++ )
-       in >> fParamS0Par[i][j][k];
+  for ( int i = 0; i < 2; i++ )
+    for ( int j = 0; j < 3; j++ )
+      for ( int k = 0; k < 7; k++ )
+        in >> fParamS0Par[i][j][k];
 }
index e178430a6d63e1ea2a334216f73b9dad457b87d4..f6564614eaa469cdc4c943a98d0a64cca1ba05a4 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCAParam
 {
- public:
 public:
 
-#if !defined(HLTCA_GPUCODE)  
-  GPUd() AliHLTTPCCAParam();
+#if !defined(HLTCA_GPUCODE)
+    GPUd() AliHLTTPCCAParam();
 #endif
 
-  ~AliHLTTPCCAParam(){;}
-
-  GPUd() void Initialize( Int_t iSlice, Int_t nRows, Float_t rowX[],
-                         Float_t alpha, Float_t dAlpha,
-                         Float_t rMin, Float_t rMax, Float_t zMin, Float_t zMax,
-                         Float_t padPitch, Float_t zSigma, Float_t bz );
-  GPUd() void Update();
-  
-  GPUd() void Slice2Global( Float_t x, Float_t y,  Float_t z, 
-                           Float_t *X, Float_t *Y,  Float_t *Z ) const;
-
-  GPUd() void Global2Slice( Float_t x, Float_t y,  Float_t z, 
-                           Float_t *X, Float_t *Y,  Float_t *Z ) const;
-
-
-  GPUhd() Int_t ISlice() const { return fISlice;}
-  GPUhd() Int_t NRows() const { return fNRows;}
-
-  GPUhd() Float_t RowX( Int_t iRow ) const { return fRowX[iRow]; }  
-
-  GPUd() Float_t Alpha() const { return fAlpha;}
-  GPUd() Float_t Alpha( Int_t iSlice ) const { return 0.174533 + DAlpha()*iSlice;}
-  GPUd() Float_t DAlpha() const { return fDAlpha;}
-  GPUd() Float_t CosAlpha() const { return fCosAlpha;}
-  GPUd() Float_t SinAlpha() const { return fSinAlpha;}
-  GPUd() Float_t AngleMin() const { return fAngleMin;}
-  GPUd() Float_t AngleMax() const { return fAngleMax;}
-  GPUd() Float_t RMin() const { return fRMin;}
-  GPUd() Float_t RMax() const { return fRMax;}
-  GPUd() Float_t ZMin() const { return fZMin;}
-  GPUd() Float_t ZMax() const { return fZMax;}
-  GPUd() Float_t ErrZ() const { return fErrZ;}
-  GPUd() Float_t ErrX() const { return fErrX;}
-  GPUd() Float_t ErrY() const { return fErrY;}
-  GPUd() Float_t Bz() const { return fBz;}
-
-  GPUd() Float_t TrackConnectionFactor() const { return fTrackConnectionFactor; }
-  GPUd() Float_t TrackChiCut()  const { return fTrackChiCut; }
-  GPUd() Float_t TrackChi2Cut() const { return fTrackChi2Cut; }
-  GPUd() Int_t   MaxTrackMatchDRow() const { return fMaxTrackMatchDRow; }
-  GPUd() Float_t HitPickUpFactor() const { return fHitPickUpFactor; }
-
-
-
-  GPUhd() void SetISlice( Int_t v ){  fISlice = v;}
-  GPUhd() void SetNRows( Int_t v ){  fNRows = v;}  
-  GPUhd() void SetRowX( Int_t iRow, Float_t v ){  fRowX[iRow] = v; }
-  GPUd() void SetAlpha( Float_t v ){  fAlpha = v;}
-  GPUd() void SetDAlpha( Float_t v ){  fDAlpha = v;}
-  GPUd() void SetCosAlpha( Float_t v ){  fCosAlpha = v;}
-  GPUd() void SetSinAlpha( Float_t v ){  fSinAlpha = v;}
-  GPUd() void SetAngleMin( Float_t v ){  fAngleMin = v;}
-  GPUd() void SetAngleMax( Float_t v ){  fAngleMax = v;}
-  GPUd() void SetRMin( Float_t v ){  fRMin = v;}
-  GPUd() void SetRMax( Float_t v ){  fRMax = v;}
-  GPUd() void SetZMin( Float_t v ){  fZMin = v;}
-  GPUd() void SetZMax( Float_t v ){  fZMax = v;}
-  GPUd() void SetErrZ( Float_t v ){  fErrZ = v;}
-  GPUd() void SetErrX( Float_t v ){  fErrX = v;}
-  GPUd() void SetErrY( Float_t v ){  fErrY = v;}
-  GPUd() void SetBz( Float_t v ){  fBz = v;}
-  GPUd() void SetTrackConnectionFactor( Float_t v ){ fTrackConnectionFactor = v;}
-  GPUd() void SetTrackChiCut( Float_t v ) {  fTrackChiCut = v; }
-  GPUd() void SetTrackChi2Cut( Float_t v ){  fTrackChi2Cut = v; }
-  GPUd() void SetMaxTrackMatchDRow( Int_t v ){  fMaxTrackMatchDRow = v; }
-  GPUd() void SetHitPickUpFactor( Float_t v ){  fHitPickUpFactor = v; }
-
-
-  GPUd() Float_t GetClusterError2(Int_t yz, Int_t type, Float_t z, Float_t angle ) const;
-  GPUd() void GetClusterErrors2( Int_t iRow, Float_t z, Float_t sinPhi, Float_t cosPhi, Float_t DzDs, Float_t &Err2Y, Float_t &Err2Z ) const;
-
-  void WriteSettings( std::ostream &out ) const;
-  void ReadSettings( std::istream &in );
-  
-  GPUd() void SetParamS0Par(Int_t i, Int_t j, Int_t k, Float_t val ){
-    fParamS0Par[i][j][k] = val;
-  }
-
-  GPUd() Float_t GetBz() const { return fBz;}
-  GPUd() Float_t GetBz( float x, float y, float z ) const;
-  GPUd()  Float_t GetBz( const AliHLTTPCCATrackParam &t ) const;
+    ~AliHLTTPCCAParam() {;}
+
+    GPUd() void Initialize( int iSlice, int nRows, float rowX[],
+                            float alpha, float dAlpha,
+                            float rMin, float rMax, float zMin, float zMax,
+                            float padPitch, float zSigma, float bz );
+    GPUd() void Update();
+
+    GPUd() void Slice2Global( float x, float y,  float z,
+                              float *X, float *Y,  float *Z ) const;
+
+    GPUd() void Global2Slice( float x, float y,  float z,
+                              float *X, float *Y,  float *Z ) const;
+
+
+    GPUhd() int ISlice() const { return fISlice;}
+    GPUhd() int NRows() const { return fNRows;}
+
+    GPUhd() float RowX( int iRow ) const { return fRowX[iRow]; }
+
+    GPUd() float Alpha() const { return fAlpha;}
+    GPUd() float Alpha( int iSlice ) const { return 0.174533 + DAlpha()*iSlice;}
+    GPUd() float DAlpha() const { return fDAlpha;}
+    GPUd() float CosAlpha() const { return fCosAlpha;}
+    GPUd() float SinAlpha() const { return fSinAlpha;}
+    GPUd() float AngleMin() const { return fAngleMin;}
+    GPUd() float AngleMax() const { return fAngleMax;}
+    GPUd() float RMin() const { return fRMin;}
+    GPUd() float RMax() const { return fRMax;}
+    GPUd() float ZMin() const { return fZMin;}
+    GPUd() float ZMax() const { return fZMax;}
+    GPUd() float ErrZ() const { return fErrZ;}
+    GPUd() float ErrX() const { return fErrX;}
+    GPUd() float ErrY() const { return fErrY;}
+    GPUd() float Bz() const { return fBz;}
+
+    GPUd() float TrackConnectionFactor() const { return fTrackConnectionFactor; }
+    GPUd() float TrackChiCut()  const { return fTrackChiCut; }
+    GPUd() float TrackChi2Cut() const { return fTrackChi2Cut; }
+    GPUd() int   MaxTrackMatchDRow() const { return fMaxTrackMatchDRow; }
+    GPUd() float HitPickUpFactor() const { return fHitPickUpFactor; }
+
+
+
+    GPUhd() void SetISlice( int v ) {  fISlice = v;}
+    GPUhd() void SetNRows( int v ) {  fNRows = v;}
+    GPUhd() void SetRowX( int iRow, float v ) {  fRowX[iRow] = v; }
+    GPUd() void SetAlpha( float v ) {  fAlpha = v;}
+    GPUd() void SetDAlpha( float v ) {  fDAlpha = v;}
+    GPUd() void SetCosAlpha( float v ) {  fCosAlpha = v;}
+    GPUd() void SetSinAlpha( float v ) {  fSinAlpha = v;}
+    GPUd() void SetAngleMin( float v ) {  fAngleMin = v;}
+    GPUd() void SetAngleMax( float v ) {  fAngleMax = v;}
+    GPUd() void SetRMin( float v ) {  fRMin = v;}
+    GPUd() void SetRMax( float v ) {  fRMax = v;}
+    GPUd() void SetZMin( float v ) {  fZMin = v;}
+    GPUd() void SetZMax( float v ) {  fZMax = v;}
+    GPUd() void SetErrZ( float v ) {  fErrZ = v;}
+    GPUd() void SetErrX( float v ) {  fErrX = v;}
+    GPUd() void SetErrY( float v ) {  fErrY = v;}
+    GPUd() void SetBz( float v ) {  fBz = v;}
+    GPUd() void SetTrackConnectionFactor( float v ) { fTrackConnectionFactor = v;}
+    GPUd() void SetTrackChiCut( float v ) {  fTrackChiCut = v; }
+    GPUd() void SetTrackChi2Cut( float v ) {  fTrackChi2Cut = v; }
+    GPUd() void SetMaxTrackMatchDRow( int v ) {  fMaxTrackMatchDRow = v; }
+    GPUd() void SetHitPickUpFactor( float v ) {  fHitPickUpFactor = v; }
+
+
+    GPUd() float GetClusterError2( int yz, int type, float z, float angle ) const;
+    GPUd() void GetClusterErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const;
+
+    void WriteSettings( std::ostream &out ) const;
+    void ReadSettings( std::istream &in );
+
+    GPUd() void SetParamS0Par( int i, int j, int k, float val ) {
+      fParamS0Par[i][j][k] = val;
+    }
+
+    GPUd() float GetBz() const { return fBz;}
+    GPUd() float GetBz( float x, float y, float z ) const;
+    GPUd()  float GetBz( const AliHLTTPCCATrackParam &t ) const;
 
   protected:
 
-  Int_t fISlice; // slice number
-  Int_t fNRows; // number of rows
+    int fISlice; // slice number
+    int fNRows; // number of rows
 
-  Float_t fAlpha, fDAlpha; // slice angle and angular size
-  Float_t fCosAlpha, fSinAlpha;// sign and cosine of the slice angle
-  Float_t fAngleMin, fAngleMax; // minimal and maximal angle
-  Float_t fRMin, fRMax;// slice R range
-  Float_t fZMin, fZMax;// slice Z range
-  Float_t fErrX, fErrY, fErrZ;// default cluster errors
-  Float_t fPadPitch; // pad pitch 
-  Float_t fBz;       // magnetic field value (only constant field can be used)
+    float fAlpha, fDAlpha; // slice angle and angular size
+    float fCosAlpha, fSinAlpha;// sign and cosine of the slice angle
+    float fAngleMin, fAngleMax; // minimal and maximal angle
+    float fRMin, fRMax;// slice R range
+    float fZMin, fZMax;// slice Z range
+    float fErrX, fErrY, fErrZ;// default cluster errors
+    float fPadPitch; // pad pitch
+    float fBz;       // magnetic field value (only constant field can be used)
 
-  Float_t fHitPickUpFactor;// multiplier for the chi2 window for hit pick up procedure
+    float fHitPickUpFactor;// multiplier for the chi2 window for hit pick up procedure
 
-  Int_t   fMaxTrackMatchDRow;// maximal jump in TPC row for connecting track segments
-  Float_t fTrackConnectionFactor; // allowed distance in Chi^2/3.5 for neighbouring tracks
-  Float_t fTrackChiCut; // cut for track Sqrt(Chi2/NDF);
-  Float_t fTrackChi2Cut;// cut for track Chi^2/NDF
+    int   fMaxTrackMatchDRow;// maximal jump in TPC row for connecting track segments
+    float fTrackConnectionFactor; // allowed distance in Chi^2/3.5 for neighbouring tracks
+    float fTrackChiCut; // cut for track Sqrt(Chi2/NDF);
+    float fTrackChi2Cut;// cut for track Chi^2/NDF
 
-  Float_t fRowX[200];// X-coordinate of rows
-  Float_t fParamS0Par[2][3][7];    // cluster error parameterization coeficients
-  Float_t fPolinomialFieldBz[6];   // field coefficients
+    float fRowX[200];// X-coordinate of rows
+    float fParamS0Par[2][3][7];    // cluster error parameterization coeficients
+    float fPolinomialFieldBz[6];   // field coefficients
 
 };
 
 
 
-GPUd() inline Float_t AliHLTTPCCAParam::GetBz( float x, float y, float z ) const
+GPUd() inline float AliHLTTPCCAParam::GetBz( float x, float y, float z ) const
 {
-  float r2 = x*x+y*y;
+  float r2 = x * x + y * y;
   float r  = CAMath::Sqrt( r2 );
   const float *c = fPolinomialFieldBz;
   return ( c[0] + c[1]*z  + c[2]*r  + c[3]*z*z + c[4]*z*r + c[5]*r2 );
 }
 
-GPUd() inline Float_t AliHLTTPCCAParam::GetBz( const AliHLTTPCCATrackParam &t ) const
+GPUd() inline float AliHLTTPCCAParam::GetBz( const AliHLTTPCCATrackParam &t ) const
 {
   return GetBz( t.X(), t.Y(), t.Z() );
 }
index cc4112c789599c1d6800ccfe353294e72fa3c98b..7b4400d331685932d292f01bb4d1da170a2adc91 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
@@ -45,237 +45,237 @@ AliHLTTPCCAPerformance &AliHLTTPCCAPerformance::Instance()
 }
 
 AliHLTTPCCAPerformance::AliHLTTPCCAPerformance()
-  : 
-  fTracker(0),
-  fHitLabels(0),
-  fNHits(0),                   
-  fMCTracks(0),  
-  fNMCTracks(0),               
-  fMCPoints(0),  
-  fNMCPoints(0),               
-  fDoClusterPulls(0),         
-  fStatNEvents(0),
-  fStatTime(0),
-  fStatSeedNRecTot(0),
-  fStatSeedNRecOut(0),
-  fStatSeedNGhost(0),
-  fStatSeedNMCAll(0),
-  fStatSeedNRecAll(0),
-  fStatSeedNClonesAll(0),
-  fStatSeedNMCRef(0), 
-  fStatSeedNRecRef(0), 
-  fStatSeedNClonesRef(0),  
-  fStatCandNRecTot(0),
-  fStatCandNRecOut(0),
-  fStatCandNGhost(0),
-  fStatCandNMCAll(0),
-  fStatCandNRecAll(0),
-  fStatCandNClonesAll(0),
-  fStatCandNMCRef(0), 
-  fStatCandNRecRef(0), 
-  fStatCandNClonesRef(0),  
-  fStatNRecTot(0),
-  fStatNRecOut(0),
-  fStatNGhost(0),
-  fStatNMCAll(0),
-  fStatNRecAll(0),
-  fStatNClonesAll(0),
-  fStatNMCRef(0), 
-  fStatNRecRef(0), 
-  fStatNClonesRef(0),  
-  fStatGBNRecTot(0), 
-  fStatGBNRecOut(0), 
-  fStatGBNGhost(0),
-  fStatGBNMCAll(0),
-  fStatGBNRecAll(0),
-  fStatGBNClonesAll(0),
-  fStatGBNMCRef(0), 
-  fStatGBNRecRef(0), 
-  fStatGBNClonesRef(0),  
-  fHistoDir(0), 
-  fhResY(0),       
-  fhResZ(0),       
-  fhResSinPhi(0),  
-  fhResDzDs(0),    
-  fhResPt(0),      
-  fhPullY(0),      
-  fhPullZ(0),      
-  fhPullSinPhi(0), 
-  fhPullDzDs(0),
-  fhPullQPt(0), 
-  fhPullYS(0),      
-  fhPullZT(0),      
-  fhHitErrY(0), 
-  fhHitErrZ(0),
-  fhHitResY(0),
-  fhHitResZ(0),
-  fhHitPullY(0),
-  fhHitPullZ(0), 
-  fhHitShared(0),
-  fhHitResY1(0),
-  fhHitResZ1(0),
-  fhHitPullY1(0),
-  fhHitPullZ1(0),
-  fhCellPurity(0),
-  fhCellNHits(0),
-  fhCellPurityVsN(0), 
-  fhCellPurityVsPt(0),
-  fhEffVsP(0), 
-  fhSeedEffVsP(0),
-  fhCandEffVsP(0),
-  fhGBEffVsP(0),
-  fhGBEffVsPt(0),
-  fhNeighQuality(0),
-  fhNeighEff(0),
-  fhNeighQualityVsPt(0),
-  fhNeighEffVsPt(0),
-  fhNeighDy(0),
-  fhNeighDz(0),
-  fhNeighChi(0),
-  fhNeighDyVsPt(0),
-  fhNeighDzVsPt(0),
-  fhNeighChiVsPt(0), 
-  fhNeighNCombVsArea(0),
-  fhNHitsPerSeed (0),
-  fhNHitsPerTrackCand(0),
-  fhTrackLengthRef(0),
-  fhRefRecoX(0),
-  fhRefRecoY(0),
-  fhRefRecoZ(0),
-  fhRefRecoP(0),
-  fhRefRecoPt(0),
-  fhRefRecoAngleY(0),
-  fhRefRecoAngleZ(0),
-  fhRefRecoNHits(0),
-  fhRefNotRecoX(0),
-  fhRefNotRecoY(0),
-  fhRefNotRecoZ(0),
-  fhRefNotRecoP(0),
-  fhRefNotRecoPt(0),
-  fhRefNotRecoAngleY(0),
-  fhRefNotRecoAngleZ(0),
-  fhRefNotRecoNHits(0)
+    :
+    fTracker( 0 ),
+    fHitLabels( 0 ),
+    fNHits( 0 ),
+    fMCTracks( 0 ),
+    fNMCTracks( 0 ),
+    fMCPoints( 0 ),
+    fNMCPoints( 0 ),
+    fDoClusterPulls( 0 ),
+    fStatNEvents( 0 ),
+    fStatTime( 0 ),
+    fStatSeedNRecTot( 0 ),
+    fStatSeedNRecOut( 0 ),
+    fStatSeedNGhost( 0 ),
+    fStatSeedNMCAll( 0 ),
+    fStatSeedNRecAll( 0 ),
+    fStatSeedNClonesAll( 0 ),
+    fStatSeedNMCRef( 0 ),
+    fStatSeedNRecRef( 0 ),
+    fStatSeedNClonesRef( 0 ),
+    fStatCandNRecTot( 0 ),
+    fStatCandNRecOut( 0 ),
+    fStatCandNGhost( 0 ),
+    fStatCandNMCAll( 0 ),
+    fStatCandNRecAll( 0 ),
+    fStatCandNClonesAll( 0 ),
+    fStatCandNMCRef( 0 ),
+    fStatCandNRecRef( 0 ),
+    fStatCandNClonesRef( 0 ),
+    fStatNRecTot( 0 ),
+    fStatNRecOut( 0 ),
+    fStatNGhost( 0 ),
+    fStatNMCAll( 0 ),
+    fStatNRecAll( 0 ),
+    fStatNClonesAll( 0 ),
+    fStatNMCRef( 0 ),
+    fStatNRecRef( 0 ),
+    fStatNClonesRef( 0 ),
+    fStatGBNRecTot( 0 ),
+    fStatGBNRecOut( 0 ),
+    fStatGBNGhost( 0 ),
+    fStatGBNMCAll( 0 ),
+    fStatGBNRecAll( 0 ),
+    fStatGBNClonesAll( 0 ),
+    fStatGBNMCRef( 0 ),
+    fStatGBNRecRef( 0 ),
+    fStatGBNClonesRef( 0 ),
+    fHistoDir( 0 ),
+    fhResY( 0 ),
+    fhResZ( 0 ),
+    fhResSinPhi( 0 ),
+    fhResDzDs( 0 ),
+    fhResPt( 0 ),
+    fhPullY( 0 ),
+    fhPullZ( 0 ),
+    fhPullSinPhi( 0 ),
+    fhPullDzDs( 0 ),
+    fhPullQPt( 0 ),
+    fhPullYS( 0 ),
+    fhPullZT( 0 ),
+    fhHitErrY( 0 ),
+    fhHitErrZ( 0 ),
+    fhHitResY( 0 ),
+    fhHitResZ( 0 ),
+    fhHitPullY( 0 ),
+    fhHitPullZ( 0 ),
+    fhHitShared( 0 ),
+    fhHitResY1( 0 ),
+    fhHitResZ1( 0 ),
+    fhHitPullY1( 0 ),
+    fhHitPullZ1( 0 ),
+    fhCellPurity( 0 ),
+    fhCellNHits( 0 ),
+    fhCellPurityVsN( 0 ),
+    fhCellPurityVsPt( 0 ),
+    fhEffVsP( 0 ),
+    fhSeedEffVsP( 0 ),
+    fhCandEffVsP( 0 ),
+    fhGBEffVsP( 0 ),
+    fhGBEffVsPt( 0 ),
+    fhNeighQuality( 0 ),
+    fhNeighEff( 0 ),
+    fhNeighQualityVsPt( 0 ),
+    fhNeighEffVsPt( 0 ),
+    fhNeighDy( 0 ),
+    fhNeighDz( 0 ),
+    fhNeighChi( 0 ),
+    fhNeighDyVsPt( 0 ),
+    fhNeighDzVsPt( 0 ),
+    fhNeighChiVsPt( 0 ),
+    fhNeighNCombVsArea( 0 ),
+    fhNHitsPerSeed ( 0 ),
+    fhNHitsPerTrackCand( 0 ),
+    fhTrackLengthRef( 0 ),
+    fhRefRecoX( 0 ),
+    fhRefRecoY( 0 ),
+    fhRefRecoZ( 0 ),
+    fhRefRecoP( 0 ),
+    fhRefRecoPt( 0 ),
+    fhRefRecoAngleY( 0 ),
+    fhRefRecoAngleZ( 0 ),
+    fhRefRecoNHits( 0 ),
+    fhRefNotRecoX( 0 ),
+    fhRefNotRecoY( 0 ),
+    fhRefNotRecoZ( 0 ),
+    fhRefNotRecoP( 0 ),
+    fhRefNotRecoPt( 0 ),
+    fhRefNotRecoAngleY( 0 ),
+    fhRefNotRecoAngleZ( 0 ),
+    fhRefNotRecoNHits( 0 )
 {
   //* constructor
 }
 
 
-AliHLTTPCCAPerformance::AliHLTTPCCAPerformance(const AliHLTTPCCAPerformance&)
-  :
-  fTracker(0),
-  fHitLabels(0),
-  fNHits(0),                   
-  fMCTracks(0),  
-  fNMCTracks(0),               
-  fMCPoints(0),  
-  fNMCPoints(0),               
-  fDoClusterPulls(0),         
-  fStatNEvents(0),
-  fStatTime(0),
-  fStatSeedNRecTot(0),
-  fStatSeedNRecOut(0),
-  fStatSeedNGhost(0),
-  fStatSeedNMCAll(0),
-  fStatSeedNRecAll(0),
-  fStatSeedNClonesAll(0),
-  fStatSeedNMCRef(0), 
-  fStatSeedNRecRef(0), 
-  fStatSeedNClonesRef(0),  
-  fStatCandNRecTot(0),
-  fStatCandNRecOut(0),
-  fStatCandNGhost(0),
-  fStatCandNMCAll(0),
-  fStatCandNRecAll(0),
-  fStatCandNClonesAll(0),
-  fStatCandNMCRef(0), 
-  fStatCandNRecRef(0), 
-  fStatCandNClonesRef(0),  
-  fStatNRecTot(0),
-  fStatNRecOut(0),
-  fStatNGhost(0),
-  fStatNMCAll(0),
-  fStatNRecAll(0),
-  fStatNClonesAll(0),
-  fStatNMCRef(0), 
-  fStatNRecRef(0), 
-  fStatNClonesRef(0),  
-  fStatGBNRecTot(0), 
-  fStatGBNRecOut(0), 
-  fStatGBNGhost(0),
-  fStatGBNMCAll(0),
-  fStatGBNRecAll(0),
-  fStatGBNClonesAll(0),
-  fStatGBNMCRef(0), 
-  fStatGBNRecRef(0), 
-  fStatGBNClonesRef(0),  
-  fHistoDir(0), 
-  fhResY(0),       
-  fhResZ(0),       
-  fhResSinPhi(0),  
-  fhResDzDs(0),    
-  fhResPt(0),      
-  fhPullY(0),      
-  fhPullZ(0),      
-  fhPullSinPhi(0), 
-  fhPullDzDs(0),
-  fhPullQPt(0), 
-  fhPullYS(0),      
-  fhPullZT(0),      
-  fhHitErrY(0), 
-  fhHitErrZ(0),
-  fhHitResY(0),
-  fhHitResZ(0),
-  fhHitPullY(0),
-  fhHitPullZ(0),  
-  fhHitShared(0),
-  fhHitResY1(0),
-  fhHitResZ1(0),
-  fhHitPullY1(0),
-  fhHitPullZ1(0),
-  fhCellPurity(0),
-  fhCellNHits(0),
-  fhCellPurityVsN(0), 
-  fhCellPurityVsPt(0),
-  fhEffVsP(0), 
-  fhSeedEffVsP(0),
-  fhCandEffVsP(0),
-  fhGBEffVsP(0),
-  fhGBEffVsPt(0),
-  fhNeighQuality(0),
-  fhNeighEff(0),
-  fhNeighQualityVsPt(0),
-  fhNeighEffVsPt(0),
-  fhNeighDy(0),
-  fhNeighDz(0),
-  fhNeighChi(0),
-  fhNeighDyVsPt(0),
-  fhNeighDzVsPt(0),
-  fhNeighChiVsPt(0), 
-  fhNeighNCombVsArea(0),
-  fhNHitsPerSeed (0),
-  fhNHitsPerTrackCand(0),
-  fhTrackLengthRef(0),
-  fhRefRecoX(0),
-  fhRefRecoY(0),
-  fhRefRecoZ(0),
-  fhRefRecoP(0),
-  fhRefRecoPt(0),
-  fhRefRecoAngleY(0),
-  fhRefRecoAngleZ(0),
-  fhRefRecoNHits(0),
-  fhRefNotRecoX(0),
-  fhRefNotRecoY(0),
-  fhRefNotRecoZ(0),
-  fhRefNotRecoP(0),
-  fhRefNotRecoPt(0),
-  fhRefNotRecoAngleY(0),
-  fhRefNotRecoAngleZ(0),
-  fhRefNotRecoNHits(0)
+AliHLTTPCCAPerformance::AliHLTTPCCAPerformance( const AliHLTTPCCAPerformance& )
+    :
+    fTracker( 0 ),
+    fHitLabels( 0 ),
+    fNHits( 0 ),
+    fMCTracks( 0 ),
+    fNMCTracks( 0 ),
+    fMCPoints( 0 ),
+    fNMCPoints( 0 ),
+    fDoClusterPulls( 0 ),
+    fStatNEvents( 0 ),
+    fStatTime( 0 ),
+    fStatSeedNRecTot( 0 ),
+    fStatSeedNRecOut( 0 ),
+    fStatSeedNGhost( 0 ),
+    fStatSeedNMCAll( 0 ),
+    fStatSeedNRecAll( 0 ),
+    fStatSeedNClonesAll( 0 ),
+    fStatSeedNMCRef( 0 ),
+    fStatSeedNRecRef( 0 ),
+    fStatSeedNClonesRef( 0 ),
+    fStatCandNRecTot( 0 ),
+    fStatCandNRecOut( 0 ),
+    fStatCandNGhost( 0 ),
+    fStatCandNMCAll( 0 ),
+    fStatCandNRecAll( 0 ),
+    fStatCandNClonesAll( 0 ),
+    fStatCandNMCRef( 0 ),
+    fStatCandNRecRef( 0 ),
+    fStatCandNClonesRef( 0 ),
+    fStatNRecTot( 0 ),
+    fStatNRecOut( 0 ),
+    fStatNGhost( 0 ),
+    fStatNMCAll( 0 ),
+    fStatNRecAll( 0 ),
+    fStatNClonesAll( 0 ),
+    fStatNMCRef( 0 ),
+    fStatNRecRef( 0 ),
+    fStatNClonesRef( 0 ),
+    fStatGBNRecTot( 0 ),
+    fStatGBNRecOut( 0 ),
+    fStatGBNGhost( 0 ),
+    fStatGBNMCAll( 0 ),
+    fStatGBNRecAll( 0 ),
+    fStatGBNClonesAll( 0 ),
+    fStatGBNMCRef( 0 ),
+    fStatGBNRecRef( 0 ),
+    fStatGBNClonesRef( 0 ),
+    fHistoDir( 0 ),
+    fhResY( 0 ),
+    fhResZ( 0 ),
+    fhResSinPhi( 0 ),
+    fhResDzDs( 0 ),
+    fhResPt( 0 ),
+    fhPullY( 0 ),
+    fhPullZ( 0 ),
+    fhPullSinPhi( 0 ),
+    fhPullDzDs( 0 ),
+    fhPullQPt( 0 ),
+    fhPullYS( 0 ),
+    fhPullZT( 0 ),
+    fhHitErrY( 0 ),
+    fhHitErrZ( 0 ),
+    fhHitResY( 0 ),
+    fhHitResZ( 0 ),
+    fhHitPullY( 0 ),
+    fhHitPullZ( 0 ),
+    fhHitShared( 0 ),
+    fhHitResY1( 0 ),
+    fhHitResZ1( 0 ),
+    fhHitPullY1( 0 ),
+    fhHitPullZ1( 0 ),
+    fhCellPurity( 0 ),
+    fhCellNHits( 0 ),
+    fhCellPurityVsN( 0 ),
+    fhCellPurityVsPt( 0 ),
+    fhEffVsP( 0 ),
+    fhSeedEffVsP( 0 ),
+    fhCandEffVsP( 0 ),
+    fhGBEffVsP( 0 ),
+    fhGBEffVsPt( 0 ),
+    fhNeighQuality( 0 ),
+    fhNeighEff( 0 ),
+    fhNeighQualityVsPt( 0 ),
+    fhNeighEffVsPt( 0 ),
+    fhNeighDy( 0 ),
+    fhNeighDz( 0 ),
+    fhNeighChi( 0 ),
+    fhNeighDyVsPt( 0 ),
+    fhNeighDzVsPt( 0 ),
+    fhNeighChiVsPt( 0 ),
+    fhNeighNCombVsArea( 0 ),
+    fhNHitsPerSeed ( 0 ),
+    fhNHitsPerTrackCand( 0 ),
+    fhTrackLengthRef( 0 ),
+    fhRefRecoX( 0 ),
+    fhRefRecoY( 0 ),
+    fhRefRecoZ( 0 ),
+    fhRefRecoP( 0 ),
+    fhRefRecoPt( 0 ),
+    fhRefRecoAngleY( 0 ),
+    fhRefRecoAngleZ( 0 ),
+    fhRefRecoNHits( 0 ),
+    fhRefNotRecoX( 0 ),
+    fhRefNotRecoY( 0 ),
+    fhRefNotRecoZ( 0 ),
+    fhRefNotRecoP( 0 ),
+    fhRefNotRecoPt( 0 ),
+    fhRefNotRecoAngleY( 0 ),
+    fhRefNotRecoAngleZ( 0 ),
+    fhRefNotRecoNHits( 0 )
 {
   //* dummy
 }
 
-const AliHLTTPCCAPerformance &AliHLTTPCCAPerformance::operator=(const AliHLTTPCCAPerformance&) const
+const AliHLTTPCCAPerformance &AliHLTTPCCAPerformance::operator=( const AliHLTTPCCAPerformance& ) const
 {
   //* dummy
   return *this;
@@ -296,47 +296,47 @@ void AliHLTTPCCAPerformance::SetTracker( AliHLTTPCCAGBTracker * const Tracker )
 void AliHLTTPCCAPerformance::StartEvent()
 {
   //* clean up arrays
-  if( !fHistoDir )  CreateHistos();
-  if( fHitLabels ) delete[] fHitLabels;
+  if ( !fHistoDir )  CreateHistos();
+  if ( fHitLabels ) delete[] fHitLabels;
   fHitLabels = 0;
   fNHits = 0;
-  if( fMCTracks ) delete[] fMCTracks;
+  if ( fMCTracks ) delete[] fMCTracks;
   fMCTracks = 0;
   fNMCTracks = 0;
-  if( fMCPoints ) delete[] fMCPoints;
+  if ( fMCPoints ) delete[] fMCPoints;
   fMCPoints = 0;
   fNMCPoints = 0;
 }
 
-void AliHLTTPCCAPerformance::SetNHits( Int_t NHits )
+void AliHLTTPCCAPerformance::SetNHits( int NHits )
 {
   //* set number of hits
-  if( fHitLabels ) delete[] fHitLabels;
+  if ( fHitLabels ) delete[] fHitLabels;
   fHitLabels = 0;
   fHitLabels = new AliHLTTPCCAHitLabel[ NHits ];
   fNHits = NHits;
-}  
+}
 
-void AliHLTTPCCAPerformance::SetNMCTracks( Int_t NumberOfMCTracks )
+void AliHLTTPCCAPerformance::SetNMCTracks( int NumberOfMCTracks )
 {
   //* set number of MC tracks
-  if( fMCTracks ) delete[] fMCTracks;
+  if ( fMCTracks ) delete[] fMCTracks;
   fMCTracks = 0;
   fMCTracks = new AliHLTTPCCAMCTrack[ NumberOfMCTracks ];
   fNMCTracks = NumberOfMCTracks;
-}  
+}
 
-void AliHLTTPCCAPerformance::SetNMCPoints( Int_t NMCPoints )
+void AliHLTTPCCAPerformance::SetNMCPoints( int NMCPoints )
 {
   //* set number of MC points
-  if( fMCPoints ) delete[] fMCPoints;
+  if ( fMCPoints ) delete[] fMCPoints;
   fMCPoints = 0;
   fMCPoints = new AliHLTTPCCAMCPoint[ NMCPoints ];
   fNMCPoints = 0;
-}  
+}
 
-void AliHLTTPCCAPerformance::ReadHitLabel( Int_t HitID, 
-                                          Int_t lab0, Int_t lab1, Int_t lab2 )
+void AliHLTTPCCAPerformance::ReadHitLabel( int HitID,
+    int lab0, int lab1, int lab2 )
 {
   //* read the hit labels
   AliHLTTPCCAHitLabel hit;
@@ -346,20 +346,20 @@ void AliHLTTPCCAPerformance::ReadHitLabel( Int_t HitID,
   fHitLabels[HitID] = hit;
 }
 
-void AliHLTTPCCAPerformance::ReadMCTrack( Int_t index, const TParticle *part )
+void AliHLTTPCCAPerformance::ReadMCTrack( int index, const TParticle *part )
 {
   //* read mc track to the local array
-  fMCTracks[index] = AliHLTTPCCAMCTrack(part);
+  fMCTracks[index] = AliHLTTPCCAMCTrack( part );
 }
 
-void AliHLTTPCCAPerformance::ReadMCTPCTrack( Int_t index, Float_t X, Float_t Y, Float_t Z, 
-                                            Float_t Px, Float_t Py, Float_t Pz )
+void AliHLTTPCCAPerformance::ReadMCTPCTrack( int index, float X, float Y, float Z,
+    float Px, float Py, float Pz )
 {
   //* read mc track parameters at TPC
-  fMCTracks[index].SetTPCPar(X,Y,Z,Px,Py,Pz);
+  fMCTracks[index].SetTPCPar( X, Y, Z, Px, Py, Pz );
 }
 
-void AliHLTTPCCAPerformance::ReadMCPoint( Int_t TrackID, Float_t X, Float_t Y, Float_t Z, Float_t Time, Int_t iSlice )
+void AliHLTTPCCAPerformance::ReadMCPoint( int TrackID, float X, float Y, float Z, float Time, int iSlice )
 {
   //* read mc point to the local array
   AliHLTTPCCAMCPoint &p = fMCPoints[fNMCPoints];
@@ -369,174 +369,174 @@ void AliHLTTPCCAPerformance::ReadMCPoint( Int_t TrackID, Float_t X, Float_t Y, F
   p.SetZ( Z );
   p.SetTime( Time );
   p.SetISlice( iSlice );
-  Float_t sx, sy, sz;
+  float sx, sy, sz;
   fTracker->Slices()[iSlice].Param().Global2Slice( X, Y, Z, &sx, &sy, &sz );
-  p.SetSx(sx);
-  p.SetSy(sy); 
-  p.SetSz(sz); 
-  if( X*X + Y*Y>10.) fNMCPoints++;
+  p.SetSx( sx );
+  p.SetSy( sy );
+  p.SetSz( sz );
+  if ( X*X + Y*Y > 10. ) fNMCPoints++;
 }
 
 void AliHLTTPCCAPerformance::CreateHistos()
 {
   //* create performance histogramms
   TDirectory *curdir = gDirectory;
-  fHistoDir = gROOT->mkdir("HLTTPCCATrackerPerformance");
+  fHistoDir = gROOT->mkdir( "HLTTPCCATrackerPerformance" );
   fHistoDir->cd();
 
-  gDirectory->mkdir("Links");
-  gDirectory->cd("Links");  
-
-  fhLinkEff[0] = new TProfile("fhLinkEffPrimRef", "fhLinkEffPrimRef vs row", 156, 2., 158.);
-  fhLinkEff[1] = new TProfile("fhLinkEffPrimExt", "fhLinkEffPrimExt vs row", 156, 2., 158.);
-  fhLinkEff[2] = new TProfile("fhLinkEffSecRef", "fhLinkEffSecRef vs row", 156, 2., 158.);
-  fhLinkEff[3] = new TProfile("fhLinkEffSecExt", "fhLinkEffSecExt vs row", 156, 2., 158.);
-  fhLinkAreaY[0] = new TH1D("fhLinkAreaYPrimRef","fhLinkAreaYPrimRef",100,0,10);
-  fhLinkAreaZ[0] = new TH1D("fhLinkAreaZPrimRef","fhLinkAreaZPrimRef",100,0,10);
-  fhLinkAreaY[1] = new TH1D("fhLinkAreaYPrimExt","fhLinkAreaYPrimExt",100,0,10);
-  fhLinkAreaZ[1] = new TH1D("fhLinkAreaZPrimExt","fhLinkAreaZPrimExt",100,0,10);
-  fhLinkAreaY[2] = new TH1D("fhLinkAreaYSecRef","fhLinkAreaYSecRef",100,0,10);
-  fhLinkAreaZ[2] = new TH1D("fhLinkAreaZSecRef","fhLinkAreaZSecRef",100,0,10);
-  fhLinkAreaY[3] = new TH1D("fhLinkAreaYSecExt","fhLinkAreaYSecExt",100,0,10);
-  fhLinkAreaZ[3] = new TH1D("fhLinkAreaZSecExt","fhLinkAreaZSecExt",100,0,10);
-  fhLinkChiRight[0] = new TH1D("fhLinkChiRightPrimRef","fhLinkChiRightPrimRef",100,0,10);
-  fhLinkChiRight[1] = new TH1D("fhLinkChiRightPrimExt","fhLinkChiRightPrimExt",100,0,10);
-  fhLinkChiRight[2] = new TH1D("fhLinkChiRightSecRef","fhLinkChiRightSecRef",100,0,10);
-  fhLinkChiRight[3] = new TH1D("fhLinkChiRightSecExt","fhLinkChiRightSecExt",100,0,10);
-  fhLinkChiWrong[0] = new TH1D("fhLinkChiWrongPrimRef","fhLinkChiWrongPrimRef",100,0,10);
-  fhLinkChiWrong[1] = new TH1D("fhLinkChiWrongPrimExt","fhLinkChiWrongPrimExt",100,0,10);
-  fhLinkChiWrong[2] = new TH1D("fhLinkChiWrongSecRef","fhLinkChiWrongSecRef",100,0,10);
-  fhLinkChiWrong[3] = new TH1D("fhLinkChiWrongSecExt","fhLinkChiWrongSecExt",100,0,10);
-
-  gDirectory->cd(".."); 
-
-  gDirectory->mkdir("Neighbours");
-  gDirectory->cd("Neighbours");  
-  
-  fhNeighQuality = new TProfile("NeighQuality", "Neighbours Quality vs row", 160, 0., 160.); 
-  fhNeighEff = new TProfile("NeighEff", "Neighbours Efficiency vs row", 160, 0., 160.); 
-  fhNeighQualityVsPt = new TProfile("NeighQualityVsPt", "Neighbours Quality vs Pt", 100, 0., 5.); 
-  fhNeighEffVsPt = new TProfile("NeighEffVsPt", "Neighbours Efficiency vs Pt", 100, 0., 5.); 
-  fhNeighDy = new TH1D("NeighDy","Neighbours dy",100,-10,10);
-  fhNeighDz =  new TH1D("NeighDz","Neighbours dz",100,-10,10);
-  fhNeighChi = new TH1D("NeighChi","Neighbours chi",100,0,20);
-
-  fhNeighDyVsPt = new TH2D("NeighDyVsPt","NeighDyVsPt", 100,0,5, 100, -20,20);
-  fhNeighDzVsPt = new TH2D("NeighDzVsPt","NeighDzVsPt", 100,0,5, 100, -20,20);
-  fhNeighChiVsPt = new TH2D("NeighChiVsPt","NeighChiVsPt", 100,0,5, 100, 0,40);
-  fhNeighNCombVsArea = new TH2D("NeighNCombVsArea","NeighNCombVsArea", 15,0,3, 40, 0,40);
-
-  gDirectory->cd(".."); 
-
-  gDirectory->mkdir("Tracklets");
-  gDirectory->cd("Tracklets");
-
-  fhNHitsPerSeed = new TH1D("NHitsPerSeed","NHitsPerSeed", 160,0,160);
-  fhSeedEffVsP = new TProfile("fhSeedEffVsP", "Track Seed Eff vs P", 100, 0., 5.);
-
-  gDirectory->cd(".."); 
-
-  gDirectory->mkdir("TrackCandidates");
-  gDirectory->cd("TrackCandidates");
-
-  fhNHitsPerTrackCand = new TH1D("NHitsPerTrackCand","NHitsPerTrackCand", 160,0,160);
-  fhCandEffVsP = new TProfile("fhCandEffVsP", "Track Candidate Eff vs P", 100, 0., 5.);
-
-  gDirectory->cd(".."); 
-  
-  gDirectory->mkdir("Tracks");
-  gDirectory->cd("Tracks");  
-
-  fhTrackLengthRef = new TH1D("TrackLengthRef", "TrackLengthRef", 100,0,1);
-
-  fhRefRecoX = new TH1D("fhRefRecoX","fhRefRecoX",100,0,200.);
-  fhRefRecoY = new TH1D("fhRefRecoY","fhRefRecoY",100,-200,200.);
-  fhRefRecoZ = new TH1D("fhRefRecoZ","fhRefRecoZ",100,-250,250.);
-
-
-  fhRefRecoP = new TH1D("fhRefRecoP","fhRefRecoP",100,0,10.);
-  fhRefRecoPt = new TH1D("fhRefRecoPt","fhRefRecoPt",100,0,10.);
-  fhRefRecoAngleY = new TH1D("fhRefRecoAngleY","fhRefRecoAngleY",100,-180.,180.);
-  fhRefRecoAngleZ = new TH1D("fhRefRecoAngleZ","fhRefRecoAngleZ",100,-180.,180);
-  fhRefRecoNHits = new TH1D("fhRefRecoNHits","fhRefRecoNHits",100,0.,200);
-
-  fhRefNotRecoX = new TH1D("fhRefNotRecoX","fhRefNotRecoX",100,0,200.);
-  fhRefNotRecoY = new TH1D("fhRefNotRecoY","fhRefNotRecoY",100,-200,200.);
-  fhRefNotRecoZ = new TH1D("fhRefNotRecoZ","fhRefNotRecoZ",100,-250,250.);
-
-
-  fhRefNotRecoP = new TH1D("fhRefNotRecoP","fhRefNotRecoP",100,0,10.);
-  fhRefNotRecoPt = new TH1D("fhRefNotRecoPt","fhRefNotRecoPt",100,0,10.);
-  fhRefNotRecoAngleY = new TH1D("fhRefNotRecoAngleY","fhRefNotRecoAngleY",100,-180.,180.);
-  fhRefNotRecoAngleZ = new TH1D("fhRefNotRecoAngleZ","fhRefNotRecoAngleZ",100,-180.,180);
-  fhRefNotRecoNHits = new TH1D("fhRefNotRecoNHits","fhRefNotRecoNHits",100,0.,200);
-  
-  gDirectory->cd(".."); 
-
-  gDirectory->mkdir("TrackFit");
-  gDirectory->cd("TrackFit");  
-  
-  fhResY = new TH1D("resY", "track Y resoltion [cm]", 30, -.5, .5);
-  fhResZ = new TH1D("resZ", "track Z resoltion [cm]", 30, -.5, .5);
-  fhResSinPhi = new TH1D("resSinPhi", "track SinPhi resoltion ", 30, -.03, .03);
-  fhResDzDs = new TH1D("resDzDs", "track DzDs resoltion ", 30, -.01, .01);
-  fhResPt = new TH1D("resPt", "track telative Pt resoltion", 30, -.2, .2);
-  fhPullY = new TH1D("pullY", "track Y pull", 30, -10., 10.);
-  fhPullZ = new TH1D("pullZ", "track Z pull", 30, -10., 10.);
-  fhPullSinPhi = new TH1D("pullSinPhi", "track SinPhi pull", 30, -10., 10.);
-  fhPullDzDs = new TH1D("pullDzDs", "track DzDs pull", 30, -10., 10.);
-  fhPullQPt = new TH1D("pullQPt", "track Q/Pt pull", 30, -10., 10.);
-  fhPullYS = new TH1D("pullYS", "track Y+SinPhi chi deviation", 100, 0., 30.);
-  fhPullZT = new TH1D("pullZT", "track Z+DzDs chi deviation ", 100, 0., 30.);
-
-  gDirectory->cd("..");  
-
-  fhEffVsP = new TProfile("EffVsP", "Eff vs P", 100, 0., 5.);
-  fhGBEffVsP = new TProfile("GBEffVsP", "Global tracker: Eff vs P", 100, 0., 5.);
-  fhGBEffVsPt = new TProfile("GBEffVsPt", "Global tracker: Eff vs Pt", 100, 0.2, 5.);
-
-  gDirectory->mkdir("Clusters");
-  gDirectory->cd("Clusters");  
-
-  fhHitShared = new TProfile("fhHitSharedf", "fhHitShared vs row", 160, 0., 160.);
-
-  fhHitResY = new TH1D("resHitY", "Y cluster resoltion [cm]", 100, -2., 2.);
-  fhHitResZ = new TH1D("resHitZ", "Z cluster resoltion [cm]", 100, -2., 2.);
-  fhHitPullY = new TH1D("pullHitY", "Y cluster pull", 50, -10., 10.);
-  fhHitPullZ = new TH1D("pullHitZ", "Z cluster pull", 50, -10., 10.);
-
-  fhHitResY1 = new TH1D("resHitY1", "Y cluster resoltion [cm]", 100, -2., 2.);
-  fhHitResZ1 = new TH1D("resHitZ1", "Z cluster resoltion [cm]", 100, -2., 2.);
-  fhHitPullY1 = new TH1D("pullHitY1", "Y cluster pull", 50, -10., 10.);
-  fhHitPullZ1 = new TH1D("pullHitZ1", "Z cluster pull", 50, -10., 10.);
-
-  fhHitErrY = new TH1D("HitErrY", "Y cluster error [cm]", 100, 0., 1.);
-  fhHitErrZ = new TH1D("HitErrZ", "Z cluster error [cm]", 100, 0., 1.);
-
-  gDirectory->cd("..");  
-
-  gDirectory->mkdir("Cells");
-  gDirectory->cd("Cells");  
-  fhCellPurity = new TH1D("CellPurity", "Cell Purity", 100, -0.1, 1.1);
-  fhCellNHits = new TH1D("CellNHits", "Cell NHits", 40, 0., 40.);
-  fhCellPurityVsN = new TProfile("CellPurityVsN", "Cell purity Vs N hits", 40, 2., 42.);
-  fhCellPurityVsPt = new TProfile("CellPurityVsPt", "Cell purity Vs Pt", 100, 0., 5.);
-  gDirectory->cd("..");  
+  gDirectory->mkdir( "Links" );
+  gDirectory->cd( "Links" );
+
+  fhLinkEff[0] = new TProfile( "fhLinkEffPrimRef", "fhLinkEffPrimRef vs row", 156, 2., 158. );
+  fhLinkEff[1] = new TProfile( "fhLinkEffPrimExt", "fhLinkEffPrimExt vs row", 156, 2., 158. );
+  fhLinkEff[2] = new TProfile( "fhLinkEffSecRef", "fhLinkEffSecRef vs row", 156, 2., 158. );
+  fhLinkEff[3] = new TProfile( "fhLinkEffSecExt", "fhLinkEffSecExt vs row", 156, 2., 158. );
+  fhLinkAreaY[0] = new TH1D( "fhLinkAreaYPrimRef", "fhLinkAreaYPrimRef", 100, 0, 10 );
+  fhLinkAreaZ[0] = new TH1D( "fhLinkAreaZPrimRef", "fhLinkAreaZPrimRef", 100, 0, 10 );
+  fhLinkAreaY[1] = new TH1D( "fhLinkAreaYPrimExt", "fhLinkAreaYPrimExt", 100, 0, 10 );
+  fhLinkAreaZ[1] = new TH1D( "fhLinkAreaZPrimExt", "fhLinkAreaZPrimExt", 100, 0, 10 );
+  fhLinkAreaY[2] = new TH1D( "fhLinkAreaYSecRef", "fhLinkAreaYSecRef", 100, 0, 10 );
+  fhLinkAreaZ[2] = new TH1D( "fhLinkAreaZSecRef", "fhLinkAreaZSecRef", 100, 0, 10 );
+  fhLinkAreaY[3] = new TH1D( "fhLinkAreaYSecExt", "fhLinkAreaYSecExt", 100, 0, 10 );
+  fhLinkAreaZ[3] = new TH1D( "fhLinkAreaZSecExt", "fhLinkAreaZSecExt", 100, 0, 10 );
+  fhLinkChiRight[0] = new TH1D( "fhLinkChiRightPrimRef", "fhLinkChiRightPrimRef", 100, 0, 10 );
+  fhLinkChiRight[1] = new TH1D( "fhLinkChiRightPrimExt", "fhLinkChiRightPrimExt", 100, 0, 10 );
+  fhLinkChiRight[2] = new TH1D( "fhLinkChiRightSecRef", "fhLinkChiRightSecRef", 100, 0, 10 );
+  fhLinkChiRight[3] = new TH1D( "fhLinkChiRightSecExt", "fhLinkChiRightSecExt", 100, 0, 10 );
+  fhLinkChiWrong[0] = new TH1D( "fhLinkChiWrongPrimRef", "fhLinkChiWrongPrimRef", 100, 0, 10 );
+  fhLinkChiWrong[1] = new TH1D( "fhLinkChiWrongPrimExt", "fhLinkChiWrongPrimExt", 100, 0, 10 );
+  fhLinkChiWrong[2] = new TH1D( "fhLinkChiWrongSecRef", "fhLinkChiWrongSecRef", 100, 0, 10 );
+  fhLinkChiWrong[3] = new TH1D( "fhLinkChiWrongSecExt", "fhLinkChiWrongSecExt", 100, 0, 10 );
+
+  gDirectory->cd( ".." );
+
+  gDirectory->mkdir( "Neighbours" );
+  gDirectory->cd( "Neighbours" );
+
+  fhNeighQuality = new TProfile( "NeighQuality", "Neighbours Quality vs row", 160, 0., 160. );
+  fhNeighEff = new TProfile( "NeighEff", "Neighbours Efficiency vs row", 160, 0., 160. );
+  fhNeighQualityVsPt = new TProfile( "NeighQualityVsPt", "Neighbours Quality vs Pt", 100, 0., 5. );
+  fhNeighEffVsPt = new TProfile( "NeighEffVsPt", "Neighbours Efficiency vs Pt", 100, 0., 5. );
+  fhNeighDy = new TH1D( "NeighDy", "Neighbours dy", 100, -10, 10 );
+  fhNeighDz =  new TH1D( "NeighDz", "Neighbours dz", 100, -10, 10 );
+  fhNeighChi = new TH1D( "NeighChi", "Neighbours chi", 100, 0, 20 );
+
+  fhNeighDyVsPt = new TH2D( "NeighDyVsPt", "NeighDyVsPt", 100, 0, 5, 100, -20, 20 );
+  fhNeighDzVsPt = new TH2D( "NeighDzVsPt", "NeighDzVsPt", 100, 0, 5, 100, -20, 20 );
+  fhNeighChiVsPt = new TH2D( "NeighChiVsPt", "NeighChiVsPt", 100, 0, 5, 100, 0, 40 );
+  fhNeighNCombVsArea = new TH2D( "NeighNCombVsArea", "NeighNCombVsArea", 15, 0, 3, 40, 0, 40 );
+
+  gDirectory->cd( ".." );
+
+  gDirectory->mkdir( "Tracklets" );
+  gDirectory->cd( "Tracklets" );
+
+  fhNHitsPerSeed = new TH1D( "NHitsPerSeed", "NHitsPerSeed", 160, 0, 160 );
+  fhSeedEffVsP = new TProfile( "fhSeedEffVsP", "Track Seed Eff vs P", 100, 0., 5. );
+
+  gDirectory->cd( ".." );
+
+  gDirectory->mkdir( "TrackCandidates" );
+  gDirectory->cd( "TrackCandidates" );
+
+  fhNHitsPerTrackCand = new TH1D( "NHitsPerTrackCand", "NHitsPerTrackCand", 160, 0, 160 );
+  fhCandEffVsP = new TProfile( "fhCandEffVsP", "Track Candidate Eff vs P", 100, 0., 5. );
+
+  gDirectory->cd( ".." );
+
+  gDirectory->mkdir( "Tracks" );
+  gDirectory->cd( "Tracks" );
+
+  fhTrackLengthRef = new TH1D( "TrackLengthRef", "TrackLengthRef", 100, 0, 1 );
+
+  fhRefRecoX = new TH1D( "fhRefRecoX", "fhRefRecoX", 100, 0, 200. );
+  fhRefRecoY = new TH1D( "fhRefRecoY", "fhRefRecoY", 100, -200, 200. );
+  fhRefRecoZ = new TH1D( "fhRefRecoZ", "fhRefRecoZ", 100, -250, 250. );
+
+
+  fhRefRecoP = new TH1D( "fhRefRecoP", "fhRefRecoP", 100, 0, 10. );
+  fhRefRecoPt = new TH1D( "fhRefRecoPt", "fhRefRecoPt", 100, 0, 10. );
+  fhRefRecoAngleY = new TH1D( "fhRefRecoAngleY", "fhRefRecoAngleY", 100, -180., 180. );
+  fhRefRecoAngleZ = new TH1D( "fhRefRecoAngleZ", "fhRefRecoAngleZ", 100, -180., 180 );
+  fhRefRecoNHits = new TH1D( "fhRefRecoNHits", "fhRefRecoNHits", 100, 0., 200 );
+
+  fhRefNotRecoX = new TH1D( "fhRefNotRecoX", "fhRefNotRecoX", 100, 0, 200. );
+  fhRefNotRecoY = new TH1D( "fhRefNotRecoY", "fhRefNotRecoY", 100, -200, 200. );
+  fhRefNotRecoZ = new TH1D( "fhRefNotRecoZ", "fhRefNotRecoZ", 100, -250, 250. );
+
+
+  fhRefNotRecoP = new TH1D( "fhRefNotRecoP", "fhRefNotRecoP", 100, 0, 10. );
+  fhRefNotRecoPt = new TH1D( "fhRefNotRecoPt", "fhRefNotRecoPt", 100, 0, 10. );
+  fhRefNotRecoAngleY = new TH1D( "fhRefNotRecoAngleY", "fhRefNotRecoAngleY", 100, -180., 180. );
+  fhRefNotRecoAngleZ = new TH1D( "fhRefNotRecoAngleZ", "fhRefNotRecoAngleZ", 100, -180., 180 );
+  fhRefNotRecoNHits = new TH1D( "fhRefNotRecoNHits", "fhRefNotRecoNHits", 100, 0., 200 );
+
+  gDirectory->cd( ".." );
+
+  gDirectory->mkdir( "TrackFit" );
+  gDirectory->cd( "TrackFit" );
+
+  fhResY = new TH1D( "resY", "track Y resoltion [cm]", 30, -.5, .5 );
+  fhResZ = new TH1D( "resZ", "track Z resoltion [cm]", 30, -.5, .5 );
+  fhResSinPhi = new TH1D( "resSinPhi", "track SinPhi resoltion ", 30, -.03, .03 );
+  fhResDzDs = new TH1D( "resDzDs", "track DzDs resoltion ", 30, -.01, .01 );
+  fhResPt = new TH1D( "resPt", "track telative Pt resoltion", 30, -.2, .2 );
+  fhPullY = new TH1D( "pullY", "track Y pull", 30, -10., 10. );
+  fhPullZ = new TH1D( "pullZ", "track Z pull", 30, -10., 10. );
+  fhPullSinPhi = new TH1D( "pullSinPhi", "track SinPhi pull", 30, -10., 10. );
+  fhPullDzDs = new TH1D( "pullDzDs", "track DzDs pull", 30, -10., 10. );
+  fhPullQPt = new TH1D( "pullQPt", "track Q/Pt pull", 30, -10., 10. );
+  fhPullYS = new TH1D( "pullYS", "track Y+SinPhi chi deviation", 100, 0., 30. );
+  fhPullZT = new TH1D( "pullZT", "track Z+DzDs chi deviation ", 100, 0., 30. );
+
+  gDirectory->cd( ".." );
+
+  fhEffVsP = new TProfile( "EffVsP", "Eff vs P", 100, 0., 5. );
+  fhGBEffVsP = new TProfile( "GBEffVsP", "Global tracker: Eff vs P", 100, 0., 5. );
+  fhGBEffVsPt = new TProfile( "GBEffVsPt", "Global tracker: Eff vs Pt", 100, 0.2, 5. );
+
+  gDirectory->mkdir( "Clusters" );
+  gDirectory->cd( "Clusters" );
+
+  fhHitShared = new TProfile( "fhHitSharedf", "fhHitShared vs row", 160, 0., 160. );
+
+  fhHitResY = new TH1D( "resHitY", "Y cluster resoltion [cm]", 100, -2., 2. );
+  fhHitResZ = new TH1D( "resHitZ", "Z cluster resoltion [cm]", 100, -2., 2. );
+  fhHitPullY = new TH1D( "pullHitY", "Y cluster pull", 50, -10., 10. );
+  fhHitPullZ = new TH1D( "pullHitZ", "Z cluster pull", 50, -10., 10. );
+
+  fhHitResY1 = new TH1D( "resHitY1", "Y cluster resoltion [cm]", 100, -2., 2. );
+  fhHitResZ1 = new TH1D( "resHitZ1", "Z cluster resoltion [cm]", 100, -2., 2. );
+  fhHitPullY1 = new TH1D( "pullHitY1", "Y cluster pull", 50, -10., 10. );
+  fhHitPullZ1 = new TH1D( "pullHitZ1", "Z cluster pull", 50, -10., 10. );
+
+  fhHitErrY = new TH1D( "HitErrY", "Y cluster error [cm]", 100, 0., 1. );
+  fhHitErrZ = new TH1D( "HitErrZ", "Z cluster error [cm]", 100, 0., 1. );
 
-  curdir->cd();  
+  gDirectory->cd( ".." );
+
+  gDirectory->mkdir( "Cells" );
+  gDirectory->cd( "Cells" );
+  fhCellPurity = new TH1D( "CellPurity", "Cell Purity", 100, -0.1, 1.1 );
+  fhCellNHits = new TH1D( "CellNHits", "Cell NHits", 40, 0., 40. );
+  fhCellPurityVsN = new TProfile( "CellPurityVsN", "Cell purity Vs N hits", 40, 2., 42. );
+  fhCellPurityVsPt = new TProfile( "CellPurityVsPt", "Cell purity Vs Pt", 100, 0., 5. );
+  gDirectory->cd( ".." );
+
+  curdir->cd();
 }
 
 void AliHLTTPCCAPerformance::WriteDir2Current( TObject *obj )
 {
   //* recursive function to copy the directory 'obj' to the current one
-  if( !obj->IsFolder() ) obj->Write();
-  else{
+  if ( !obj->IsFolder() ) obj->Write();
+  else {
     TDirectory *cur = gDirectory;
-    TDirectory *sub = cur->mkdir(obj->GetName());
+    TDirectory *sub = cur->mkdir( obj->GetName() );
     sub->cd();
-    TList *listSub = ((TDirectory*)obj)->GetList();
-    TIter it(listSub);
-    while( TObject *obj1=it() ) WriteDir2Current(obj1);
+    TList *listSub = ( ( TDirectory* )obj )->GetList();
+    TIter it( listSub );
+    while ( TObject *obj1 = it() ) WriteDir2Current( obj1 );
     cur->cd();
   }
 }
@@ -546,330 +546,330 @@ void AliHLTTPCCAPerformance::WriteHistos()
   //* write histograms to the file
   TDirectory *curr = gDirectory;
   // Open output file and write histograms
-  TFile* outfile = new TFile("HLTTPCCATrackerPerformance.root","RECREATE");
+  TFile* outfile = new TFile( "HLTTPCCATrackerPerformance.root", "RECREATE" );
   outfile->cd();
-  WriteDir2Current(fHistoDir);
+  WriteDir2Current( fHistoDir );
   outfile->Close();
   curr->cd();
 }
 
 
-void AliHLTTPCCAPerformance::LinkPerformance( Int_t iSlice )
-{ 
+void AliHLTTPCCAPerformance::LinkPerformance( int iSlice )
+{
   // Efficiency and quality of the found neighbours
-  std::cout<<"Link performance..."<<std::endl;
-  if( !fTracker ) return;  
+  std::cout << "Link performance..." << std::endl;
+  if ( !fTracker ) return;
   AliHLTTPCCATracker &slice = fTracker->Slices()[iSlice];
 
-  const Int_t *id = slice.HitInputIDs();
+  const int *id = slice.HitInputIDs();
 
-  Int_t mcType[fNMCTracks];
+  int mcType[fNMCTracks];
 
-  for (Int_t imc=0; imc<fNMCTracks; imc++){   
-    if( fMCTracks[imc].P()<.2 ){  mcType[imc] = -1; continue; }
-    Float_t x = fMCTracks[imc].Par()[0];
-    Float_t y = fMCTracks[imc].Par()[1];
-    //Float_t z = fMCTracks[imc].Par()[2];
-    if( x*x + y*y < 100. ){
-      if( fMCTracks[imc].P()>=1 ) mcType[imc] = 0;
+  for ( int imc = 0; imc < fNMCTracks; imc++ ) {
+    if ( fMCTracks[imc].P() < .2 ) {  mcType[imc] = -1; continue; }
+    float x = fMCTracks[imc].Par()[0];
+    float y = fMCTracks[imc].Par()[1];
+    //float z = fMCTracks[imc].Par()[2];
+    if ( x*x + y*y < 100. ) {
+      if ( fMCTracks[imc].P() >= 1 ) mcType[imc] = 0;
       else mcType[imc] = 1;
     } else {
-      if( fMCTracks[imc].P()>=1 ) mcType[imc] = 2;
+      if ( fMCTracks[imc].P() >= 1 ) mcType[imc] = 2;
       else mcType[imc] = 3;
     }
   }
 
-  struct AliHLTTPCCAMCHits{
-    Int_t fNHits;
-    Int_t fID[30];
-  }; 
+  struct AliHLTTPCCAMCHits {
+    int fNHits;
+    int fID[30];
+  };
   AliHLTTPCCAMCHits *mcGbHitsUp = new AliHLTTPCCAMCHits[fNMCTracks];
   AliHLTTPCCAMCHits *mcGbHitsDn = new AliHLTTPCCAMCHits[fNMCTracks];
 
-  for( Int_t iRow=2; iRow<slice.Param().NRows()-2; iRow++ ){
-    
-    const AliHLTTPCCARow &row = slice.Row(iRow);
-    const AliHLTTPCCARow &rowUp = slice.Row(iRow+2);
-    const AliHLTTPCCARow &rowDn = slice.Row(iRow-2);    
-    
-    Int_t gbHits  [row.NHits()];
-    Int_t gbHitsUp[rowUp.NHits()];
-    Int_t gbHitsDn[rowDn.NHits()];
-
-    for (Int_t ih = 0; ih<row.NHits()  ; ih++) gbHits  [ih] = fTracker->FirstSliceHit()[iSlice]+id[row  .FirstHit()+ih];    
-    for (Int_t ih = 0; ih<rowUp.NHits(); ih++) gbHitsUp[ih] = fTracker->FirstSliceHit()[iSlice]+id[rowUp.FirstHit()+ih];
-    for (Int_t ih = 0; ih<rowDn.NHits(); ih++) gbHitsDn[ih] = fTracker->FirstSliceHit()[iSlice]+id[rowDn.FirstHit()+ih];
-
-    for (Int_t imc=0; imc<fNMCTracks; imc++){ 
+  for ( int iRow = 2; iRow < slice.Param().NRows() - 2; iRow++ ) {
+
+    const AliHLTTPCCARow &row = slice.Row( iRow );
+    const AliHLTTPCCARow &rowUp = slice.Row( iRow + 2 );
+    const AliHLTTPCCARow &rowDn = slice.Row( iRow - 2 );
+
+    int gbHits  [row.NHits()];
+    int gbHitsUp[rowUp.NHits()];
+    int gbHitsDn[rowDn.NHits()];
+
+    for ( int ih = 0; ih < row.NHits()  ; ih++ ) gbHits  [ih] = fTracker->FirstSliceHit()[iSlice] + id[row  .FirstHit()+ih];
+    for ( int ih = 0; ih < rowUp.NHits(); ih++ ) gbHitsUp[ih] = fTracker->FirstSliceHit()[iSlice] + id[rowUp.FirstHit()+ih];
+    for ( int ih = 0; ih < rowDn.NHits(); ih++ ) gbHitsDn[ih] = fTracker->FirstSliceHit()[iSlice] + id[rowDn.FirstHit()+ih];
+
+    for ( int imc = 0; imc < fNMCTracks; imc++ ) {
       mcGbHitsUp[imc].fNHits = 0;
       mcGbHitsDn[imc].fNHits = 0;
     }
-  
-    for (Int_t ih = 0; ih<rowUp.NHits(); ih++){      
+
+    for ( int ih = 0; ih < rowUp.NHits(); ih++ ) {
       AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[gbHitsUp[ih]].ID()];
-      for( Int_t il=0; il<3; il++ ){
-       Int_t imc = l.fLab[il];
-       if( imc <0 ) break;
-       Int_t &nmc = mcGbHitsUp[imc].fNHits;
-       if( nmc>=30 ) continue;
-       mcGbHitsUp[imc].fID[nmc] = gbHitsUp[ih];
-       nmc++;
+      for ( int il = 0; il < 3; il++ ) {
+        int imc = l.fLab[il];
+        if ( imc < 0 ) break;
+        int &nmc = mcGbHitsUp[imc].fNHits;
+        if ( nmc >= 30 ) continue;
+        mcGbHitsUp[imc].fID[nmc] = gbHitsUp[ih];
+        nmc++;
       }
     }
 
-    for (Int_t ih = 0; ih<rowDn.NHits(); ih++){
-      AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[gbHitsDn[ih]].ID()];    
-      for( Int_t il=0; il<3; il++ ){
-       Int_t imc = l.fLab[il];
-       if( imc <0 ) break;
-       Int_t &nmc = mcGbHitsDn[imc].fNHits;
-       if( nmc>=30 ) continue;
-       mcGbHitsDn[imc].fID[nmc] = gbHitsDn[ih];
-       nmc++;
+    for ( int ih = 0; ih < rowDn.NHits(); ih++ ) {
+      AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[gbHitsDn[ih]].ID()];
+      for ( int il = 0; il < 3; il++ ) {
+        int imc = l.fLab[il];
+        if ( imc < 0 ) break;
+        int &nmc = mcGbHitsDn[imc].fNHits;
+        if ( nmc >= 30 ) continue;
+        mcGbHitsDn[imc].fID[nmc] = gbHitsDn[ih];
+        nmc++;
       }
     }
 
-    Short_t *linkUp = ((Short_t*)(slice.RowData() + row.FullOffset())) + row.FullLinkOffset();
-    Short_t *linkDn = linkUp + row.NHits();
+    short *linkUp = ( ( short* )( slice.RowData() + row.FullOffset() ) ) + row.FullLinkOffset();
+    short *linkDn = linkUp + row.NHits();
+
+    //float dxUp = rowUp.X() - row.X();
+    //float dxDn = row.X() - rowDn.X();
+    float tUp = rowUp.X() / row.X();
+    float tDn = rowDn.X() / row.X();
 
-    //Float_t dxUp = rowUp.X() - row.X();
-    //Float_t dxDn = row.X() - rowDn.X();
-    Float_t tUp = rowUp.X()/row.X();
-    Float_t tDn = rowDn.X()/row.X();
+    for ( int ih = 0; ih < row.NHits(); ih++ ) {
+
+      int up = linkUp[ih];
+      int dn = linkDn[ih];
 
-    for( Int_t ih=0; ih<row.NHits(); ih++ ){      
-      
-      Int_t up = linkUp[ih];
-      Int_t dn = linkDn[ih];
-      
       AliHLTTPCCAGBHit &h = fTracker->Hits()[gbHits[ih]];
-      AliHLTTPCCAHitLabel &l = fHitLabels[h.ID()];    
-
-      Int_t isMC = -1;
-      Int_t mcFound=-1;
-
-      Float_t yUp = h.Y()*tUp, zUp = h.Z()*tUp;
-      Float_t yDn = h.Y()*tDn, zDn = h.Z()*tDn;
-
-      for( Int_t il=0; il<3; il++ ){
-       Int_t imc = l.fLab[il];
-       if( imc<0 ) break;
-
-       Bool_t isMcUp=0, isMcDn=0;
-
-       Float_t dyMin=1.e8, dzMin=1.e8;
-       for( Int_t i=0; i<mcGbHitsUp[imc].fNHits; i++ ){
-         AliHLTTPCCAGBHit &h1 = fTracker->Hits()[mcGbHitsUp[imc].fID[i]];
-         Float_t dy = TMath::Abs(h1.Y()-yUp);
-         Float_t dz = TMath::Abs(h1.Z()-zUp);
-         if( dy*dy+dz*dz < dyMin*dyMin + dzMin*dzMin ){
-           dyMin = dy;
-           dzMin = dz;     
-         }
-       }
-
-       if( mcType[imc]>=0 && mcGbHitsUp[imc].fNHits>=0 ){
-         fhLinkAreaY[mcType[imc]]->Fill(dyMin);
-         fhLinkAreaZ[mcType[imc]]->Fill(dzMin);
-       }
-       if( dyMin*dyMin+dzMin*dzMin<100. ) isMcUp = 1;
-       dyMin=1.e8; 
-       dzMin=1.e8;
-       for( Int_t i=0; i<mcGbHitsDn[imc].fNHits; i++ ){
-         AliHLTTPCCAGBHit &h1 = fTracker->Hits()[mcGbHitsDn[imc].fID[i]];
-         Float_t dy = TMath::Abs(h1.Y()-yDn);
-         Float_t dz = TMath::Abs(h1.Z()-zDn);
-         if( dy*dy+dz*dz < dyMin*dyMin + dzMin*dzMin ){
-           dyMin = dy;
-           dzMin = dz;     
-         }
-       }
-
-       if( mcType[imc]>=0 && mcGbHitsDn[imc].fNHits>=0 ){
-         fhLinkAreaY[mcType[imc]]->Fill(dyMin);
-         fhLinkAreaZ[mcType[imc]]->Fill(dzMin);
-       }
-       if( dyMin*dyMin+dzMin*dzMin<100. ) isMcDn = 1;
-       if( !isMcUp || !isMcDn ) continue;
-       isMC = imc;
-
-       Bool_t found=0;
-       if( up>=0 && dn>=0 ){
-         //std::cout<<"row, ih, mc, up, dn = "<<iRow<<" "<<ih<<" "<<imc<<" "<<up<<" "<<dn<<std::endl;
-         AliHLTTPCCAGBHit &hUp = fTracker->Hits()[gbHitsUp[up]];
-         AliHLTTPCCAGBHit &hDn = fTracker->Hits()[gbHitsDn[dn]];
-         AliHLTTPCCAHitLabel &lUp = fHitLabels[hUp.ID()];
-         AliHLTTPCCAHitLabel &lDn = fHitLabels[hDn.ID()];
-         Bool_t foundUp=0, foundDn=0;
-         for( Int_t jl=0; jl<3; jl++ ){
-           if( lUp.fLab[jl] == imc ) foundUp=1;
-           if( lDn.fLab[jl] == imc ) foundDn=1;
-           //std::cout<<"mc up, dn = "<<lUp.fLab[jl]<<" "<<lDn.fLab[jl]<<std::endl;
-         }
-         if( foundUp && foundDn ) found = 1;
-       }
-       if( found ){ mcFound = imc; break;}     
+      AliHLTTPCCAHitLabel &l = fHitLabels[h.ID()];
+
+      int isMC = -1;
+      int mcFound = -1;
+
+      float yUp = h.Y() * tUp, zUp = h.Z() * tUp;
+      float yDn = h.Y() * tDn, zDn = h.Z() * tDn;
+
+      for ( int il = 0; il < 3; il++ ) {
+        int imc = l.fLab[il];
+        if ( imc < 0 ) break;
+
+        bool isMcUp = 0, isMcDn = 0;
+
+        float dyMin = 1.e8, dzMin = 1.e8;
+        for ( int i = 0; i < mcGbHitsUp[imc].fNHits; i++ ) {
+          AliHLTTPCCAGBHit &h1 = fTracker->Hits()[mcGbHitsUp[imc].fID[i]];
+          float dy = TMath::Abs( h1.Y() - yUp );
+          float dz = TMath::Abs( h1.Z() - zUp );
+          if ( dy*dy + dz*dz < dyMin*dyMin + dzMin*dzMin ) {
+            dyMin = dy;
+            dzMin = dz;
+          }
+        }
+
+        if ( mcType[imc] >= 0 && mcGbHitsUp[imc].fNHits >= 0 ) {
+          fhLinkAreaY[mcType[imc]]->Fill( dyMin );
+          fhLinkAreaZ[mcType[imc]]->Fill( dzMin );
+        }
+        if ( dyMin*dyMin + dzMin*dzMin < 100. ) isMcUp = 1;
+
+        dyMin = 1.e8;
+        dzMin = 1.e8;
+        for ( int i = 0; i < mcGbHitsDn[imc].fNHits; i++ ) {
+          AliHLTTPCCAGBHit &h1 = fTracker->Hits()[mcGbHitsDn[imc].fID[i]];
+          float dy = TMath::Abs( h1.Y() - yDn );
+          float dz = TMath::Abs( h1.Z() - zDn );
+          if ( dy*dy + dz*dz < dyMin*dyMin + dzMin*dzMin ) {
+            dyMin = dy;
+            dzMin = dz;
+          }
+        }
+
+        if ( mcType[imc] >= 0 && mcGbHitsDn[imc].fNHits >= 0 ) {
+          fhLinkAreaY[mcType[imc]]->Fill( dyMin );
+          fhLinkAreaZ[mcType[imc]]->Fill( dzMin );
+        }
+        if ( dyMin*dyMin + dzMin*dzMin < 100. ) isMcDn = 1;
+
+        if ( !isMcUp || !isMcDn ) continue;
+        isMC = imc;
+
+        bool found = 0;
+        if ( up >= 0 && dn >= 0 ) {
+          //std::cout<<"row, ih, mc, up, dn = "<<iRow<<" "<<ih<<" "<<imc<<" "<<up<<" "<<dn<<std::endl;
+          AliHLTTPCCAGBHit &hUp = fTracker->Hits()[gbHitsUp[up]];
+          AliHLTTPCCAGBHit &hDn = fTracker->Hits()[gbHitsDn[dn]];
+          AliHLTTPCCAHitLabel &lUp = fHitLabels[hUp.ID()];
+          AliHLTTPCCAHitLabel &lDn = fHitLabels[hDn.ID()];
+          bool foundUp = 0, foundDn = 0;
+          for ( int jl = 0; jl < 3; jl++ ) {
+            if ( lUp.fLab[jl] == imc ) foundUp = 1;
+            if ( lDn.fLab[jl] == imc ) foundDn = 1;
+            //std::cout<<"mc up, dn = "<<lUp.fLab[jl]<<" "<<lDn.fLab[jl]<<std::endl;
+          }
+          if ( foundUp && foundDn ) found = 1;
+        }
+        if ( found ) { mcFound = imc; break;}
       }
-  
-      if( mcFound>=0 ){
-       //std::cout<<" mc "<<mcFound<<" found"<<std::endl;
-       if( mcType[mcFound]>=0 ) fhLinkEff[mcType[mcFound]]->Fill(iRow, 1 );    
-      }else if( isMC>=0 ){
-       //std::cout<<" mc "<<isMC<<" not found"<<std::endl;
-       if( mcType[isMC]>=0 ) fhLinkEff[mcType[isMC]]->Fill(iRow, 0 );                  
+
+      if ( mcFound >= 0 ) {
+        //std::cout<<" mc "<<mcFound<<" found"<<std::endl;
+        if ( mcType[mcFound] >= 0 ) fhLinkEff[mcType[mcFound]]->Fill( iRow, 1 );
+      } else if ( isMC >= 0 ) {
+        //std::cout<<" mc "<<isMC<<" not found"<<std::endl;
+        if ( mcType[isMC] >= 0 ) fhLinkEff[mcType[isMC]]->Fill( iRow, 0 );
       }
 
-    } // ih    
+    } // ih
   } // iRow
   delete[] mcGbHitsUp;
   delete[] mcGbHitsDn;
 }
 
 
-void AliHLTTPCCAPerformance::SliceTrackletPerformance( Int_t iSlice, Bool_t PrintFlag )
-{ 
+void AliHLTTPCCAPerformance::SliceTrackletPerformance( int iSlice, bool PrintFlag )
+{
   //* calculate slice tracker performance
-  if( !fTracker ) return;
-  
-  Int_t nRecTot = 0, nGhost=0, nRecOut=0;
-  Int_t nMCAll = 0, nRecAll=0, nClonesAll=0;
-  Int_t nMCRef = 0, nRecRef=0, nClonesRef=0;
+  if ( !fTracker ) return;
+
+  int nRecTot = 0, nGhost = 0, nRecOut = 0;
+  int nMCAll = 0, nRecAll = 0, nClonesAll = 0;
+  int nMCRef = 0, nRecRef = 0, nClonesRef = 0;
   AliHLTTPCCATracker &slice = fTracker->Slices()[iSlice];
 
-  Int_t firstSliceHit = fTracker->FirstSliceHit()[iSlice];
-  Int_t endSliceHit = fTracker->NHits();
-  if( iSlice<fTracker->NSlices()-1 ) endSliceHit = fTracker->FirstSliceHit()[iSlice+1];    
+  int firstSliceHit = fTracker->FirstSliceHit()[iSlice];
+  int endSliceHit = fTracker->NHits();
+  if ( iSlice < fTracker->NSlices() - 1 ) endSliceHit = fTracker->FirstSliceHit()[iSlice+1];
 
   // Select reconstructable MC tracks
 
   {
-    for (Int_t imc=0; imc<fNMCTracks; imc++) fMCTracks[imc].SetNHits( 0 );
-    
-    for( Int_t ih=firstSliceHit; ih<endSliceHit; ih++){
-      Int_t id = fTracker->Hits()[ih].ID();
-      if( id<0 || id>=fNHits ) break;
+    for ( int imc = 0; imc < fNMCTracks; imc++ ) fMCTracks[imc].SetNHits( 0 );
+
+    for ( int ih = firstSliceHit; ih < endSliceHit; ih++ ) {
+      int id = fTracker->Hits()[ih].ID();
+      if ( id < 0 || id >= fNHits ) break;
       AliHLTTPCCAHitLabel &l = fHitLabels[id];
-      if( l.fLab[0]>=0 ) fMCTracks[l.fLab[0]].SetNHits(fMCTracks[l.fLab[0]].NHits()+1);
-      if( l.fLab[1]>=0 ) fMCTracks[l.fLab[1]].SetNHits(fMCTracks[l.fLab[1]].NHits()+1);
-      if( l.fLab[2]>=0 ) fMCTracks[l.fLab[2]].SetNHits(fMCTracks[l.fLab[2]].NHits()+1);
+      if ( l.fLab[0] >= 0 ) fMCTracks[l.fLab[0]].SetNHits( fMCTracks[l.fLab[0]].NHits() + 1 );
+      if ( l.fLab[1] >= 0 ) fMCTracks[l.fLab[1]].SetNHits( fMCTracks[l.fLab[1]].NHits() + 1 );
+      if ( l.fLab[2] >= 0 ) fMCTracks[l.fLab[2]].SetNHits( fMCTracks[l.fLab[2]].NHits() + 1 );
     }
-    
-    for (Int_t imc=0; imc<fNMCTracks; imc++) {         
+
+    for ( int imc = 0; imc < fNMCTracks; imc++ ) {
       AliHLTTPCCAMCTrack &mc = fMCTracks[imc];
       mc.SetSet( 0 );
       mc.SetNReconstructed( 0 );
       mc.SetNTurns( 1 );
-      if( mc.NHits() >=  30 && mc.P()>=.05 ){
-       mc.SetSet( 1 );
-       nMCAll++;
-       if( mc.NHits() >=  30 && mc.P()>=1. ){
-         mc.SetSet( 2 );
-         nMCRef++;
-       }
+      if ( mc.NHits() >=  30 && mc.P() >= .05 ) {
+        mc.SetSet( 1 );
+        nMCAll++;
+        if ( mc.NHits() >=  30 && mc.P() >= 1. ) {
+          mc.SetSet( 2 );
+          nMCRef++;
+        }
       }
     }
   }
 
 
-  Int_t traN = *slice.NTracklets();
-  Int_t *traLabels = 0; 
-  Double_t *traPurity = 0;
+  int traN = *slice.NTracklets();
+  int *traLabels = 0;
+  double *traPurity = 0;
 
-  traLabels = new Int_t[traN];
-  traPurity = new Double_t[traN];
+  traLabels = new int[traN];
+  traPurity = new double[traN];
   {
-    for (Int_t itr=0; itr<traN; itr++) {
-      traLabels[itr]=-1;
-      traPurity[itr]= 0;
-      
-      Int_t hits[1600];
-      Int_t nHits=0;
-
-      {      
-       Int_t id = slice.TrackletStartHits()[itr];
-       Int_t iRow = AliHLTTPCCATracker::ID2IRow(id);
-       Int_t ih =  AliHLTTPCCATracker::ID2IHit(id);
-      
-       while( ih>=0 ){
-         const AliHLTTPCCARow &row = slice.Row(iRow);
-         hits[nHits] = firstSliceHit + slice.HitInputIDs()[row.FirstHit()+ih];
-         nHits++;      
-         Short_t *linkUp = ((Short_t*)(slice.RowData() + row.FullOffset())) + row.FullLinkOffset();
-         ih = linkUp[ih];
-         iRow++;
-       }
+    for ( int itr = 0; itr < traN; itr++ ) {
+      traLabels[itr] = -1;
+      traPurity[itr] = 0;
+
+      int hits[1600];
+      int nHits = 0;
+
+      {
+        int id = slice.TrackletStartHits()[itr];
+        int iRow = AliHLTTPCCATracker::ID2IRow( id );
+        int ih =  AliHLTTPCCATracker::ID2IHit( id );
+
+        while ( ih >= 0 ) {
+          const AliHLTTPCCARow &row = slice.Row( iRow );
+          hits[nHits] = firstSliceHit + slice.HitInputIDs()[row.FirstHit()+ih];
+          nHits++;
+          short *linkUp = ( ( short* )( slice.RowData() + row.FullOffset() ) ) + row.FullLinkOffset();
+          ih = linkUp[ih];
+          iRow++;
+        }
       }
 
-      if( nHits<5 ) continue;
-       
-      Int_t lb[1600*3];
-      Int_t nla=0;
+      if ( nHits < 5 ) continue;
+
+      int lb[1600*3];
+      int nla = 0;
 
-      for( Int_t ih=0; ih<nHits; ih++ ){
-       AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[hits[ih]].ID()];   
-       if(l.fLab[0]>=0 ) lb[nla++]= l.fLab[0];
-       if(l.fLab[1]>=0 ) lb[nla++]= l.fLab[1];
-       if(l.fLab[2]>=0 ) lb[nla++]= l.fLab[2];
+      for ( int ih = 0; ih < nHits; ih++ ) {
+        AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[hits[ih]].ID()];
+        if ( l.fLab[0] >= 0 ) lb[nla++] = l.fLab[0];
+        if ( l.fLab[1] >= 0 ) lb[nla++] = l.fLab[1];
+        if ( l.fLab[2] >= 0 ) lb[nla++] = l.fLab[2];
       }
-      
-      sort( lb, lb+nla );
-      Int_t labmax = -1, labcur=-1, lmax = 0, lcurr=0;
-      for( Int_t i=0; i<nla; i++ ){
-       if( lb[i]!=labcur ){
-         if( labcur>=0 && lmax<lcurr ){
-           lmax = lcurr;
-           labmax = labcur;
-         }
-         labcur = lb[i];
-         lcurr = 0;
-       }
-       lcurr++;
+
+      sort( lb, lb + nla );
+      int labmax = -1, labcur = -1, lmax = 0, lcurr = 0;
+      for ( int i = 0; i < nla; i++ ) {
+        if ( lb[i] != labcur ) {
+          if ( labcur >= 0 && lmax < lcurr ) {
+            lmax = lcurr;
+            labmax = labcur;
+          }
+          labcur = lb[i];
+          lcurr = 0;
+        }
+        lcurr++;
       }
-      if( labcur>=0 && lmax<lcurr ){
-       lmax = lcurr;
-       labmax = labcur;
+      if ( labcur >= 0 && lmax < lcurr ) {
+        lmax = lcurr;
+        labmax = labcur;
       }
       lmax = 0;
-      for( Int_t ih=0; ih<nHits; ih++ ){
-       AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[hits[ih]].ID()];   
-       if( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax 
-           ) lmax++;
+      for ( int ih = 0; ih < nHits; ih++ ) {
+        AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[hits[ih]].ID()];
+        if ( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax
+           ) lmax++;
       }
       traLabels[itr] = labmax;
-      traPurity[itr] = ( (nHits>0) ?double(lmax)/double(nHits) :0 );
+      traPurity[itr] = ( ( nHits > 0 ) ? double( lmax ) / double( nHits ) : 0 );
     }
   }
 
-  nRecTot+= traN;
-  
-  for(Int_t itr=0; itr<traN; itr++){      
-    if( traPurity[itr]<.9 || traLabels[itr]<0 || traLabels[itr]>=fNMCTracks){
+  nRecTot += traN;
+
+  for ( int itr = 0; itr < traN; itr++ ) {
+    if ( traPurity[itr] < .9 || traLabels[itr] < 0 || traLabels[itr] >= fNMCTracks ) {
       nGhost++;
       continue;
     }
-    
-    AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];        
-    mc.SetNReconstructed( mc.NReconstructed()+1 );
-    if( mc.Set()== 0 ) nRecOut++;
-    else{
-      if( mc.NReconstructed()==1 ) nRecAll++;
-      else if(mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
-      if( mc.Set()==2 ){
-       if( mc.NReconstructed()==1 ) nRecRef++;
-       else if(mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
+
+    AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];
+    mc.SetNReconstructed( mc.NReconstructed() + 1 );
+    if ( mc.Set() == 0 ) nRecOut++;
+    else {
+      if ( mc.NReconstructed() == 1 ) nRecAll++;
+      else if ( mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
+      if ( mc.Set() == 2 ) {
+        if ( mc.NReconstructed() == 1 ) nRecRef++;
+        else if ( mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
       }
-    }      
+    }
   }
 
-  for (Int_t ipart=0; ipart<fNMCTracks; ipart++) {             
+  for ( int ipart = 0; ipart < fNMCTracks; ipart++ ) {
     AliHLTTPCCAMCTrack &mc = fMCTracks[ipart];
-    if( mc.Set()>0 ) fhSeedEffVsP->Fill(mc.P(), ( mc.NReconstructed()>0 ?1 :0));
-  }  
+    if ( mc.Set() > 0 ) fhSeedEffVsP->Fill( mc.P(), ( mc.NReconstructed() > 0 ? 1 : 0 ) );
+  }
 
-  if( traLabels ) delete[] traLabels;
-  if( traPurity ) delete[] traPurity;
+  if ( traLabels ) delete[] traLabels;
+  if ( traPurity ) delete[] traPurity;
 
   fStatSeedNRecTot += nRecTot;
   fStatSeedNRecOut += nRecOut;
@@ -881,195 +881,195 @@ void AliHLTTPCCAPerformance::SliceTrackletPerformance( Int_t iSlice, Bool_t Prin
   fStatSeedNRecRef  += nRecRef;
   fStatSeedNClonesRef  += nClonesRef;
 
-  if( nMCAll ==0 ) return;
-
-  if( PrintFlag ){
-    cout<<"Track seed performance for slice "<<iSlice<<" : "<<endl;
-    cout<<" N tracks : "
-       <<nMCAll<<" mc all, "
-       <<nMCRef<<" mc ref, "
-       <<nRecTot<<" rec total, "
-       <<nRecAll<<" rec all, "
-       <<nClonesAll<<" clones all, "
-       <<nRecRef<<" rec ref, "
-       <<nClonesRef<<" clones ref, "
-       <<nRecOut<<" out, "
-       <<nGhost<<" ghost"<<endl;
-  
-    Int_t nRecExtr = nRecAll - nRecRef;
-    Int_t nMCExtr = nMCAll - nMCRef;
-    Int_t nClonesExtr = nClonesAll - nClonesRef;
-  
-    Double_t dRecTot = (nRecTot>0 ) ? nRecTot :1;
-    Double_t dMCAll = (nMCAll>0 ) ? nMCAll :1;
-    Double_t dMCRef = (nMCRef>0 ) ? nMCRef :1;
-    Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1;
-    Double_t dRecAll = (nRecAll+nClonesAll>0 ) ? nRecAll+nClonesAll :1;
-    Double_t dRecRef = (nRecRef+nClonesRef>0 ) ? nRecRef+nClonesRef :1;
-    Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1;
-    
-    cout<<" EffRef = ";
-    if( nMCRef>0 ) cout<<nRecRef/dMCRef; else cout<<"_";
-    cout<<", CloneRef = ";
-    if( nRecRef >0 ) cout << nClonesRef/dRecRef; else cout<<"_";
-    cout<<endl;
-    cout<<" EffExtra = ";
-    if( nMCExtr>0 ) cout << nRecExtr/dMCExtr; else cout<<"_";
-    cout <<", CloneExtra = ";
-    if( nRecExtr>0 ) cout << nClonesExtr/dRecExtr; else cout<<"_";
-    cout<<endl;
-    cout<<" EffAll = ";
-    if( nMCAll>0 ) cout<<nRecAll/dMCAll; else cout<<"_";
-    cout <<", CloneAll = ";
-    if( nRecAll>0 ) cout << nClonesAll/dRecAll; else cout<<"_";
-    cout <<endl;
-    cout<<" Out = ";
-    if( nRecTot>0 ) cout <<nRecOut/dRecTot; else cout<<"_";
-    cout <<", Ghost = ";
-    if( nRecTot>0 ) cout<<nGhost/dRecTot; else cout<<"_";
-    cout<<endl;
+  if ( nMCAll == 0 ) return;
+
+  if ( PrintFlag ) {
+    cout << "Track seed performance for slice " << iSlice << " : " << endl;
+    cout << " N tracks : "
+         << nMCAll << " mc all, "
+         << nMCRef << " mc ref, "
+         << nRecTot << " rec total, "
+         << nRecAll << " rec all, "
+         << nClonesAll << " clones all, "
+         << nRecRef << " rec ref, "
+         << nClonesRef << " clones ref, "
+         << nRecOut << " out, "
+         << nGhost << " ghost" << endl;
+
+    int nRecExtr = nRecAll - nRecRef;
+    int nMCExtr = nMCAll - nMCRef;
+    int nClonesExtr = nClonesAll - nClonesRef;
+
+    double dRecTot = ( nRecTot > 0 ) ? nRecTot : 1;
+    double dMCAll = ( nMCAll > 0 ) ? nMCAll : 1;
+    double dMCRef = ( nMCRef > 0 ) ? nMCRef : 1;
+    double dMCExtr = ( nMCExtr > 0 ) ? nMCExtr : 1;
+    double dRecAll = ( nRecAll + nClonesAll > 0 ) ? nRecAll + nClonesAll : 1;
+    double dRecRef = ( nRecRef + nClonesRef > 0 ) ? nRecRef + nClonesRef : 1;
+    double dRecExtr = ( nRecExtr + nClonesExtr > 0 ) ? nRecExtr + nClonesExtr : 1;
+
+    cout << " EffRef = ";
+    if ( nMCRef > 0 ) cout << nRecRef / dMCRef; else cout << "_";
+    cout << ", CloneRef = ";
+    if ( nRecRef > 0 ) cout << nClonesRef / dRecRef; else cout << "_";
+    cout << endl;
+    cout << " EffExtra = ";
+    if ( nMCExtr > 0 ) cout << nRecExtr / dMCExtr; else cout << "_";
+    cout << ", CloneExtra = ";
+    if ( nRecExtr > 0 ) cout << nClonesExtr / dRecExtr; else cout << "_";
+    cout << endl;
+    cout << " EffAll = ";
+    if ( nMCAll > 0 ) cout << nRecAll / dMCAll; else cout << "_";
+    cout << ", CloneAll = ";
+    if ( nRecAll > 0 ) cout << nClonesAll / dRecAll; else cout << "_";
+    cout << endl;
+    cout << " Out = ";
+    if ( nRecTot > 0 ) cout << nRecOut / dRecTot; else cout << "_";
+    cout << ", Ghost = ";
+    if ( nRecTot > 0 ) cout << nGhost / dRecTot; else cout << "_";
+    cout << endl;
   }
 }
 
 
 
 
-void AliHLTTPCCAPerformance::SliceTrackCandPerformance( Int_t iSlice, Bool_t PrintFlag )
-{ 
+void AliHLTTPCCAPerformance::SliceTrackCandPerformance( int iSlice, bool PrintFlag )
+{
   //* calculate slice tracker performance
-  if( !fTracker ) return;
-  
-  Int_t nRecTot = 0, nGhost=0, nRecOut=0;
-  Int_t nMCAll = 0, nRecAll=0, nClonesAll=0;
-  Int_t nMCRef = 0, nRecRef=0, nClonesRef=0;
+  if ( !fTracker ) return;
+
+  int nRecTot = 0, nGhost = 0, nRecOut = 0;
+  int nMCAll = 0, nRecAll = 0, nClonesAll = 0;
+  int nMCRef = 0, nRecRef = 0, nClonesRef = 0;
   AliHLTTPCCATracker &slice = fTracker->Slices()[iSlice];
 
-  Int_t firstSliceHit = fTracker->FirstSliceHit()[iSlice];
-  Int_t endSliceHit = fTracker->NHits();
-  if( iSlice<fTracker->NSlices()-1 ) endSliceHit = fTracker->FirstSliceHit()[iSlice+1];    
+  int firstSliceHit = fTracker->FirstSliceHit()[iSlice];
+  int endSliceHit = fTracker->NHits();
+  if ( iSlice < fTracker->NSlices() - 1 ) endSliceHit = fTracker->FirstSliceHit()[iSlice+1];
 
   // Select reconstructable MC tracks
 
   {
-    for (Int_t imc=0; imc<fNMCTracks; imc++) fMCTracks[imc].SetNHits( 0 );
-    
-    for( Int_t ih=firstSliceHit; ih<endSliceHit; ih++){
-      Int_t id = fTracker->Hits()[ih].ID();
-      if( id<0 || id>=fNHits ) break;
+    for ( int imc = 0; imc < fNMCTracks; imc++ ) fMCTracks[imc].SetNHits( 0 );
+
+    for ( int ih = firstSliceHit; ih < endSliceHit; ih++ ) {
+      int id = fTracker->Hits()[ih].ID();
+      if ( id < 0 || id >= fNHits ) break;
       AliHLTTPCCAHitLabel &l = fHitLabels[id];
-      if( l.fLab[0]>=0 ) fMCTracks[l.fLab[0]].SetNHits(fMCTracks[l.fLab[0]].NHits()+1);
-      if( l.fLab[1]>=0 ) fMCTracks[l.fLab[1]].SetNHits(fMCTracks[l.fLab[1]].NHits()+1);
-      if( l.fLab[2]>=0 ) fMCTracks[l.fLab[2]].SetNHits(fMCTracks[l.fLab[2]].NHits()+1);
+      if ( l.fLab[0] >= 0 ) fMCTracks[l.fLab[0]].SetNHits( fMCTracks[l.fLab[0]].NHits() + 1 );
+      if ( l.fLab[1] >= 0 ) fMCTracks[l.fLab[1]].SetNHits( fMCTracks[l.fLab[1]].NHits() + 1 );
+      if ( l.fLab[2] >= 0 ) fMCTracks[l.fLab[2]].SetNHits( fMCTracks[l.fLab[2]].NHits() + 1 );
     }
-    
-    for (Int_t imc=0; imc<fNMCTracks; imc++) {         
+
+    for ( int imc = 0; imc < fNMCTracks; imc++ ) {
       AliHLTTPCCAMCTrack &mc = fMCTracks[imc];
       mc.SetSet( 0 );
       mc.SetNReconstructed( 0 );
       mc.SetNTurns( 1 );
-      if( mc.NHits() >=  30 && mc.P()>=.05 ){
-       mc.SetSet( 1 );
-       nMCAll++;
-       if( mc.NHits() >=  30 && mc.P()>=1. ){
-         mc.SetSet( 2 );
-         nMCRef++;
-       }
+      if ( mc.NHits() >=  30 && mc.P() >= .05 ) {
+        mc.SetSet( 1 );
+        nMCAll++;
+        if ( mc.NHits() >=  30 && mc.P() >= 1. ) {
+          mc.SetSet( 2 );
+          nMCRef++;
+        }
       }
     }
   }
 
-  Int_t traN = *slice.NTracklets();
-  Int_t *traLabels = 0; 
-  Double_t *traPurity = 0;
-  traLabels = new Int_t[traN];
-  traPurity = new Double_t[traN];
+  int traN = *slice.NTracklets();
+  int *traLabels = 0;
+  double *traPurity = 0;
+  traLabels = new int[traN];
+  traPurity = new double[traN];
   {
-    for (Int_t itr=0; itr<traN; itr++) {
-      traLabels[itr]=-1;
-      traPurity[itr]= 0;
+    for ( int itr = 0; itr < traN; itr++ ) {
+      traLabels[itr] = -1;
+      traPurity[itr] = 0;
 
       AliHLTTPCCATracklet &t = slice.Tracklets()[itr];
-       
-      Int_t nHits = t.NHits();
-      if( nHits<10 ) continue;
-      Int_t firstRow = t.FirstRow();
-      Int_t lastRow = t.LastRow();
-      nHits=0;
-
-      Int_t lb[1600*3];
-      Int_t nla=0;
-
-      for( Int_t irow=firstRow; irow<=lastRow; irow++ ){
-       Int_t ih = t.RowHit(irow);
-       if( ih<0 ) continue;
-       Int_t index = firstSliceHit + slice.HitInputIDs()[slice.Row(irow).FirstHit()+ih];
-       AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];      
-       if(l.fLab[0]>=0 ) lb[nla++]= l.fLab[0];
-       if(l.fLab[1]>=0 ) lb[nla++]= l.fLab[1];
-       if(l.fLab[2]>=0 ) lb[nla++]= l.fLab[2];
-       nHits++;     
+
+      int nHits = t.NHits();
+      if ( nHits < 10 ) continue;
+      int firstRow = t.FirstRow();
+      int lastRow = t.LastRow();
+      nHits = 0;
+
+      int lb[1600*3];
+      int nla = 0;
+
+      for ( int irow = firstRow; irow <= lastRow; irow++ ) {
+        int ih = t.RowHit( irow );
+        if ( ih < 0 ) continue;
+        int index = firstSliceHit + slice.HitInputIDs()[slice.Row( irow ).FirstHit()+ih];
+        AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
+        if ( l.fLab[0] >= 0 ) lb[nla++] = l.fLab[0];
+        if ( l.fLab[1] >= 0 ) lb[nla++] = l.fLab[1];
+        if ( l.fLab[2] >= 0 ) lb[nla++] = l.fLab[2];
+        nHits++;
       }
-      if( nHits<10 ) continue;      
-      
-      sort( lb, lb+nla );
-      Int_t labmax = -1, labcur=-1, lmax = 0, lcurr=0;
-      for( Int_t i=0; i<nla; i++ ){
-       if( lb[i]!=labcur ){
-         if( labcur>=0 && lmax<lcurr ){
-           lmax = lcurr;
-           labmax = labcur;
-         }
-         labcur = lb[i];
-         lcurr = 0;
-       }
-       lcurr++;
+      if ( nHits < 10 ) continue;
+
+      sort( lb, lb + nla );
+      int labmax = -1, labcur = -1, lmax = 0, lcurr = 0;
+      for ( int i = 0; i < nla; i++ ) {
+        if ( lb[i] != labcur ) {
+          if ( labcur >= 0 && lmax < lcurr ) {
+            lmax = lcurr;
+            labmax = labcur;
+          }
+          labcur = lb[i];
+          lcurr = 0;
+        }
+        lcurr++;
       }
-      if( labcur>=0 && lmax<lcurr ){
-       lmax = lcurr;
-       labmax = labcur;
+      if ( labcur >= 0 && lmax < lcurr ) {
+        lmax = lcurr;
+        labmax = labcur;
       }
       lmax = 0;
-      for( Int_t irow=firstRow; irow<=lastRow; irow++ ){
-       Int_t ih = t.RowHit(irow);
-       if( ih<0 ) continue;
-       Int_t index = firstSliceHit + slice.HitInputIDs()[slice.Row(irow).FirstHit()+ih];
-       AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];      
-       if( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax 
-           ) lmax++;
+      for ( int irow = firstRow; irow <= lastRow; irow++ ) {
+        int ih = t.RowHit( irow );
+        if ( ih < 0 ) continue;
+        int index = firstSliceHit + slice.HitInputIDs()[slice.Row( irow ).FirstHit()+ih];
+        AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
+        if ( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax
+           ) lmax++;
       }
       traLabels[itr] = labmax;
-      traPurity[itr] = ( (nHits>0) ?double(lmax)/double(nHits) :0 );
+      traPurity[itr] = ( ( nHits > 0 ) ? double( lmax ) / double( nHits ) : 0 );
     }
   }
-  
-  nRecTot+= traN;
-  
-  for(Int_t itr=0; itr<traN; itr++){      
-    if( traPurity[itr]<.9 || traLabels[itr]<0 || traLabels[itr]>=fNMCTracks){
+
+  nRecTot += traN;
+
+  for ( int itr = 0; itr < traN; itr++ ) {
+    if ( traPurity[itr] < .9 || traLabels[itr] < 0 || traLabels[itr] >= fNMCTracks ) {
       nGhost++;
       continue;
     }
-    
-    AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];        
-    mc.SetNReconstructed( mc.NReconstructed()+1);
-    if( mc.Set()== 0 ) nRecOut++;
-    else{
-      if( mc.NReconstructed()==1 ) nRecAll++;
-      else if(mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
-      if( mc.Set()==2 ){
-       if( mc.NReconstructed()==1 ) nRecRef++;
-       else if(mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
+
+    AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];
+    mc.SetNReconstructed( mc.NReconstructed() + 1 );
+    if ( mc.Set() == 0 ) nRecOut++;
+    else {
+      if ( mc.NReconstructed() == 1 ) nRecAll++;
+      else if ( mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
+      if ( mc.Set() == 2 ) {
+        if ( mc.NReconstructed() == 1 ) nRecRef++;
+        else if ( mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
       }
-    }      
+    }
   }
 
-  for (Int_t ipart=0; ipart<fNMCTracks; ipart++) {             
+  for ( int ipart = 0; ipart < fNMCTracks; ipart++ ) {
     AliHLTTPCCAMCTrack &mc = fMCTracks[ipart];
-    if( mc.Set()>0 ) fhCandEffVsP->Fill(mc.P(), ( mc.NReconstructed()>0 ?1 :0));
-  }  
+    if ( mc.Set() > 0 ) fhCandEffVsP->Fill( mc.P(), ( mc.NReconstructed() > 0 ? 1 : 0 ) );
+  }
 
-  if( traLabels ) delete[] traLabels;
-  if( traPurity ) delete[] traPurity;
+  if ( traLabels ) delete[] traLabels;
+  if ( traPurity ) delete[] traPurity;
 
   fStatCandNRecTot += nRecTot;
   fStatCandNRecOut += nRecOut;
@@ -1081,190 +1081,190 @@ void AliHLTTPCCAPerformance::SliceTrackCandPerformance( Int_t iSlice, Bool_t Pri
   fStatCandNRecRef  += nRecRef;
   fStatCandNClonesRef  += nClonesRef;
 
-  if( nMCAll ==0 ) return;
-
-  if( PrintFlag ){
-    cout<<"Track candidate performance for slice "<<iSlice<<" : "<<endl;
-    cout<<" N tracks : "
-       <<nMCAll<<" mc all, "
-       <<nMCRef<<" mc ref, "
-       <<nRecTot<<" rec total, "
-       <<nRecAll<<" rec all, "
-       <<nClonesAll<<" clones all, "
-       <<nRecRef<<" rec ref, "
-       <<nClonesRef<<" clones ref, "
-       <<nRecOut<<" out, "
-       <<nGhost<<" ghost"<<endl;
-  
-    Int_t nRecExtr = nRecAll - nRecRef;
-    Int_t nMCExtr = nMCAll - nMCRef;
-    Int_t nClonesExtr = nClonesAll - nClonesRef;
-  
-    Double_t dRecTot = (nRecTot>0 ) ? nRecTot :1;
-    Double_t dMCAll = (nMCAll>0 ) ? nMCAll :1;
-    Double_t dMCRef = (nMCRef>0 ) ? nMCRef :1;
-    Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1;
-    Double_t dRecAll = (nRecAll+nClonesAll>0 ) ? nRecAll+nClonesAll :1;
-    Double_t dRecRef = (nRecRef+nClonesRef>0 ) ? nRecRef+nClonesRef :1;
-    Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1;
-    
-    cout<<" EffRef = ";
-    if( nMCRef>0 ) cout<<nRecRef/dMCRef; else cout<<"_";
-    cout<<", CloneRef = ";
-    if( nRecRef >0 ) cout << nClonesRef/dRecRef; else cout<<"_";
-    cout<<endl;
-    cout<<" EffExtra = ";
-    if( nMCExtr>0 ) cout << nRecExtr/dMCExtr; else cout<<"_";
-    cout <<", CloneExtra = ";
-    if( nRecExtr>0 ) cout << nClonesExtr/dRecExtr; else cout<<"_";
-    cout<<endl;
-    cout<<" EffAll = ";
-    if( nMCAll>0 ) cout<<nRecAll/dMCAll; else cout<<"_";
-    cout <<", CloneAll = ";
-    if( nRecAll>0 ) cout << nClonesAll/dRecAll; else cout<<"_";
-    cout <<endl;
-    cout<<" Out = ";
-    if( nRecTot>0 ) cout <<nRecOut/dRecTot; else cout<<"_";
-    cout <<", Ghost = ";
-    if( nRecTot>0 ) cout<<nGhost/dRecTot; else cout<<"_";
-    cout<<endl;
+  if ( nMCAll == 0 ) return;
+
+  if ( PrintFlag ) {
+    cout << "Track candidate performance for slice " << iSlice << " : " << endl;
+    cout << " N tracks : "
+         << nMCAll << " mc all, "
+         << nMCRef << " mc ref, "
+         << nRecTot << " rec total, "
+         << nRecAll << " rec all, "
+         << nClonesAll << " clones all, "
+         << nRecRef << " rec ref, "
+         << nClonesRef << " clones ref, "
+         << nRecOut << " out, "
+         << nGhost << " ghost" << endl;
+
+    int nRecExtr = nRecAll - nRecRef;
+    int nMCExtr = nMCAll - nMCRef;
+    int nClonesExtr = nClonesAll - nClonesRef;
+
+    double dRecTot = ( nRecTot > 0 ) ? nRecTot : 1;
+    double dMCAll = ( nMCAll > 0 ) ? nMCAll : 1;
+    double dMCRef = ( nMCRef > 0 ) ? nMCRef : 1;
+    double dMCExtr = ( nMCExtr > 0 ) ? nMCExtr : 1;
+    double dRecAll = ( nRecAll + nClonesAll > 0 ) ? nRecAll + nClonesAll : 1;
+    double dRecRef = ( nRecRef + nClonesRef > 0 ) ? nRecRef + nClonesRef : 1;
+    double dRecExtr = ( nRecExtr + nClonesExtr > 0 ) ? nRecExtr + nClonesExtr : 1;
+
+    cout << " EffRef = ";
+    if ( nMCRef > 0 ) cout << nRecRef / dMCRef; else cout << "_";
+    cout << ", CloneRef = ";
+    if ( nRecRef > 0 ) cout << nClonesRef / dRecRef; else cout << "_";
+    cout << endl;
+    cout << " EffExtra = ";
+    if ( nMCExtr > 0 ) cout << nRecExtr / dMCExtr; else cout << "_";
+    cout << ", CloneExtra = ";
+    if ( nRecExtr > 0 ) cout << nClonesExtr / dRecExtr; else cout << "_";
+    cout << endl;
+    cout << " EffAll = ";
+    if ( nMCAll > 0 ) cout << nRecAll / dMCAll; else cout << "_";
+    cout << ", CloneAll = ";
+    if ( nRecAll > 0 ) cout << nClonesAll / dRecAll; else cout << "_";
+    cout << endl;
+    cout << " Out = ";
+    if ( nRecTot > 0 ) cout << nRecOut / dRecTot; else cout << "_";
+    cout << ", Ghost = ";
+    if ( nRecTot > 0 ) cout << nGhost / dRecTot; else cout << "_";
+    cout << endl;
   }
 }
 
 
 
-void AliHLTTPCCAPerformance::SlicePerformance( Int_t iSlice, Bool_t PrintFlag )
-{ 
+void AliHLTTPCCAPerformance::SlicePerformance( int iSlice, bool PrintFlag )
+{
   //* calculate slice tracker performance
-  if( !fTracker ) return;
-  
-  Int_t nRecTot = 0, nGhost=0, nRecOut=0;
-  Int_t nMCAll = 0, nRecAll=0, nClonesAll=0;
-  Int_t nMCRef = 0, nRecRef=0, nClonesRef=0;
+  if ( !fTracker ) return;
+
+  int nRecTot = 0, nGhost = 0, nRecOut = 0;
+  int nMCAll = 0, nRecAll = 0, nClonesAll = 0;
+  int nMCRef = 0, nRecRef = 0, nClonesRef = 0;
   AliHLTTPCCATracker &slice = fTracker->Slices()[iSlice];
 
-  Int_t firstSliceHit = 0;
-  for( ; firstSliceHit<fTracker->NHits(); firstSliceHit++){
-    if( fTracker->Hits()[firstSliceHit].ISlice()==iSlice ) break;
+  int firstSliceHit = 0;
+  for ( ; firstSliceHit < fTracker->NHits(); firstSliceHit++ ) {
+    if ( fTracker->Hits()[firstSliceHit].ISlice() == iSlice ) break;
   }
-  Int_t endSliceHit = firstSliceHit;  
+  int endSliceHit = firstSliceHit;
 
-  for( ; endSliceHit<fTracker->NHits(); endSliceHit++){
-    if( fTracker->Hits()[endSliceHit].ISlice()!=iSlice ) break;
+  for ( ; endSliceHit < fTracker->NHits(); endSliceHit++ ) {
+    if ( fTracker->Hits()[endSliceHit].ISlice() != iSlice ) break;
   }
-    
+
 
   // Select reconstructable MC tracks
 
   {
-    for (Int_t imc=0; imc<fNMCTracks; imc++) fMCTracks[imc].SetNHits( 0 );
-        
-    for( Int_t ih=firstSliceHit; ih<endSliceHit; ih++){
-      Int_t id = fTracker->Hits()[ih].ID();
-      if( id<0 || id>fNHits ) break;
+    for ( int imc = 0; imc < fNMCTracks; imc++ ) fMCTracks[imc].SetNHits( 0 );
+
+    for ( int ih = firstSliceHit; ih < endSliceHit; ih++ ) {
+      int id = fTracker->Hits()[ih].ID();
+      if ( id < 0 || id > fNHits ) break;
       AliHLTTPCCAHitLabel &l = fHitLabels[id];
-      if( l.fLab[0]>=0 ) fMCTracks[l.fLab[0]].SetNHits(fMCTracks[l.fLab[0]].NHits()+1);
-      if( l.fLab[1]>=0 ) fMCTracks[l.fLab[1]].SetNHits(fMCTracks[l.fLab[1]].NHits()+1);
-      if( l.fLab[2]>=0 ) fMCTracks[l.fLab[2]].SetNHits(fMCTracks[l.fLab[2]].NHits()+1);
+      if ( l.fLab[0] >= 0 ) fMCTracks[l.fLab[0]].SetNHits( fMCTracks[l.fLab[0]].NHits() + 1 );
+      if ( l.fLab[1] >= 0 ) fMCTracks[l.fLab[1]].SetNHits( fMCTracks[l.fLab[1]].NHits() + 1 );
+      if ( l.fLab[2] >= 0 ) fMCTracks[l.fLab[2]].SetNHits( fMCTracks[l.fLab[2]].NHits() + 1 );
     }
-    
-    for (Int_t imc=0; imc<fNMCTracks; imc++) {         
+
+    for ( int imc = 0; imc < fNMCTracks; imc++ ) {
       AliHLTTPCCAMCTrack &mc = fMCTracks[imc];
       mc.SetSet( 0 );
       mc.SetNReconstructed( 0 );
       mc.SetNTurns( 1 );
-      if( mc.NHits() >=  30 && mc.P()>=.05 ){
-       mc.SetSet(1);
-       nMCAll++;
-       if( mc.NHits() >=  30 && mc.P()>=1. ){
-         mc.SetSet( 2 );
-         nMCRef++;
-       }
+      if ( mc.NHits() >=  30 && mc.P() >= .05 ) {
+        mc.SetSet( 1 );
+        nMCAll++;
+        if ( mc.NHits() >=  30 && mc.P() >= 1. ) {
+          mc.SetSet( 2 );
+          nMCRef++;
+        }
       }
     }
   }
 
-  Int_t traN = *slice.NOutTracks();
-  Int_t *traLabels = 0; 
-  Double_t *traPurity = 0;
-  traLabels = new Int_t[traN];
-  traPurity = new Double_t[traN];
+  int traN = *slice.NOutTracks();
+  int *traLabels = 0;
+  double *traPurity = 0;
+  traLabels = new int[traN];
+  traPurity = new double[traN];
   {
-    for (Int_t itr=0; itr<traN; itr++) {
-      traLabels[itr]=-1;
-      traPurity[itr]= 0;
+    for ( int itr = 0; itr < traN; itr++ ) {
+      traLabels[itr] = -1;
+      traPurity[itr] = 0;
       AliHLTTPCCAOutTrack &tCA = slice.OutTracks()[itr];
-      Int_t nhits = tCA.NHits();
-      Int_t *lb = new Int_t[nhits*3];
-      Int_t nla=0;
+      int nhits = tCA.NHits();
+      int *lb = new int[nhits*3];
+      int nla = 0;
       //cout<<"\nHit labels:"<<endl;
-      for( Int_t ihit=0; ihit<nhits; ihit++){
-       Int_t index = firstSliceHit + slice.OutTrackHits()[tCA.FirstHitRef()+ihit];
-       AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
-       //cout<<l.fLab[0]<<" "<<l.fLab[1]<<" "<<l.fLab[2]<<endl;
-       if(l.fLab[0]>=0 ) lb[nla++]= l.fLab[0];
-       if(l.fLab[1]>=0 ) lb[nla++]= l.fLab[1];
-       if(l.fLab[2]>=0 ) lb[nla++]= l.fLab[2];
+      for ( int ihit = 0; ihit < nhits; ihit++ ) {
+        int index = firstSliceHit + slice.OutTrackHits()[tCA.FirstHitRef()+ihit];
+        AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
+        //cout<<l.fLab[0]<<" "<<l.fLab[1]<<" "<<l.fLab[2]<<endl;
+        if ( l.fLab[0] >= 0 ) lb[nla++] = l.fLab[0];
+        if ( l.fLab[1] >= 0 ) lb[nla++] = l.fLab[1];
+        if ( l.fLab[2] >= 0 ) lb[nla++] = l.fLab[2];
       }
-      sort( lb, lb+nla );
-      Int_t labmax = -1, labcur=-1, lmax = 0, lcurr=0;
-      for( Int_t i=0; i<nla; i++ ){
-       if( lb[i]!=labcur ){
-         if( labcur>=0 && lmax<lcurr ){
-           lmax = lcurr;
-           labmax = labcur;
-         }
-         labcur = lb[i];
-         lcurr = 0;
-       }
-       lcurr++;
+      sort( lb, lb + nla );
+      int labmax = -1, labcur = -1, lmax = 0, lcurr = 0;
+      for ( int i = 0; i < nla; i++ ) {
+        if ( lb[i] != labcur ) {
+          if ( labcur >= 0 && lmax < lcurr ) {
+            lmax = lcurr;
+            labmax = labcur;
+          }
+          labcur = lb[i];
+          lcurr = 0;
+        }
+        lcurr++;
       }
-      if( labcur>=0 && lmax<lcurr ){
-       lmax = lcurr;
-       labmax = labcur;
+      if ( labcur >= 0 && lmax < lcurr ) {
+        lmax = lcurr;
+        labmax = labcur;
       }
       lmax = 0;
-      for( Int_t ihit=0; ihit<nhits; ihit++){
-       Int_t index = firstSliceHit + slice.OutTrackHits()[tCA.FirstHitRef()+ihit];
-       AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
-       if( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax 
-           ) lmax++;
+      for ( int ihit = 0; ihit < nhits; ihit++ ) {
+        int index = firstSliceHit + slice.OutTrackHits()[tCA.FirstHitRef()+ihit];
+        AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
+        if ( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax
+           ) lmax++;
       }
       traLabels[itr] = labmax;
-      traPurity[itr] = ( (nhits>0) ?double(lmax)/double(nhits) :0 );
+      traPurity[itr] = ( ( nhits > 0 ) ? double( lmax ) / double( nhits ) : 0 );
       //cout<<"perf track "<<itr<<": "<<nhits<<" "<<labmax<<" "<<traPurity[itr]<<endl;
-      if( lb ) delete[] lb;
+      if ( lb ) delete[] lb;
     }
   }
 
-  nRecTot+= traN;
+  nRecTot += traN;
 
-  for(Int_t itr=0; itr<traN; itr++){      
-    if( traPurity[itr]<.9 || traLabels[itr]<0 || traLabels[itr]>=fNMCTracks){
+  for ( int itr = 0; itr < traN; itr++ ) {
+    if ( traPurity[itr] < .9 || traLabels[itr] < 0 || traLabels[itr] >= fNMCTracks ) {
       nGhost++;
       continue;
     }
 
-    AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];        
-    mc.SetNReconstructed(mc.NReconstructed()+1);
-    if( mc.Set()== 0 ) nRecOut++;
-    else{
-      if( mc.NReconstructed()==1 ) nRecAll++;
-      else if(mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
-      if( mc.Set()==2 ){
-       if( mc.NReconstructed()==1 ) nRecRef++;
-       else if(mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
+    AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];
+    mc.SetNReconstructed( mc.NReconstructed() + 1 );
+    if ( mc.Set() == 0 ) nRecOut++;
+    else {
+      if ( mc.NReconstructed() == 1 ) nRecAll++;
+      else if ( mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
+      if ( mc.Set() == 2 ) {
+        if ( mc.NReconstructed() == 1 ) nRecRef++;
+        else if ( mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
       }
-    }      
+    }
   }
 
-  for (Int_t ipart=0; ipart<fNMCTracks; ipart++) {             
+  for ( int ipart = 0; ipart < fNMCTracks; ipart++ ) {
     AliHLTTPCCAMCTrack &mc = fMCTracks[ipart];
-    if( mc.Set()>0 ) fhEffVsP->Fill(mc.P(), ( mc.NReconstructed()>0 ?1 :0));
-  }  
+    if ( mc.Set() > 0 ) fhEffVsP->Fill( mc.P(), ( mc.NReconstructed() > 0 ? 1 : 0 ) );
+  }
 
-  if( traLabels ) delete[] traLabels;
-  if( traPurity ) delete[] traPurity;
+  if ( traLabels ) delete[] traLabels;
+  if ( traPurity ) delete[] traPurity;
 
   fStatNRecTot += nRecTot;
   fStatNRecOut += nRecOut;
@@ -1276,62 +1276,62 @@ void AliHLTTPCCAPerformance::SlicePerformance( Int_t iSlice, Bool_t PrintFlag )
   fStatNRecRef  += nRecRef;
   fStatNClonesRef  += nClonesRef;
 
-  if( nMCAll ==0 ) return;
-
-  if( PrintFlag ){
-    cout<<"Performance for slice "<<iSlice<<" : "<<endl;
-    cout<<" N tracks : "
-       <<nMCAll<<" mc all, "
-       <<nMCRef<<" mc ref, "
-       <<nRecTot<<" rec total, "
-       <<nRecAll<<" rec all, "
-       <<nClonesAll<<" clones all, "
-       <<nRecRef<<" rec ref, "
-       <<nClonesRef<<" clones ref, "
-       <<nRecOut<<" out, "
-       <<nGhost<<" ghost"<<endl;
-  
-    Int_t nRecExtr = nRecAll - nRecRef;
-    Int_t nMCExtr = nMCAll - nMCRef;
-    Int_t nClonesExtr = nClonesAll - nClonesRef;
-  
-    Double_t dRecTot = (nRecTot>0 ) ? nRecTot :1;
-    Double_t dMCAll = (nMCAll>0 ) ? nMCAll :1;
-    Double_t dMCRef = (nMCRef>0 ) ? nMCRef :1;
-    Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1;
-    Double_t dRecAll = (nRecAll+nClonesAll>0 ) ? nRecAll+nClonesAll :1;
-    Double_t dRecRef = (nRecRef+nClonesRef>0 ) ? nRecRef+nClonesRef :1;
-    Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1;
-    
-    cout<<" EffRef = ";
-    if( nMCRef>0 ) cout<<nRecRef/dMCRef; else cout<<"_";
-    cout<<", CloneRef = ";
-    if( nRecRef >0 ) cout << nClonesRef/dRecRef; else cout<<"_";
-    cout<<endl;
-    cout<<" EffExtra = ";
-    if( nMCExtr>0 ) cout << nRecExtr/dMCExtr; else cout<<"_";
-    cout <<", CloneExtra = ";
-    if( nRecExtr>0 ) cout << nClonesExtr/dRecExtr; else cout<<"_";
-    cout<<endl;
-    cout<<" EffAll = ";
-    if( nMCAll>0 ) cout<<nRecAll/dMCAll; else cout<<"_";
-    cout <<", CloneAll = ";
-    if( nRecAll>0 ) cout << nClonesAll/dRecAll; else cout<<"_";
-    cout <<endl;
-    cout<<" Out = ";
-    if( nRecTot>0 ) cout <<nRecOut/dRecTot; else cout<<"_";
-    cout <<", Ghost = ";
-    if( nRecTot>0 ) cout<<nGhost/dRecTot; else cout<<"_";
-    cout<<endl;
+  if ( nMCAll == 0 ) return;
+
+  if ( PrintFlag ) {
+    cout << "Performance for slice " << iSlice << " : " << endl;
+    cout << " N tracks : "
+         << nMCAll << " mc all, "
+         << nMCRef << " mc ref, "
+         << nRecTot << " rec total, "
+         << nRecAll << " rec all, "
+         << nClonesAll << " clones all, "
+         << nRecRef << " rec ref, "
+         << nClonesRef << " clones ref, "
+         << nRecOut << " out, "
+         << nGhost << " ghost" << endl;
+
+    int nRecExtr = nRecAll - nRecRef;
+    int nMCExtr = nMCAll - nMCRef;
+    int nClonesExtr = nClonesAll - nClonesRef;
+
+    double dRecTot = ( nRecTot > 0 ) ? nRecTot : 1;
+    double dMCAll = ( nMCAll > 0 ) ? nMCAll : 1;
+    double dMCRef = ( nMCRef > 0 ) ? nMCRef : 1;
+    double dMCExtr = ( nMCExtr > 0 ) ? nMCExtr : 1;
+    double dRecAll = ( nRecAll + nClonesAll > 0 ) ? nRecAll + nClonesAll : 1;
+    double dRecRef = ( nRecRef + nClonesRef > 0 ) ? nRecRef + nClonesRef : 1;
+    double dRecExtr = ( nRecExtr + nClonesExtr > 0 ) ? nRecExtr + nClonesExtr : 1;
+
+    cout << " EffRef = ";
+    if ( nMCRef > 0 ) cout << nRecRef / dMCRef; else cout << "_";
+    cout << ", CloneRef = ";
+    if ( nRecRef > 0 ) cout << nClonesRef / dRecRef; else cout << "_";
+    cout << endl;
+    cout << " EffExtra = ";
+    if ( nMCExtr > 0 ) cout << nRecExtr / dMCExtr; else cout << "_";
+    cout << ", CloneExtra = ";
+    if ( nRecExtr > 0 ) cout << nClonesExtr / dRecExtr; else cout << "_";
+    cout << endl;
+    cout << " EffAll = ";
+    if ( nMCAll > 0 ) cout << nRecAll / dMCAll; else cout << "_";
+    cout << ", CloneAll = ";
+    if ( nRecAll > 0 ) cout << nClonesAll / dRecAll; else cout << "_";
+    cout << endl;
+    cout << " Out = ";
+    if ( nRecTot > 0 ) cout << nRecOut / dRecTot; else cout << "_";
+    cout << ", Ghost = ";
+    if ( nRecTot > 0 ) cout << nGhost / dRecTot; else cout << "_";
+    cout << endl;
   }
 }
 
 
 void AliHLTTPCCAPerformance::Performance( fstream *StatFile )
-{ 
-  // main routine for performance calculation  
+{
+  // main routine for performance calculation
   //SG!!!
-  /*  
+  /*
   fStatNEvents=0;
     fStatNRecTot=0;
     fStatNRecOut=0;
@@ -1343,528 +1343,528 @@ void AliHLTTPCCAPerformance::Performance( fstream *StatFile )
     fStatNRecRef=0;
     fStatNClonesRef=0;
   */
-  fStatNEvents++;  
-  for( Int_t islice=0; islice<fTracker->NSlices(); islice++){ 
+  fStatNEvents++;
+  for ( int islice = 0; islice < fTracker->NSlices(); islice++ ) {
     //SliceTrackletPerformance( islice,0 );
     SliceTrackCandPerformance( islice, 0 );
-    SlicePerformance(islice,0);
+    SlicePerformance( islice, 0 );
   }
 
 
   // global tracker performance
   {
-      if( !fTracker ) return;
+    if ( !fTracker ) return;
 
-      Int_t nRecTot = 0, nGhost=0, nRecOut=0;
-      Int_t nMCAll = 0, nRecAll=0, nClonesAll=0;
-      Int_t nMCRef = 0, nRecRef=0, nClonesRef=0;
+    int nRecTot = 0, nGhost = 0, nRecOut = 0;
+    int nMCAll = 0, nRecAll = 0, nClonesAll = 0;
+    int nMCRef = 0, nRecRef = 0, nClonesRef = 0;
 
-      // Select reconstructable MC tracks
-   
-      {
-       for (Int_t imc=0; imc<fNMCTracks; imc++) fMCTracks[imc].SetNHits( 0 );
-          
-       for( Int_t ih=0; ih<fNHits; ih++){
-         AliHLTTPCCAHitLabel &l = fHitLabels[ih];
-         if( l.fLab[0]>=0 ) fMCTracks[l.fLab[0]].SetNHits(fMCTracks[l.fLab[0]].NHits()+1);
-         if( l.fLab[1]>=0 ) fMCTracks[l.fLab[1]].SetNHits(fMCTracks[l.fLab[1]].NHits()+1);
-         if( l.fLab[2]>=0 ) fMCTracks[l.fLab[2]].SetNHits(fMCTracks[l.fLab[2]].NHits()+1);
-       }
-    
-       for (Int_t imc=0; imc<fNMCTracks; imc++) {              
-         AliHLTTPCCAMCTrack &mc = fMCTracks[imc];
-         mc.SetSet( 0 );
-         mc.SetNReconstructed( 0 );
-         mc.SetNTurns( 1 );
-         if( mc.NHits() >=  50 && mc.P()>=.05 ){
-           mc.SetSet(1);
-           nMCAll++;
-           if( mc.P()>=1. ){
-             mc.SetSet(2);
-             nMCRef++;
-           }
-         }
-       }
+    // Select reconstructable MC tracks
+
+    {
+      for ( int imc = 0; imc < fNMCTracks; imc++ ) fMCTracks[imc].SetNHits( 0 );
+
+      for ( int ih = 0; ih < fNHits; ih++ ) {
+        AliHLTTPCCAHitLabel &l = fHitLabels[ih];
+        if ( l.fLab[0] >= 0 ) fMCTracks[l.fLab[0]].SetNHits( fMCTracks[l.fLab[0]].NHits() + 1 );
+        if ( l.fLab[1] >= 0 ) fMCTracks[l.fLab[1]].SetNHits( fMCTracks[l.fLab[1]].NHits() + 1 );
+        if ( l.fLab[2] >= 0 ) fMCTracks[l.fLab[2]].SetNHits( fMCTracks[l.fLab[2]].NHits() + 1 );
       }
 
-      Int_t traN = fTracker->NTracks();
-      Int_t *traLabels = 0;
-      Double_t *traPurity = 0;
-      traLabels = new Int_t[traN];
-      traPurity = new Double_t[traN];
-      {
-       for (Int_t itr=0; itr<traN; itr++) {
-         traLabels[itr]=-1;
-         traPurity[itr]= 0;
-         AliHLTTPCCAGBTrack &tCA = fTracker->Tracks()[itr];
-         Int_t nhits = tCA.NHits();
-         Int_t *lb = new Int_t[nhits*3];
-         Int_t nla=0;
-         for( Int_t ihit=0; ihit<nhits; ihit++){
-           Int_t index = fTracker->TrackHits()[tCA.FirstHitRef()+ihit];
-           AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
-           if(l.fLab[0]>=0 ) lb[nla++]= l.fLab[0];
-           if(l.fLab[1]>=0 ) lb[nla++]= l.fLab[1];
-           if(l.fLab[2]>=0 ) lb[nla++]= l.fLab[2];
-         }
-         sort( lb, lb+nla );
-         Int_t labmax = -1, labcur=-1, lmax = 0, lcurr=0;
-         for( Int_t i=0; i<nla; i++ ){
-           if( lb[i]!=labcur ){
-             if( labcur>=0 && lmax<lcurr ){
-               lmax = lcurr;
-               labmax = labcur;
-             }
-             labcur = lb[i];
-             lcurr = 0;
-           }
-           lcurr++;
-         }
-         if( labcur>=0 && lmax<lcurr ){
-           lmax = lcurr;
-           labmax = labcur;
-         }
-         lmax = 0;
-         for( Int_t ihit=0; ihit<nhits; ihit++){
-           Int_t index = fTracker->TrackHits()[tCA.FirstHitRef()+ihit];
-           AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
-           if( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax 
-               ) lmax++;
-         }
-         traLabels[itr] = labmax;
-         traPurity[itr] = ( (nhits>0) ?double(lmax)/double(nhits) :0 );
-         if( lb ) delete[] lb;
-       }
+      for ( int imc = 0; imc < fNMCTracks; imc++ ) {
+        AliHLTTPCCAMCTrack &mc = fMCTracks[imc];
+        mc.SetSet( 0 );
+        mc.SetNReconstructed( 0 );
+        mc.SetNTurns( 1 );
+        if ( mc.NHits() >=  50 && mc.P() >= .05 ) {
+          mc.SetSet( 1 );
+          nMCAll++;
+          if ( mc.P() >= 1. ) {
+            mc.SetSet( 2 );
+            nMCRef++;
+          }
+        }
       }
+    }
+
+    int traN = fTracker->NTracks();
+    int *traLabels = 0;
+    double *traPurity = 0;
+    traLabels = new int[traN];
+    traPurity = new double[traN];
+    {
+      for ( int itr = 0; itr < traN; itr++ ) {
+        traLabels[itr] = -1;
+        traPurity[itr] = 0;
+        AliHLTTPCCAGBTrack &tCA = fTracker->Tracks()[itr];
+        int nhits = tCA.NHits();
+        int *lb = new int[nhits*3];
+        int nla = 0;
+        for ( int ihit = 0; ihit < nhits; ihit++ ) {
+          int index = fTracker->TrackHits()[tCA.FirstHitRef()+ihit];
+          AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
+          if ( l.fLab[0] >= 0 ) lb[nla++] = l.fLab[0];
+          if ( l.fLab[1] >= 0 ) lb[nla++] = l.fLab[1];
+          if ( l.fLab[2] >= 0 ) lb[nla++] = l.fLab[2];
+        }
+        sort( lb, lb + nla );
+        int labmax = -1, labcur = -1, lmax = 0, lcurr = 0;
+        for ( int i = 0; i < nla; i++ ) {
+          if ( lb[i] != labcur ) {
+            if ( labcur >= 0 && lmax < lcurr ) {
+              lmax = lcurr;
+              labmax = labcur;
+            }
+            labcur = lb[i];
+            lcurr = 0;
+          }
+          lcurr++;
+        }
+        if ( labcur >= 0 && lmax < lcurr ) {
+          lmax = lcurr;
+          labmax = labcur;
+        }
+        lmax = 0;
+        for ( int ihit = 0; ihit < nhits; ihit++ ) {
+          int index = fTracker->TrackHits()[tCA.FirstHitRef()+ihit];
+          AliHLTTPCCAHitLabel &l = fHitLabels[fTracker->Hits()[index].ID()];
+          if ( l.fLab[0] == labmax || l.fLab[1] == labmax || l.fLab[2] == labmax
+             ) lmax++;
+        }
+        traLabels[itr] = labmax;
+        traPurity[itr] = ( ( nhits > 0 ) ? double( lmax ) / double( nhits ) : 0 );
+        if ( lb ) delete[] lb;
+      }
+    }
 
-      nRecTot+= traN;
-      for(Int_t itr=0; itr<traN; itr++){      
-       if( traPurity[itr]<.9 || traLabels[itr]<0 || traLabels[itr]>=fNMCTracks){
-         nGhost++;
-         continue;
-       }
-       AliHLTTPCCAGBTrack &tCA = fTracker->Tracks()[itr];
-       AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];     
-       
-       mc.SetNReconstructed(mc.NReconstructed()+1);
-       if( mc.Set()== 0 ) nRecOut++;
-       else{
-         if( mc.NReconstructed()==1 ) nRecAll++;
-         else if(mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
-         if( mc.Set()==2 ){
-           if( mc.NReconstructed()==1 ) nRecRef++;
-           else if(mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
-           fhTrackLengthRef->Fill( tCA.NHits()/((Double_t) mc.NHits()));
-         }
-       }      
-
-       // track resolutions
-       while( mc.Set()==2 && TMath::Abs(mc.TPCPar()[0]) + TMath::Abs(mc.TPCPar()[1])>1 ){
-         if( traPurity[itr]<.90 ) break;
-         AliHLTTPCCAGBTrack &t = fTracker->Tracks()[itr];
-         AliHLTTPCCATrackParam p = t.Param();
-         Double_t cosA = TMath::Cos( t.Alpha() );
-         Double_t sinA = TMath::Sin( t.Alpha() );
-         Double_t mcX =  mc.TPCPar()[0]*cosA + mc.TPCPar()[1]*sinA;
-         Double_t mcY = -mc.TPCPar()[0]*sinA + mc.TPCPar()[1]*cosA;
-         Double_t mcZ =  mc.TPCPar()[2];
-         Double_t mcEx =  mc.TPCPar()[3]*cosA + mc.TPCPar()[4]*sinA;
-         Double_t mcEy = -mc.TPCPar()[3]*sinA + mc.TPCPar()[4]*cosA;
-         Double_t mcEz =  mc.TPCPar()[5];
-         Double_t mcEt = TMath::Sqrt(mcEx*mcEx + mcEy*mcEy);
-         if( TMath::Abs(mcEt)<1.e-4 ) break;
-         Double_t mcSinPhi = mcEy / mcEt;
-         Double_t mcDzDs   = mcEz / mcEt;
-         Double_t mcQPt = mc.TPCPar()[6]/ mcEt;
-         if( TMath::Abs(mcQPt)<1.e-4 ) break;
-         Double_t mcPt = 1./TMath::Abs(mcQPt);
-         if( mcPt<1. ) break;
-         if( t.NHits() <  50 ) break;
-         Double_t bz = fTracker->Slices()[0].Param().Bz();
-         if( !p.TransportToXWithMaterial( mcX, bz ) ) break;
-         if( p.GetCosPhi()*mcEx < 0 ){ // change direction
-           mcSinPhi = -mcSinPhi;
-           mcDzDs = -mcDzDs;
-           mcQPt = -mcQPt;
-         }
-         const Double_t kCLight = 0.000299792458;  
-         Double_t k2QPt = 100;
-         if( TMath::Abs(bz)>1.e-4 ) k2QPt= 1./(bz*kCLight);
-         Double_t qPt = p.GetKappa(bz)*k2QPt;
-         Double_t pt = 100;
-         if( TMath::Abs(qPt) >1.e-4 ) pt = 1./TMath::Abs(qPt);
-         
-         fhResY->Fill( p.GetY() - mcY ); 
-         fhResZ->Fill( p.GetZ() - mcZ );
-         fhResSinPhi->Fill( p.GetSinPhi() - mcSinPhi );
-         fhResDzDs->Fill( p.GetDzDs() - mcDzDs );
-         fhResPt->Fill( ( pt - mcPt )/mcPt );
-
-         if( p.GetErr2Y()>0 ) fhPullY->Fill( (p.GetY() - mcY)/TMath::Sqrt(p.GetErr2Y()) ); 
-         if( p.GetErr2Z()>0 ) fhPullZ->Fill( (p.GetZ() - mcZ)/TMath::Sqrt(p.GetErr2Z()) ); 
-
-         if( p.GetErr2SinPhi()>0 ) fhPullSinPhi->Fill( (p.GetSinPhi() - mcSinPhi)/TMath::Sqrt(p.GetErr2SinPhi()) ); 
-         if( p.GetErr2DzDs()>0 ) fhPullDzDs->Fill( (p.DzDs() - mcDzDs)/TMath::Sqrt(p.GetErr2DzDs()) ); 
-         //if( p.GetErr2Kappa()>0 ) fhPullQPt->Fill( (qPt - mcQPt)/TMath::Sqrt(p.GetErr2Kappa()*k2QPt*k2QPt) ); 
-         //fhPullYS->Fill( TMath::Sqrt(fTracker->GetChi2( p.GetY(), p.GetSinPhi(), p.GetCov()[0], p.GetCov()[3], p.GetCov()[5], 
-         //                                 mcY, mcSinPhi, 0,0,0 )));
-  //fhPullZT->Fill( TMath::Sqrt(fTracker->GetChi2( p.GetZ(), p.GetDzDs(), p.GetCov()[2], p.GetCov()[7], p.GetCov()[9], 
-         //      mcZ, mcDzDs, 0,0,0 ) ));
-
-         break;
-       }
+    nRecTot += traN;
+    for ( int itr = 0; itr < traN; itr++ ) {
+      if ( traPurity[itr] < .9 || traLabels[itr] < 0 || traLabels[itr] >= fNMCTracks ) {
+        nGhost++;
+        continue;
       }
+      AliHLTTPCCAGBTrack &tCA = fTracker->Tracks()[itr];
+      AliHLTTPCCAMCTrack &mc = fMCTracks[traLabels[itr]];
+
+      mc.SetNReconstructed( mc.NReconstructed() + 1 );
+      if ( mc.Set() == 0 ) nRecOut++;
+      else {
+        if ( mc.NReconstructed() == 1 ) nRecAll++;
+        else if ( mc.NReconstructed() > mc.NTurns() ) nClonesAll++;
+        if ( mc.Set() == 2 ) {
+          if ( mc.NReconstructed() == 1 ) nRecRef++;
+          else if ( mc.NReconstructed() > mc.NTurns() ) nClonesRef++;
+          fhTrackLengthRef->Fill( tCA.NHits() / ( ( double ) mc.NHits() ) );
+        }
+      }
+
+      // track resolutions
+      while ( mc.Set() == 2 && TMath::Abs( mc.TPCPar()[0] ) + TMath::Abs( mc.TPCPar()[1] ) > 1 ) {
+        if ( traPurity[itr] < .90 ) break;
+        AliHLTTPCCAGBTrack &t = fTracker->Tracks()[itr];
+        AliHLTTPCCATrackParam p = t.Param();
+        double cosA = TMath::Cos( t.Alpha() );
+        double sinA = TMath::Sin( t.Alpha() );
+        double mcX =  mc.TPCPar()[0] * cosA + mc.TPCPar()[1] * sinA;
+        double mcY = -mc.TPCPar()[0] * sinA + mc.TPCPar()[1] * cosA;
+        double mcZ =  mc.TPCPar()[2];
+        double mcEx =  mc.TPCPar()[3] * cosA + mc.TPCPar()[4] * sinA;
+        double mcEy = -mc.TPCPar()[3] * sinA + mc.TPCPar()[4] * cosA;
+        double mcEz =  mc.TPCPar()[5];
+        double mcEt = TMath::Sqrt( mcEx * mcEx + mcEy * mcEy );
+        if ( TMath::Abs( mcEt ) < 1.e-4 ) break;
+        double mcSinPhi = mcEy / mcEt;
+        double mcDzDs   = mcEz / mcEt;
+        double mcQPt = mc.TPCPar()[6] / mcEt;
+        if ( TMath::Abs( mcQPt ) < 1.e-4 ) break;
+        double mcPt = 1. / TMath::Abs( mcQPt );
+        if ( mcPt < 1. ) break;
+        if ( t.NHits() <  50 ) break;
+        double bz = fTracker->Slices()[0].Param().Bz();
+        if ( !p.TransportToXWithMaterial( mcX, bz ) ) break;
+        if ( p.GetCosPhi()*mcEx < 0 ) { // change direction
+          mcSinPhi = -mcSinPhi;
+          mcDzDs = -mcDzDs;
+          mcQPt = -mcQPt;
+        }
+        const double kCLight = 0.000299792458;
+        double k2QPt = 100;
+        if ( TMath::Abs( bz ) > 1.e-4 ) k2QPt = 1. / ( bz * kCLight );
+        double qPt = p.GetKappa( bz ) * k2QPt;
+        double pt = 100;
+        if ( TMath::Abs( qPt ) > 1.e-4 ) pt = 1. / TMath::Abs( qPt );
+
+        fhResY->Fill( p.GetY() - mcY );
+        fhResZ->Fill( p.GetZ() - mcZ );
+        fhResSinPhi->Fill( p.GetSinPhi() - mcSinPhi );
+        fhResDzDs->Fill( p.GetDzDs() - mcDzDs );
+        fhResPt->Fill( ( pt - mcPt ) / mcPt );
+
+        if ( p.GetErr2Y() > 0 ) fhPullY->Fill( ( p.GetY() - mcY ) / TMath::Sqrt( p.GetErr2Y() ) );
+        if ( p.GetErr2Z() > 0 ) fhPullZ->Fill( ( p.GetZ() - mcZ ) / TMath::Sqrt( p.GetErr2Z() ) );
+
+        if ( p.GetErr2SinPhi() > 0 ) fhPullSinPhi->Fill( ( p.GetSinPhi() - mcSinPhi ) / TMath::Sqrt( p.GetErr2SinPhi() ) );
+        if ( p.GetErr2DzDs() > 0 ) fhPullDzDs->Fill( ( p.DzDs() - mcDzDs ) / TMath::Sqrt( p.GetErr2DzDs() ) );
+        //if( p.GetErr2Kappa()>0 ) fhPullQPt->Fill( (qPt - mcQPt)/TMath::Sqrt(p.GetErr2Kappa()*k2QPt*k2QPt) );
+        //fhPullYS->Fill( TMath::Sqrt(fTracker->GetChi2( p.GetY(), p.GetSinPhi(), p.GetCov()[0], p.GetCov()[3], p.GetCov()[5],
+        //             mcY, mcSinPhi, 0,0,0 )));
+        //fhPullZT->Fill( TMath::Sqrt(fTracker->GetChi2( p.GetZ(), p.GetDzDs(), p.GetCov()[2], p.GetCov()[7], p.GetCov()[9],
+        //    mcZ, mcDzDs, 0,0,0 ) ));
+
+        break;
+      }
+    }
 
-      for (Int_t ipart=0; ipart<fNMCTracks; ipart++) {         
-       AliHLTTPCCAMCTrack &mc = fMCTracks[ipart];
-       if( mc.Set()>0 ) fhGBEffVsP->Fill(mc.P(), ( mc.NReconstructed()>0 ?1 :0));
-       if( mc.Set()>0 ) fhGBEffVsPt->Fill(mc.Pt(), ( mc.NReconstructed()>0 ?1 :0));
-       if( mc.Set()==2 ){ 
-         const Double_t *p = mc.TPCPar();
-         Double_t r = TMath::Sqrt(p[0]*p[0] + p[1]*p[1]);
-         Double_t cosA = p[0]/r;
-         Double_t sinA = p[1]/r;
-
-
-         Double_t phipos = TMath::Pi()+TMath::ATan2(-p[1], -p[0]);
-         Double_t alpha =  TMath::Pi()*(20*((((Int_t)(phipos*180/TMath::Pi()))/20))+10)/180.;
-         cosA = TMath::Cos(alpha);
-         sinA = TMath::Sin(alpha);
-
-         Double_t mcX =  p[0]*cosA + p[1]*sinA;
-         Double_t mcY = -p[0]*sinA + p[1]*cosA;
-         Double_t mcZ =  p[2];
-         Double_t mcEx =  p[3]*cosA + p[4]*sinA;
-         Double_t mcEy = -p[3]*sinA + p[4]*cosA;
-         Double_t mcEz =  p[5];
-         //Double_t mcEt = TMath::Sqrt(mcEx*mcEx + mcEy*mcEy);
-         Double_t angleY = TMath::ATan2(mcEy, mcEx)*180./TMath::Pi();
-         Double_t angleZ = TMath::ATan2(mcEz, mcEx)*180./TMath::Pi();
-
-         if( mc.NReconstructed()>0 ){
-           fhRefRecoX->Fill(mcX);
-           fhRefRecoY->Fill(mcY);
-           fhRefRecoZ->Fill(mcZ);
-           fhRefRecoP->Fill(mc.P());
-           fhRefRecoPt->Fill(mc.Pt());
-           fhRefRecoAngleY->Fill(angleY);
-           fhRefRecoAngleZ->Fill(angleZ);
-           fhRefRecoNHits->Fill(mc.NHits());
-         } else {
-           fhRefNotRecoX->Fill(mcX);
-           fhRefNotRecoY->Fill(mcY);
-           fhRefNotRecoZ->Fill(mcZ);
-           fhRefNotRecoP->Fill(mc.P());
-           fhRefNotRecoPt->Fill(mc.Pt());
-           fhRefNotRecoAngleY->Fill(angleY);
-           fhRefNotRecoAngleZ->Fill(angleZ);
-           fhRefNotRecoNHits->Fill(mc.NHits());
-         }
-       }
+    for ( int ipart = 0; ipart < fNMCTracks; ipart++ ) {
+      AliHLTTPCCAMCTrack &mc = fMCTracks[ipart];
+      if ( mc.Set() > 0 ) fhGBEffVsP->Fill( mc.P(), ( mc.NReconstructed() > 0 ? 1 : 0 ) );
+      if ( mc.Set() > 0 ) fhGBEffVsPt->Fill( mc.Pt(), ( mc.NReconstructed() > 0 ? 1 : 0 ) );
+      if ( mc.Set() == 2 ) {
+        const double *p = mc.TPCPar();
+        double r = TMath::Sqrt( p[0] * p[0] + p[1] * p[1] );
+        double cosA = p[0] / r;
+        double sinA = p[1] / r;
+
+
+        double phipos = TMath::Pi() + TMath::ATan2( -p[1], -p[0] );
+        double alpha =  TMath::Pi() * ( 20 * ( ( ( ( int )( phipos * 180 / TMath::Pi() ) ) / 20 ) ) + 10 ) / 180.;
+        cosA = TMath::Cos( alpha );
+        sinA = TMath::Sin( alpha );
+
+        double mcX =  p[0] * cosA + p[1] * sinA;
+        double mcY = -p[0] * sinA + p[1] * cosA;
+        double mcZ =  p[2];
+        double mcEx =  p[3] * cosA + p[4] * sinA;
+        double mcEy = -p[3] * sinA + p[4] * cosA;
+        double mcEz =  p[5];
+        //double mcEt = TMath::Sqrt(mcEx*mcEx + mcEy*mcEy);
+        double angleY = TMath::ATan2( mcEy, mcEx ) * 180. / TMath::Pi();
+        double angleZ = TMath::ATan2( mcEz, mcEx ) * 180. / TMath::Pi();
+
+        if ( mc.NReconstructed() > 0 ) {
+          fhRefRecoX->Fill( mcX );
+          fhRefRecoY->Fill( mcY );
+          fhRefRecoZ->Fill( mcZ );
+          fhRefRecoP->Fill( mc.P() );
+          fhRefRecoPt->Fill( mc.Pt() );
+          fhRefRecoAngleY->Fill( angleY );
+          fhRefRecoAngleZ->Fill( angleZ );
+          fhRefRecoNHits->Fill( mc.NHits() );
+        } else {
+          fhRefNotRecoX->Fill( mcX );
+          fhRefNotRecoY->Fill( mcY );
+          fhRefNotRecoZ->Fill( mcZ );
+          fhRefNotRecoP->Fill( mc.P() );
+          fhRefNotRecoPt->Fill( mc.Pt() );
+          fhRefNotRecoAngleY->Fill( angleY );
+          fhRefNotRecoAngleZ->Fill( angleZ );
+          fhRefNotRecoNHits->Fill( mc.NHits() );
+        }
       }
+    }
 
-      if( traLabels ) delete[] traLabels;
-      if( traPurity ) delete[] traPurity;
-
-      fStatGBNRecTot += nRecTot;
-      fStatGBNRecOut += nRecOut;
-      fStatGBNGhost  += nGhost;
-      fStatGBNMCAll  += nMCAll;
-      fStatGBNRecAll  += nRecAll;
-      fStatGBNClonesAll  += nClonesAll;
-      fStatGBNMCRef  += nMCRef;
-      fStatGBNRecRef  += nRecRef;
-      fStatGBNClonesRef  += nClonesRef;
+    if ( traLabels ) delete[] traLabels;
+    if ( traPurity ) delete[] traPurity;
+
+    fStatGBNRecTot += nRecTot;
+    fStatGBNRecOut += nRecOut;
+    fStatGBNGhost  += nGhost;
+    fStatGBNMCAll  += nMCAll;
+    fStatGBNRecAll  += nRecAll;
+    fStatGBNClonesAll  += nClonesAll;
+    fStatGBNMCRef  += nMCRef;
+    fStatGBNRecRef  += nRecRef;
+    fStatGBNClonesRef  += nClonesRef;
   }
 
-  
+
   // distribution of cluster errors
 
-  {    
-    Int_t nHits = fTracker->NHits();
-    for( Int_t ih=0; ih<nHits; ih++ ){
+  {
+    int nHits = fTracker->NHits();
+    for ( int ih = 0; ih < nHits; ih++ ) {
       AliHLTTPCCAGBHit &hit = fTracker->Hits()[ih];
       AliHLTTPCCAHitLabel &l = fHitLabels[hit.ID()];
-      fhHitErrY->Fill(hit.ErrY());
-      fhHitErrZ->Fill(hit.ErrZ());
-      Int_t nmc=0;
-      for( Int_t il=0; il<3; il++ ) if( l.fLab[il]>=0 ) nmc++;
-      if( nmc==1 ) fhHitShared->Fill(hit.IRow(),0);
-      else if( nmc>1 ) fhHitShared->Fill(hit.IRow(),1);
+      fhHitErrY->Fill( hit.ErrY() );
+      fhHitErrZ->Fill( hit.ErrZ() );
+      int nmc = 0;
+      for ( int il = 0; il < 3; il++ ) if ( l.fLab[il] >= 0 ) nmc++;
+      if ( nmc == 1 ) fhHitShared->Fill( hit.IRow(), 0 );
+      else if ( nmc > 1 ) fhHitShared->Fill( hit.IRow(), 1 );
     }
   }
 
   // cluster pulls
 
-  if( fDoClusterPulls && fNMCPoints>0 ) {
+  if ( fDoClusterPulls && fNMCPoints > 0 ) {
 
     {
-      for (Int_t ipart=0; ipart<fNMCTracks; ipart++) {         
-       AliHLTTPCCAMCTrack &mc = fMCTracks[ipart];
-       mc.SetNMCPoints(0);
+      for ( int ipart = 0; ipart < fNMCTracks; ipart++ ) {
+        AliHLTTPCCAMCTrack &mc = fMCTracks[ipart];
+        mc.SetNMCPoints( 0 );
       }
-      sort(fMCPoints, fMCPoints+fNMCPoints, AliHLTTPCCAMCPoint::Compare );
-      
-      for( Int_t ip=0; ip<fNMCPoints; ip++ ){
-       AliHLTTPCCAMCPoint &p = fMCPoints[ip];
-       AliHLTTPCCAMCTrack &t = fMCTracks[p.TrackID()];
-       if( t.NMCPoints()==0 ) t.SetFirstMCPointID( ip );
-       t.SetNMCPoints(t.NMCPoints()+1);
+      sort( fMCPoints, fMCPoints + fNMCPoints, AliHLTTPCCAMCPoint::Compare );
+
+      for ( int ip = 0; ip < fNMCPoints; ip++ ) {
+        AliHLTTPCCAMCPoint &p = fMCPoints[ip];
+        AliHLTTPCCAMCTrack &t = fMCTracks[p.TrackID()];
+        if ( t.NMCPoints() == 0 ) t.SetFirstMCPointID( ip );
+        t.SetNMCPoints( t.NMCPoints() + 1 );
       }
     }
 
-    for( Int_t ih=0; ih<fNHits; ih++ ){
+    for ( int ih = 0; ih < fNHits; ih++ ) {
 
       AliHLTTPCCAGBHit &hit = fTracker->Hits()[ih];
       AliHLTTPCCAHitLabel &l = fHitLabels[ih];
 
-      if( l.fLab[0]<0 || l.fLab[0]>=fNMCTracks
-         || l.fLab[1]>=0 || l.fLab[2]>=0       ) continue;
+      if ( l.fLab[0] < 0 || l.fLab[0] >= fNMCTracks
+           || l.fLab[1] >= 0 || l.fLab[2] >= 0       ) continue;
 
-      Int_t lab = l.fLab[0];
+      int lab = l.fLab[0];
 
       AliHLTTPCCAMCTrack &track = fMCTracks[lab];
       //if( track.Pt()<1. ) continue;
-      Int_t ip1=-1, ip2=-1;
-      Double_t d1 = 1.e20, d2=1.e20;
-      for( Int_t ip=0; ip<track.NMCPoints(); ip++ ){
+      int ip1 = -1, ip2 = -1;
+      double d1 = 1.e20, d2 = 1.e20;
+      for ( int ip = 0; ip < track.NMCPoints(); ip++ ) {
         AliHLTTPCCAMCPoint &p = fMCPoints[track.FirstMCPointID() + ip];
-        if( p.ISlice() != hit.ISlice() ) continue;        
-        Double_t dx = p.Sx()-hit.X();
-        Double_t dy = p.Sy()-hit.Y();
-        Double_t dz = p.Sz()-hit.Z();
-        Double_t d = dx*dx + dy*dy + dz*dz;
-        if( p.Sx()< hit.X() ){
-         if( d<d1 ){
-           d1 = d;
-           ip1 = ip;
-         }
-       }else{
-         if( d<d2 ){
-           d2 = d;
-           ip2 = ip;
-         }
-       }
+        if ( p.ISlice() != hit.ISlice() ) continue;
+        double dx = p.Sx() - hit.X();
+        double dy = p.Sy() - hit.Y();
+        double dz = p.Sz() - hit.Z();
+        double d = dx * dx + dy * dy + dz * dz;
+        if ( p.Sx() < hit.X() ) {
+          if ( d < d1 ) {
+            d1 = d;
+            ip1 = ip;
+          }
+        } else {
+          if ( d < d2 ) {
+            d2 = d;
+            ip2 = ip;
+          }
+        }
       }
 
-      if( ip1<0 || ip2<0 ) continue;
+      if ( ip1 < 0 || ip2 < 0 ) continue;
 
       AliHLTTPCCAMCPoint &p1 = fMCPoints[track.FirstMCPointID() + ip1];
       AliHLTTPCCAMCPoint &p2 = fMCPoints[track.FirstMCPointID() + ip2];
-      Double_t dx = p2.Sx() - p1.Sx();
-      Double_t dy = p2.Sy() - p1.Sy();
-      Double_t dz = p2.Sz() - p1.Sz();
-      if( TMath::Abs(dx)>1.e-8 && TMath::Abs(p1.Sx()-hit.X())<2. && TMath::Abs(p2.Sx()-hit.X())<2.  ){
-        Double_t sx = hit.X();
-        //Double_t sy = p1.Sy() + dy/dx*(sx-p1.Sx());
-        Double_t sz = p1.Sz() + dz/dx*(sx-p1.Sx());
-       
-       //Float_t errY, errZ;
-       {
-         AliHLTTPCCATrackParam t;
-         t.SetZ( sz );
-         t.SetSinPhi( dy/TMath::Sqrt(dx*dx+dy*dy) );
-         t.SetSignCosPhi( dx );
-         t.SetDzDs( dz/TMath::Sqrt(dx*dx+dy*dy) );
-         //fTracker->GetErrors2(hit,t,errY, errZ );
-         //errY = TMath::Sqrt(errY);
-         //errZ = TMath::Sqrt(errZ);
-       } 
-       /*             
-       fhHitResY->Fill((hit.Y()-sy));
-       fhHitResZ->Fill((hit.Z()-sz));
-       fhHitPullY->Fill((hit.Y()-sy)/errY);
-       fhHitPullZ->Fill((hit.Z()-sz)/errZ);
-       if( track.Pt()>=1. ){
-         fhHitResY1->Fill((hit.Y()-sy));
-         fhHitResZ1->Fill((hit.Z()-sz));
-         fhHitPullY1->Fill((hit.Y()-sy)/errY);
-         fhHitPullZ1->Fill((hit.Z()-sz)/errZ);
-       }
-       */
+      double dx = p2.Sx() - p1.Sx();
+      double dy = p2.Sy() - p1.Sy();
+      double dz = p2.Sz() - p1.Sz();
+      if ( TMath::Abs( dx ) > 1.e-8 && TMath::Abs( p1.Sx() - hit.X() ) < 2. && TMath::Abs( p2.Sx() - hit.X() ) < 2.  ) {
+        double sx = hit.X();
+        //double sy = p1.Sy() + dy/dx*(sx-p1.Sx());
+        double sz = p1.Sz() + dz / dx * ( sx - p1.Sx() );
+
+        //float errY, errZ;
+        {
+          AliHLTTPCCATrackParam t;
+          t.SetZ( sz );
+          t.SetSinPhi( dy / TMath::Sqrt( dx*dx + dy*dy ) );
+          t.SetSignCosPhi( dx );
+          t.SetDzDs( dz / TMath::Sqrt( dx*dx + dy*dy ) );
+          //fTracker->GetErrors2(hit,t,errY, errZ );
+          //errY = TMath::Sqrt(errY);
+          //errZ = TMath::Sqrt(errZ);
+        }
+        /*
+        fhHitResY->Fill((hit.Y()-sy));
+        fhHitResZ->Fill((hit.Z()-sz));
+        fhHitPullY->Fill((hit.Y()-sy)/errY);
+        fhHitPullZ->Fill((hit.Z()-sz)/errZ);
+        if( track.Pt()>=1. ){
+          fhHitResY1->Fill((hit.Y()-sy));
+          fhHitResZ1->Fill((hit.Z()-sz));
+          fhHitPullY1->Fill((hit.Y()-sy)/errY);
+          fhHitPullZ1->Fill((hit.Z()-sz)/errZ);
+        }
+        */
       }
-    }   
+    }
   }
 
   {
-    cout<<"\nSlice Track Seed performance: \n"<<endl;
-    cout<<" N tracks : "
-       <<fStatNMCAll/fStatNEvents<<" mc all, "
-       <<fStatSeedNMCRef/fStatNEvents<<" mc ref, "
-       <<fStatSeedNRecTot/fStatNEvents<<" rec total, "
-       <<fStatSeedNRecAll/fStatNEvents<<" rec all, "
-       <<fStatSeedNClonesAll/fStatNEvents<<" clones all, "
-       <<fStatSeedNRecRef/fStatNEvents<<" rec ref, "
-       <<fStatSeedNClonesRef/fStatNEvents<<" clones ref, "
-       <<fStatSeedNRecOut/fStatNEvents<<" out, "
-       <<fStatSeedNGhost/fStatNEvents<<" ghost"<<endl;
-  
-    Int_t nRecExtr = fStatSeedNRecAll - fStatSeedNRecRef;
-    Int_t nMCExtr = fStatNMCAll - fStatNMCRef;
-    Int_t nClonesExtr = fStatSeedNClonesAll - fStatSeedNClonesRef;
-    
-    Double_t dRecTot = (fStatSeedNRecTot>0 ) ? fStatSeedNRecTot :1;
-    Double_t dMCAll = (fStatNMCAll>0 ) ? fStatNMCAll :1;
-    Double_t dMCRef = (fStatNMCRef>0 ) ? fStatNMCRef :1;
-    Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1;
-    Double_t dRecAll = (fStatSeedNRecAll+fStatSeedNClonesAll>0 ) ? fStatSeedNRecAll+fStatSeedNClonesAll :1;
-    Double_t dRecRef = (fStatSeedNRecRef+fStatSeedNClonesRef>0 ) ? fStatSeedNRecRef+fStatSeedNClonesRef :1;
-    Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1;
-    
-    cout<<" EffRef = "<< fStatSeedNRecRef/dMCRef
-       <<", CloneRef = " << fStatSeedNClonesRef/dRecRef <<endl;
-    cout<<" EffExtra = "<<nRecExtr/dMCExtr
-       <<", CloneExtra = " << nClonesExtr/dRecExtr<<endl;
-    cout<<" EffAll = "<<fStatSeedNRecAll/dMCAll
-       <<", CloneAll = " << fStatSeedNClonesAll/dRecAll<<endl;
-    cout<<" Out = "<<fStatSeedNRecOut/dRecTot
-       <<", Ghost = "<<fStatSeedNGhost/dRecTot<<endl;
+    cout << "\nSlice Track Seed performance: \n" << endl;
+    cout << " N tracks : "
+         << fStatNMCAll / fStatNEvents << " mc all, "
+         << fStatSeedNMCRef / fStatNEvents << " mc ref, "
+         << fStatSeedNRecTot / fStatNEvents << " rec total, "
+         << fStatSeedNRecAll / fStatNEvents << " rec all, "
+         << fStatSeedNClonesAll / fStatNEvents << " clones all, "
+         << fStatSeedNRecRef / fStatNEvents << " rec ref, "
+         << fStatSeedNClonesRef / fStatNEvents << " clones ref, "
+         << fStatSeedNRecOut / fStatNEvents << " out, "
+         << fStatSeedNGhost / fStatNEvents << " ghost" << endl;
+
+    int nRecExtr = fStatSeedNRecAll - fStatSeedNRecRef;
+    int nMCExtr = fStatNMCAll - fStatNMCRef;
+    int nClonesExtr = fStatSeedNClonesAll - fStatSeedNClonesRef;
+
+    double dRecTot = ( fStatSeedNRecTot > 0 ) ? fStatSeedNRecTot : 1;
+    double dMCAll = ( fStatNMCAll > 0 ) ? fStatNMCAll : 1;
+    double dMCRef = ( fStatNMCRef > 0 ) ? fStatNMCRef : 1;
+    double dMCExtr = ( nMCExtr > 0 ) ? nMCExtr : 1;
+    double dRecAll = ( fStatSeedNRecAll + fStatSeedNClonesAll > 0 ) ? fStatSeedNRecAll + fStatSeedNClonesAll : 1;
+    double dRecRef = ( fStatSeedNRecRef + fStatSeedNClonesRef > 0 ) ? fStatSeedNRecRef + fStatSeedNClonesRef : 1;
+    double dRecExtr = ( nRecExtr + nClonesExtr > 0 ) ? nRecExtr + nClonesExtr : 1;
+
+    cout << " EffRef = " << fStatSeedNRecRef / dMCRef
+         << ", CloneRef = " << fStatSeedNClonesRef / dRecRef << endl;
+    cout << " EffExtra = " << nRecExtr / dMCExtr
+         << ", CloneExtra = " << nClonesExtr / dRecExtr << endl;
+    cout << " EffAll = " << fStatSeedNRecAll / dMCAll
+         << ", CloneAll = " << fStatSeedNClonesAll / dRecAll << endl;
+    cout << " Out = " << fStatSeedNRecOut / dRecTot
+         << ", Ghost = " << fStatSeedNGhost / dRecTot << endl;
   }
 
   {
-    cout<<"\nSlice Track candidate performance: \n"<<endl;
-    cout<<" N tracks : "
-       <<fStatNMCAll/fStatNEvents<<" mc all, "
-       <<fStatCandNMCRef/fStatNEvents<<" mc ref, "
-       <<fStatCandNRecTot/fStatNEvents<<" rec total, "
-       <<fStatCandNRecAll/fStatNEvents<<" rec all, "
-       <<fStatCandNClonesAll/fStatNEvents<<" clones all, "
-       <<fStatCandNRecRef/fStatNEvents<<" rec ref, "
-       <<fStatCandNClonesRef/fStatNEvents<<" clones ref, "
-       <<fStatCandNRecOut/fStatNEvents<<" out, "
-       <<fStatCandNGhost/fStatNEvents<<" ghost"<<endl;
-  
-    Int_t nRecExtr = fStatCandNRecAll - fStatCandNRecRef;
-    Int_t nMCExtr = fStatNMCAll - fStatNMCRef;
-    Int_t nClonesExtr = fStatCandNClonesAll - fStatCandNClonesRef;
-    
-    Double_t dRecTot = (fStatCandNRecTot>0 ) ? fStatCandNRecTot :1;
-    Double_t dMCAll = (fStatNMCAll>0 ) ? fStatNMCAll :1;
-    Double_t dMCRef = (fStatNMCRef>0 ) ? fStatNMCRef :1;
-    Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1;
-    Double_t dRecAll = (fStatCandNRecAll+fStatCandNClonesAll>0 ) ? fStatCandNRecAll+fStatCandNClonesAll :1;
-    Double_t dRecRef = (fStatCandNRecRef+fStatCandNClonesRef>0 ) ? fStatCandNRecRef+fStatCandNClonesRef :1;
-    Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1;
-    
-    cout<<" EffRef = "<< fStatCandNRecRef/dMCRef
-       <<", CloneRef = " << fStatCandNClonesRef/dRecRef <<endl;
-    cout<<" EffExtra = "<<nRecExtr/dMCExtr
-       <<", CloneExtra = " << nClonesExtr/dRecExtr<<endl;
-    cout<<" EffAll = "<<fStatCandNRecAll/dMCAll
-       <<", CloneAll = " << fStatCandNClonesAll/dRecAll<<endl;
-    cout<<" Out = "<<fStatCandNRecOut/dRecTot
-       <<", Ghost = "<<fStatCandNGhost/dRecTot<<endl;
+    cout << "\nSlice Track candidate performance: \n" << endl;
+    cout << " N tracks : "
+         << fStatNMCAll / fStatNEvents << " mc all, "
+         << fStatCandNMCRef / fStatNEvents << " mc ref, "
+         << fStatCandNRecTot / fStatNEvents << " rec total, "
+         << fStatCandNRecAll / fStatNEvents << " rec all, "
+         << fStatCandNClonesAll / fStatNEvents << " clones all, "
+         << fStatCandNRecRef / fStatNEvents << " rec ref, "
+         << fStatCandNClonesRef / fStatNEvents << " clones ref, "
+         << fStatCandNRecOut / fStatNEvents << " out, "
+         << fStatCandNGhost / fStatNEvents << " ghost" << endl;
+
+    int nRecExtr = fStatCandNRecAll - fStatCandNRecRef;
+    int nMCExtr = fStatNMCAll - fStatNMCRef;
+    int nClonesExtr = fStatCandNClonesAll - fStatCandNClonesRef;
+
+    double dRecTot = ( fStatCandNRecTot > 0 ) ? fStatCandNRecTot : 1;
+    double dMCAll = ( fStatNMCAll > 0 ) ? fStatNMCAll : 1;
+    double dMCRef = ( fStatNMCRef > 0 ) ? fStatNMCRef : 1;
+    double dMCExtr = ( nMCExtr > 0 ) ? nMCExtr : 1;
+    double dRecAll = ( fStatCandNRecAll + fStatCandNClonesAll > 0 ) ? fStatCandNRecAll + fStatCandNClonesAll : 1;
+    double dRecRef = ( fStatCandNRecRef + fStatCandNClonesRef > 0 ) ? fStatCandNRecRef + fStatCandNClonesRef : 1;
+    double dRecExtr = ( nRecExtr + nClonesExtr > 0 ) ? nRecExtr + nClonesExtr : 1;
+
+    cout << " EffRef = " << fStatCandNRecRef / dMCRef
+         << ", CloneRef = " << fStatCandNClonesRef / dRecRef << endl;
+    cout << " EffExtra = " << nRecExtr / dMCExtr
+         << ", CloneExtra = " << nClonesExtr / dRecExtr << endl;
+    cout << " EffAll = " << fStatCandNRecAll / dMCAll
+         << ", CloneAll = " << fStatCandNClonesAll / dRecAll << endl;
+    cout << " Out = " << fStatCandNRecOut / dRecTot
+         << ", Ghost = " << fStatCandNGhost / dRecTot << endl;
   }
 
   {
-    cout<<"\nSlice tracker performance: \n"<<endl;
-    cout<<" N tracks : "
-       <<fStatNMCAll/fStatNEvents<<" mc all, "
-       <<fStatNMCRef/fStatNEvents<<" mc ref, "
-       <<fStatNRecTot/fStatNEvents<<" rec total, "
-       <<fStatNRecAll/fStatNEvents<<" rec all, "
-       <<fStatNClonesAll/fStatNEvents<<" clones all, "
-       <<fStatNRecRef/fStatNEvents<<" rec ref, "
-       <<fStatNClonesRef/fStatNEvents<<" clones ref, "
-       <<fStatNRecOut/fStatNEvents<<" out, "
-       <<fStatNGhost/fStatNEvents<<" ghost"<<endl;
-  
-    Int_t nRecExtr = fStatNRecAll - fStatNRecRef;
-    Int_t nMCExtr = fStatNMCAll - fStatNMCRef;
-    Int_t nClonesExtr = fStatNClonesAll - fStatNClonesRef;
-    
-    Double_t dRecTot = (fStatNRecTot>0 ) ? fStatNRecTot :1;
-    Double_t dMCAll = (fStatNMCAll>0 ) ? fStatNMCAll :1;
-    Double_t dMCRef = (fStatNMCRef>0 ) ? fStatNMCRef :1;
-    Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1;
-    Double_t dRecAll = (fStatNRecAll+fStatNClonesAll>0 ) ? fStatNRecAll+fStatNClonesAll :1;
-    Double_t dRecRef = (fStatNRecRef+fStatNClonesRef>0 ) ? fStatNRecRef+fStatNClonesRef :1;
-    Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1;
-    
-    cout<<" EffRef = "<< fStatNRecRef/dMCRef
-       <<", CloneRef = " << fStatNClonesRef/dRecRef <<endl;
-    cout<<" EffExtra = "<<nRecExtr/dMCExtr
-       <<", CloneExtra = " << nClonesExtr/dRecExtr<<endl;
-    cout<<" EffAll = "<<fStatNRecAll/dMCAll
-       <<", CloneAll = " << fStatNClonesAll/dRecAll<<endl;
-    cout<<" Out = "<<fStatNRecOut/dRecTot
-       <<", Ghost = "<<fStatNGhost/dRecTot<<endl;
-    cout<<" Time = "<<fTracker->StatTime(0)/fTracker->StatNEvents()*1.e3<<" msec/event "<<endl;
-    cout<<" Local timers = "
-       <<fTracker->StatTime(1)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(2)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(3)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(4)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(5)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(6)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(7)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(8)/fTracker->StatNEvents()*1.e3<<" "
-       <<" msec/event "<<endl;
+    cout << "\nSlice tracker performance: \n" << endl;
+    cout << " N tracks : "
+         << fStatNMCAll / fStatNEvents << " mc all, "
+         << fStatNMCRef / fStatNEvents << " mc ref, "
+         << fStatNRecTot / fStatNEvents << " rec total, "
+         << fStatNRecAll / fStatNEvents << " rec all, "
+         << fStatNClonesAll / fStatNEvents << " clones all, "
+         << fStatNRecRef / fStatNEvents << " rec ref, "
+         << fStatNClonesRef / fStatNEvents << " clones ref, "
+         << fStatNRecOut / fStatNEvents << " out, "
+         << fStatNGhost / fStatNEvents << " ghost" << endl;
+
+    int nRecExtr = fStatNRecAll - fStatNRecRef;
+    int nMCExtr = fStatNMCAll - fStatNMCRef;
+    int nClonesExtr = fStatNClonesAll - fStatNClonesRef;
+
+    double dRecTot = ( fStatNRecTot > 0 ) ? fStatNRecTot : 1;
+    double dMCAll = ( fStatNMCAll > 0 ) ? fStatNMCAll : 1;
+    double dMCRef = ( fStatNMCRef > 0 ) ? fStatNMCRef : 1;
+    double dMCExtr = ( nMCExtr > 0 ) ? nMCExtr : 1;
+    double dRecAll = ( fStatNRecAll + fStatNClonesAll > 0 ) ? fStatNRecAll + fStatNClonesAll : 1;
+    double dRecRef = ( fStatNRecRef + fStatNClonesRef > 0 ) ? fStatNRecRef + fStatNClonesRef : 1;
+    double dRecExtr = ( nRecExtr + nClonesExtr > 0 ) ? nRecExtr + nClonesExtr : 1;
+
+    cout << " EffRef = " << fStatNRecRef / dMCRef
+         << ", CloneRef = " << fStatNClonesRef / dRecRef << endl;
+    cout << " EffExtra = " << nRecExtr / dMCExtr
+         << ", CloneExtra = " << nClonesExtr / dRecExtr << endl;
+    cout << " EffAll = " << fStatNRecAll / dMCAll
+         << ", CloneAll = " << fStatNClonesAll / dRecAll << endl;
+    cout << " Out = " << fStatNRecOut / dRecTot
+         << ", Ghost = " << fStatNGhost / dRecTot << endl;
+    cout << " Time = " << fTracker->StatTime( 0 ) / fTracker->StatNEvents()*1.e3 << " msec/event " << endl;
+    cout << " Local timers = "
+         << fTracker->StatTime( 1 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 2 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 3 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 4 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 5 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 6 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 7 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 8 ) / fTracker->StatNEvents()*1.e3 << " "
+         << " msec/event " << endl;
   }
 
 
   {
-    cout<<"\nGlobal tracker performance for "<<fStatNEvents<<" events: \n"<<endl;
-    cout<<" N tracks : "
-       <<fStatGBNMCAll<<" mc all, "
-       <<fStatGBNMCRef<<" mc ref, "
-       <<fStatGBNRecTot<<" rec total, "
-       <<fStatGBNRecAll<<" rec all, "
-       <<fStatGBNClonesAll<<" clones all, "
-       <<fStatGBNRecRef<<" rec ref, "
-       <<fStatGBNClonesRef<<" clones ref, "
-       <<fStatGBNRecOut<<" out, "
-       <<fStatGBNGhost<<" ghost"<<endl;
-     cout<<" N tracks average : "
-       <<fStatGBNMCAll/fStatNEvents<<" mc all, "
-       <<fStatGBNMCRef/fStatNEvents<<" mc ref, "
-       <<fStatGBNRecTot/fStatNEvents<<" rec total, "
-       <<fStatGBNRecAll/fStatNEvents<<" rec all, "
-       <<fStatGBNClonesAll/fStatNEvents<<" clones all, "
-       <<fStatGBNRecRef/fStatNEvents<<" rec ref, "
-       <<fStatGBNClonesRef/fStatNEvents<<" clones ref, "
-       <<fStatGBNRecOut/fStatNEvents<<" out, "
-       <<fStatGBNGhost/fStatNEvents<<" ghost"<<endl;
-  
-    Int_t nRecExtr = fStatGBNRecAll - fStatGBNRecRef;
-    Int_t nMCExtr = fStatGBNMCAll - fStatGBNMCRef;
-    Int_t nClonesExtr = fStatGBNClonesAll - fStatGBNClonesRef;
-    
-    Double_t dRecTot = (fStatGBNRecTot>0 ) ? fStatGBNRecTot :1;
-    Double_t dMCAll = (fStatGBNMCAll>0 ) ? fStatGBNMCAll :1;
-    Double_t dMCRef = (fStatGBNMCRef>0 ) ? fStatGBNMCRef :1;
-    Double_t dMCExtr = (nMCExtr>0 ) ? nMCExtr :1;
-    Double_t dRecAll = (fStatGBNRecAll+fStatGBNClonesAll>0 ) ? fStatGBNRecAll+fStatGBNClonesAll :1;
-    Double_t dRecRef = (fStatGBNRecRef+fStatGBNClonesRef>0 ) ? fStatGBNRecRef+fStatGBNClonesRef :1;
-    Double_t dRecExtr = (nRecExtr+nClonesExtr>0 ) ? nRecExtr+nClonesExtr :1;
-    
-    cout<<" EffRef = "<< fStatGBNRecRef/dMCRef
-       <<", CloneRef = " << fStatGBNClonesRef/dRecRef <<endl;
-    cout<<" EffExtra = "<<nRecExtr/dMCExtr
-       <<", CloneExtra = " << nClonesExtr/dRecExtr<<endl;
-    cout<<" EffAll = "<<fStatGBNRecAll/dMCAll
-       <<", CloneAll = " << fStatGBNClonesAll/dRecAll<<endl;
-    cout<<" Out = "<<fStatGBNRecOut/dRecTot
-       <<", Ghost = "<<fStatGBNGhost/dRecTot<<endl;
-    cout<<" Time = "<<( fTracker->StatTime(0)+fTracker->StatTime(9) )/fTracker->StatNEvents()*1.e3<<" msec/event "<<endl;
-    cout<<" Local timers: "<<endl;
-    cout<<" slice tracker "<<fTracker->StatTime(0)/fTracker->StatNEvents()*1.e3<<": "
-       <<fTracker->StatTime(1)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(2)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(3)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(4)/fTracker->StatNEvents()*1.e3<<" "
-       <<fTracker->StatTime(5)/fTracker->StatNEvents()*1.e3<<"["
-       <<fTracker->StatTime(6)/fTracker->StatNEvents()*1.e3<<"/"
-       <<fTracker->StatTime(7)/fTracker->StatNEvents()*1.e3<<"] "
-       <<fTracker->StatTime(8)/fTracker->StatNEvents()*1.e3
-       <<" msec/event "<<endl;
-    cout<<" GB merger "<<fTracker->StatTime(9)/fTracker->StatNEvents()*1.e3<<": "
-       <<fTracker->StatTime(10)/fTracker->StatNEvents()*1.e3<<", "
-       <<fTracker->StatTime(11)/fTracker->StatNEvents()*1.e3<<", "
-       <<fTracker->StatTime(12)/fTracker->StatNEvents()*1.e3<<" "
-       <<" msec/event "<<endl;
-
-    if( StatFile && StatFile->is_open() ){
+    cout << "\nGlobal tracker performance for " << fStatNEvents << " events: \n" << endl;
+    cout << " N tracks : "
+         << fStatGBNMCAll << " mc all, "
+         << fStatGBNMCRef << " mc ref, "
+         << fStatGBNRecTot << " rec total, "
+         << fStatGBNRecAll << " rec all, "
+         << fStatGBNClonesAll << " clones all, "
+         << fStatGBNRecRef << " rec ref, "
+         << fStatGBNClonesRef << " clones ref, "
+         << fStatGBNRecOut << " out, "
+         << fStatGBNGhost << " ghost" << endl;
+    cout << " N tracks average : "
+         << fStatGBNMCAll / fStatNEvents << " mc all, "
+         << fStatGBNMCRef / fStatNEvents << " mc ref, "
+         << fStatGBNRecTot / fStatNEvents << " rec total, "
+         << fStatGBNRecAll / fStatNEvents << " rec all, "
+         << fStatGBNClonesAll / fStatNEvents << " clones all, "
+         << fStatGBNRecRef / fStatNEvents << " rec ref, "
+         << fStatGBNClonesRef / fStatNEvents << " clones ref, "
+         << fStatGBNRecOut / fStatNEvents << " out, "
+         << fStatGBNGhost / fStatNEvents << " ghost" << endl;
+
+    int nRecExtr = fStatGBNRecAll - fStatGBNRecRef;
+    int nMCExtr = fStatGBNMCAll - fStatGBNMCRef;
+    int nClonesExtr = fStatGBNClonesAll - fStatGBNClonesRef;
+
+    double dRecTot = ( fStatGBNRecTot > 0 ) ? fStatGBNRecTot : 1;
+    double dMCAll = ( fStatGBNMCAll > 0 ) ? fStatGBNMCAll : 1;
+    double dMCRef = ( fStatGBNMCRef > 0 ) ? fStatGBNMCRef : 1;
+    double dMCExtr = ( nMCExtr > 0 ) ? nMCExtr : 1;
+    double dRecAll = ( fStatGBNRecAll + fStatGBNClonesAll > 0 ) ? fStatGBNRecAll + fStatGBNClonesAll : 1;
+    double dRecRef = ( fStatGBNRecRef + fStatGBNClonesRef > 0 ) ? fStatGBNRecRef + fStatGBNClonesRef : 1;
+    double dRecExtr = ( nRecExtr + nClonesExtr > 0 ) ? nRecExtr + nClonesExtr : 1;
+
+    cout << " EffRef = " << fStatGBNRecRef / dMCRef
+         << ", CloneRef = " << fStatGBNClonesRef / dRecRef << endl;
+    cout << " EffExtra = " << nRecExtr / dMCExtr
+         << ", CloneExtra = " << nClonesExtr / dRecExtr << endl;
+    cout << " EffAll = " << fStatGBNRecAll / dMCAll
+         << ", CloneAll = " << fStatGBNClonesAll / dRecAll << endl;
+    cout << " Out = " << fStatGBNRecOut / dRecTot
+         << ", Ghost = " << fStatGBNGhost / dRecTot << endl;
+    cout << " Time = " << ( fTracker->StatTime( 0 ) + fTracker->StatTime( 9 ) ) / fTracker->StatNEvents()*1.e3 << " msec/event " << endl;
+    cout << " Local timers: " << endl;
+    cout << " slice tracker " << fTracker->StatTime( 0 ) / fTracker->StatNEvents()*1.e3 << ": "
+         << fTracker->StatTime( 1 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 2 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 3 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 4 ) / fTracker->StatNEvents()*1.e3 << " "
+         << fTracker->StatTime( 5 ) / fTracker->StatNEvents()*1.e3 << "["
+         << fTracker->StatTime( 6 ) / fTracker->StatNEvents()*1.e3 << "/"
+         << fTracker->StatTime( 7 ) / fTracker->StatNEvents()*1.e3 << "] "
+         << fTracker->StatTime( 8 ) / fTracker->StatNEvents()*1.e3
+         << " msec/event " << endl;
+    cout << " GB merger " << fTracker->StatTime( 9 ) / fTracker->StatNEvents()*1.e3 << ": "
+         << fTracker->StatTime( 10 ) / fTracker->StatNEvents()*1.e3 << ", "
+         << fTracker->StatTime( 11 ) / fTracker->StatNEvents()*1.e3 << ", "
+         << fTracker->StatTime( 12 ) / fTracker->StatNEvents()*1.e3 << " "
+         << " msec/event " << endl;
+
+    if ( StatFile && StatFile->is_open() ) {
       fstream &out = *StatFile;
 
       //out<<"\nGlobal tracker performance for "<<fStatNEvents<<" events: \n"<<endl;
@@ -1878,39 +1878,39 @@ void AliHLTTPCCAPerformance::Performance( fstream *StatFile )
       // <<fStatGBNClonesRef/fStatNEvents<<" clones ref, "
       // <<fStatGBNRecOut/fStatNEvents<<" out, "
       // <<fStatGBNGhost/fStatNEvents<<" ghost"<<endl;
-      fStatTime+=fTracker->SliceTrackerTime();
-      double timeHz=0;
-      if( fStatTime>1.e-4 ) timeHz = 1./fStatTime*fStatNEvents;
-
-      out<<"<table border>"<<endl;
-      out<<"<tr>"<<endl; 
-      out<<"<td>      </td> <td align=center> RefSet </td> <td align=center> AllSet </td> <td align=center> ExtraSet </td>"<<endl;
-      out<<"</tr>"<<endl;
-      out<<"<tr>"<<endl;
-      out<<"<td>Efficiency</td> <td align=center>"<<fStatGBNRecRef/dMCRef
-        <<"</td> <td align=center>"<<fStatGBNRecAll/dMCAll
-        <<"</td> <td align=center>"<<nRecExtr/dMCExtr
-        <<"</td>"<<endl;
-      out<<"</tr>"<<endl;
-      out<<"<tr> "<<endl;
-      out<<"<td>Clone</td>      <td align=center>"<<fStatGBNClonesRef/dRecRef
-        <<"</td> <td align=center>"<<fStatGBNClonesAll/dRecAll
-        <<"</td> <td align=center>"<<nClonesExtr/dRecExtr
-        <<"</td>"<<endl;
-      out<<"</tr>"<<endl;
-      out<<"<tr> "<<endl;
-      out<<"<td>Ghost</td>      <td colspan=3 align=center>"<<fStatGBNGhost/dRecTot
-        <<"</td>"<<endl;
-      out<<"</tr>"<<endl;
-      out<<"<tr> "<<endl;
-      out<<"<td>Time</td>      <td colspan=3 align=center>"<<timeHz 
-        <<" ev/s</td>"<<endl;
-      out<<"</tr>"<<endl;
-      out<<"<tr> "<<endl;
-      out<<"<td>N Events</td>      <td colspan=3 align=center>"<<fStatNEvents
-        <<"</td>"<<endl;
-      out<<"</tr>"<<endl;
-      out<<"</table>"<<endl;
+      fStatTime += fTracker->SliceTrackerTime();
+      double timeHz = 0;
+      if ( fStatTime > 1.e-4 ) timeHz = 1. / fStatTime * fStatNEvents;
+
+      out << "<table border>" << endl;
+      out << "<tr>" << endl;
+      out << "<td>      </td> <td align=center> RefSet </td> <td align=center> AllSet </td> <td align=center> ExtraSet </td>" << endl;
+      out << "</tr>" << endl;
+      out << "<tr>" << endl;
+      out << "<td>Efficiency</td> <td align=center>" << fStatGBNRecRef / dMCRef
+      << "</td> <td align=center>" << fStatGBNRecAll / dMCAll
+      << "</td> <td align=center>" << nRecExtr / dMCExtr
+      << "</td>" << endl;
+      out << "</tr>" << endl;
+      out << "<tr> " << endl;
+      out << "<td>Clone</td>      <td align=center>" << fStatGBNClonesRef / dRecRef
+      << "</td> <td align=center>" << fStatGBNClonesAll / dRecAll
+      << "</td> <td align=center>" << nClonesExtr / dRecExtr
+      << "</td>" << endl;
+      out << "</tr>" << endl;
+      out << "<tr> " << endl;
+      out << "<td>Ghost</td>      <td colspan=3 align=center>" << fStatGBNGhost / dRecTot
+      << "</td>" << endl;
+      out << "</tr>" << endl;
+      out << "<tr> " << endl;
+      out << "<td>Time</td>      <td colspan=3 align=center>" << timeHz
+      << " ev/s</td>" << endl;
+      out << "</tr>" << endl;
+      out << "<tr> " << endl;
+      out << "<td>N Events</td>      <td colspan=3 align=center>" << fStatNEvents
+      << "</td>" << endl;
+      out << "</tr>" << endl;
+      out << "</table>" << endl;
     }
 
   }
@@ -1923,47 +1923,47 @@ void AliHLTTPCCAPerformance::Performance( fstream *StatFile )
 void AliHLTTPCCAPerformance::WriteMCEvent( ostream &out ) const
 {
   // write MC information to the file
-  out<<fNMCTracks<<endl;
-  for( Int_t it=0; it<fNMCTracks; it++ ){
+  out << fNMCTracks << endl;
+  for ( int it = 0; it < fNMCTracks; it++ ) {
     AliHLTTPCCAMCTrack &t = fMCTracks[it];
-    out<<it<<" ";
-    out<<t.PDG()<<endl;
-    for( Int_t i=0; i<7; i++ ) out<<t.Par()[i]<<" ";
-    out<<endl<<"    ";
-    for( Int_t i=0; i<7; i++ ) out<<t.TPCPar()[i]<<" ";
-    out<<endl<<"    ";
-    out<< t.P()<<" ";
-    out<< t.Pt()<<" ";
-    out<< t.NMCPoints()<<" ";
-    out<< t.FirstMCPointID()<<" ";
-    out<< t.NHits()<<" ";
-    out<< t.NReconstructed()<<" ";
-    out<< t.Set()<<" ";
-    out<< t.NTurns()<<endl;
+    out << it << " ";
+    out << t.PDG() << endl;
+    for ( int i = 0; i < 7; i++ ) out << t.Par()[i] << " ";
+    out << endl << "    ";
+    for ( int i = 0; i < 7; i++ ) out << t.TPCPar()[i] << " ";
+    out << endl << "    ";
+    out << t.P() << " ";
+    out << t.Pt() << " ";
+    out << t.NMCPoints() << " ";
+    out << t.FirstMCPointID() << " ";
+    out << t.NHits() << " ";
+    out << t.NReconstructed() << " ";
+    out << t.Set() << " ";
+    out << t.NTurns() << endl;
   }
 
-  out<<fNHits<<endl;
-  for( Int_t ih=0; ih<fNHits; ih++ ){
+  out << fNHits << endl;
+  for ( int ih = 0; ih < fNHits; ih++ ) {
     AliHLTTPCCAHitLabel &l = fHitLabels[ih];
-    out<<l.fLab[0]<<" "<<l.fLab[1]<<" "<<l.fLab[2]<<endl;
+    out << l.fLab[0] << " " << l.fLab[1] << " " << l.fLab[2] << endl;
   }
 }
 
 void AliHLTTPCCAPerformance::WriteMCPoints( ostream &out ) const
-{  
+{
   // write Mc points to the file
-  out<<fNMCPoints<<endl;
-  for( Int_t ip=0; ip<fNMCPoints; ip++ ){
+  out << fNMCPoints << endl;
+  for ( int ip = 0; ip < fNMCPoints; ip++ ) {
     AliHLTTPCCAMCPoint &p = fMCPoints[ip];
-    out<< p.X()<<" ";
-    out<< p.Y()<<" ";
-    out<< p.Z()<<" ";
-    out<< p.Sx()<<" ";
-    out<< p.Sy()<<" ";
-    out<< p.Sz()<<" ";
-    out<< p.Time()<<" ";
-    out<< p.ISlice()<<" ";
-    out<< p.TrackID()<<endl;
+    out << p.X() << " ";
+    out << p.Y() << " ";
+    out << p.Z() << " ";
+    out << p.Sx() << " ";
+    out << p.Sy() << " ";
+    out << p.Sz() << " ";
+    out << p.Time() << " ";
+    out << p.ISlice() << " ";
+    out << p.TrackID() << endl;
   }
 }
 
@@ -1971,58 +1971,58 @@ void AliHLTTPCCAPerformance::ReadMCEvent( istream &in )
 {
   // read mc info from the file
   StartEvent();
-  if( fMCTracks ) delete[] fMCTracks;
+  if ( fMCTracks ) delete[] fMCTracks;
   fMCTracks = 0;
   fNMCTracks = 0;
-  if( fHitLabels ) delete[] fHitLabels;
+  if ( fHitLabels ) delete[] fHitLabels;
   fHitLabels = 0;
   fNHits = 0;
-  if( fMCPoints ) delete[] fMCPoints;
+  if ( fMCPoints ) delete[] fMCPoints;
   fMCPoints = 0;
   fNMCPoints = 0;
 
-  in>>fNMCTracks;
+  in >> fNMCTracks;
   fMCTracks = new AliHLTTPCCAMCTrack[fNMCTracks];
-  for( Int_t it=0; it<fNMCTracks; it++ ){
+  for ( int it = 0; it < fNMCTracks; it++ ) {
     AliHLTTPCCAMCTrack &t = fMCTracks[it];
-    Int_t j;
-    Float_t f;
-    in>>j;
-    in>> j; t.SetPDG(j);
-    for( Int_t i=0; i<7; i++ ){ in>>f; t.SetPar(i,f);}
-    for( Int_t i=0; i<7; i++ ){ in>>f; t.SetTPCPar(i,f);}
-    in>> f; t.SetP(f);
-    in>> f; t.SetPt(f);
-    in>> j; t.SetNHits(j);
-    in>> j; t.SetNMCPoints(j);
-    in>> j; t.SetFirstMCPointID(j);
-    in>> j; t.SetNReconstructed(j);
-    in>> j; t.SetSet(j);
-    in>> j; t.SetNTurns(j);
+    int j;
+    float f;
+    in >> j;
+    in >> j; t.SetPDG( j );
+    for ( int i = 0; i < 7; i++ ) { in >> f; t.SetPar( i, f );}
+    for ( int i = 0; i < 7; i++ ) { in >> f; t.SetTPCPar( i, f );}
+    in >> f; t.SetP( f );
+    in >> f; t.SetPt( f );
+    in >> j; t.SetNHits( j );
+    in >> j; t.SetNMCPoints( j );
+    in >> j; t.SetFirstMCPointID( j );
+    in >> j; t.SetNReconstructed( j );
+    in >> j; t.SetSet( j );
+    in >> j; t.SetNTurns( j );
   }
-  
-  in>>fNHits;
+
+  in >> fNHits;
   fHitLabels = new AliHLTTPCCAHitLabel[fNHits];
-  for( Int_t ih=0; ih<fNHits; ih++ ){
+  for ( int ih = 0; ih < fNHits; ih++ ) {
     AliHLTTPCCAHitLabel &l = fHitLabels[ih];
-    in>>l.fLab[0]>>l.fLab[1]>>l.fLab[2];
+    in >> l.fLab[0] >> l.fLab[1] >> l.fLab[2];
   }
 }
 
 void AliHLTTPCCAPerformance::ReadMCPoints( istream &in )
 {
   // read mc points from the file
-  if( fMCPoints ) delete[] fMCPoints;
+  if ( fMCPoints ) delete[] fMCPoints;
   fMCPoints = 0;
   fNMCPoints = 0;
-  
-  in>>fNMCPoints;
+
+  in >> fNMCPoints;
   fMCPoints = new AliHLTTPCCAMCPoint[fNMCPoints];
-  for( Int_t ip=0; ip<fNMCPoints; ip++ ){
+  for ( int ip = 0; ip < fNMCPoints; ip++ ) {
     AliHLTTPCCAMCPoint &p = fMCPoints[ip];
-    Float_t f;
-    Int_t i;
-    in>> f;
+    float f;
+    int i;
+    in >> f;
     p.SetX( f );
     in >> f;
     p.SetY( f );
index 7e1ebca6b4c46a1321f43186e0522c0eb4fcb58e..05a8eb4ad19c54ef99a3716ba140c0261a5ac2ee 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -25,161 +25,161 @@ class TProfile;
 
 /**
  * @class AliHLTTPCCAPerformance
- * 
+ *
  * Does performance evaluation of the HLT Cellular Automaton-based tracker
- * It checks performance for AliHLTTPCCATracker slice tracker 
+ * It checks performance for AliHLTTPCCATracker slice tracker
  * and for AliHLTTPCCAGBTracker global tracker
  *
  */
 class AliHLTTPCCAPerformance
 {
 
- public:
-
-  struct AliHLTTPCCAHitLabel{
-    Int_t fLab[3]; //* array of 3 MC labels
-  };
-
-  AliHLTTPCCAPerformance();
-  AliHLTTPCCAPerformance(const AliHLTTPCCAPerformance&);
-  const AliHLTTPCCAPerformance &operator=(const AliHLTTPCCAPerformance&) const;
-
-  virtual ~AliHLTTPCCAPerformance();
-
-  static AliHLTTPCCAPerformance &Instance();
-
-  void SetTracker( AliHLTTPCCAGBTracker * const Tracker );
-  void StartEvent();
-  void SetNHits( Int_t NHits );
-  void SetNMCTracks( Int_t NMCTracks );
-  void SetNMCPoints( Int_t NMCPoints );
-
-  void ReadHitLabel( Int_t HitID, 
-                    Int_t lab0, Int_t lab1, Int_t lab2 );
-  void ReadMCTrack( Int_t index, const TParticle *part );
-  void ReadMCTPCTrack( Int_t index, Float_t X, Float_t Y, Float_t Z, 
-                      Float_t Px, Float_t Py, Float_t Pz ); 
-
-  void ReadMCPoint( Int_t TrackID, Float_t X, Float_t Y, Float_t Z, Float_t Time, Int_t iSlice );
-
-  void CreateHistos();
-  void WriteHistos();
-  void SlicePerformance( Int_t iSlice, Bool_t PrintFlag  );
-  void SliceTrackletPerformance( Int_t iSlice, Bool_t PrintFlag );
-  void SliceTrackCandPerformance( Int_t iSlice, Bool_t PrintFlag );
-
-  void Performance( fstream *StatFile = 0);
-
-  void WriteMCEvent( ostream &out ) const;
-  void ReadMCEvent( istream &in );
-  void WriteMCPoints( ostream &out ) const;
-  void ReadMCPoints( istream &in );
-  Bool_t DoClusterPulls() const { return fDoClusterPulls; }
-  void SetDoClusterPulls( Bool_t v ) { fDoClusterPulls = v; }
-  AliHLTTPCCAHitLabel *HitLabels() const { return fHitLabels;}
-  AliHLTTPCCAMCTrack *MCTracks() const { return fMCTracks; }
-  Int_t NMCTracks() const { return fNMCTracks; }
-
-  TH1D *HNHitsPerSeed() const { return fhNHitsPerSeed;}
-  TH1D *HNHitsPerTrackCand() const { return fhNHitsPerTrackCand; }
-
-  TH1D *LinkChiRight( int i ) const { return fhLinkChiRight[i]; }
-  TH1D *LinkChiWrong( int i ) const { return fhLinkChiWrong[i]; }
-
-  void LinkPerformance( Int_t iSlice );
-
-protected:
-
-  AliHLTTPCCAGBTracker *fTracker; //* pointer to the tracker
-  
-
-  AliHLTTPCCAHitLabel *fHitLabels; //* array of hit MC labels
-  Int_t fNHits;                    //* number of hits
-  AliHLTTPCCAMCTrack *fMCTracks;   //* array of MC tracks
-  Int_t fNMCTracks;                //* number of MC tracks
-  AliHLTTPCCAMCPoint *fMCPoints;   //* array of MC points
-  Int_t fNMCPoints;                //* number of MC points
-  Bool_t fDoClusterPulls;          //* do cluster pulls (very slow)
-  Int_t fStatNEvents; //* n of events proceed
-  Double_t fStatTime; //* reco time;
-
-  Int_t fStatSeedNRecTot; //* total n of reconstructed tracks 
-  Int_t fStatSeedNRecOut; //* n of reconstructed tracks in Out set
-  Int_t fStatSeedNGhost;//* n of reconstructed tracks in Ghost set
-  Int_t fStatSeedNMCAll;//* n of MC tracks 
-  Int_t fStatSeedNRecAll; //* n of reconstructed tracks in All set
-  Int_t fStatSeedNClonesAll;//* total n of reconstructed tracks in Clone set
-  Int_t fStatSeedNMCRef; //* n of MC reference tracks 
-  Int_t fStatSeedNRecRef; //* n of reconstructed tracks in Ref set
-  Int_t fStatSeedNClonesRef; //* n of reconstructed clones in Ref set
-
-  Int_t fStatCandNRecTot; //* total n of reconstructed tracks 
-  Int_t fStatCandNRecOut; //* n of reconstructed tracks in Out set
-  Int_t fStatCandNGhost;//* n of reconstructed tracks in Ghost set
-  Int_t fStatCandNMCAll;//* n of MC tracks 
-  Int_t fStatCandNRecAll; //* n of reconstructed tracks in All set
-  Int_t fStatCandNClonesAll;//* total n of reconstructed tracks in Clone set
-  Int_t fStatCandNMCRef; //* n of MC reference tracks 
-  Int_t fStatCandNRecRef; //* n of reconstructed tracks in Ref set
-  Int_t fStatCandNClonesRef; //* n of reconstructed clones in Ref set
-
-  Int_t fStatNRecTot; //* total n of reconstructed tracks 
-  Int_t fStatNRecOut; //* n of reconstructed tracks in Out set
-  Int_t fStatNGhost;//* n of reconstructed tracks in Ghost set
-  Int_t fStatNMCAll;//* n of MC tracks 
-  Int_t fStatNRecAll; //* n of reconstructed tracks in All set
-  Int_t fStatNClonesAll;//* total n of reconstructed tracks in Clone set
-  Int_t fStatNMCRef; //* n of MC reference tracks 
-  Int_t fStatNRecRef; //* n of reconstructed tracks in Ref set
-  Int_t fStatNClonesRef; //* n of reconstructed clones in Ref set
-
-  Int_t fStatGBNRecTot; //* global tracker: total n of reconstructed tracks 
-  Int_t fStatGBNRecOut; //* global tracker: n of reconstructed tracks in Out set
-  Int_t fStatGBNGhost;//* global tracker: n of reconstructed tracks in Ghost set
-  Int_t fStatGBNMCAll;//* global tracker: n of MC tracks 
-  Int_t fStatGBNRecAll; //* global tracker: n of reconstructed tracks in All set
-  Int_t fStatGBNClonesAll;//* global tracker: total n of reconstructed tracks in Clone set
-  Int_t fStatGBNMCRef; //* global tracker: n of MC reference tracks 
-  Int_t fStatGBNRecRef; //* global tracker: n of reconstructed tracks in Ref set
-  Int_t fStatGBNClonesRef; //* global tracker: n of reconstructed clones in Ref set
-
-  TDirectory *fHistoDir; //* ROOT directory with histogramms
-
-  TH1D 
-  *fhResY,       //* track Y resolution at the TPC entrance
-  *fhResZ,       //* track Z resolution at the TPC entrance
-  *fhResSinPhi,  //* track SinPhi resolution at the TPC entrance
-  *fhResDzDs,    //* track DzDs resolution at the TPC entrance
-  *fhResPt,      //* track Pt relative resolution at the TPC entrance
-  *fhPullY,      //* track Y pull at the TPC entrance
-  *fhPullZ,      //* track Z pull at the TPC entrance
-  *fhPullSinPhi, //* track SinPhi pull at the TPC entrance
-  *fhPullDzDs, //* track DzDs pull at the TPC entrance
-  *fhPullQPt,    //* track Q/Pt pull at the TPC entrance
-  *fhPullYS,       //* sqrt(chi2/ndf) deviation of the track parameters Y and SinPhi at the TPC entrance
-  *fhPullZT;      //* sqrt(chi2/ndf) deviation of the track parameters Z and DzDs at the TPC entrance
-
-  TH1D 
-  *fhHitErrY, //* hit error in Y
-    *fhHitErrZ,//* hit error in Z    
 public:
+
+    struct AliHLTTPCCAHitLabel {
+      int fLab[3]; //* array of 3 MC labels
+    };
+
+    AliHLTTPCCAPerformance();
+    AliHLTTPCCAPerformance( const AliHLTTPCCAPerformance& );
+    const AliHLTTPCCAPerformance &operator=( const AliHLTTPCCAPerformance& ) const;
+
+    virtual ~AliHLTTPCCAPerformance();
+
+    static AliHLTTPCCAPerformance &Instance();
+
+    void SetTracker( AliHLTTPCCAGBTracker * const Tracker );
+    void StartEvent();
+    void SetNHits( int NHits );
+    void SetNMCTracks( int NMCTracks );
+    void SetNMCPoints( int NMCPoints );
+
+    void ReadHitLabel( int HitID,
+                       int lab0, int lab1, int lab2 );
+    void ReadMCTrack( int index, const TParticle *part );
+    void ReadMCTPCTrack( int index, float X, float Y, float Z,
+                         float Px, float Py, float Pz );
+
+    void ReadMCPoint( int TrackID, float X, float Y, float Z, float Time, int iSlice );
+
+    void CreateHistos();
+    void WriteHistos();
+    void SlicePerformance( int iSlice, bool PrintFlag  );
+    void SliceTrackletPerformance( int iSlice, bool PrintFlag );
+    void SliceTrackCandPerformance( int iSlice, bool PrintFlag );
+
+    void Performance( fstream *StatFile = 0 );
+
+    void WriteMCEvent( ostream &out ) const;
+    void ReadMCEvent( istream &in );
+    void WriteMCPoints( ostream &out ) const;
+    void ReadMCPoints( istream &in );
+    bool DoClusterPulls() const { return fDoClusterPulls; }
+    void SetDoClusterPulls( bool v ) { fDoClusterPulls = v; }
+    AliHLTTPCCAHitLabel *HitLabels() const { return fHitLabels;}
+    AliHLTTPCCAMCTrack *MCTracks() const { return fMCTracks; }
+    int NMCTracks() const { return fNMCTracks; }
+
+    TH1D *HNHitsPerSeed() const { return fhNHitsPerSeed;}
+    TH1D *HNHitsPerTrackCand() const { return fhNHitsPerTrackCand; }
+
+    TH1D *LinkChiRight( int i ) const { return fhLinkChiRight[i]; }
+    TH1D *LinkChiWrong( int i ) const { return fhLinkChiWrong[i]; }
+
+    void LinkPerformance( int iSlice );
+
+  protected:
+
+    AliHLTTPCCAGBTracker *fTracker; //* pointer to the tracker
+
+
+    AliHLTTPCCAHitLabel *fHitLabels; //* array of hit MC labels
+    int fNHits;                    //* number of hits
+    AliHLTTPCCAMCTrack *fMCTracks;   //* array of MC tracks
+    int fNMCTracks;                //* number of MC tracks
+    AliHLTTPCCAMCPoint *fMCPoints;   //* array of MC points
+    int fNMCPoints;                //* number of MC points
+    bool fDoClusterPulls;          //* do cluster pulls (very slow)
+    int fStatNEvents; //* n of events proceed
+    double fStatTime; //* reco time;
+
+    int fStatSeedNRecTot; //* total n of reconstructed tracks
+    int fStatSeedNRecOut; //* n of reconstructed tracks in Out set
+    int fStatSeedNGhost;//* n of reconstructed tracks in Ghost set
+    int fStatSeedNMCAll;//* n of MC tracks
+    int fStatSeedNRecAll; //* n of reconstructed tracks in All set
+    int fStatSeedNClonesAll;//* total n of reconstructed tracks in Clone set
+    int fStatSeedNMCRef; //* n of MC reference tracks
+    int fStatSeedNRecRef; //* n of reconstructed tracks in Ref set
+    int fStatSeedNClonesRef; //* n of reconstructed clones in Ref set
+
+    int fStatCandNRecTot; //* total n of reconstructed tracks
+    int fStatCandNRecOut; //* n of reconstructed tracks in Out set
+    int fStatCandNGhost;//* n of reconstructed tracks in Ghost set
+    int fStatCandNMCAll;//* n of MC tracks
+    int fStatCandNRecAll; //* n of reconstructed tracks in All set
+    int fStatCandNClonesAll;//* total n of reconstructed tracks in Clone set
+    int fStatCandNMCRef; //* n of MC reference tracks
+    int fStatCandNRecRef; //* n of reconstructed tracks in Ref set
+    int fStatCandNClonesRef; //* n of reconstructed clones in Ref set
+
+    int fStatNRecTot; //* total n of reconstructed tracks
+    int fStatNRecOut; //* n of reconstructed tracks in Out set
+    int fStatNGhost;//* n of reconstructed tracks in Ghost set
+    int fStatNMCAll;//* n of MC tracks
+    int fStatNRecAll; //* n of reconstructed tracks in All set
+    int fStatNClonesAll;//* total n of reconstructed tracks in Clone set
+    int fStatNMCRef; //* n of MC reference tracks
+    int fStatNRecRef; //* n of reconstructed tracks in Ref set
+    int fStatNClonesRef; //* n of reconstructed clones in Ref set
+
+    int fStatGBNRecTot; //* global tracker: total n of reconstructed tracks
+    int fStatGBNRecOut; //* global tracker: n of reconstructed tracks in Out set
+    int fStatGBNGhost;//* global tracker: n of reconstructed tracks in Ghost set
+    int fStatGBNMCAll;//* global tracker: n of MC tracks
+    int fStatGBNRecAll; //* global tracker: n of reconstructed tracks in All set
+    int fStatGBNClonesAll;//* global tracker: total n of reconstructed tracks in Clone set
+    int fStatGBNMCRef; //* global tracker: n of MC reference tracks
+    int fStatGBNRecRef; //* global tracker: n of reconstructed tracks in Ref set
+    int fStatGBNClonesRef; //* global tracker: n of reconstructed clones in Ref set
+
+    TDirectory *fHistoDir; //* ROOT directory with histogramms
+
+    TH1D
+    *fhResY,       //* track Y resolution at the TPC entrance
+    *fhResZ,       //* track Z resolution at the TPC entrance
+    *fhResSinPhi,  //* track SinPhi resolution at the TPC entrance
+    *fhResDzDs,    //* track DzDs resolution at the TPC entrance
+    *fhResPt,      //* track Pt relative resolution at the TPC entrance
+    *fhPullY,      //* track Y pull at the TPC entrance
+    *fhPullZ,      //* track Z pull at the TPC entrance
+    *fhPullSinPhi, //* track SinPhi pull at the TPC entrance
+    *fhPullDzDs, //* track DzDs pull at the TPC entrance
+    *fhPullQPt,    //* track Q/Pt pull at the TPC entrance
+    *fhPullYS,       //* sqrt(chi2/ndf) deviation of the track parameters Y and SinPhi at the TPC entrance
+    *fhPullZT;      //* sqrt(chi2/ndf) deviation of the track parameters Z and DzDs at the TPC entrance
+
+    TH1D
+    *fhHitErrY, //* hit error in Y
+    *fhHitErrZ,//* hit error in Z
     *fhHitResY,//* hit resolution Y
     *fhHitResZ,//* hit resolution Z
     *fhHitPullY,//* hit  pull Y
     *fhHitPullZ;//* hit  pull Z
-  TProfile *fhHitShared; //* ratio of the shared clusters
+    TProfile *fhHitShared; //* ratio of the shared clusters
 
-  TH1D 
+    TH1D
     *fhHitResY1,//* hit resolution Y, pt>1GeV
     *fhHitResZ1,//* hit resolution Z, pt>1GeV
     *fhHitPullY1,//* hit  pull Y, pt>1GeV
     *fhHitPullZ1;//* hit  pull Z, pt>1GeV
 
-  TH1D
+    TH1D
     *fhCellPurity,//* cell purity
     *fhCellNHits//* cell n hits
     ;
 
-  TProfile 
+    TProfile
     *fhCellPurityVsN, //* cell purity vs N hits
     *fhCellPurityVsPt,//* cell purity vs MC Pt
     *fhEffVsP, //* reconstruction efficiency vs P plot
@@ -187,25 +187,25 @@ protected:
     *fhCandEffVsP, //* reconstruction efficiency vs P plot
     *fhGBEffVsP, //* global reconstruction efficiency vs P plot
     *fhGBEffVsPt, //* global reconstruction efficiency vs P plot
-    *fhNeighQuality, // quality for neighbours finder 
+    *fhNeighQuality, // quality for neighbours finder
     *fhNeighEff,// efficiency for neighbours finder
     *fhNeighQualityVsPt,// quality for neighbours finder vs track Pt
     *fhNeighEffVsPt;// efficiency for neighbours finder vs track Pt
-  TH1D 
-  *fhNeighDy, // dy for neighbours
+    TH1D
+    *fhNeighDy, // dy for neighbours
     *fhNeighDz,// dz for neighbours
     *fhNeighChi;// chi2^0.5 for neighbours
-  TH2D
+    TH2D
     *fhNeighDyVsPt, // dy for neighbours vs track Pt
     *fhNeighDzVsPt,// dz for neighbours vs track Pt
     *fhNeighChiVsPt, // chi2^0.5 for neighbours vs track Pt
     *fhNeighNCombVsArea; // N neighbours in the search area
 
-  TH1D 
+    TH1D
     *fhNHitsPerSeed, // n hits per track seed
     *fhNHitsPerTrackCand; // n hits per track candidate
 
-  TH1D 
+    TH1D
     *fhTrackLengthRef, // reconstructed track length, %
     *fhRefRecoX,// parameters of non-reconstructed ref. mc track
     *fhRefRecoY,// parameters of non-reconstructed ref. mc track
@@ -224,14 +224,14 @@ protected:
     *fhRefNotRecoAngleZ,// parameters of non-reconstructed ref. mc track
     *fhRefNotRecoNHits;// parameters of non-reconstructed ref. mc track
 
-  TProfile * fhLinkEff[4]; // link efficiency
-  TH1D *fhLinkAreaY[4]; // area in Y for the link finder
-  TH1D *fhLinkAreaZ[4]; // area in Z for the link finder
-  TH1D *fhLinkChiRight[4]; // sqrt(chi^2) for right neighbours
-  TH1D *fhLinkChiWrong[4]; // sqrt(chi^2) for wrong neighbours
+    TProfile * fhLinkEff[4]; // link efficiency
+    TH1D *fhLinkAreaY[4]; // area in Y for the link finder
+    TH1D *fhLinkAreaZ[4]; // area in Z for the link finder
+    TH1D *fhLinkChiRight[4]; // sqrt(chi^2) for right neighbours
+    TH1D *fhLinkChiWrong[4]; // sqrt(chi^2) for wrong neighbours
+
+    static void WriteDir2Current( TObject *obj );
 
-  static void WriteDir2Current( TObject *obj );
-  
 };
 
 #endif
index eaad3e6bc9c8447badf7370c269e642f63ec223e..0f7a058395ee2a44a3f4fcf13ab8fbddf529f080 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -25,7 +25,7 @@ class AliHLTTPCCATracker;
 template<class TProcess>
 GPUg() void AliHLTTPCCAProcess()
 {
-  AliHLTTPCCATracker &tracker = *((AliHLTTPCCATracker*) cTracker);
+  AliHLTTPCCATracker &tracker = *( ( AliHLTTPCCATracker* ) cTracker );
 
   GPUshared() typename TProcess::AliHLTTPCCASharedMemory smem;
 
@@ -37,28 +37,28 @@ GPUg() void AliHLTTPCCAProcess()
     TProcess::Thread( gridDim.x, blockDim.x, blockIdx.x, threadIdx.x, iSync, smem, tracker  ); \
   }
 
-  GPUPROCESS(1)
-  GPUPROCESS(2)
-  GPUPROCESS(3)
-    
-    //for( Int_t iSync=0; iSync<=TProcess::NThreadSyncPoints(); iSync++){
-    //__syncthreads();
-    //TProcess::ThreadGPU( gridDim.x, blockDim.x, blockIdx.x, threadIdx.x, iSync, smem, tracker  ); 
-    //}
-    
+  GPUPROCESS( 1 )
+  GPUPROCESS( 2 )
+  GPUPROCESS( 3 )
+
+  //for( int iSync=0; iSync<=TProcess::NThreadSyncPoints(); iSync++){
+  //__syncthreads();
+  //TProcess::ThreadGPU( gridDim.x, blockDim.x, blockIdx.x, threadIdx.x, iSync, smem, tracker  );
+  //}
+
 #undef GPUPROCESS
 }
 
 #else
 
 template<class TProcess>
-GPUg() void AliHLTTPCCAProcess( Int_t nBlocks, Int_t nThreads, AliHLTTPCCATracker &tracker )
-{  
-  for( Int_t iB=0; iB<nBlocks; iB++ ){
+GPUg() void AliHLTTPCCAProcess( int nBlocks, int nThreads, AliHLTTPCCATracker &tracker )
+{
+  for ( int iB = 0; iB < nBlocks; iB++ ) {
     typename TProcess::AliHLTTPCCASharedMemory smem;
-    for( Int_t iS=0; iS<=TProcess::NThreadSyncPoints(); iS++)
-      for( Int_t iT=0; iT<nThreads; iT++ ){    
-       TProcess::Thread( nBlocks, nThreads, iB, iT, iS, smem, tracker  );
+    for ( int iS = 0; iS <= TProcess::NThreadSyncPoints(); iS++ )
+      for ( int iT = 0; iT < nThreads; iT++ ) {
+        TProcess::Thread( nBlocks, nThreads, iB, iT, iS, smem, tracker  );
       }
   }
 }
@@ -72,32 +72,32 @@ GPUg() void AliHLTTPCCAProcess( Int_t nBlocks, Int_t nThreads, AliHLTTPCCATracke
 template<typename TProcess>
 GPUg() void AliHLTTPCCAProcess1()
 {
-  AliHLTTPCCATracker &tracker = *((AliHLTTPCCATracker*) cTracker);
-  AliHLTTPCCATrackParam tParam; 
-  
-  GPUshared() typename TProcess::AliHLTTPCCASharedMemory sMem;  
-  
+  AliHLTTPCCATracker &tracker = *( ( AliHLTTPCCATracker* ) cTracker );
+  AliHLTTPCCATrackParam tParam;
+
+  GPUshared() typename TProcess::AliHLTTPCCASharedMemory sMem;
+
   typename TProcess::AliHLTTPCCAThreadMemory rMem;
 
-  for( Int_t iSync=0; iSync<=TProcess::NThreadSyncPoints(); iSync++){
-    GPUsync(); 
-    TProcess::Thread( gridDim.x, blockDim.x, blockIdx.x, threadIdx.x, iSync, 
-                     sMem, rMem, tracker, tParam  ); 
-  }  
+  for ( int iSync = 0; iSync <= TProcess::NThreadSyncPoints(); iSync++ ) {
+    GPUsync();
+    TProcess::Thread( gridDim.x, blockDim.x, blockIdx.x, threadIdx.x, iSync,
+                      sMem, rMem, tracker, tParam  );
+  }
 }
 
 #else
 
 template<typename TProcess>
-GPUg() void AliHLTTPCCAProcess1( Int_t nBlocks, Int_t nThreads, AliHLTTPCCATracker &tracker )
+GPUg() void AliHLTTPCCAProcess1( int nBlocks, int nThreads, AliHLTTPCCATracker &tracker )
 {
-  for( Int_t iB=0; iB<nBlocks; iB++ ){
+  for ( int iB = 0; iB < nBlocks; iB++ ) {
     typename TProcess::AliHLTTPCCASharedMemory smem;
     typename TProcess::AliHLTTPCCAThreadMemory *rMem = new typename TProcess::AliHLTTPCCAThreadMemory[nThreads];
     AliHLTTPCCATrackParam *tParam = new AliHLTTPCCATrackParam[ nThreads ];
-    for( Int_t iS=0; iS<=TProcess::NThreadSyncPoints(); iS++){
-      for( Int_t iT=0; iT<nThreads; iT++ )
-       TProcess::Thread( nBlocks, nThreads, iB, iT, iS, smem, rMem[iT], tracker, tParam[iT]  );
+    for ( int iS = 0; iS <= TProcess::NThreadSyncPoints(); iS++ ) {
+      for ( int iT = 0; iT < nThreads; iT++ )
+        TProcess::Thread( nBlocks, nThreads, iB, iT, iS, smem, rMem[iT], tracker, tParam[iT]  );
     }
     delete[] rMem;
     delete[] tParam;
index f4626b7c6ba114c7383b2c72d02d44839df2d7fb..65d8d7a9712a61d0919faff7c9985337fe6ee1e6 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 
 
 #if !defined(HLTCA_GPUCODE)
-AliHLTTPCCARow::AliHLTTPCCARow() 
-  :
-  fFirstHit(0), fNHits(0), fX(0), fMaxY(0), fGrid(),
-  fHy0(0),fHz0(0), fHstepY(0),fHstepZ(0), fHstepYi(0), fHstepZi(0),
-  fFullSize(0), fFullOffset(0), fFullGridOffset(0),fFullLinkOffset(0)
+AliHLTTPCCARow::AliHLTTPCCARow()
+    :
+    fFirstHit( 0 ), fNHits( 0 ), fX( 0 ), fMaxY( 0 ), fGrid(),
+    fHy0( 0 ), fHz0( 0 ), fHstepY( 0 ), fHstepZ( 0 ), fHstepYi( 0 ), fHstepZi( 0 ),
+    fFullSize( 0 ), fFullOffset( 0 ), fFullGridOffset( 0 ), fFullLinkOffset( 0 )
 {
   // dummy constructor
 }
index 97dac3a07a14f02d1306c2a82ee000fbd27189ae..209ee57e5d3d6967bb11660d3a349f1d58f56869 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCARow
 {
- public: 
+  public:
 
 #if !defined(HLTCA_GPUCODE)
-  AliHLTTPCCARow();  
+    AliHLTTPCCARow();
 #endif
 
-  GPUhd() Int_t   FirstHit() const { return fFirstHit; }
-  GPUhd() Int_t   NHits()    const { return fNHits; }
-  GPUhd() Float_t X()        const { return fX; }
-  GPUhd() Float_t MaxY()     const { return fMaxY; }
-  GPUhd() const AliHLTTPCCAGrid &Grid() const { return fGrid; }  
+    GPUhd() int   FirstHit() const { return fFirstHit; }
+    GPUhd() int   NHits()    const { return fNHits; }
+    GPUhd() float X()        const { return fX; }
+    GPUhd() float MaxY()     const { return fMaxY; }
+    GPUhd() const AliHLTTPCCAGrid &Grid() const { return fGrid; }
 
-  GPUhd() Float_t Hy0()      const { return fHy0;}
-  GPUhd() Float_t Hz0()      const { return fHz0;}
-  GPUhd() Float_t HstepY()   const { return fHstepY;}
-  GPUhd() Float_t HstepZ()   const { return fHstepZ;}
-  GPUhd() Float_t HstepYi()  const { return fHstepYi;}
-  GPUhd() Float_t HstepZi()  const { return fHstepZi;}
-  GPUhd() Int_t   FullSize()    const { return fFullSize;}
-  GPUhd() Int_t   FullOffset()  const { return fFullOffset;}
-  GPUhd() Int_t   FullGridOffset()  const { return fFullGridOffset;}
-  GPUhd() Int_t   FullLinkOffset()  const { return fFullLinkOffset;}
+    GPUhd() float Hy0()      const { return fHy0;}
+    GPUhd() float Hz0()      const { return fHz0;}
+    GPUhd() float HstepY()   const { return fHstepY;}
+    GPUhd() float HstepZ()   const { return fHstepZ;}
+    GPUhd() float HstepYi()  const { return fHstepYi;}
+    GPUhd() float HstepZi()  const { return fHstepZi;}
+    GPUhd() int   FullSize()    const { return fFullSize;}
+    GPUhd() int   FullOffset()  const { return fFullOffset;}
+    GPUhd() int   FullGridOffset()  const { return fFullGridOffset;}
+    GPUhd() int   FullLinkOffset()  const { return fFullLinkOffset;}
 
-  GPUhd() void SetFirstHit( Int_t v ){ fFirstHit = v; }
-  GPUhd() void SetNHits( Int_t v )   { fNHits = v; }
-  GPUhd() void SetX( Float_t v )       { fX = v; }
-  GPUhd() void SetMaxY( Float_t v )    { fMaxY = v; }
-  GPUhd() void SetGrid( const AliHLTTPCCAGrid &v ){ fGrid = v; }  
+    GPUhd() void SetFirstHit( int v ) { fFirstHit = v; }
+    GPUhd() void SetNHits( int v )   { fNHits = v; }
+    GPUhd() void SetX( float v )       { fX = v; }
+    GPUhd() void SetMaxY( float v )    { fMaxY = v; }
+    GPUhd() void SetGrid( const AliHLTTPCCAGrid &v ) { fGrid = v; }
 
-  GPUhd() void SetHy0( Float_t v ) { fHy0 = v;}
-  GPUhd() void SetHz0( Float_t v ) { fHz0 = v;}
-  GPUhd() void SetHstepY( Float_t v ) { fHstepY = v;}
-  GPUhd() void SetHstepZ( Float_t v ) { fHstepZ = v;}
-  GPUhd() void SetHstepYi( Float_t v ) { fHstepYi = v;}
-  GPUhd() void SetHstepZi( Float_t v ) { fHstepZi = v;}
-  GPUhd() void SetFullSize( Int_t v ) { fFullSize = v;}
-  GPUhd() void SetFullOffset( Int_t v ) { fFullOffset = v;}
-  GPUhd() void SetFullGridOffset( Int_t v ) { fFullGridOffset = v;}
-  GPUhd() void SetFullLinkOffset( Int_t v ) { fFullLinkOffset = v;}
+    GPUhd() void SetHy0( float v ) { fHy0 = v;}
+    GPUhd() void SetHz0( float v ) { fHz0 = v;}
+    GPUhd() void SetHstepY( float v ) { fHstepY = v;}
+    GPUhd() void SetHstepZ( float v ) { fHstepZ = v;}
+    GPUhd() void SetHstepYi( float v ) { fHstepYi = v;}
+    GPUhd() void SetHstepZi( float v ) { fHstepZi = v;}
+    GPUhd() void SetFullSize( int v ) { fFullSize = v;}
+    GPUhd() void SetFullOffset( int v ) { fFullOffset = v;}
+    GPUhd() void SetFullGridOffset( int v ) { fFullGridOffset = v;}
+    GPUhd() void SetFullLinkOffset( int v ) { fFullLinkOffset = v;}
 
-private:
+  private:
 
-  Int_t fFirstHit;         // index of the first hit in the hit array
-  Int_t fNHits;            // number of hits 
-  Float_t fX;              // X coordinate of the row
-  Float_t fMaxY;           // maximal Y coordinate of the row
-  AliHLTTPCCAGrid fGrid;   // grid of hits
+    int fFirstHit;         // index of the first hit in the hit array
+    int fNHits;            // number of hits
+    float fX;              // X coordinate of the row
+    float fMaxY;           // maximal Y coordinate of the row
+    AliHLTTPCCAGrid fGrid;   // grid of hits
 
-  Float_t fHy0,fHz0, fHstepY,fHstepZ, fHstepYi, fHstepZi; // temporary variables
-  Int_t fFullSize, fFullOffset, fFullGridOffset,fFullLinkOffset; // temporary variables
+    float fHy0, fHz0, fHstepY, fHstepZ, fHstepYi, fHstepZi; // temporary variables
+    int fFullSize, fFullOffset, fFullGridOffset, fFullLinkOffset; // temporary variables
 
 };
 
index 05a2a6267d37f66db42d18059079dd88437483fc..e2cb0a161b29335181f0248558647e7e03aa7c74 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  * and transport the output to AliHLTTPCCAGBMerger{Component}
  *
  * The class contains all the necessary information about TPC tracks, reconstructed in one slice.
- * This includes the reconstructed track parameters and some compressed information 
+ * This includes the reconstructed track parameters and some compressed information
  * about the assigned clusters: clusterId, position and amplitude.
  *
  */
 class AliHLTTPCCASliceOutput
 {
- public:
 public:
 
-  GPUhd() Int_t NTracks()                    const { return fNTracks;              }
-  GPUhd() Int_t NTrackClusters()             const { return fNTrackClusters;       }
+    GPUhd() int NTracks()                    const { return fNTracks;              }
+    GPUhd() int NTrackClusters()             const { return fNTrackClusters;       }
 
-  GPUhd() const AliHLTTPCCASliceTrack &Track( Int_t i ) const { return fTracks[i]; }
-  GPUhd() UInt_t   ClusterIDrc     ( Int_t i )  const { return fClusterIDrc[i]; }
-  GPUhd() UShort_t ClusterPackedYZ ( Int_t i )  const { return fClusterPackedYZ[i]; }
-  GPUhd() UChar_t  ClusterPackedAmp( Int_t i )  const { return fClusterPackedAmp[i]; }
-  GPUhd() float2   ClusterUnpackedYZ ( Int_t i )  const { return fClusterUnpackedYZ[i]; }
-  GPUhd() float    ClusterUnpackedX  ( Int_t i )  const { return fClusterUnpackedX[i]; }
+    GPUhd() const AliHLTTPCCASliceTrack &Track( int i ) const { return fTracks[i]; }
+    GPUhd() unsigned int   ClusterIDrc     ( int i )  const { return fClusterIDrc[i]; }
+    GPUhd() unsigned short ClusterPackedYZ ( int i )  const { return fClusterPackedYZ[i]; }
+    GPUhd() UChar_t  ClusterPackedAmp( int i )  const { return fClusterPackedAmp[i]; }
+    GPUhd() float2   ClusterUnpackedYZ ( int i )  const { return fClusterUnpackedYZ[i]; }
+    GPUhd() float    ClusterUnpackedX  ( int i )  const { return fClusterUnpackedX[i]; }
 
-  GPUhd() static Int_t EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters );
-  GPUhd() void SetPointers();
+    GPUhd() static int EstimateSize( int nOfTracks, int nOfTrackClusters );
+    GPUhd() void SetPointers();
 
-  GPUhd() void SetNTracks       ( Int_t v )  { fNTracks = v;        }
-  GPUhd() void SetNTrackClusters( Int_t v )  { fNTrackClusters = v; }
+    GPUhd() void SetNTracks       ( int v )  { fNTracks = v;        }
+    GPUhd() void SetNTrackClusters( int v )  { fNTrackClusters = v; }
 
-  GPUhd() void SetTrack( Int_t i, const AliHLTTPCCASliceTrack &v ) {  fTracks[i] = v; }
-  GPUhd() void SetClusterIDrc( Int_t i, UInt_t v ) {  fClusterIDrc[i] = v; }
-  GPUhd() void SetClusterPackedYZ( Int_t i, UShort_t v ) {  fClusterPackedYZ[i] = v; }
-  GPUhd() void SetClusterPackedAmp( Int_t i, UChar_t v ) {  fClusterPackedAmp[i] = v; }
-  GPUhd() void SetClusterUnpackedYZ( Int_t i, float2 v ) {  fClusterUnpackedYZ[i] = v; }
-  GPUhd() void SetClusterUnpackedX( Int_t i, float v ) {  fClusterUnpackedX[i] = v; }
+    GPUhd() void SetTrack( int i, const AliHLTTPCCASliceTrack &v ) {  fTracks[i] = v; }
+    GPUhd() void SetClusterIDrc( int i, unsigned int v ) {  fClusterIDrc[i] = v; }
+    GPUhd() void SetClusterPackedYZ( int i, unsigned short v ) {  fClusterPackedYZ[i] = v; }
+    GPUhd() void SetClusterPackedAmp( int i, UChar_t v ) {  fClusterPackedAmp[i] = v; }
+    GPUhd() void SetClusterUnpackedYZ( int i, float2 v ) {  fClusterUnpackedYZ[i] = v; }
+    GPUhd() void SetClusterUnpackedX( int i, float v ) {  fClusterUnpackedX[i] = v; }
 
- private:
 private:
 
-  AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& )
-    : fNTracks(0),fNTrackClusters(0),fTracks(0),fClusterIDrc(0), fClusterPackedYZ(0),fClusterUnpackedYZ(0),fClusterUnpackedX(0),fClusterPackedAmp(0){}
+    AliHLTTPCCASliceOutput( const AliHLTTPCCASliceOutput& )
+        : fNTracks( 0 ), fNTrackClusters( 0 ), fTracks( 0 ), fClusterIDrc( 0 ), fClusterPackedYZ( 0 ), fClusterUnpackedYZ( 0 ), fClusterUnpackedX( 0 ), fClusterPackedAmp( 0 ) {}
 
-  const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
+    const AliHLTTPCCASliceOutput& operator=( const AliHLTTPCCASliceOutput& ) const { return *this; }
 
-  Int_t fNTracks;                 // number of reconstructed tracks
-  Int_t fNTrackClusters;          // total number of track clusters
-  AliHLTTPCCASliceTrack *fTracks; // pointer to reconstructed tracks
-  UInt_t   *fClusterIDrc;         // pointer to cluster IDs ( packed IRow and ICluster)
-  UShort_t *fClusterPackedYZ;     // pointer to packed cluster YZ coordinates 
-  float2   *fClusterUnpackedYZ;   // pointer to cluster coordinates (temporary data, for debug proposes)
-  float    *fClusterUnpackedX;   // pointer to cluster coordinates (temporary data, for debug proposes)
-  UChar_t  *fClusterPackedAmp;    // pointer to packed cluster amplitudes
+    int fNTracks;                 // number of reconstructed tracks
+    int fNTrackClusters;          // total number of track clusters
+    AliHLTTPCCASliceTrack *fTracks; // pointer to reconstructed tracks
+    unsigned int   *fClusterIDrc;         // pointer to cluster IDs ( packed IRow and ICluster)
+    unsigned short *fClusterPackedYZ;     // pointer to packed cluster YZ coordinates
+    float2   *fClusterUnpackedYZ;   // pointer to cluster coordinates (temporary data, for debug proposes)
+    float    *fClusterUnpackedX;   // pointer to cluster coordinates (temporary data, for debug proposes)
+    UChar_t  *fClusterPackedAmp;    // pointer to packed cluster amplitudes
 
 };
 
 
 
-GPUhd() inline Int_t AliHLTTPCCASliceOutput::EstimateSize( Int_t nOfTracks, Int_t nOfTrackClusters )
+GPUhd() inline int AliHLTTPCCASliceOutput::EstimateSize( int nOfTracks, int nOfTrackClusters )
 {
   // calculate the amount of memory [bytes] needed for the event
 
-  const Int_t kClusterDataSize = sizeof(UInt_t) + sizeof(UShort_t) + sizeof(float2) + sizeof(float)+ sizeof(UChar_t);
+  const int kClusterDataSize = sizeof( unsigned int ) + sizeof( unsigned short ) + sizeof( float2 ) + sizeof( float ) + sizeof( UChar_t );
 
-  return sizeof(AliHLTTPCCASliceOutput) + sizeof(AliHLTTPCCASliceTrack)*nOfTracks + kClusterDataSize*nOfTrackClusters;
+  return sizeof( AliHLTTPCCASliceOutput ) + sizeof( AliHLTTPCCASliceTrack )*nOfTracks + kClusterDataSize*nOfTrackClusters;
 }
 
 
@@ -86,12 +86,12 @@ GPUhd() inline void AliHLTTPCCASliceOutput::SetPointers()
 {
   // set all pointers
 
-  fTracks            = (AliHLTTPCCASliceTrack*)((&fClusterPackedAmp)+1);
-  fClusterUnpackedYZ = (float2*)  ( fTracks   + fNTracks );
-  fClusterUnpackedX  = (float*)   ( fClusterUnpackedYZ + fNTrackClusters );
-  fClusterIDrc       = (UInt_t*)  ( fClusterUnpackedX  + fNTrackClusters );
-  fClusterPackedYZ   = (UShort_t*)( fClusterIDrc       + fNTrackClusters );
-  fClusterPackedAmp  = (UChar_t*) ( fClusterPackedYZ + fNTrackClusters );
+  fTracks            = ( AliHLTTPCCASliceTrack* )( ( &fClusterPackedAmp ) + 1 );
+  fClusterUnpackedYZ = ( float2* )  ( fTracks   + fNTracks );
+  fClusterUnpackedX  = ( float* )   ( fClusterUnpackedYZ + fNTrackClusters );
+  fClusterIDrc       = ( unsigned int* )  ( fClusterUnpackedX  + fNTrackClusters );
+  fClusterPackedYZ   = ( unsigned short* )( fClusterIDrc       + fNTrackClusters );
+  fClusterPackedAmp  = ( UChar_t* ) ( fClusterPackedYZ + fNTrackClusters );
 }
 
 #endif
index 926835e11f6f381a941e8fd35ae64d08973f9987..a89d2d7e77e33aef02ae7fb94e45af1e6cdceac0 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -16,9 +16,9 @@
  * @class AliHLTTPCCASliceTrack
  * AliHLTTPCCASliceTrack class is used to store TPC tracks,
  * which are reconstructed by the TPCCATracker slice tracker.
- * 
+ *
  * The class contains:
- * - fitted track parameters at its first row, the covariance matrix, \Chi^2, NDF (number of degrees of freedom ) 
+ * - fitted track parameters at its first row, the covariance matrix, \Chi^2, NDF (number of degrees of freedom )
  * - n of clusters assigned to the track
  * - index of its first cluster in corresponding cluster arrays
  *
  */
 class AliHLTTPCCASliceTrack
 {
- public:
+  public:
+
+    GPUhd() int NClusters()                    const { return fNClusters;       }
+    GPUhd() int FirstClusterRef()              const { return fFirstClusterRef; }
+    GPUhd() const AliHLTTPCCATrackParam &Param() const { return fParam;           }
 
-  GPUhd() Int_t NClusters()                    const { return fNClusters;       }
-  GPUhd() Int_t FirstClusterRef()              const { return fFirstClusterRef; }
-  GPUhd() const AliHLTTPCCATrackParam &Param() const { return fParam;           }
+    GPUhd() void SetNClusters( int v )                   { fNClusters = v;       }
+    GPUhd() void SetFirstClusterRef( int v )              { fFirstClusterRef = v; }
+    GPUhd() void SetParam( const AliHLTTPCCATrackParam &v ) { fParam = v;           }
 
-  GPUhd() void SetNClusters( Int_t v )                   { fNClusters = v;       }
-  GPUhd() void SetFirstClusterRef( Int_t v)              { fFirstClusterRef = v; }
-  GPUhd() void SetParam( const AliHLTTPCCATrackParam &v) { fParam = v;           }
+  private:
 
- private:
-  
-  AliHLTTPCCATrackParam fParam; //* fitted track parameters at its innermost cluster
-  Int_t fFirstClusterRef;       //* index of the index of the first track cluster in corresponding cluster arrays
-  Int_t fNClusters;             //* number of track clusters
+    AliHLTTPCCATrackParam fParam; //* fitted track parameters at its innermost cluster
+    int fFirstClusterRef;       //* index of the index of the first track cluster in corresponding cluster arrays
+    int fNClusters;             //* number of track clusters
 
 };
 
index 443ceabbaa82e6e516f9e3eae47b4a5eb351a9ab..2cd4e332e307fb5dc2b9e3a5c6a1a238c65bffa6 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id: AliHLTTPCCAStartHitsFinder.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLTTPCCAMath.h"
 
 GPUd() void AliHLTTPCCAStartHitsFinder::Thread
-( Int_t /*nBlocks*/, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
+( int /*nBlocks*/, int nThreads, int iBlock, int iThread, int iSync,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker )
 {
   // find start hits for tracklets
 
-  if( iSync==0 )
-    {
-      if( iThread==0 ){
-       if( iBlock==0 ){
-         CAMath::AtomicExch( tracker.NTracklets(),0); 
-       }
-       s.fNRows = tracker.Param().NRows();
-       s.fIRow = iBlock+1;
-       s.fNRowStartHits = 0;
-       if( s.fIRow <= s.fNRows-4 ){      
-         s.fNHits = tracker.Row(s.fIRow).NHits(); 
-         if( s.fNHits>=10240 ) s.fNHits = 10230;
+  if ( iSync == 0 ) {
+    if ( iThread == 0 ) {
+      if ( iBlock == 0 ) {
+        CAMath::AtomicExch( tracker.NTracklets(), 0 );
+      }
+      s.fNRows = tracker.Param().NRows();
+      s.fIRow = iBlock + 1;
+      s.fNRowStartHits = 0;
+      if ( s.fIRow <= s.fNRows - 4 ) {
+        s.fNHits = tracker.Row( s.fIRow ).NHits();
+        if ( s.fNHits >= 10240 ) s.fNHits = 10230;
 
-         const AliHLTTPCCARow &row = tracker.Row(s.fIRow);
-         s.fHitLinkUp = ((Short_t*)(tracker.RowData() + row.FullOffset())) + row.FullLinkOffset();
-         s.fHitLinkDown = s.fHitLinkUp + row.NHits();
+        const AliHLTTPCCARow &row = tracker.Row( s.fIRow );
+        s.fHitLinkUp = ( ( short* )( tracker.RowData() + row.FullOffset() ) ) + row.FullLinkOffset();
+        s.fHitLinkDown = s.fHitLinkUp + row.NHits();
 
-       } else s.fNHits = -1;
-      }
-    } 
-  else if( iSync==1 )
-    {
-      for( Int_t ih=iThread; ih<s.fNHits; ih+=nThreads ){      
-       if( ( s.fHitLinkDown[ih]<0 ) && ( s.fHitLinkUp[ih]>=0 ) ){
-         Int_t oldNRowStartHits = CAMath::AtomicAdd(&s.fNRowStartHits,1);
-         s.fRowStartHits[oldNRowStartHits] = AliHLTTPCCATracker::IRowIHit2ID(s.fIRow, ih);
-       }
-      }
+      } else s.fNHits = -1;
     }
-  else if( iSync==2 )
-    {
-      if( iThread == 0 ){
-       s.fNOldStartHits = CAMath::AtomicAdd(tracker.NTracklets(),s.fNRowStartHits);  
+  } else if ( iSync == 1 ) {
+    for ( int ih = iThread; ih < s.fNHits; ih += nThreads ) {
+      if ( ( s.fHitLinkDown[ih] < 0 ) && ( s.fHitLinkUp[ih] >= 0 ) ) {
+        int oldNRowStartHits = CAMath::AtomicAdd( &s.fNRowStartHits, 1 );
+        s.fRowStartHits[oldNRowStartHits] = AliHLTTPCCATracker::IRowIHit2ID( s.fIRow, ih );
       }
     }
-  else if( iSync==3 )
-    {
-      Int_t *startHits = tracker.TrackletStartHits();
-      for( Int_t ish=iThread; ish<s.fNRowStartHits; ish+=nThreads ){    
-       startHits[s.fNOldStartHits+ish] = s.fRowStartHits[ish];
-      }
+  } else if ( iSync == 2 ) {
+    if ( iThread == 0 ) {
+      s.fNOldStartHits = CAMath::AtomicAdd( tracker.NTracklets(), s.fNRowStartHits );
+    }
+  } else if ( iSync == 3 ) {
+    int *startHits = tracker.TrackletStartHits();
+    for ( int ish = iThread; ish < s.fNRowStartHits; ish += nThreads ) {
+      startHits[s.fNOldStartHits+ish] = s.fRowStartHits[ish];
     }
+  }
 }
 
index 99246aea2de06eb1f51afa393189839110ea7218..c64129cce04945c87612e29136a2ffa766e9e028 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -15,40 +15,38 @@ class AliHLTTPCCATracker;
 
 /**
  * @class AliHLTTPCCAStartHitsFinder
- * 
+ *
  */
 class AliHLTTPCCAStartHitsFinder
 {
- public:
-  class AliHLTTPCCASharedMemory
 public:
+    class AliHLTTPCCASharedMemory
     {
-     friend class AliHLTTPCCAStartHitsFinder;
-    public:
- #if !defined(HLTCA_GPUCODE)
-      AliHLTTPCCASharedMemory()
-       : fIRow(0), fNRows(0), fNHits(0), fHitLinkDown(0), fHitLinkUp(0), fNOldStartHits(0), fNRowStartHits(0)
-      {}
-
-      AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/) 
-       : fIRow(0), fNRows(0), fNHits(0), fHitLinkDown(0), fHitLinkUp(0), fNOldStartHits(0), fNRowStartHits(0)
-      {}
-      AliHLTTPCCASharedMemory& operator=(const AliHLTTPCCASharedMemory& /*dummy*/){ return *this; }
+        friend class AliHLTTPCCAStartHitsFinder;
+      public:
+#if !defined(HLTCA_GPUCODE)
+        AliHLTTPCCASharedMemory()
+            : fIRow( 0 ), fNRows( 0 ), fNHits( 0 ), fHitLinkDown( 0 ), fHitLinkUp( 0 ), fNOldStartHits( 0 ), fNRowStartHits( 0 ) {}
+
+        AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ )
+            : fIRow( 0 ), fNRows( 0 ), fNHits( 0 ), fHitLinkDown( 0 ), fHitLinkUp( 0 ), fNOldStartHits( 0 ), fNRowStartHits( 0 ) {}
+        AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; }
 #endif
-    protected:
-      Int_t fIRow; // row index
-      Int_t fNRows; // n rows
-      Int_t fNHits; // n hits in the row
-      Short_t *fHitLinkDown; // pointer to down link array
-      Short_t *fHitLinkUp; // pointer to the up link array
-      Int_t fRowStartHits[10240]; // temp. array for the start hits
-      Int_t fNOldStartHits; // n start hits from other jobs
-      Int_t fNRowStartHits; // n start hits for this row
-   };
-
-  GPUd() static Int_t NThreadSyncPoints(){ return 3; }  
-
-  GPUd() static void Thread( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
-                            AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
+      protected:
+        int fIRow; // row index
+        int fNRows; // n rows
+        int fNHits; // n hits in the row
+        short *fHitLinkDown; // pointer to down link array
+        short *fHitLinkUp; // pointer to the up link array
+        int fRowStartHits[10240]; // temp. array for the start hits
+        int fNOldStartHits; // n start hits from other jobs
+        int fNRowStartHits; // n start hits for this row
+    };
+
+    GPUd() static int NThreadSyncPoints() { return 3; }
+
+    GPUd() static void Thread( int nBlocks, int nThreads, int iBlock, int iThread, int iSync,
+                               AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
 };
 
 
index a986ee32717a1e3abed6052af99c41873df3c0ea..8c1e8428b1cd9bd4fbe62bdee4a06f15d20a6c33 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
index cae970a1e9422534b03ea3f1ea99040577b0b440..08390482952aa937a137d4a733bad302553550e4 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCATrack
 {
- public:
 public:
 #if !defined(HLTCA_GPUCODE)
-  AliHLTTPCCATrack() :fAlive(0),fFirstHitID(0),fNHits(0), fParam(){}
-  ~AliHLTTPCCATrack(){}
+    AliHLTTPCCATrack() : fAlive( 0 ), fFirstHitID( 0 ), fNHits( 0 ), fParam() {}
+    ~AliHLTTPCCATrack() {}
 #endif
 
-  GPUhd() Bool_t Alive()               const { return fAlive; }
-  GPUhd() Int_t  NHits()               const { return fNHits; }
-  GPUhd() Int_t  FirstHitID()          const { return fFirstHitID; }
-  GPUhd() const AliHLTTPCCATrackParam &Param() const { return fParam; };
-  
-  GPUhd() void SetAlive( Bool_t v )               { fAlive=v; }
-  GPUhd() void SetNHits( Int_t v )               { fNHits=v; }
-  GPUhd() void SetFirstHitID( Int_t v )          { fFirstHitID=v; }
-  GPUhd() void SetParam( AliHLTTPCCATrackParam v ){ fParam=v; };
-  
-private:
-  
-  Bool_t fAlive;       // flag for mark tracks used by the track merger
-  Int_t  fFirstHitID; // index of the first track cell in the track->cell pointer array
-  Int_t  fNHits;      // number of track cells
-  AliHLTTPCCATrackParam fParam; // track parameters 
-  
-private:
-  //void Dummy(); // to make rulechecker happy by having something in .cxx file
-
-  //ClassDef(AliHLTTPCCATrack,1)
+    GPUhd() bool Alive()               const { return fAlive; }
+    GPUhd() int  NHits()               const { return fNHits; }
+    GPUhd() int  FirstHitID()          const { return fFirstHitID; }
+    GPUhd() const AliHLTTPCCATrackParam &Param() const { return fParam; };
+
+    GPUhd() void SetAlive( bool v )               { fAlive = v; }
+    GPUhd() void SetNHits( int v )               { fNHits = v; }
+    GPUhd() void SetFirstHitID( int v )          { fFirstHitID = v; }
+    GPUhd() void SetParam( AliHLTTPCCATrackParam v ) { fParam = v; };
+
+  private:
+
+    bool fAlive;       // flag for mark tracks used by the track merger
+    int  fFirstHitID; // index of the first track cell in the track->cell pointer array
+    int  fNHits;      // number of track cells
+    AliHLTTPCCATrackParam fParam; // track parameters
+
+  private:
+    //void Dummy(); // to make rulechecker happy by having something in .cxx file
+
+    //ClassDef(AliHLTTPCCATrack,1)
 };
 
 #endif
index aefc531bcfb97dee1c1af95b44c5b9294b582a34..600a0144942284af2aee10000ec52ea635646b84 100644 (file)
@@ -1,6 +1,6 @@
 // $Id: AliHLTTPCCATrackConvertor.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLTTPCCAMath.h"
 
 
-void AliHLTTPCCATrackConvertor::GetExtParam( const AliHLTTPCCATrackParam &T1, AliExternalTrackParam &T2, Double_t alpha )
+void AliHLTTPCCATrackConvertor::GetExtParam( const AliHLTTPCCATrackParam &T1, AliExternalTrackParam &T2, double alpha )
 {
-  //* Convert from AliHLTTPCCATrackParam to AliExternalTrackParam parameterisation, 
-  //* the angle alpha is the global angle of the local X axis 
+  //* Convert from AliHLTTPCCATrackParam to AliExternalTrackParam parameterisation,
+  //* the angle alpha is the global angle of the local X axis
 
-  Double_t par[5], cov[15];
-  for( Int_t i=0; i<5; i++ ) par[i] = T1.GetPar()[i];
-  for( Int_t i=0; i<15; i++ ) cov[i] = T1.GetCov()[i];
+  double par[5], cov[15];
+  for ( int i = 0; i < 5; i++ ) par[i] = T1.GetPar()[i];
+  for ( int i = 0; i < 15; i++ ) cov[i] = T1.GetCov()[i];
 
-  if(par[2]>.99 ) par[2]=.99;
-  if(par[2]<-.99 ) par[2]=-.99;
+  if ( par[2] > .99 ) par[2] = .99;
+  if ( par[2] < -.99 ) par[2] = -.99;
 
-  if( T1.GetSignCosPhi()<0 ){ // change direction
+  if ( T1.GetSignCosPhi() < 0 ) { // change direction
     par[2] = -par[2]; // sin phi
     par[3] = -par[3]; // DzDs
     par[4] = -par[4]; // kappa
@@ -47,18 +47,18 @@ void AliHLTTPCCATrackConvertor::GetExtParam( const AliHLTTPCCATrackParam &T1, Al
     cov[10] = -cov[10];
     cov[11] = -cov[11];
   }
-  T2.Set( (Double_t) T1.GetX(),alpha,par,cov);
+  T2.Set( ( double ) T1.GetX(), alpha, par, cov );
 }
 
 void AliHLTTPCCATrackConvertor::SetExtParam( AliHLTTPCCATrackParam &T1, const AliExternalTrackParam &T2 )
 {
   //* Convert from AliExternalTrackParam parameterisation
-  
-  for( Int_t i=0; i<5; i++ ) T1.SetPar( i, T2.GetParameter()[i] );
-  for( Int_t i=0; i<15; i++ ) T1.SetCov( i, T2.GetCovariance()[i] );
+
+  for ( int i = 0; i < 5; i++ ) T1.SetPar( i, T2.GetParameter()[i] );
+  for ( int i = 0; i < 15; i++ ) T1.SetCov( i, T2.GetCovariance()[i] );
   T1.SetX( T2.GetX() );
-  if(T1.SinPhi()>.99 ) T1.SetSinPhi( .99 );
-  if(T1.SinPhi()<-.99 ) T1.SetSinPhi( -.99 );
+  if ( T1.SinPhi() > .99 ) T1.SetSinPhi( .99 );
+  if ( T1.SinPhi() < -.99 ) T1.SetSinPhi( -.99 );
   T1.SetSignCosPhi( 1 );
 }
 
index 1685b5879eee0a807670c69a2e78a0f9686f831f..a573745fbd3801d8bb8ab707685fd1a9abd2ae55 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -23,12 +23,12 @@ class AliHLTTPCCATrackParam;
  */
 class AliHLTTPCCATrackConvertor
 {
- public:
 public:
 
-  AliHLTTPCCATrackConvertor(){}
+    AliHLTTPCCATrackConvertor() {}
 
-  static void GetExtParam( const AliHLTTPCCATrackParam &T1, AliExternalTrackParam &T2, Double_t alpha );
-  static void SetExtParam( AliHLTTPCCATrackParam &T1, const AliExternalTrackParam &T2 );
+    static void GetExtParam( const AliHLTTPCCATrackParam &T1, AliExternalTrackParam &T2, double alpha );
+    static void SetExtParam( AliHLTTPCCATrackParam &T1, const AliExternalTrackParam &T2 );
 
 };
 
index 65413303d2704d79a6a0f562e204ebb5a533180e..e00ce0f95abe2e0f6ccb237dc090860af8f7c420 100644 (file)
@@ -1,5 +1,5 @@
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
 /**
  * @class AliHLTTPCCATrackLinearisation
  *
- * AliHLTTPCCATrackLinearisation class describes the parameters which are used 
+ * AliHLTTPCCATrackLinearisation class describes the parameters which are used
  * to linearise the transport equations for the track trajectory.
  *
- * The class is used during track (re)fit, when the AliHLTTPCTrackParam track is only 
- * partially fitted, and there is some apriory knowledge about trajectory. 
- * This apriory knowledge is used to linearise the transport equations. 
+ * The class is used during track (re)fit, when the AliHLTTPCTrackParam track is only
+ * partially fitted, and there is some apriory knowledge about trajectory.
+ * This apriory knowledge is used to linearise the transport equations.
  *
- * In case the track is fully fitted, the best linearisation point is  
+ * In case the track is fully fitted, the best linearisation point is
  * the track trajectory itself (AliHLTTPCCATrackLinearisation = AliHLTTPCTrackParam ).
  *
  */
 class AliHLTTPCCATrackLinearisation
 {
- public:
 public:
 
-  AliHLTTPCCATrackLinearisation()
-    :fSinPhi( 0 ), fCosPhi( 1 ), fDzDs( 0 ), fQPt( 0 ){}
+    AliHLTTPCCATrackLinearisation()
+        : fSinPhi( 0 ), fCosPhi( 1 ), fDzDs( 0 ), fQPt( 0 ) {}
 
-  AliHLTTPCCATrackLinearisation( Float_t SinPhi1, Float_t CosPhi1, Float_t DzDs1, Float_t QPt1 )
-    : fSinPhi( SinPhi1 ), fCosPhi( CosPhi1 ), fDzDs( DzDs1 ), fQPt( QPt1 )
-    {}
-  
-  AliHLTTPCCATrackLinearisation( const AliHLTTPCCATrackParam &t );
-                                                                                            
-  GPUd() void Set( Float_t SinPhi1, Float_t CosPhi1, Float_t DzDs1, Float_t QPt1 );
+    AliHLTTPCCATrackLinearisation( float SinPhi1, float CosPhi1, float DzDs1, float QPt1 )
+        : fSinPhi( SinPhi1 ), fCosPhi( CosPhi1 ), fDzDs( DzDs1 ), fQPt( QPt1 ) {}
 
+    AliHLTTPCCATrackLinearisation( const AliHLTTPCCATrackParam &t );
 
-  GPUd() Float_t SinPhi()const { return fSinPhi; }
-  GPUd() Float_t CosPhi()const { return fCosPhi; }
-  GPUd() Float_t DzDs()  const { return fDzDs; }
-  GPUd() Float_t QPt()   const { return fQPt; }
+    GPUd() void Set( float SinPhi1, float CosPhi1, float DzDs1, float QPt1 );
 
-  GPUd() Float_t GetSinPhi()const { return fSinPhi; }
-  GPUd() Float_t GetCosPhi()const { return fCosPhi; }
-  GPUd() Float_t GetDzDs()  const { return fDzDs; }
-  GPUd() Float_t GetQPt()   const { return fQPt; }
 
-  GPUd() void SetSinPhi( Float_t v ){  fSinPhi = v; }
-  GPUd() void SetCosPhi( Float_t v ){  fCosPhi = v; }
-  GPUd() void SetDzDs( Float_t v )  {  fDzDs   = v; }
-  GPUd() void SetQPt( Float_t v )   {  fQPt = v; }
+    GPUd() float SinPhi()const { return fSinPhi; }
+    GPUd() float CosPhi()const { return fCosPhi; }
+    GPUd() float DzDs()  const { return fDzDs; }
+    GPUd() float QPt()   const { return fQPt; }
 
-private:
+    GPUd() float GetSinPhi()const { return fSinPhi; }
+    GPUd() float GetCosPhi()const { return fCosPhi; }
+    GPUd() float GetDzDs()  const { return fDzDs; }
+    GPUd() float GetQPt()   const { return fQPt; }
 
-  Float_t fSinPhi; // SinPhi
-  Float_t fCosPhi; // CosPhi
-  Float_t fDzDs;   // DzDs
-  Float_t fQPt;    // QPt
+    GPUd() void SetSinPhi( float v ) {  fSinPhi = v; }
+    GPUd() void SetCosPhi( float v ) {  fCosPhi = v; }
+    GPUd() void SetDzDs( float v )  {  fDzDs   = v; }
+    GPUd() void SetQPt( float v )   {  fQPt = v; }
+
+  private:
+
+    float fSinPhi; // SinPhi
+    float fCosPhi; // CosPhi
+    float fDzDs;   // DzDs
+    float fQPt;    // QPt
 };
 
 
 inline AliHLTTPCCATrackLinearisation::AliHLTTPCCATrackLinearisation( const AliHLTTPCCATrackParam &t )
-  : fSinPhi(t.SinPhi()), fCosPhi(0), fDzDs(t.DzDs()), fQPt( t.QPt() )
+    : fSinPhi( t.SinPhi() ), fCosPhi( 0 ), fDzDs( t.DzDs() ), fQPt( t.QPt() )
 {
-  if( fSinPhi > .999 ) fSinPhi = .999;
-  else if( fSinPhi < -.999 ) fSinPhi = -.999;
-  fCosPhi = CAMath::Sqrt(1 - fSinPhi*fSinPhi);
-  if( t.SignCosPhi()<0 ) fCosPhi = -fCosPhi;
+  if ( fSinPhi > .999 ) fSinPhi = .999;
+  else if ( fSinPhi < -.999 ) fSinPhi = -.999;
+  fCosPhi = CAMath::Sqrt( 1 - fSinPhi * fSinPhi );
+  if ( t.SignCosPhi() < 0 ) fCosPhi = -fCosPhi;
 }
-                               
 
-GPUd() inline void AliHLTTPCCATrackLinearisation::Set( Float_t SinPhi1, Float_t CosPhi1, 
-                                                 Float_t DzDs1, Float_t QPt1 )
+
+GPUd() inline void AliHLTTPCCATrackLinearisation::Set( float SinPhi1, float CosPhi1,
+    float DzDs1, float QPt1 )
 {
-  SetSinPhi( SinPhi1 ); 
-  SetCosPhi( CosPhi1 ); 
-  SetDzDs( DzDs1 ); 
+  SetSinPhi( SinPhi1 );
+  SetCosPhi( CosPhi1 );
+  SetDzDs( DzDs1 );
   SetQPt( QPt1 );
 }
 
index 70674bb92f8df58e4309ca52b2540ecd532c4faa..e71022d462eccfbfc484f41ce6e5d6e2c38271fc 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 //
 // Circle in XY:
 //
-// kCLight = 0.000299792458; 
+// kCLight = 0.000299792458;
 // Kappa = Bz*kCLight*QPt;
 // R  = 1/TMath::Abs(Kappa);
 // Xc = X - sin(Phi)/Kappa;
 // Yc = Y + cos(Phi)/Kappa;
 //
 
-GPUd() Float_t AliHLTTPCCATrackParam::GetDist2( const AliHLTTPCCATrackParam &t ) const
+GPUd() float AliHLTTPCCATrackParam::GetDist2( const AliHLTTPCCATrackParam &t ) const
 {
-  // get squared distance between tracks 
+  // get squared distance between tracks
 
-  Float_t dx = GetX() - t.GetX();
-  Float_t dy = GetY() - t.GetY();
-  Float_t dz = GetZ() - t.GetZ();
+  float dx = GetX() - t.GetX();
+  float dy = GetY() - t.GetY();
+  float dz = GetZ() - t.GetZ();
   return dx*dx + dy*dy + dz*dz;
 }
 
-GPUd() Float_t AliHLTTPCCATrackParam::GetDistXZ2( const AliHLTTPCCATrackParam &t ) const
+GPUd() float AliHLTTPCCATrackParam::GetDistXZ2( const AliHLTTPCCATrackParam &t ) const
 {
-  // get squared distance between tracks in X&Z 
+  // get squared distance between tracks in X&Z
 
-  Float_t dx = GetX() - t.GetX();
-  Float_t dz = GetZ() - t.GetZ();
+  float dx = GetX() - t.GetX();
+  float dz = GetZ() - t.GetZ();
   return dx*dx + dz*dz;
 }
 
 
-GPUd() Float_t  AliHLTTPCCATrackParam::GetS( Float_t x, Float_t y, Float_t Bz ) const
+GPUd() float  AliHLTTPCCATrackParam::GetS( float x, float y, float Bz ) const
 {
   //* Get XY path length to the given point
 
-  Float_t k  = GetKappa( Bz );
-  Float_t ex = GetCosPhi();
-  Float_t ey = GetSinPhi();
-  x-= GetX();
-  y-= GetY();
-  Float_t dS = x*ex + y*ey;
-  if( CAMath::Abs(k)>1.e-4 ) dS = CAMath::ATan2( k*dS, 1+k*(x*ey-y*ex) )/k;
+  float k  = GetKappa( Bz );
+  float ex = GetCosPhi();
+  float ey = GetSinPhi();
+  x -= GetX();
+  y -= GetY();
+  float dS = x * ex + y * ey;
+  if ( CAMath::Abs( k ) > 1.e-4 ) dS = CAMath::ATan2( k * dS, 1 + k * ( x * ey - y * ex ) ) / k;
   return dS;
 }
 
-GPUd() void  AliHLTTPCCATrackParam::GetDCAPoint( Float_t x, Float_t y, Float_t z,
-                                                Float_t &xp, Float_t &yp, Float_t &zp, 
-                                                Float_t Bz ) const
+GPUd() void  AliHLTTPCCATrackParam::GetDCAPoint( float x, float y, float z,
+    float &xp, float &yp, float &zp,
+    float Bz ) const
 {
   //* Get the track point closest to the (x,y,z)
 
-  Float_t x0 = GetX();
-  Float_t y0 = GetY();
-  Float_t k  = GetKappa( Bz );
-  Float_t ex = GetCosPhi();
-  Float_t ey = GetSinPhi();
-  Float_t dx = x - x0;
-  Float_t dy = y - y0; 
-  Float_t ax = dx*k+ey;
-  Float_t ay = dy*k-ex;
-  Float_t a = sqrt( ax*ax+ay*ay );
-  xp = x0 + (dx - ey*( (dx*dx+dy*dy)*k - 2*(-dx*ey+dy*ex) )/(a+1) )/a;
-  yp = y0 + (dy + ex*( (dx*dx+dy*dy)*k - 2*(-dx*ey+dy*ex) )/(a+1) )/a;
-  Float_t s = GetS(x,y, Bz);
-  zp = GetZ() + GetDzDs()*s;
-  if( CAMath::Abs(k)>1.e-2 ){
-    Float_t dZ = CAMath::Abs( GetDzDs()*CAMath::TwoPi()/k );
-    if( dZ>.1 ){
-      zp+= CAMath::Nint((z-zp)/dZ)*dZ;    
+  float x0 = GetX();
+  float y0 = GetY();
+  float k  = GetKappa( Bz );
+  float ex = GetCosPhi();
+  float ey = GetSinPhi();
+  float dx = x - x0;
+  float dy = y - y0;
+  float ax = dx * k + ey;
+  float ay = dy * k - ex;
+  float a = sqrt( ax * ax + ay * ay );
+  xp = x0 + ( dx - ey * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a;
+  yp = y0 + ( dy + ex * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a;
+  float s = GetS( x, y, Bz );
+  zp = GetZ() + GetDzDs() * s;
+  if ( CAMath::Abs( k ) > 1.e-2 ) {
+    float dZ = CAMath::Abs( GetDzDs() * CAMath::TwoPi() / k );
+    if ( dZ > .1 ) {
+      zp += CAMath::Nint( ( z - zp ) / dZ ) * dZ;
     }
   }
 }
@@ -101,191 +101,192 @@ GPUd() void  AliHLTTPCCATrackParam::GetDCAPoint( Float_t x, Float_t y, Float_t z
 //*
 
 
-GPUd() Bool_t  AliHLTTPCCATrackParam::TransportToX( Float_t x, AliHLTTPCCATrackLinearisation &t0, Float_t Bz,  Float_t maxSinPhi, Float_t *DL )
+GPUd() bool  AliHLTTPCCATrackParam::TransportToX( float x, AliHLTTPCCATrackLinearisation &t0, float Bz,  float maxSinPhi, float *DL )
 {
   //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz
   //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
-  //* linearisation of trajectory t0 is also transported to X=x, 
+  //* linearisation of trajectory t0 is also transported to X=x,
   //* returns 1 if OK
   //*
 
-  Float_t ex = t0.CosPhi();
-  Float_t ey = t0.SinPhi();
-  Float_t k   = t0.QPt()*Bz;
-  Float_t dx = x - X();
-
-  Float_t ey1 = k*dx + ey;
-  Float_t ex1;
-  
-  // check for intersection with X=x 
-
-  if( CAMath::Abs(ey1)>maxSinPhi ) return 0;
-
-  ex1 = CAMath::Sqrt(1 - ey1*ey1);
-  if( ex<0 ) ex1 = -ex1;
-  
-  Float_t dx2 = dx*dx;
-  Float_t ss = ey+ey1;
-  Float_t cc = ex+ex1;  
-
-  if( CAMath::Abs(cc)<1.e-4 || CAMath::Abs(ex)<1.e-4 || CAMath::Abs(ex1)<1.e-4 ) return 0;
-
-  Float_t tg = ss/cc; // tan((phi1+phi)/2)
-  
-  Float_t dy = dx*tg;
-  Float_t dl = dx*CAMath::Sqrt(1+tg*tg);
-
-  if( cc<0 ) dl = -dl;
-  Float_t dSin = dl*k/2;
-  if( dSin > 1 ) dSin = 1;
-  if( dSin <-1 ) dSin = -1;
-  Float_t dS = ( CAMath::Abs(k)>1.e-4)  ? (2*CAMath::ASin(dSin)/k) :dl;  
-  Float_t dz = dS*t0.DzDs();
-
-  if( DL ) *DL = -dS*CAMath::Sqrt(1 + t0.DzDs()*t0.DzDs() );
-
-  Float_t cci = 1./cc;
-  Float_t exi = 1./ex;
-  Float_t ex1i = 1./ex1;
-  
-  Float_t d[5] = { 0,
-                  0,
-                  fP[2]-t0.SinPhi(),
-                  fP[3]-t0.DzDs(), 
-                  fP[4]-t0.QPt() };
-
-  //Float_t H0[5] = { 1,0, h2,  0, h4 };
-  //Float_t H1[5] = { 0, 1, 0, dS,  0 };
-  //Float_t H2[5] = { 0, 0, 1,  0, dxBz };
-  //Float_t H3[5] = { 0, 0, 0,  1,  0 };
-  //Float_t H4[5] = { 0, 0, 0,  0,  1 };
-  
-  Float_t h2 = dx*(1+ey*ey1 + ex*ex1)*exi*ex1i*cci;
-  Float_t h4 = dx2*(cc + ss*ey1*ex1i )*cci*cci*Bz;
-  Float_t dxBz = dx*Bz;
+  float ex = t0.CosPhi();
+  float ey = t0.SinPhi();
+  float k   = t0.QPt() * Bz;
+  float dx = x - X();
+
+  float ey1 = k * dx + ey;
+  float ex1;
+
+  // check for intersection with X=x
+
+  if ( CAMath::Abs( ey1 ) > maxSinPhi ) return 0;
+
+  ex1 = CAMath::Sqrt( 1 - ey1 * ey1 );
+  if ( ex < 0 ) ex1 = -ex1;
+
+  float dx2 = dx * dx;
+  float ss = ey + ey1;
+  float cc = ex + ex1;
+
+  if ( CAMath::Abs( cc ) < 1.e-4 || CAMath::Abs( ex ) < 1.e-4 || CAMath::Abs( ex1 ) < 1.e-4 ) return 0;
+
+  float tg = ss / cc; // tan((phi1+phi)/2)
+
+  float dy = dx * tg;
+  float dl = dx * CAMath::Sqrt( 1 + tg * tg );
+
+  if ( cc < 0 ) dl = -dl;
+  float dSin = dl * k / 2;
+  if ( dSin > 1 ) dSin = 1;
+  if ( dSin < -1 ) dSin = -1;
+  float dS = ( CAMath::Abs( k ) > 1.e-4 )  ? ( 2 * CAMath::ASin( dSin ) / k ) : dl;
+  float dz = dS * t0.DzDs();
+
+  if ( DL ) *DL = -dS * CAMath::Sqrt( 1 + t0.DzDs() * t0.DzDs() );
+
+  float cci = 1. / cc;
+  float exi = 1. / ex;
+  float ex1i = 1. / ex1;
+
+  float d[5] = { 0,
+                   0,
+                   fP[2] - t0.SinPhi(),
+                   fP[3] - t0.DzDs(),
+                   fP[4] - t0.QPt()
+                 };
+
+  //float H0[5] = { 1,0, h2,  0, h4 };
+  //float H1[5] = { 0, 1, 0, dS,  0 };
+  //float H2[5] = { 0, 0, 1,  0, dxBz };
+  //float H3[5] = { 0, 0, 0,  1,  0 };
+  //float H4[5] = { 0, 0, 0,  0,  1 };
+
+  float h2 = dx * ( 1 + ey * ey1 + ex * ex1 ) * exi * ex1i * cci;
+  float h4 = dx2 * ( cc + ss * ey1 * ex1i ) * cci * cci * Bz;
+  float dxBz = dx * Bz;
 
   t0.SetCosPhi( ex1 );
-  t0.SetSinPhi( ey1 );  
+  t0.SetSinPhi( ey1 );
 
   fX    = X() + dx;
-  fP[0] = Y() + dy     + h2*d[2]           +   h4*d[4];
-  fP[1] = Z() + dz               + dS*d[3];
-  fP[2] = t0.SinPhi() +     d[2]           + dxBz*d[4];
-
-  Float_t c00 = fC[0];
-  Float_t c10 = fC[1];
-  Float_t c11 = fC[2];
-  Float_t c20 = fC[3];
-  Float_t c21 = fC[4];
-  Float_t c22 = fC[5];
-  Float_t c30 = fC[6];
-  Float_t c31 = fC[7];
-  Float_t c32 = fC[8];
-  Float_t c33 = fC[9];
-  Float_t c40 = fC[10];
-  Float_t c41 = fC[11];
-  Float_t c42 = fC[12];
-  Float_t c43 = fC[13];
-  Float_t c44 = fC[14];
-
-  fC[0]=( c00  + h2*h2*c22 + h4*h4*c44 
-         + 2*( h2*c20 + h4*c40 + h2*h4*c42 )  ); 
-
-  fC[1]= c10 + h2*c21 + h4*c41 + dS*(c30 + h2*c32 + h4*c43);
-  fC[2]= c11 + 2*dS*c31 + dS*dS*c33;
-
-  fC[3]= c20 + h2*c22 + h4*c42 + dxBz*( c40 + h2*c42 + h4*c44);
-  fC[4]= c21 + dS*c32 + dxBz*(c41 + dS*c43);
-  fC[5]= c22 +2*dxBz*c42 + dxBz*dxBz*c44;
-
-  fC[6]= c30 + h2*c32 + h4*c43;
-  fC[7]= c31 + dS*c33;
-  fC[8]= c32 + dxBz*c43;
-  fC[9]= c33;
-
-  fC[10]= c40 + h2*c42 + h4*c44;
-  fC[11]= c41 + dS*c43;
-  fC[12]= c42 + dxBz*c44;
-  fC[13]= c43;
-  fC[14]= c44;
+  fP[0] = Y() + dy     + h2 * d[2]           +   h4 * d[4];
+  fP[1] = Z() + dz               + dS * d[3];
+  fP[2] = t0.SinPhi() +     d[2]           + dxBz * d[4];
+
+  float c00 = fC[0];
+  float c10 = fC[1];
+  float c11 = fC[2];
+  float c20 = fC[3];
+  float c21 = fC[4];
+  float c22 = fC[5];
+  float c30 = fC[6];
+  float c31 = fC[7];
+  float c32 = fC[8];
+  float c33 = fC[9];
+  float c40 = fC[10];
+  float c41 = fC[11];
+  float c42 = fC[12];
+  float c43 = fC[13];
+  float c44 = fC[14];
+
+  fC[0] = ( c00  + h2 * h2 * c22 + h4 * h4 * c44
+            + 2 * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 )  );
+
+  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
+  fC[2] = c11 + 2 * dS * c31 + dS * dS * c33;
+
+  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
+  fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 );
+  fC[5] = c22 + 2 * dxBz * c42 + dxBz * dxBz * c44;
+
+  fC[6] = c30 + h2 * c32 + h4 * c43;
+  fC[7] = c31 + dS * c33;
+  fC[8] = c32 + dxBz * c43;
+  fC[9] = c33;
+
+  fC[10] = c40 + h2 * c42 + h4 * c44;
+  fC[11] = c41 + dS * c43;
+  fC[12] = c42 + dxBz * c44;
+  fC[13] = c43;
+  fC[14] = c44;
 
   return 1;
 }
 
 
-GPUd() Bool_t  AliHLTTPCCATrackParam::TransportToX( Float_t x, Float_t sinPhi0, Float_t cosPhi0,  Float_t Bz, Float_t maxSinPhi )
+GPUd() bool  AliHLTTPCCATrackParam::TransportToX( float x, float sinPhi0, float cosPhi0,  float Bz, float maxSinPhi )
 {
-  //* Transport the track parameters to X=x, using linearization at phi0 with 0 curvature, 
+  //* Transport the track parameters to X=x, using linearization at phi0 with 0 curvature,
   //* and the field value Bz
   //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
-  //* linearisation of trajectory t0 is also transported to X=x, 
+  //* linearisation of trajectory t0 is also transported to X=x,
   //* returns 1 if OK
   //*
 
-  Float_t ex = cosPhi0;
-  Float_t ey = sinPhi0;
-  Float_t dx = x - X();
+  float ex = cosPhi0;
+  float ey = sinPhi0;
+  float dx = x - X();
+
+  if ( CAMath::Abs( ex ) < 1.e-4 ) return 0;
+  float exi = 1. / ex;
 
-  if( CAMath::Abs(ex)<1.e-4 ) return 0;
-  Float_t exi = 1./ex;
+  float dxBz = dx * Bz;
+  float dS = dx * exi;
+  float h2 = dS * exi * exi;
+  float h4 = .5 * h2 * dxBz;
 
-  Float_t dxBz = dx*Bz;
-  Float_t dS = dx*exi;
-  Float_t h2 = dS*exi*exi;
-  Float_t h4 = .5*h2*dxBz;
-  //Float_t H0[5] = { 1,0, h2,  0, h4 };
-  //Float_t H1[5] = { 0, 1, 0, dS,  0 };
-  //Float_t H2[5] = { 0, 0, 1,  0, dxBz };
-  //Float_t H3[5] = { 0, 0, 0,  1,  0 };
-  //Float_t H4[5] = { 0, 0, 0,  0,  1 };
+  //float H0[5] = { 1,0, h2,  0, h4 };
+  //float H1[5] = { 0, 1, 0, dS,  0 };
+  //float H2[5] = { 0, 0, 1,  0, dxBz };
+  //float H3[5] = { 0, 0, 0,  1,  0 };
+  //float H4[5] = { 0, 0, 0,  0,  1 };
 
-  Float_t sinPhi = SinPhi() + dxBz*QPt();
-  if( maxSinPhi>0 && CAMath::Abs(sinPhi)>maxSinPhi ) return 0;
+  float sinPhi = SinPhi() + dxBz * QPt();
+  if ( maxSinPhi > 0 && CAMath::Abs( sinPhi ) > maxSinPhi ) return 0;
 
   fX    = X() + dx;
-  fP[0]+= dS*ey + h2*( SinPhi() - ey )  +   h4*QPt();
-  fP[1]+= dS*DzDs();
+  fP[0] += dS * ey + h2 * ( SinPhi() - ey )  +   h4 * QPt();
+  fP[1] += dS * DzDs();
   fP[2] = sinPhi;
 
-  Float_t c00 = fC[0];
-  Float_t c10 = fC[1];
-  Float_t c11 = fC[2];
-  Float_t c20 = fC[3];
-  Float_t c21 = fC[4];
-  Float_t c22 = fC[5];
-  Float_t c30 = fC[6];
-  Float_t c31 = fC[7];
-  Float_t c32 = fC[8];
-  Float_t c33 = fC[9];
-  Float_t c40 = fC[10];
-  Float_t c41 = fC[11];
-  Float_t c42 = fC[12];
-  Float_t c43 = fC[13];
-  Float_t c44 = fC[14];
-
-
-  fC[0]=( c00  + h2*h2*c22 + h4*h4*c44 
-         + 2*( h2*c20 + h4*c40 + h2*h4*c42 )  ); 
-
-  fC[1]= c10 + h2*c21 + h4*c41 + dS*(c30 + h2*c32 + h4*c43);
-  fC[2]= c11 + 2*dS*c31 + dS*dS*c33;
-
-  fC[3]= c20 + h2*c22 + h4*c42 + dxBz*( c40 + h2*c42 + h4*c44);
-  fC[4]= c21 + dS*c32 + dxBz*(c41 + dS*c43);
-  fC[5]= c22 +2*dxBz*c42 + dxBz*dxBz*c44;
-
-  fC[6]= c30 + h2*c32 + h4*c43;
-  fC[7]= c31 + dS*c33;
-  fC[8]= c32 + dxBz*c43;
-  fC[9]= c33;
-
-  fC[10]= c40 + h2*c42 + h4*c44;
-  fC[11]= c41 + dS*c43;
-  fC[12]= c42 + dxBz*c44;
-  fC[13]= c43;
-  fC[14]= c44;
+
+  float c00 = fC[0];
+  float c10 = fC[1];
+  float c11 = fC[2];
+  float c20 = fC[3];
+  float c21 = fC[4];
+  float c22 = fC[5];
+  float c30 = fC[6];
+  float c31 = fC[7];
+  float c32 = fC[8];
+  float c33 = fC[9];
+  float c40 = fC[10];
+  float c41 = fC[11];
+  float c42 = fC[12];
+  float c43 = fC[13];
+  float c44 = fC[14];
+
+
+  fC[0] = ( c00  + h2 * h2 * c22 + h4 * h4 * c44
+            + 2 * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 )  );
+
+  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 );
+  fC[2] = c11 + 2 * dS * c31 + dS * dS * c33;
+
+  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 );
+  fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 );
+  fC[5] = c22 + 2 * dxBz * c42 + dxBz * dxBz * c44;
+
+  fC[6] = c30 + h2 * c32 + h4 * c43;
+  fC[7] = c31 + dS * c33;
+  fC[8] = c32 + dxBz * c43;
+  fC[9] = c33;
+
+  fC[10] = c40 + h2 * c42 + h4 * c44;
+  fC[11] = c41 + dS * c43;
+  fC[12] = c42 + dxBz * c44;
+  fC[13] = c43;
+  fC[14] = c44;
 
   return 1;
 }
@@ -295,48 +296,48 @@ GPUd() Bool_t  AliHLTTPCCATrackParam::TransportToX( Float_t x, Float_t sinPhi0,
 
 
 
-GPUd() Bool_t  AliHLTTPCCATrackParam::TransportToX( Float_t x, Float_t Bz, Float_t maxSinPhi )
+GPUd() bool  AliHLTTPCCATrackParam::TransportToX( float x, float Bz, float maxSinPhi )
 {
-  //* Transport the track parameters to X=x 
+  //* Transport the track parameters to X=x
 
-  AliHLTTPCCATrackLinearisation t0(*this);
+  AliHLTTPCCATrackLinearisation t0( *this );
 
   return TransportToX( x, t0, Bz, maxSinPhi );
 }
 
 
 
-GPUd() Bool_t  AliHLTTPCCATrackParam::TransportToXWithMaterial( Float_t x,  AliHLTTPCCATrackLinearisation &t0, AliHLTTPCCATrackFitParam &par, Float_t Bz, Float_t maxSinPhi )
+GPUd() bool  AliHLTTPCCATrackParam::TransportToXWithMaterial( float x,  AliHLTTPCCATrackLinearisation &t0, AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi )
 {
   //* Transport the track parameters to X=x  taking into account material budget
 
-  const Float_t kRho = 1.025e-3;//0.9e-3; 
-  const Float_t kRadLen=29.532;//28.94;
-  const Float_t kRhoOverRadLen = kRho/kRadLen;
-  Float_t dl;
+  const float kRho = 1.025e-3;//0.9e-3;
+  const float kRadLen = 29.532;//28.94;
+  const float kRhoOverRadLen = kRho / kRadLen;
+  float dl;
 
-  if( !TransportToX( x, t0, Bz,  maxSinPhi, &dl ) ) return 0;
+  if ( !TransportToX( x, t0, Bz,  maxSinPhi, &dl ) ) return 0;
 
-  CorrectForMeanMaterial(dl*kRhoOverRadLen,dl*kRho,par);  
+  CorrectForMeanMaterial( dl*kRhoOverRadLen, dl*kRho, par );
   return 1;
 }
 
 
-GPUd() Bool_t  AliHLTTPCCATrackParam::TransportToXWithMaterial( Float_t x,  AliHLTTPCCATrackFitParam &par, Float_t Bz, Float_t maxSinPhi )
+GPUd() bool  AliHLTTPCCATrackParam::TransportToXWithMaterial( float x,  AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi )
 {
   //* Transport the track parameters to X=x  taking into account material budget
 
-  AliHLTTPCCATrackLinearisation t0(*this);
+  AliHLTTPCCATrackLinearisation t0( *this );
   return TransportToXWithMaterial( x, t0, par, Bz, maxSinPhi );
 }
 
-GPUd() Bool_t AliHLTTPCCATrackParam::TransportToXWithMaterial( Float_t x, Float_t Bz, Float_t maxSinPhi )
+GPUd() bool AliHLTTPCCATrackParam::TransportToXWithMaterial( float x, float Bz, float maxSinPhi )
 {
   //* Transport the track parameters to X=x taking into account material budget
 
   AliHLTTPCCATrackFitParam par;
   CalculateFitParameters( par );
-  return TransportToXWithMaterial(x, par, Bz, maxSinPhi );
+  return TransportToXWithMaterial( x, par, Bz, maxSinPhi );
 }
 
 
@@ -345,12 +346,12 @@ GPUd() Bool_t AliHLTTPCCATrackParam::TransportToXWithMaterial( Float_t x, Float_
 //*
 
 
-Float_t AliHLTTPCCATrackParam::BetheBlochGeant(Float_t bg2,
-                                              Float_t kp0,
-                                              Float_t kp1,
-                                              Float_t kp2,
-                                              Float_t kp3,
-                                              Float_t kp4) 
+float AliHLTTPCCATrackParam::BetheBlochGeant( float bg2,
+    float kp0,
+    float kp1,
+    float kp2,
+    float kp3,
+    float kp4 )
 {
   //
   // This is the parameterization of the Bethe-Bloch formula inspired by Geant.
@@ -362,150 +363,150 @@ Float_t AliHLTTPCCATrackParam::BetheBlochGeant(Float_t bg2,
   // kp3 - mean excitation energy [GeV]
   // kp4 - mean Z/A
   //
-  // The default values for the kp* parameters are for silicon. 
+  // The default values for the kp* parameters are for silicon.
   // The returned value is in [GeV/(g/cm^2)].
-  // 
-
-  const Float_t mK  = 0.307075e-3; // [GeV*cm^2/g]
-  const Float_t me  = 0.511e-3;    // [GeV/c^2]
-  const Float_t rho = kp0;
-  const Float_t x0  = kp1*2.303;
-  const Float_t x1  = kp2*2.303;
-  const Float_t mI  = kp3;
-  const Float_t mZA = kp4;
-  const Float_t maxT= 2*me*bg2;    // neglecting the electron mass
-  
+  //
+
+  const float mK  = 0.307075e-3; // [GeV*cm^2/g]
+  const float me  = 0.511e-3;    // [GeV/c^2]
+  const float rho = kp0;
+  const float x0  = kp1 * 2.303;
+  const float x1  = kp2 * 2.303;
+  const float mI  = kp3;
+  const float mZA = kp4;
+  const float maxT = 2 * me * bg2;    // neglecting the electron mass
+
   //*** Density effect
-  Float_t d2=0.; 
-  const Float_t x=0.5*TMath::Log(bg2);
-  const Float_t lhwI=TMath::Log(28.816*1e-9*TMath::Sqrt(rho*mZA)/mI);
-  if (x > x1) {
+  float d2 = 0.;
+  const float x = 0.5 * TMath::Log( bg2 );
+  const float lhwI = TMath::Log( 28.816 * 1e-9 * TMath::Sqrt( rho * mZA ) / mI );
+  if ( x > x1 ) {
     d2 = lhwI + x - 0.5;
-  } else if (x > x0) {
-    const Float_t r=(x1-x)/(x1-x0);
-    d2 = lhwI + x - 0.5 + (0.5 - lhwI - x0)*r*r*r;
+  } else if ( x > x0 ) {
+    const float r = ( x1 - x ) / ( x1 - x0 );
+    d2 = lhwI + x - 0.5 + ( 0.5 - lhwI - x0 ) * r * r * r;
   }
 
-  return mK*mZA*(1+bg2)/bg2*(0.5*TMath::Log(2*me*bg2*maxT/(mI*mI)) - bg2/(1+bg2) - d2);
+  return mK*mZA*( 1 + bg2 ) / bg2*( 0.5*TMath::Log( 2*me*bg2*maxT / ( mI*mI ) ) - bg2 / ( 1 + bg2 ) - d2 );
 }
 
-Float_t AliHLTTPCCATrackParam::BetheBlochSolid(Float_t bg) 
+float AliHLTTPCCATrackParam::BetheBlochSolid( float bg )
 {
   //------------------------------------------------------------------
-  // This is an approximation of the Bethe-Bloch formula, 
-  // reasonable for solid materials. 
+  // This is an approximation of the Bethe-Bloch formula,
+  // reasonable for solid materials.
   // All the parameters are, in fact, for Si.
   // The returned value is in [GeV]
   //------------------------------------------------------------------
 
-  return BetheBlochGeant(bg);
+  return BetheBlochGeant( bg );
 }
 
-Float_t AliHLTTPCCATrackParam::BetheBlochGas(Float_t bg) 
+float AliHLTTPCCATrackParam::BetheBlochGas( float bg )
 {
   //------------------------------------------------------------------
-  // This is an approximation of the Bethe-Bloch formula, 
+  // This is an approximation of the Bethe-Bloch formula,
   // reasonable for gas materials.
   // All the parameters are, in fact, for Ne.
   // The returned value is in [GeV]
   //------------------------------------------------------------------
 
-  const Float_t rho = 0.9e-3;
-  const Float_t x0  = 2.;
-  const Float_t x1  = 4.;
-  const Float_t mI  = 140.e-9;
-  const Float_t mZA = 0.49555;
+  const float rho = 0.9e-3;
+  const float x0  = 2.;
+  const float x1  = 4.;
+  const float mI  = 140.e-9;
+  const float mZA = 0.49555;
 
-  return BetheBlochGeant(bg,rho,x0,x1,mI,mZA);
+  return BetheBlochGeant( bg, rho, x0, x1, mI, mZA );
 }
 
 
 
 
-GPUd() Float_t AliHLTTPCCATrackParam::ApproximateBetheBloch( Float_t beta2 ) 
+GPUd() float AliHLTTPCCATrackParam::ApproximateBetheBloch( float beta2 )
 {
   //------------------------------------------------------------------
-  // This is an approximation of the Bethe-Bloch formula with 
+  // This is an approximation of the Bethe-Bloch formula with
   // the density effect taken into account at beta*gamma > 3.5
-  // (the approximation is reasonable only for solid materials) 
+  // (the approximation is reasonable only for solid materials)
   //------------------------------------------------------------------
-  if (beta2 >= 1) return 0;
+  if ( beta2 >= 1 ) return 0;
 
-  if (beta2/(1-beta2)>3.5*3.5)
-    return 0.153e-3/beta2*( log(3.5*5940)+0.5*log(beta2/(1-beta2)) - beta2);
-  return 0.153e-3/beta2*(log(5940*beta2/(1-beta2)) - beta2);
+  if ( beta2 / ( 1 - beta2 ) > 3.5*3.5 )
+    return 0.153e-3 / beta2*( log( 3.5*5940 ) + 0.5*log( beta2 / ( 1 - beta2 ) ) - beta2 );
+  return 0.153e-3 / beta2*( log( 5940*beta2 / ( 1 - beta2 ) ) - beta2 );
 }
 
 
-GPUd() void AliHLTTPCCATrackParam::CalculateFitParameters( AliHLTTPCCATrackFitParam &par, Float_t mass )
+GPUd() void AliHLTTPCCATrackParam::CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass )
 {
   //*!
 
-  Float_t p2 = (1.+ fP[3]*fP[3]);
-  Float_t k2 = fP[4]*fP[4];
-  Float_t mass2 = mass*mass;
-  Float_t beta2= p2 / (p2 + mass2*k2);
+  float p2 = ( 1. + fP[3] * fP[3] );
+  float k2 = fP[4] * fP[4];
+  float mass2 = mass * mass;
+  float beta2 = p2 / ( p2 + mass2 * k2 );
 
-  Float_t pp2 = (k2>1.e-8) ?p2/k2 :10000; // impuls 2  
+  float pp2 = ( k2 > 1.e-8 ) ? p2 / k2 : 10000; // impuls 2
 
   //par.fBethe = BetheBlochGas( pp2/mass2);
-  par.fBethe = ApproximateBetheBloch( pp2/mass2);
-  par.fE = CAMath::Sqrt( pp2 + mass2);
-  par.fTheta2 = 14.1*14.1/(beta2*pp2*1e6);
-  par.fEP2 = par.fE/pp2;
+  par.fBethe = ApproximateBetheBloch( pp2 / mass2 );
+  par.fE = CAMath::Sqrt( pp2 + mass2 );
+  par.fTheta2 = 14.1 * 14.1 / ( beta2 * pp2 * 1e6 );
+  par.fEP2 = par.fE / pp2;
 
   // Approximate energy loss fluctuation (M.Ivanov)
-  
-  const Float_t knst=0.07; // To be tuned.  
-  par.fSigmadE2 = knst*par.fEP2*fP[4];
+
+  const float knst = 0.07; // To be tuned.
+  par.fSigmadE2 = knst * par.fEP2 * fP[4];
   par.fSigmadE2 = par.fSigmadE2 * par.fSigmadE2;
-  par.fK22 = (1. + fP[3]*fP[3]);
-  par.fK33 = par.fK22*par.fK22;
-  par.fK43 = fP[3]*fP[4]*par.fK22;
-  par.fK44 = fP[3]*fP[3]*fP[4]*fP[4];
+
+  par.fK22 = ( 1. + fP[3] * fP[3] );
+  par.fK33 = par.fK22 * par.fK22;
+  par.fK43 = fP[3] * fP[4] * par.fK22;
+  par.fK44 = fP[3] * fP[3] * fP[4] * fP[4];
 
 }
 
 
-GPUd() Bool_t AliHLTTPCCATrackParam::CorrectForMeanMaterial( Float_t xOverX0,  Float_t xTimesRho, const AliHLTTPCCATrackFitParam &par )
+GPUd() bool AliHLTTPCCATrackParam::CorrectForMeanMaterial( float xOverX0,  float xTimesRho, const AliHLTTPCCATrackFitParam &par )
 {
   //------------------------------------------------------------------
   // This function corrects the track parameters for the crossed material.
   // "xOverX0"   - X/X0, the thickness in units of the radiation length.
-  // "xTimesRho" - is the product length*density (g/cm^2). 
+  // "xTimesRho" - is the product length*density (g/cm^2).
   //------------------------------------------------------------------
 
-  Float_t &fC22=fC[5];
-  Float_t &fC33=fC[9];
-  Float_t &fC40=fC[10];
-  Float_t &fC41=fC[11];
-  Float_t &fC42=fC[12];
-  Float_t &fC43=fC[13];
-  Float_t &fC44=fC[14]; 
+  float &fC22 = fC[5];
+  float &fC33 = fC[9];
+  float &fC40 = fC[10];
+  float &fC41 = fC[11];
+  float &fC42 = fC[12];
+  float &fC43 = fC[13];
+  float &fC44 = fC[14];
 
   //Energy losses************************
-  Float_t dE = par.fBethe*xTimesRho;
-  if ( CAMath::Abs(dE) > 0.3*par.fE ) return 0; //30% energy loss is too much!
-  Float_t corr = (1.- par.fEP2*dE);
-  if( corr<0.3 || corr>1.3 ) return 0;
-
-  fP[4]*= corr;
-  fC40*= corr;
-  fC41*= corr;
-  fC42*= corr;
-  fC43*= corr;
-  fC44*= corr*corr;
-  fC44+= par.fSigmadE2*CAMath::Abs(dE);
+
+  float dE = par.fBethe * xTimesRho;
+  if ( CAMath::Abs( dE ) > 0.3*par.fE ) return 0; //30% energy loss is too much!
+  float corr = ( 1. - par.fEP2 * dE );
+  if ( corr < 0.3 || corr > 1.3 ) return 0;
+
+  fP[4] *= corr;
+  fC40 *= corr;
+  fC41 *= corr;
+  fC42 *= corr;
+  fC43 *= corr;
+  fC44 *= corr * corr;
+  fC44 += par.fSigmadE2 * CAMath::Abs( dE );
 
   //Multiple scattering******************
-  
-  Float_t theta2 = par.fTheta2*CAMath::Abs(xOverX0);
-  fC22 += theta2*par.fK22*(1.- fP[2]*fP[2]);
-  fC33 += theta2*par.fK33;
-  fC43 += theta2*par.fK43; 
-  fC44 += theta2*par.fK44;
+
+  float theta2 = par.fTheta2 * CAMath::Abs( xOverX0 );
+  fC22 += theta2 * par.fK22 * ( 1. - fP[2] * fP[2] );
+  fC33 += theta2 * par.fK33;
+  fC43 += theta2 * par.fK43;
+  fC44 += theta2 * par.fK44;
 
   return 1;
 }
@@ -516,152 +517,152 @@ GPUd() Bool_t AliHLTTPCCATrackParam::CorrectForMeanMaterial( Float_t xOverX0,  F
 //*
 
 
-GPUd() Bool_t AliHLTTPCCATrackParam::Rotate( Float_t alpha, Float_t maxSinPhi )
+GPUd() bool AliHLTTPCCATrackParam::Rotate( float alpha, float maxSinPhi )
 {
   //* Rotate the coordinate system in XY on the angle alpha
-  
-  Float_t cA = CAMath::Cos( alpha );
-  Float_t sA = CAMath::Sin( alpha );
-  Float_t x = X(), y= Y(), sP= SinPhi(), cP= GetCosPhi();
-  Float_t cosPhi = cP*cA + sP*sA;
-  Float_t sinPhi =-cP*sA + sP*cA;
-  
-  if( CAMath::Abs(sinPhi)> maxSinPhi || CAMath::Abs(cosPhi)<1.e-2 || CAMath::Abs(cP)<1.e-2  ) return 0;
-  
-  Float_t j0 = cP/cosPhi; 
-  Float_t j2 = cosPhi/cP;
-  
+
+  float cA = CAMath::Cos( alpha );
+  float sA = CAMath::Sin( alpha );
+  float x = X(), y = Y(), sP = SinPhi(), cP = GetCosPhi();
+  float cosPhi = cP * cA + sP * sA;
+  float sinPhi = -cP * sA + sP * cA;
+
+  if ( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-2 || CAMath::Abs( cP ) < 1.e-2  ) return 0;
+
+  float j0 = cP / cosPhi;
+  float j2 = cosPhi / cP;
+
   SetX( x*cA +  y*sA );
-  SetY(-x*sA +  y*cA );
+  SetY( -x*sA +  y*cA );
   SetSignCosPhi( cosPhi );
   SetSinPhi( sinPhi );
 
 
-  //Float_t J[5][5] = { { j0, 0, 0,  0,  0 }, // Y
+  //float J[5][5] = { { j0, 0, 0,  0,  0 }, // Y
   //                      {  0, 1, 0,  0,  0 }, // Z
   //                      {  0, 0, j2, 0,  0 }, // SinPhi
-  //                     {  0, 0, 0,  1,  0 }, // DzDs
-  //                     {  0, 0, 0,  0,  1 } }; // Kappa
+  //                    {  0, 0, 0,  1,  0 }, // DzDs
+  //                    {  0, 0, 0,  0,  1 } }; // Kappa
   //cout<<"alpha="<<alpha<<" "<<x<<" "<<y<<" "<<sP<<" "<<cP<<" "<<j0<<" "<<j2<<endl;
   //cout<<"      "<<fC[0]<<" "<<fC[1]<<" "<<fC[6]<<" "<<fC[10]<<" "<<fC[4]<<" "<<fC[5]<<" "<<fC[8]<<" "<<fC[12]<<endl;
-  fC[0]*= j0*j0;
-  fC[1]*= j0;
-  fC[3]*= j0;
-  fC[6]*= j0;
-  fC[10]*= j0;
-
-  fC[3]*= j2;
-  fC[4]*= j2;
-  fC[5]*= j2*j2; 
-  fC[8]*= j2;
-  fC[12]*= j2;
+  fC[0] *= j0 * j0;
+  fC[1] *= j0;
+  fC[3] *= j0;
+  fC[6] *= j0;
+  fC[10] *= j0;
+
+  fC[3] *= j2;
+  fC[4] *= j2;
+  fC[5] *= j2 * j2;
+  fC[8] *= j2;
+  fC[12] *= j2;
   //cout<<"      "<<fC[0]<<" "<<fC[1]<<" "<<fC[6]<<" "<<fC[10]<<" "<<fC[4]<<" "<<fC[5]<<" "<<fC[8]<<" "<<fC[12]<<endl;
   return 1;
 }
 
-GPUd() Bool_t AliHLTTPCCATrackParam::Rotate( Float_t alpha, AliHLTTPCCATrackLinearisation &t0, Float_t maxSinPhi )
+GPUd() bool AliHLTTPCCATrackParam::Rotate( float alpha, AliHLTTPCCATrackLinearisation &t0, float maxSinPhi )
 {
   //* Rotate the coordinate system in XY on the angle alpha
-  
-  Float_t cA = CAMath::Cos( alpha );
-  Float_t sA = CAMath::Sin( alpha );
-  Float_t x0 = X(), y0= Y(), sP= t0.SinPhi(), cP= t0.CosPhi();
-  Float_t cosPhi = cP*cA + sP*sA;
-  Float_t sinPhi =-cP*sA + sP*cA;
-  
-  if( CAMath::Abs(sinPhi)> maxSinPhi || CAMath::Abs(cosPhi)<1.e-2 || CAMath::Abs(cP)<1.e-2  ) return 0;
-  
-  //Float_t J[5][5] = { { j0, 0, 0,  0,  0 }, // Y
+
+  float cA = CAMath::Cos( alpha );
+  float sA = CAMath::Sin( alpha );
+  float x0 = X(), y0 = Y(), sP = t0.SinPhi(), cP = t0.CosPhi();
+  float cosPhi = cP * cA + sP * sA;
+  float sinPhi = -cP * sA + sP * cA;
+
+  if ( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-2 || CAMath::Abs( cP ) < 1.e-2  ) return 0;
+
+  //float J[5][5] = { { j0, 0, 0,  0,  0 }, // Y
   //                    {  0, 1, 0,  0,  0 }, // Z
   //                    {  0, 0, j2, 0,  0 }, // SinPhi
-  //                   {  0, 0, 0,  1,  0 }, // DzDs
-  //                   {  0, 0, 0,  0,  1 } }; // Kappa
+  //                  {  0, 0, 0,  1,  0 }, // DzDs
+  //                  {  0, 0, 0,  0,  1 } }; // Kappa
 
-  Float_t j0 = cP/cosPhi; 
-  Float_t j2 = cosPhi/cP;
-  Float_t d[2] = {Y() - y0, SinPhi() - sP};
+  float j0 = cP / cosPhi;
+  float j2 = cosPhi / cP;
+  float d[2] = {Y() - y0, SinPhi() - sP};
 
   SetX( x0*cA +  y0*sA );
-  SetY(-x0*sA +  y0*cA + j0*d[0] );
+  SetY( -x0*sA +  y0*cA + j0*d[0] );
   t0.SetCosPhi( cosPhi );
   t0.SetSinPhi( sinPhi );
 
   SetSinPhi( sinPhi + j2*d[1] );
 
-  fC[0]*= j0*j0;
-  fC[1]*= j0;
-  fC[3]*= j0;
-  fC[6]*= j0;
-  fC[10]*= j0;
+  fC[0] *= j0 * j0;
+  fC[1] *= j0;
+  fC[3] *= j0;
+  fC[6] *= j0;
+  fC[10] *= j0;
 
-  fC[3]*= j2;
-  fC[4]*= j2;
-  fC[5]*= j2*j2; 
-  fC[8]*= j2;
-  fC[12]*= j2;
+  fC[3] *= j2;
+  fC[4] *= j2;
+  fC[5] *= j2 * j2;
+  fC[8] *= j2;
+  fC[12] *= j2;
 
   return 1;
 }
 
 
-GPUd() Bool_t AliHLTTPCCATrackParam::Filter( Float_t y, Float_t z, Float_t err2Y, Float_t err2Z, Float_t maxSinPhi )
+GPUd() bool AliHLTTPCCATrackParam::Filter( float y, float z, float err2Y, float err2Z, float maxSinPhi )
 {
-  //* Add the y,z measurement with the Kalman filter 
-
-  Float_t 
-    c00 = fC[ 0],
-    c11 = fC[ 2],
-    c20 = fC[ 3],
-    c31 = fC[ 7],
-    c40 = fC[10];
-
-  err2Y+=c00;
-  err2Z+=c11;
-
-  Float_t
-    z0 = y-fP[0],
-    z1 = z-fP[1];
-  
-  if( err2Y < 1.e-8 || err2Z<1.e-8 ) return 0;
-
-  Float_t mS0 = 1./err2Y;
-  Float_t mS2 = 1./err2Z;
+  //* Add the y,z measurement with the Kalman filter
+
+  float
+  c00 = fC[ 0],
+        c11 = fC[ 2],
+              c20 = fC[ 3],
+                    c31 = fC[ 7],
+                          c40 = fC[10];
+
+  err2Y += c00;
+  err2Z += c11;
+
+  float
+  z0 = y - fP[0],
+       z1 = z - fP[1];
+
+  if ( err2Y < 1.e-8 || err2Z < 1.e-8 ) return 0;
+
+  float mS0 = 1. / err2Y;
+  float mS2 = 1. / err2Z;
+
   // K = CHtS
-  
-  Float_t k00, k11, k20, k31, k40;
-    
-  k00 = c00*mS0;
-  k20 = c20*mS0;
-  k40 = c40*mS0;
-
-  k11 = c11*mS2;
-  k31 = c31*mS2;
-
-  Float_t sinPhi = fP[2] + k20*z0  ;
-  
-  if( maxSinPhi>0 && CAMath::Abs(sinPhi)>= maxSinPhi ) return 0;
-  
+
+  float k00, k11, k20, k31, k40;
+
+  k00 = c00 * mS0;
+  k20 = c20 * mS0;
+  k40 = c40 * mS0;
+
+  k11 = c11 * mS2;
+  k31 = c31 * mS2;
+
+  float sinPhi = fP[2] + k20 * z0  ;
+
+  if ( maxSinPhi > 0 && CAMath::Abs( sinPhi ) >= maxSinPhi ) return 0;
+
   fNDF  += 2;
-  fChi2 += mS0*z0*z0 + mS2*z1*z1 ;
+  fChi2 += mS0 * z0 * z0 + mS2 * z1 * z1 ;
 
-  fP[ 0]+= k00*z0 ;
-  fP[ 1]+= k11*z1 ;
+  fP[ 0] += k00 * z0 ;
+  fP[ 1] += k11 * z1 ;
   fP[ 2] = sinPhi ;
-  fP[ 3]+= k31*z1 ;
-  fP[ 4]+= k40*z0 ;
-    
-  fC[ 0]-= k00*c00 ;    
-  fC[ 3]-= k20*c00 ;
-  fC[ 5]-= k20*c20 ;
-  fC[10]-= k40*c00 ;
-  fC[12]-= k40*c20 ;
-  fC[14]-= k40*c40 ;
-  fC[ 2]-= k11*c11 ;
-  fC[ 7]-= k31*c11 ;
-  fC[ 9]-= k31*c31 ;
-   
+  fP[ 3] += k31 * z1 ;
+  fP[ 4] += k40 * z0 ;
+
+  fC[ 0] -= k00 * c00 ;
+  fC[ 3] -= k20 * c00 ;
+  fC[ 5] -= k20 * c20 ;
+  fC[10] -= k40 * c00 ;
+  fC[12] -= k40 * c20 ;
+  fC[14] -= k40 * c40 ;
+
+  fC[ 2] -= k11 * c11 ;
+  fC[ 7] -= k31 * c11 ;
+  fC[ 9] -= k31 * c31 ;
+
   return 1;
 }
 
@@ -675,10 +676,10 @@ GPUd() Bool_t AliHLTTPCCATrackParam::Filter( Float_t y, Float_t z, Float_t err2Y
 GPUd() void AliHLTTPCCATrackParam::Print() const
 {
   //* print parameters
+
 #if !defined(HLTCA_GPUCODE)
-  std::cout<<"track: x="<<GetX()<<" c="<<GetSignCosPhi()<<", P= "<<GetY()<<" "<<GetZ()<<" "<<GetSinPhi()<<" "<<GetDzDs()<<" "<<GetQPt()<<std::endl;
-  std::cout<<"errs2: "<<GetErr2Y()<<" "<<GetErr2Z()<<" "<<GetErr2SinPhi()<<" "<<GetErr2DzDs()<<" "<<GetErr2QPt()<<std::endl;
+  std::cout << "track: x=" << GetX() << " c=" << GetSignCosPhi() << ", P= " << GetY() << " " << GetZ() << " " << GetSinPhi() << " " << GetDzDs() << " " << GetQPt() << std::endl;
+  std::cout << "errs2: " << GetErr2Y() << " " << GetErr2Z() << " " << GetErr2SinPhi() << " " << GetErr2DzDs() << " " << GetErr2QPt() << std::endl;
 #endif
 }
 
index 90a7418c2a718341840cc9ccd5c37efcc1bf22cc..03a3d2606ccd5832c627da73c8d82c8d83bb768a 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -25,125 +25,124 @@ class AliHLTTPCCATrackLinearisation;
  */
 class AliHLTTPCCATrackParam
 {
- public:
 public:
 
-  struct AliHLTTPCCATrackFitParam
-  {
-    Float_t fBethe, fE,fTheta2, fEP2, fSigmadE2, fK22,fK33,fK43,fK44;// parameters
-  };
+    struct AliHLTTPCCATrackFitParam {
+      float fBethe, fE, fTheta2, fEP2, fSigmadE2, fK22, fK33, fK43, fK44;// parameters
+    };
 
-  GPUd() Float_t X()      const { return fX;    }
-  GPUd() Float_t Y()      const { return fP[0]; }
-  GPUd() Float_t Z()      const { return fP[1]; }
-  GPUd() Float_t SinPhi() const { return fP[2]; }
-  GPUd() Float_t DzDs()   const { return fP[3]; }
-  GPUd() Float_t QPt()    const { return fP[4]; }
-  GPUd() Float_t SignCosPhi() const { return fSignCosPhi; }
-  GPUd() Float_t Chi2()  const { return fChi2; }
-  GPUd() Int_t   NDF()   const { return fNDF; }
+    GPUd() float X()      const { return fX;    }
+    GPUd() float Y()      const { return fP[0]; }
+    GPUd() float Z()      const { return fP[1]; }
+    GPUd() float SinPhi() const { return fP[2]; }
+    GPUd() float DzDs()   const { return fP[3]; }
+    GPUd() float QPt()    const { return fP[4]; }
+    GPUd() float SignCosPhi() const { return fSignCosPhi; }
+    GPUd() float Chi2()  const { return fChi2; }
+    GPUd() int   NDF()   const { return fNDF; }
 
-  Float_t Err2Y()      const { return fC[0]; }
-  Float_t Err2Z()      const { return fC[2]; }
-  Float_t Err2SinPhi() const { return fC[5]; }
-  Float_t Err2DzDs()   const { return fC[9]; }
-  Float_t Err2QPt()    const { return fC[14]; }
+    float Err2Y()      const { return fC[0]; }
+    float Err2Z()      const { return fC[2]; }
+    float Err2SinPhi() const { return fC[5]; }
+    float Err2DzDs()   const { return fC[9]; }
+    float Err2QPt()    const { return fC[14]; }
 
-  GPUd() Float_t GetX()      const { return fX; }
-  GPUd() Float_t GetY()      const { return fP[0]; }
-  GPUd() Float_t GetZ()      const { return fP[1]; }
-  GPUd() Float_t GetSinPhi() const { return fP[2]; }
-  GPUd() Float_t GetDzDs()   const { return fP[3]; }
-  GPUd() Float_t GetQPt()    const { return fP[4]; }
-  GPUd() Float_t GetSignCosPhi() const { return fSignCosPhi; }
-  GPUd() Float_t GetChi2()   const { return fChi2; }
-  GPUd() Int_t   GetNDF()    const { return fNDF; }
+    GPUd() float GetX()      const { return fX; }
+    GPUd() float GetY()      const { return fP[0]; }
+    GPUd() float GetZ()      const { return fP[1]; }
+    GPUd() float GetSinPhi() const { return fP[2]; }
+    GPUd() float GetDzDs()   const { return fP[3]; }
+    GPUd() float GetQPt()    const { return fP[4]; }
+    GPUd() float GetSignCosPhi() const { return fSignCosPhi; }
+    GPUd() float GetChi2()   const { return fChi2; }
+    GPUd() int   GetNDF()    const { return fNDF; }
 
-  GPUd() Float_t GetKappa( Float_t Bz ) const { return fP[4]*Bz; }
-  GPUd() Float_t GetCosPhi() const { return fSignCosPhi*CAMath::Sqrt(1-SinPhi()*SinPhi()); }
+    GPUd() float GetKappa( float Bz ) const { return fP[4]*Bz; }
+    GPUd() float GetCosPhi() const { return fSignCosPhi*CAMath::Sqrt( 1 - SinPhi()*SinPhi() ); }
 
-  GPUd() Float_t GetErr2Y()      const { return fC[0]; }
-  GPUd() Float_t GetErr2Z()      const { return fC[2]; }
-  GPUd() Float_t GetErr2SinPhi() const { return fC[5]; }
-  GPUd() Float_t GetErr2DzDs()   const { return fC[9]; }
-  GPUd() Float_t GetErr2QPt()    const { return fC[14]; }
+    GPUd() float GetErr2Y()      const { return fC[0]; }
+    GPUd() float GetErr2Z()      const { return fC[2]; }
+    GPUd() float GetErr2SinPhi() const { return fC[5]; }
+    GPUd() float GetErr2DzDs()   const { return fC[9]; }
+    GPUd() float GetErr2QPt()    const { return fC[14]; }
 
-  GPUhd() const Float_t *Par() const { return fP; }
-  GPUhd() const Float_t *Cov() const { return fC; }
+    GPUhd() const float *Par() const { return fP; }
+    GPUhd() const float *Cov() const { return fC; }
 
-  const Float_t *GetPar() const { return fP; }
-  const Float_t *GetCov() const { return fC; }
+    const float *GetPar() const { return fP; }
+    const float *GetCov() const { return fC; }
 
-  GPUhd() void SetPar( Int_t i, Float_t v ){ fP[i] = v; }
-  GPUhd() void SetCov( Int_t i, Float_t v ){ fC[i] = v; }
+    GPUhd() void SetPar( int i, float v ) { fP[i] = v; }
+    GPUhd() void SetCov( int i, float v ) { fC[i] = v; }
 
-  GPUd() void SetX( Float_t v )     {  fX = v;    }
-  GPUd() void SetY( Float_t v )     {  fP[0] = v; }
-  GPUd() void SetZ( Float_t v )     {  fP[1] = v; }
-  GPUd() void SetSinPhi( Float_t v ){  fP[2] = v; }
-  GPUd() void SetDzDs( Float_t v )  {  fP[3] = v; }
-  GPUd() void SetQPt( Float_t v )   {  fP[4] = v; }
-  GPUd() void SetSignCosPhi( Float_t v ){  fSignCosPhi = v; }
-  GPUd() void SetChi2( Float_t v )  {  fChi2 = v; }
-  GPUd() void SetNDF( Int_t v )   { fNDF = v; }  
+    GPUd() void SetX( float v )     {  fX = v;    }
+    GPUd() void SetY( float v )     {  fP[0] = v; }
+    GPUd() void SetZ( float v )     {  fP[1] = v; }
+    GPUd() void SetSinPhi( float v ) {  fP[2] = v; }
+    GPUd() void SetDzDs( float v )  {  fP[3] = v; }
+    GPUd() void SetQPt( float v )   {  fP[4] = v; }
+    GPUd() void SetSignCosPhi( float v ) {  fSignCosPhi = v; }
+    GPUd() void SetChi2( float v )  {  fChi2 = v; }
+    GPUd() void SetNDF( int v )   { fNDF = v; }
 
 
-  GPUd() Float_t GetDist2( const AliHLTTPCCATrackParam &t ) const;
-  GPUd() Float_t GetDistXZ2( const AliHLTTPCCATrackParam &t ) const;
+    GPUd() float GetDist2( const AliHLTTPCCATrackParam &t ) const;
+    GPUd() float GetDistXZ2( const AliHLTTPCCATrackParam &t ) const;
 
 
-  GPUd() Float_t GetS( Float_t x, Float_t y, Float_t Bz  ) const;
+    GPUd() float GetS( float x, float y, float Bz  ) const;
 
-  GPUd() void GetDCAPoint( Float_t x, Float_t y, Float_t z,
-                          Float_t &px, Float_t &py, Float_t &pz, Float_t Bz  ) const;
+    GPUd() void GetDCAPoint( float x, float y, float z,
+                             float &px, float &py, float &pz, float Bz  ) const;
 
-  
-  GPUd() Bool_t TransportToX( Float_t x, Float_t Bz, Float_t maxSinPhi=.999 );
-  GPUd() Bool_t TransportToXWithMaterial( Float_t x, Float_t Bz, Float_t maxSinPhi=.999 );
 
-  GPUd() Bool_t  TransportToX( Float_t x, AliHLTTPCCATrackLinearisation &t0, 
-                              Float_t Bz,  Float_t maxSinPhi=.999, Float_t *DL=0 ); 
+    GPUd() bool TransportToX( float x, float Bz, float maxSinPhi = .999 );
+    GPUd() bool TransportToXWithMaterial( float x, float Bz, float maxSinPhi = .999 );
 
-  GPUd() Bool_t  TransportToX( Float_t x, Float_t sinPhi0, Float_t cosPhi0,  Float_t Bz, Float_t maxSinPhi=.999 );
+    GPUd() bool  TransportToX( float x, AliHLTTPCCATrackLinearisation &t0,
+                                 float Bz,  float maxSinPhi = .999, float *DL = 0 );
 
-  GPUd() Bool_t  TransportToXWithMaterial( Float_t x,  AliHLTTPCCATrackLinearisation &t0, 
-                                          AliHLTTPCCATrackFitParam &par, Float_t Bz, Float_t maxSinPhi=.999 );
+    GPUd() bool  TransportToX( float x, float sinPhi0, float cosPhi0,  float Bz, float maxSinPhi = .999 );
 
-  GPUd() Bool_t  TransportToXWithMaterial( Float_t x, 
-                                          AliHLTTPCCATrackFitParam &par, Float_t Bz, Float_t maxSinPhi=.999 );
 
+    GPUd() bool  TransportToXWithMaterial( float x,  AliHLTTPCCATrackLinearisation &t0,
+        AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
 
+    GPUd() bool  TransportToXWithMaterial( float x,
+        AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi = .999 );
 
-  GPUd() static Float_t ApproximateBetheBloch( Float_t beta2 );
-  GPUd() static Float_t BetheBlochGeant(Float_t bg,
-                                       Float_t kp0=2.33,
-                                       Float_t kp1=0.20,
-                                       Float_t kp2=3.00,
-                                       Float_t kp3=173e-9,
-                                       Float_t kp4=0.49848
-                                       );    
-  GPUd() static Float_t BetheBlochSolid(Float_t bg);
-  GPUd() static Float_t BetheBlochGas(Float_t bg);
 
 
-  GPUd() void CalculateFitParameters( AliHLTTPCCATrackFitParam &par, Float_t mass= 0.13957 );
-  GPUd() Bool_t CorrectForMeanMaterial( Float_t xOverX0,  Float_t xTimesRho, const AliHLTTPCCATrackFitParam &par );
+    GPUd() static float ApproximateBetheBloch( float beta2 );
+    GPUd() static float BetheBlochGeant( float bg,
+                                           float kp0 = 2.33,
+                                           float kp1 = 0.20,
+                                           float kp2 = 3.00,
+                                           float kp3 = 173e-9,
+                                           float kp4 = 0.49848
+                                         );
+    GPUd() static float BetheBlochSolid( float bg );
+    GPUd() static float BetheBlochGas( float bg );
 
-  GPUd() Bool_t Rotate( Float_t alpha, Float_t maxSinPhi = .999 );
-  GPUd() Bool_t Rotate( Float_t alpha, AliHLTTPCCATrackLinearisation &t0, Float_t maxSinPhi=.999 );
-  GPUd() Bool_t Filter( Float_t y, Float_t z, Float_t err2Y, Float_t err2Z, Float_t maxSinPhi=.999 );
 
+    GPUd() void CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass = 0.13957 );
+    GPUd() bool CorrectForMeanMaterial( float xOverX0,  float xTimesRho, const AliHLTTPCCATrackFitParam &par );
 
-  GPUd() void Print() const;
+    GPUd() bool Rotate( float alpha, float maxSinPhi = .999 );
+    GPUd() bool Rotate( float alpha, AliHLTTPCCATrackLinearisation &t0, float maxSinPhi = .999 );
+    GPUd() bool Filter( float y, float z, float err2Y, float err2Z, float maxSinPhi = .999 );
 
-private:
 
-  Float_t fX;      // x position
-  Float_t fSignCosPhi; // sign of cosPhi
-  Float_t fP[5];   // 'active' track parameters: Y, Z, SinPhi, DzDs, q/Pt
-  Float_t fC[15];  // the covariance matrix for Y,Z,SinPhi,..
-  Float_t fChi2;   // the chi^2 value
-  Int_t   fNDF;    // the Number of Degrees of Freedom
+    GPUd() void Print() const;
+
+  private:
+
+    float fX;      // x position
+    float fSignCosPhi; // sign of cosPhi
+    float fP[5];   // 'active' track parameters: Y, Z, SinPhi, DzDs, q/Pt
+    float fC[15];  // the covariance matrix for Y,Z,SinPhi,..
+    float fChi2;   // the chi^2 value
+    int   fNDF;    // the Number of Degrees of Freedom
 };
 
 #endif
index 8b80c9fcb0c9f07a20d555a13ed07ab10f37b3ed..7b22b862e679fb0718662c385b805b4d5752895b 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 //#define DRAW
 
 #ifdef DRAW
-  #include "AliHLTTPCCADisplay.h"
+#include "AliHLTTPCCADisplay.h"
 #endif //DRAW
 
 #ifdef HLTCA_INTERNAL_PERFORMANCE
- #include "AliHLTTPCCAPerformance.h"
+#include "AliHLTTPCCAPerformance.h"
 #endif
 
 
-ClassImp(AliHLTTPCCATracker)
+ClassImp( AliHLTTPCCATracker )
 
-#if !defined(HLTCA_GPUCODE)  
+#if !defined(HLTCA_GPUCODE)
 
 AliHLTTPCCATracker::AliHLTTPCCATracker()
-  :
-  fParam(),
-  fNHitsTotal(0),  
-  fCommonMemory(0), 
-  fCommonMemorySize(0),
-  fHitMemory(0), 
-  fHitMemorySize(0),
-  fTrackMemory(0), 
-  fTrackMemorySize(0),
-  fInputEvent(0),     
-  fInputEventSize(0), 
-  fRowData(0),     
-  fRowDataSize(0), 
-  fHitInputIDs(0), 
-  fHitWeights(0),  
-  fNTracklets(0),
-  fTrackletStartHits(0),
-  fTracklets(0), 
-  fNTracks(0),   
-  fTracks(0), 
-  fNTrackHits(0),
-  fTrackHits(0),
-  fOutput(0),
-  fNOutTracks(0),
-  fOutTracks(0), 
-  fNOutTrackHits(0),
-  fOutTrackHits(0),
-  fTmpHitInputIDs(0)
+    :
+    fParam(),
+    fNHitsTotal( 0 ),
+    fCommonMemory( 0 ),
+    fCommonMemorySize( 0 ),
+    fHitMemory( 0 ),
+    fHitMemorySize( 0 ),
+    fTrackMemory( 0 ),
+    fTrackMemorySize( 0 ),
+    fInputEvent( 0 ),
+    fInputEventSize( 0 ),
+    fRowData( 0 ),
+    fRowDataSize( 0 ),
+    fHitInputIDs( 0 ),
+    fHitWeights( 0 ),
+    fNTracklets( 0 ),
+    fTrackletStartHits( 0 ),
+    fTracklets( 0 ),
+    fNTracks( 0 ),
+    fTracks( 0 ),
+    fNTrackHits( 0 ),
+    fTrackHits( 0 ),
+    fOutput( 0 ),
+    fNOutTracks( 0 ),
+    fOutTracks( 0 ),
+    fNOutTrackHits( 0 ),
+    fOutTrackHits( 0 ),
+    fTmpHitInputIDs( 0 )
 {
   // constructor
 }
 
 AliHLTTPCCATracker::AliHLTTPCCATracker( const AliHLTTPCCATracker& )
-  :
-  fParam(),
-  fNHitsTotal(0),
-  fCommonMemory(0), 
-  fCommonMemorySize(0),
-  fHitMemory(0), 
-  fHitMemorySize(0),
-  fTrackMemory(0), 
-  fTrackMemorySize(0),
-  fInputEvent(0),     
-  fInputEventSize(0), 
-  fRowData(0),     
-  fRowDataSize(0), 
-  fHitInputIDs(0), 
-  fHitWeights(0),  
-  fNTracklets(0),
-  fTrackletStartHits(0),
-  fTracklets(0), 
-  fNTracks(0),   
-  fTracks(0), 
-  fNTrackHits(0),
-  fTrackHits(0),
-  fOutput(0),
-  fNOutTracks(0),
-  fOutTracks(0), 
-  fNOutTrackHits(0),
-  fOutTrackHits(0),
-  fTmpHitInputIDs(0)
+    :
+    fParam(),
+    fNHitsTotal( 0 ),
+    fCommonMemory( 0 ),
+    fCommonMemorySize( 0 ),
+    fHitMemory( 0 ),
+    fHitMemorySize( 0 ),
+    fTrackMemory( 0 ),
+    fTrackMemorySize( 0 ),
+    fInputEvent( 0 ),
+    fInputEventSize( 0 ),
+    fRowData( 0 ),
+    fRowDataSize( 0 ),
+    fHitInputIDs( 0 ),
+    fHitWeights( 0 ),
+    fNTracklets( 0 ),
+    fTrackletStartHits( 0 ),
+    fTracklets( 0 ),
+    fNTracks( 0 ),
+    fTracks( 0 ),
+    fNTrackHits( 0 ),
+    fTrackHits( 0 ),
+    fOutput( 0 ),
+    fNOutTracks( 0 ),
+    fOutTracks( 0 ),
+    fNOutTrackHits( 0 ),
+    fOutTrackHits( 0 ),
+    fTmpHitInputIDs( 0 )
 {
   // dummy
 }
@@ -138,10 +138,10 @@ AliHLTTPCCATracker &AliHLTTPCCATracker::operator=( const AliHLTTPCCATracker& )
 GPUd() AliHLTTPCCATracker::~AliHLTTPCCATracker()
 {
   // destructor
-  if( fCommonMemory ) delete[] fCommonMemory;
-  if( fHitMemory ) delete[] fHitMemory;
-  if( fTrackMemory ) delete[] fTrackMemory;
-  if( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
+  if ( fCommonMemory ) delete[] fCommonMemory;
+  if ( fHitMemory ) delete[] fHitMemory;
+  if ( fTrackMemory ) delete[] fTrackMemory;
+  if ( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
 }
 #endif
 
@@ -153,26 +153,26 @@ GPUd() void AliHLTTPCCATracker::Initialize( const AliHLTTPCCAParam &param )
   // initialisation
   fParam = param;
   fParam.Update();
-  for( Int_t irow=0; irow<fParam.NRows(); irow++ ){
-    fRows[irow].SetX( fParam.RowX(irow) );
-    fRows[irow].SetMaxY( CAMath::Tan( fParam.DAlpha()/2.)*fRows[irow].X() );
+  for ( int irow = 0; irow < fParam.NRows(); irow++ ) {
+    fRows[irow].SetX( fParam.RowX( irow ) );
+    fRows[irow].SetMaxY( CAMath::Tan( fParam.DAlpha() / 2. )*fRows[irow].X() );
   }
   StartEvent();
 }
 
 GPUd() void AliHLTTPCCATracker::StartEvent()
 {
-  // start new event and fresh the memory  
+  // start new event and fresh the memory
 
-  if( !fCommonMemory ){
+  if ( !fCommonMemory ) {
     SetPointersCommon(); // just to calculate the size
-    fCommonMemory = reinterpret_cast<Char_t*> ( new uint4 [ fCommonMemorySize/sizeof(uint4) + 100] );
+    fCommonMemory = reinterpret_cast<char*> ( new uint4 [ fCommonMemorySize/sizeof( uint4 ) + 100] );
     SetPointersCommon();// set pointers
   }
-  
-  if( fHitMemory ) delete[] fHitMemory;
+
+  if ( fHitMemory ) delete[] fHitMemory;
   fHitMemory = 0;
-  if( fTrackMemory ) delete[] fTrackMemory;
+  if ( fTrackMemory ) delete[] fTrackMemory;
   fTrackMemory = 0;
 
   fNHitsTotal = 0;
@@ -181,7 +181,7 @@ GPUd() void AliHLTTPCCATracker::StartEvent()
   *fNTrackHits = 0;
   *fNOutTracks = 0;
   *fNOutTrackHits = 0;
-  if( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
+  if ( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
   fTmpHitInputIDs = 0;
 }
 
@@ -191,151 +191,151 @@ GPUhd() void  AliHLTTPCCATracker::SetPointersCommon()
 {
   // set all pointers to the event memory
 
-  ULong_t mem = (ULong_t) fCommonMemory;  
-  UInt_t sI = sizeof(Int_t);
-  
+  ULong_t mem = ( ULong_t ) fCommonMemory;
+  unsigned int sI = sizeof( int );
+
   // set common memory
 
-  fNTracklets = (Int_t*) mem;
-  mem+= sI;
-  fNTracks = (Int_t*) mem;
-  mem+= sI;
-  fNTrackHits = (Int_t*) mem;
-  mem+= sI;  
-  fNOutTracks = (Int_t*) mem;
-  mem+= sI;
-  fNOutTrackHits = (Int_t*) mem;
-  mem+= sI;
+  fNTracklets = ( int* ) mem;
+  mem += sI;
+  fNTracks = ( int* ) mem;
+  mem += sI;
+  fNTrackHits = ( int* ) mem;
+  mem += sI;
+  fNOutTracks = ( int* ) mem;
+  mem += sI;
+  fNOutTrackHits = ( int* ) mem;
+  mem += sI;
 
   // calculate the size
 
-  fCommonMemorySize = mem - (ULong_t) fCommonMemory;
+  fCommonMemorySize = mem - ( ULong_t ) fCommonMemory;
 }
 
 
-GPUhd() void  AliHLTTPCCATracker::SetPointersHits( Int_t MaxNHits )
+GPUhd() void  AliHLTTPCCATracker::SetPointersHits( int MaxNHits )
 {
   // set all pointers to the event memory
 
-  Int_t gridSizeTotal = 2*(2*MaxNHits + 10*Param().NRows());
+  int gridSizeTotal = 2 * ( 2 * MaxNHits + 10 * Param().NRows() );
   //gridSizeTotal *=100;//SG!!!
 
-  ULong_t mem = (ULong_t) fHitMemory;  
-  UInt_t sI = sizeof(Int_t);
-  UInt_t sF = sizeof(Float_t);
-  UInt_t sS = sizeof(Short_t);
-  UInt_t s4 = sizeof(uint4);
-   
+  ULong_t mem = ( ULong_t ) fHitMemory;
+  unsigned int sI = sizeof( int );
+  unsigned int sF = sizeof( float );
+  unsigned int sS = sizeof( short );
+  unsigned int s4 = sizeof( uint4 );
+
   // set input event
 
-  mem = ( mem/s4 + 1 )*s4;
-  fInputEvent = (Char_t*) mem;  
-  fInputEventSize = (1+fParam.NRows()*2 + 1)*sI + (MaxNHits*3)*sF;
-  mem+= fInputEventSize;
+  mem = ( mem / s4 + 1 ) * s4;
+  fInputEvent = ( char* ) mem;
+  fInputEventSize = ( 1 + fParam.NRows() * 2 + 1 ) * sI + ( MaxNHits * 3 ) * sF;
+  mem += fInputEventSize;
 
   // set cluster data for TPC rows
 
-  mem = ( mem/s4 + 1 )*s4;
-  fRowData = (uint4*) mem;
-  fRowDataSize = ( 2*MaxNHits*sS +  //  yz
-                  gridSizeTotal*sS + // grid
-                  2*MaxNHits*sS +  // link up,link down
-                  fParam.NRows()*s4   // row alignment
-                  );
+  mem = ( mem / s4 + 1 ) * s4;
+  fRowData = ( uint4* ) mem;
+  fRowDataSize = ( 2 * MaxNHits * sS +  //  yz
+                   gridSizeTotal * sS + // grid
+                   2 * MaxNHits * sS +  // link up,link down
+                   fParam.NRows() * s4 // row alignment
+                 );
   mem += fRowDataSize;
 
   // extra arrays for tpc clusters
-  
-  mem = ( mem/sI + 1 )*sI;
 
-  fHitInputIDs = (Int_t*) mem;
-  mem+= MaxNHits*sI;
+  mem = ( mem / sI + 1 ) * sI;
 
-  fTrackletStartHits = (Int_t*) mem;
-  mem+= MaxNHits*sI;
+  fHitInputIDs = ( int* ) mem;
+  mem += MaxNHits * sI;
 
-  fHitWeights = (Int_t*) mem;
-  mem+=  MaxNHits*sI;
+  fTrackletStartHits = ( int* ) mem;
+  mem += MaxNHits * sI;
+
+  fHitWeights = ( int* ) mem;
+  mem +=  MaxNHits * sI;
 
   // arrays for track hits
 
-  fTrackHits = (Int_t*) mem;
-  mem+= 10*MaxNHits*sI;//SG!!!
-  
-  fOutTrackHits = (Int_t*) mem;
-  mem+= 10*MaxNHits*sI; //SG!!!
+  fTrackHits = ( int* ) mem;
+  mem += 10 * MaxNHits * sI;//SG!!!
+
+  fOutTrackHits = ( int* ) mem;
+  mem += 10 * MaxNHits * sI; //SG!!!
 
   // calculate the size
 
-  fHitMemorySize = mem - (ULong_t) fHitMemory;
+  fHitMemorySize = mem - ( ULong_t ) fHitMemory;
 }
 
 
-GPUhd() void  AliHLTTPCCATracker::SetPointersTracks( Int_t MaxNTracks, Int_t MaxNHits )
+GPUhd() void  AliHLTTPCCATracker::SetPointersTracks( int MaxNTracks, int MaxNHits )
 {
   // set all pointers to the tracks memory
 
-  ULong_t mem = (ULong_t) fTrackMemory;  
-  
+  ULong_t mem = ( ULong_t ) fTrackMemory;
+
   // memory for tracklets
 
-  mem = ( mem/sizeof(AliHLTTPCCATracklet) + 1 )*sizeof(AliHLTTPCCATracklet);
-  fTracklets = (AliHLTTPCCATracklet *) mem;
-  mem+= MaxNTracks*sizeof(AliHLTTPCCATracklet);  
-  
+  mem = ( mem / sizeof( AliHLTTPCCATracklet ) + 1 ) * sizeof( AliHLTTPCCATracklet );
+  fTracklets = ( AliHLTTPCCATracklet * ) mem;
+  mem += MaxNTracks * sizeof( AliHLTTPCCATracklet );
+
   // memory for selected tracks
-  
-  mem = ( mem/sizeof(AliHLTTPCCATrack) + 1 )*sizeof(AliHLTTPCCATrack);
-  fTracks = (AliHLTTPCCATrack*) mem;
-  mem+= MaxNTracks*sizeof(AliHLTTPCCATrack);  
-  
+
+  mem = ( mem / sizeof( AliHLTTPCCATrack ) + 1 ) * sizeof( AliHLTTPCCATrack );
+  fTracks = ( AliHLTTPCCATrack* ) mem;
+  mem += MaxNTracks * sizeof( AliHLTTPCCATrack );
+
   // memory for output
 
-  mem = ( mem/sizeof(AliHLTTPCCASliceOutput) + 1 )*sizeof(AliHLTTPCCASliceOutput);
-  fOutput = (AliHLTTPCCASliceOutput*) mem;
-  mem+= AliHLTTPCCASliceOutput::EstimateSize(MaxNTracks, MaxNHits);
-  
+  mem = ( mem / sizeof( AliHLTTPCCASliceOutput ) + 1 ) * sizeof( AliHLTTPCCASliceOutput );
+  fOutput = ( AliHLTTPCCASliceOutput* ) mem;
+  mem += AliHLTTPCCASliceOutput::EstimateSize( MaxNTracks, MaxNHits );
+
   // memory for output tracks
 
-  mem = ( mem/sizeof(AliHLTTPCCAOutTrack) + 1 )*sizeof(AliHLTTPCCAOutTrack);
-  
-  fOutTracks = (AliHLTTPCCAOutTrack*) mem;
-  mem+= MaxNTracks*sizeof(AliHLTTPCCAOutTrack);  
+  mem = ( mem / sizeof( AliHLTTPCCAOutTrack ) + 1 ) * sizeof( AliHLTTPCCAOutTrack );
+
+  fOutTracks = ( AliHLTTPCCAOutTrack* ) mem;
+  mem += MaxNTracks * sizeof( AliHLTTPCCAOutTrack );
 
   // calculate the size
 
-  fTrackMemorySize = mem - (ULong_t) fTrackMemory;
+  fTrackMemorySize = mem - ( ULong_t ) fTrackMemory;
 }
 
 
 
-GPUd() void AliHLTTPCCATracker::ReadEvent( const Int_t *RowFirstHit, const Int_t *RowNHits, const Float_t *X, const Float_t *Y, const Float_t *Z, Int_t NHits )
+GPUd() void AliHLTTPCCATracker::ReadEvent( const int *RowFirstHit, const int *RowNHits, const float *X, const float *Y, const float *Z, int NHits )
 {
   //* Read event
 
   StartEvent();
-  
+
   fNHitsTotal = NHits;
-  
+
   {
-    SetPointersHits(NHits); // to calculate the size
-    fHitMemory = reinterpret_cast<Char_t*> ( new uint4 [ fHitMemorySize/sizeof(uint4) + 100] );   
-    SetPointersHits(NHits); // set pointers for hits
+    SetPointersHits( NHits ); // to calculate the size
+    fHitMemory = reinterpret_cast<char*> ( new uint4 [ fHitMemorySize/sizeof( uint4 ) + 100] );
+    SetPointersHits( NHits ); // set pointers for hits
     *fNTracklets = 0;
     *fNTracks = 0 ;
     *fNOutTracks = 0;
     *fNOutTrackHits = 0;
   }
 
-  reinterpret_cast<Int_t*>( fInputEvent )[0] = fParam.NRows();
-  reinterpret_cast<Int_t*>( fInputEvent )[1+fParam.NRows()*2] = NHits;
-  Int_t *rowHeaders = reinterpret_cast<Int_t*>( fInputEvent ) +1;
-  Float_t *hitsXYZ = reinterpret_cast<Float_t*>( fInputEvent ) + 1+fParam.NRows()*2+1;
-  for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
+  reinterpret_cast<int*>( fInputEvent )[0] = fParam.NRows();
+  reinterpret_cast<int*>( fInputEvent )[1+fParam.NRows()*2] = NHits;
+  int *rowHeaders = reinterpret_cast<int*>( fInputEvent ) + 1;
+  float *hitsXYZ = reinterpret_cast<float*>( fInputEvent ) + 1 + fParam.NRows() * 2 + 1;
+  for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
     rowHeaders[iRow*2  ] = RowFirstHit[iRow];
     rowHeaders[iRow*2+1] = RowNHits[iRow];
   }
-  for( Int_t iHit=0; iHit<NHits; iHit++ ){
+  for ( int iHit = 0; iHit < NHits; iHit++ ) {
     hitsXYZ[iHit*3  ] = X[iHit];
     hitsXYZ[iHit*3+1] = Y[iHit];
     hitsXYZ[iHit*3+2] = Z[iHit];
@@ -343,55 +343,55 @@ GPUd() void AliHLTTPCCATracker::ReadEvent( const Int_t *RowFirstHit, const Int_t
 
   //SG cell finder - test code
 
-  if( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
-  fTmpHitInputIDs = new Int_t [NHits];
-  const Float_t areaY = .5;
-  const Float_t areaZ = .5;
-  Int_t newRowNHitsTotal = 0;
-  Bool_t *usedHits = new Bool_t [NHits];
-  for( Int_t iHit=0; iHit<NHits; iHit++ ) usedHits[iHit] = 0;
-  for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
+  if ( fTmpHitInputIDs ) delete[] fTmpHitInputIDs;
+  fTmpHitInputIDs = new int [NHits];
+  const float areaY = .5;
+  const float areaZ = .5;
+  int newRowNHitsTotal = 0;
+  bool *usedHits = new bool [NHits];
+  for ( int iHit = 0; iHit < NHits; iHit++ ) usedHits[iHit] = 0;
+  for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
     rowHeaders[iRow*2  ] = newRowNHitsTotal; // new first hit
     rowHeaders[iRow*2+1] = 0; // new N hits
-    Int_t newRowNHits = 0;
-    Int_t oldRowFirstHit = RowFirstHit[iRow];
-    Int_t oldRowLastHit = oldRowFirstHit + RowNHits[iRow];
-    for( Int_t iHit=oldRowFirstHit; iHit<oldRowLastHit; iHit++ ){
-      if( usedHits[iHit] ) continue;
-      Float_t x0 = X[iHit];
-      Float_t y0 = Y[iHit];
-      Float_t z0 = Z[iHit];
-      Float_t cx = x0;
-      Float_t cy = y0;
-      Float_t cz = z0;
-      Int_t nclu = 1;
-      usedHits[iHit]=1;
-      if(0) for( Int_t jHit=iHit+1; jHit<oldRowLastHit; jHit++ ){//SG!!!
-       //if( usedHits[jHit] ) continue;
-       Float_t dy = Y[jHit] - y0;
-       Float_t dz = Z[jHit] - z0;
-       if( CAMath::Abs(dy)<areaY && CAMath::Abs(dz)<areaZ ){
-         cx+=X[jHit];
-         cy+=Y[jHit];
-         cz+=Z[jHit];
-         nclu++;
-         usedHits[jHit]=1;
-       }
-      }
-      Int_t id = newRowNHitsTotal+newRowNHits;
-      hitsXYZ[id*3+0 ] = cx/nclu;
-      hitsXYZ[id*3+1 ] = cy/nclu;
-      hitsXYZ[id*3+2 ] = cz/nclu;
+    int newRowNHits = 0;
+    int oldRowFirstHit = RowFirstHit[iRow];
+    int oldRowLastHit = oldRowFirstHit + RowNHits[iRow];
+    for ( int iHit = oldRowFirstHit; iHit < oldRowLastHit; iHit++ ) {
+      if ( usedHits[iHit] ) continue;
+      float x0 = X[iHit];
+      float y0 = Y[iHit];
+      float z0 = Z[iHit];
+      float cx = x0;
+      float cy = y0;
+      float cz = z0;
+      int nclu = 1;
+      usedHits[iHit] = 1;
+      if ( 0 ) for ( int jHit = iHit + 1; jHit < oldRowLastHit; jHit++ ) {//SG!!!
+          //if( usedHits[jHit] ) continue;
+          float dy = Y[jHit] - y0;
+          float dz = Z[jHit] - z0;
+          if ( CAMath::Abs( dy ) < areaY && CAMath::Abs( dz ) < areaZ ) {
+            cx += X[jHit];
+            cy += Y[jHit];
+            cz += Z[jHit];
+            nclu++;
+            usedHits[jHit] = 1;
+          }
+        }
+      int id = newRowNHitsTotal + newRowNHits;
+      hitsXYZ[id*3+0 ] = cx / nclu;
+      hitsXYZ[id*3+1 ] = cy / nclu;
+      hitsXYZ[id*3+2 ] = cz / nclu;
       fTmpHitInputIDs[id] = iHit;
       newRowNHits++;
     }
     rowHeaders[iRow*2+1] = newRowNHits;
-    newRowNHitsTotal+=newRowNHits;
+    newRowNHitsTotal += newRowNHits;
   }
   fNHitsTotal = newRowNHitsTotal;
-  reinterpret_cast<Int_t*>( fInputEvent )[1+fParam.NRows()*2] = newRowNHitsTotal;
+  reinterpret_cast<int*>( fInputEvent )[1+fParam.NRows()*2] = newRowNHitsTotal;
 
-  delete[] usedHits;  
+  delete[] usedHits;
   SetupRowData();
 }
 
@@ -399,149 +399,149 @@ GPUd() void AliHLTTPCCATracker::ReadEvent( const Int_t *RowFirstHit, const Int_t
 GPUd() void AliHLTTPCCATracker::SetupRowData()
 {
   //* Convert input hits, create grids, etc.
-  
-  fNHitsTotal = reinterpret_cast<Int_t*>( fInputEvent )[1+fParam.NRows()*2];
-  Int_t *rowHeaders = reinterpret_cast<Int_t*>( fInputEvent ) +1;
-  Float_t *hitsXYZ = reinterpret_cast<Float_t*>( fInputEvent ) + 1+fParam.NRows()*2+1;
 
-  for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
-    
+  fNHitsTotal = reinterpret_cast<int*>( fInputEvent )[1+fParam.NRows()*2];
+  int *rowHeaders = reinterpret_cast<int*>( fInputEvent ) + 1;
+  float *hitsXYZ = reinterpret_cast<float*>( fInputEvent ) + 1 + fParam.NRows() * 2 + 1;
+
+  for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
+
     AliHLTTPCCARow &row = fRows[iRow];
     row.SetFirstHit( rowHeaders[iRow*2] );
     row.SetNHits( rowHeaders[iRow*2+1] );
-    Float_t yMin=1.e3, yMax=-1.e3, zMin=1.e3, zMax=-1.e3;
-    Int_t nGrid =  row.NHits();
-    for( Int_t i=0; i<row.NHits(); i++ ){
-      Int_t j = row.FirstHit()+i;
-      Float_t y = hitsXYZ[j*3+1];
-      Float_t z = hitsXYZ[j*3+2];
-      if( yMax < y ) yMax = y;
-      if( yMin > y ) yMin = y;
-      if( zMax < z ) zMax = z;
-      if( zMin > z ) zMin = z;
+    float yMin = 1.e3, yMax = -1.e3, zMin = 1.e3, zMax = -1.e3;
+    int nGrid =  row.NHits();
+    for ( int i = 0; i < row.NHits(); i++ ) {
+      int j = row.FirstHit() + i;
+      float y = hitsXYZ[j*3+1];
+      float z = hitsXYZ[j*3+2];
+      if ( yMax < y ) yMax = y;
+      if ( yMin > y ) yMin = y;
+      if ( zMax < z ) zMax = z;
+      if ( zMin > z ) zMin = z;
     }
-    if( nGrid <= 0 ){
+    if ( nGrid <= 0 ) {
       yMin = yMax = zMin = zMax = 0;
       nGrid = 1;
     }
 
     AliHLTTPCCAGrid grid;
     grid.Create( yMin, yMax, zMin, zMax, nGrid );
-    
-    Float_t sy = ( CAMath::Abs( grid.StepYInv() ) >1.e-4 ) ?1./grid.StepYInv() :1;
-    Float_t sz = ( CAMath::Abs( grid.StepZInv() ) >1.e-4 ) ?1./grid.StepZInv() :1;
-    
+
+    float sy = ( CAMath::Abs( grid.StepYInv() ) > 1.e-4 ) ? 1. / grid.StepYInv() : 1;
+    float sz = ( CAMath::Abs( grid.StepZInv() ) > 1.e-4 ) ? 1. / grid.StepZInv() : 1;
+
     //cout<<"grid n = "<<row.Grid().N()<<" "<<sy<<" "<<sz<<" "<<yMin<<" "<<yMax<<" "<<zMin<<" "<<zMax<<endl;
-    
-    Bool_t recreate=0;
-    if( sy < 2. ) { recreate = 1; sy = 2; }
-    if( sz < 2. ) { recreate = 1; sz = 2; }
+
+    bool recreate = 0;
+    if ( sy < 2. ) { recreate = 1; sy = 2; }
+    if ( sz < 2. ) { recreate = 1; sz = 2; }
     //recreate = 1;//SG!!!
     //sy=2;
     //sz=2;
-    if( recreate ) grid.Create( yMin, yMax, zMin, zMax, sy, sz );
+    if ( recreate ) grid.Create( yMin, yMax, zMin, zMax, sy, sz );
     row.SetGrid( grid );
   }
 
+
   AliHLTTPCCAHit *ffHits = new AliHLTTPCCAHit[ fNHitsTotal ];
 
-  Int_t rowDataOffset = 0;
+  int rowDataOffset = 0;
 
-  for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
+  for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
 
     AliHLTTPCCARow &row = fRows[iRow];
     const AliHLTTPCCAGrid &grid = row.Grid();
-    
-    Int_t *c = new Int_t [grid.N() + 3 + 10];
-    Int_t *bins = new Int_t [row.NHits()];
-    Int_t *filled = new Int_t [row.Grid().N() + 3 + 10 ];
 
-    for( UInt_t bin=0; bin<row.Grid().N()+3; bin++ ) filled[bin] = 0;  
+    int *c = new int [grid.N() + 3 + 10];
+    int *bins = new int [row.NHits()];
+    int *filled = new int [row.Grid().N() + 3 + 10 ];
+
+    for ( unsigned int bin = 0; bin < row.Grid().N() + 3; bin++ ) filled[bin] = 0;
 
-    for( Int_t i=0; i<row.NHits(); i++ ){
-      Int_t j = row.FirstHit()+i;
-      Int_t bin = row.Grid().GetBin( hitsXYZ[3*j+1], hitsXYZ[3*j+2] );
+    for ( int i = 0; i < row.NHits(); i++ ) {
+      int j = row.FirstHit() + i;
+      int bin = row.Grid().GetBin( hitsXYZ[3*j+1], hitsXYZ[3*j+2] );
       bins[i] = bin;
       filled[bin]++;
     }
 
     {
-      Int_t n=0;
-      for( UInt_t bin=0; bin<row.Grid().N()+3; bin++ ){
-       c[bin] = n;
-       n+=filled[bin];
+      int n = 0;
+      for ( unsigned int bin = 0; bin < row.Grid().N() + 3; bin++ ) {
+        c[bin] = n;
+        n += filled[bin];
       }
     }
 
-    for( Int_t i=0; i<row.NHits(); i++ ){ 
-      Int_t bin = bins[i];
-      Int_t ind = c[bin] + filled[bin]-1;
+    for ( int i = 0; i < row.NHits(); i++ ) {
+      int bin = bins[i];
+      int ind = c[bin] + filled[bin] - 1;
 
-     AliHLTTPCCAHit &h = ffHits[row.FirstHit()+ind];
+      AliHLTTPCCAHit &h = ffHits[row.FirstHit()+ind];
       fHitInputIDs[row.FirstHit()+ind] = fTmpHitInputIDs[row.FirstHit()+i];
-      h.SetY( hitsXYZ[3*(row.FirstHit()+i)+1] );
-      h.SetZ( hitsXYZ[3*(row.FirstHit()+i)+2] );
+      h.SetY( hitsXYZ[3*( row.FirstHit()+i )+1] );
+      h.SetZ( hitsXYZ[3*( row.FirstHit()+i )+2] );
       filled[bin]--;
     }
 
     {
-      Float_t y0 = row.Grid().YMin();
-      Float_t stepY = (row.Grid().YMax() - y0)*(1./65535.);
-      Float_t z0 = row.Grid().ZMin();
-      Float_t stepZ = (row.Grid().ZMax() - z0)*(1./65535.);
-      if( stepY<1.e-4 ) stepY = 1.e-4;
-      if( stepZ<1.e-4 ) stepZ = 1.e-4;
-      Float_t stepYi = 1./stepY;
-      Float_t stepZi = 1./stepZ;
-      
+      float y0 = row.Grid().YMin();
+      float stepY = ( row.Grid().YMax() - y0 ) * ( 1. / 65535. );
+      float z0 = row.Grid().ZMin();
+      float stepZ = ( row.Grid().ZMax() - z0 ) * ( 1. / 65535. );
+      if ( stepY < 1.e-4 ) stepY = 1.e-4;
+      if ( stepZ < 1.e-4 ) stepZ = 1.e-4;
+      float stepYi = 1. / stepY;
+      float stepZi = 1. / stepZ;
+
       row.SetHy0( y0 );
       row.SetHz0( z0 );
       row.SetHstepY( stepY );
       row.SetHstepZ( stepZ );
       row.SetHstepYi( stepYi );
       row.SetHstepZi( stepZi );
-      
+
       row.SetFullOffset( rowDataOffset );
-      ushort2 *p= (ushort2*)( fRowData + row.FullOffset() );
-      for( Int_t ih=0; ih<row.NHits(); ih++ ){
-       Int_t ihTot = row.FirstHit()+ih;
-       AliHLTTPCCAHit &hh = ffHits[ihTot];
-       Float_t xx = ((hh.Y() - y0)*stepYi);
-       Float_t yy = ((hh.Z() - z0)*stepZi);
-       if( xx<0 || yy<0 || xx>=65536 || yy>= 65536 ){
-         std::cout<<"!!!! hit packing error!!! "<<xx<<" "<<yy<<" "<<std::endl;
-       }
-       p[ih].x = (UShort_t) xx;
-       p[ih].y = (UShort_t) yy;
+      ushort2 *p = ( ushort2* )( fRowData + row.FullOffset() );
+      for ( int ih = 0; ih < row.NHits(); ih++ ) {
+        int ihTot = row.FirstHit() + ih;
+        AliHLTTPCCAHit &hh = ffHits[ihTot];
+        float xx = ( ( hh.Y() - y0 ) * stepYi );
+        float yy = ( ( hh.Z() - z0 ) * stepZi );
+        if ( xx < 0 || yy < 0 || xx >= 65536 || yy >= 65536 ) {
+          std::cout << "!!!! hit packing error!!! " << xx << " " << yy << " " << std::endl;
+        }
+        p[ih].x = ( unsigned short ) xx;
+        p[ih].y = ( unsigned short ) yy;
       }
-      Int_t size = row.NHits()*sizeof(ushort2);
+      int size = row.NHits() * sizeof( ushort2 );
 
-      row.SetFullGridOffset( row.NHits()*2 );   
-      UShort_t *p1 = ((UShort_t *)p) + row.FullGridOffset();
+      row.SetFullGridOffset( row.NHits()*2 );
+      unsigned short *p1 = ( ( unsigned short * )p ) + row.FullGridOffset();
 
-      Int_t n = grid.N();
-      for( Int_t i=0; i<n; i++ ){
-       p1[i] = c[i];
-      }     
-      UShort_t a = c[n];
-      Int_t nn = n+grid.Ny()+3;
-      for( Int_t i=n; i<nn; i++ ) p1[i] = a;
+      int n = grid.N();
+      for ( int i = 0; i < n; i++ ) {
+        p1[i] = c[i];
+      }
+      unsigned short a = c[n];
+      int nn = n + grid.Ny() + 3;
+      for ( int i = n; i < nn; i++ ) p1[i] = a;
 
-      size+= (nn)*sizeof(UShort_t);
+      size += ( nn ) * sizeof( unsigned short );
       row.SetFullLinkOffset( row.NHits()*2 + nn );
-      size+= row.NHits()*2*sizeof(Short_t);
+      size += row.NHits() * 2 * sizeof( short );
 
-      if( size%16 ) size = size/sizeof(uint4)+1;
-      else size = size/sizeof(uint4);
+      if ( size % 16 ) size = size / sizeof( uint4 ) + 1;
+      else size = size / sizeof( uint4 );
       row.SetFullSize( size );
       //cout<<iRow<<", "<<row.fNHits<<"= "<<size*16<<"b: "<<row.fFullOffset<<" "<<row.fFullSize<<" "<<row.fFullGridOffset<<" "<<row.fFullLinkOffset<<std::endl;
 
-      rowDataOffset+=size;
+      rowDataOffset += size;
     }
-    if( c ) delete[] c;
-    if( bins ) delete[] bins;
-    if( filled ) delete[] filled;
+    if ( c ) delete[] c;
+    if ( bins ) delete[] bins;
+    if ( filled ) delete[] filled;
   }
   delete[] ffHits;
 }
@@ -560,31 +560,31 @@ GPUh() void AliHLTTPCCATracker::Reconstruct()
   fTimers[5] = 0; // write output
   fTimers[6] = 0;
   fTimers[7] = 0;
-  
+
   //if( fParam.ISlice()<1 ) return; //SG!!!
 
   TStopwatch timer0;
 
   //SetupRowData();
-  if( fNHitsTotal < 1 ){
+  if ( fNHitsTotal < 1 ) {
     {
-      SetPointersTracks(1, 1); // to calculate the size
-      fTrackMemory = reinterpret_cast<Char_t*> ( new uint4 [ fTrackMemorySize/sizeof(uint4) + 100] );   
-      SetPointersTracks(1, 1); // set pointers for tracks
-      fOutput->SetNTracks(0);
-      fOutput->SetNTrackClusters(0);
+      SetPointersTracks( 1, 1 ); // to calculate the size
+      fTrackMemory = reinterpret_cast<char*> ( new uint4 [ fTrackMemorySize/sizeof( uint4 ) + 100] );
+      SetPointersTracks( 1, 1 ); // set pointers for tracks
+      fOutput->SetNTracks( 0 );
+      fOutput->SetNTrackClusters( 0 );
     }
 
     return;
   }
 #ifdef DRAW
 
-  AliHLTTPCCADisplay::Instance().ClearView();  
+  AliHLTTPCCADisplay::Instance().ClearView();
   AliHLTTPCCADisplay::Instance().SetSliceView();
   AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
-  AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );  
-  if( fNHitsTotal>0 ){
-    AliHLTTPCCADisplay::Instance().DrawSliceHits( kRed, .5);  
+  AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
+  if ( fNHitsTotal > 0 ) {
+    AliHLTTPCCADisplay::Instance().DrawSliceHits( kRed, .5 );
     AliHLTTPCCADisplay::Instance().Ask();
   }
 #endif
@@ -592,123 +592,123 @@ GPUh() void AliHLTTPCCATracker::Reconstruct()
   *fNTracks = 0;
   *fNTracklets = 0;
 
-#if !defined(HLTCA_GPUCODE)  
+#if !defined(HLTCA_GPUCODE)
+
   AliHLTTPCCAProcess<AliHLTTPCCANeighboursFinder>( Param().NRows(), 1, *this );
 
-#ifdef HLTCA_INTERNAL_PERFORMANCE 
-  //if( Param().ISlice()<=2 ) 
+#ifdef HLTCA_INTERNAL_PERFORMANCE
+  //if( Param().ISlice()<=2 )
   //AliHLTTPCCAPerformance::Instance().LinkPerformance( Param().ISlice() );
 #endif
 
 
 #ifdef DRAW
-  if( fNHitsTotal>0 ){
-    AliHLTTPCCADisplay::Instance().DrawSliceLinks( -1, -1, 1);  
+  if ( fNHitsTotal > 0 ) {
+    AliHLTTPCCADisplay::Instance().DrawSliceLinks( -1, -1, 1 );
     AliHLTTPCCADisplay::Instance().Ask();
   }
 #endif
 
 
-  AliHLTTPCCAProcess<AliHLTTPCCANeighboursCleaner>( Param().NRows()-2, 1, *this );
-  AliHLTTPCCAProcess<AliHLTTPCCAStartHitsFinder>( Param().NRows()-4, 1, *this );
+  AliHLTTPCCAProcess<AliHLTTPCCANeighboursCleaner>( Param().NRows() - 2, 1, *this );
+  AliHLTTPCCAProcess<AliHLTTPCCAStartHitsFinder>( Param().NRows() - 4, 1, *this );
+
+  int nStartHits = *fNTracklets;
 
-  Int_t nStartHits = *fNTracklets;
-  
-  Int_t nThreads = 128;
-  Int_t nBlocks = fNHitsTotal/nThreads + 1;
-  if( nBlocks<12 ){
-    nBlocks = 12; 
-    nThreads = fNHitsTotal/12+1;
-    if( nThreads%32 ) nThreads = (nThreads/32+1)*32;
+  int nThreads = 128;
+  int nBlocks = fNHitsTotal / nThreads + 1;
+  if ( nBlocks < 12 ) {
+    nBlocks = 12;
+    nThreads = fNHitsTotal / 12 + 1;
+    if ( nThreads % 32 ) nThreads = ( nThreads / 32 + 1 ) * 32;
   }
-      
+
   nThreads = fNHitsTotal;
   nBlocks = 1;
 
-  AliHLTTPCCAProcess<AliHLTTPCCAUsedHitsInitialiser>(nBlocks, nThreads,*this);
+  AliHLTTPCCAProcess<AliHLTTPCCAUsedHitsInitialiser>( nBlocks, nThreads, *this );
 
 
   {
-    SetPointersTracks(nStartHits, fNHitsTotal); // to calculate the size
-    fTrackMemory = reinterpret_cast<Char_t*> ( new uint4 [ fTrackMemorySize/sizeof(uint4) + 100] );   
-    SetPointersTracks(nStartHits, fNHitsTotal); // set pointers for hits
+    SetPointersTracks( nStartHits, fNHitsTotal ); // to calculate the size
+    fTrackMemory = reinterpret_cast<char*> ( new uint4 [ fTrackMemorySize/sizeof( uint4 ) + 100] );
+    SetPointersTracks( nStartHits, fNHitsTotal ); // set pointers for hits
   }
 
-  Int_t nMemThreads = AliHLTTPCCATrackletConstructor::NMemThreads();
+  int nMemThreads = AliHLTTPCCATrackletConstructor::NMemThreads();
   nThreads = 256;//96;
-  nBlocks = nStartHits/nThreads + 1;
-  if( nBlocks<30 ){
+  nBlocks = nStartHits / nThreads + 1;
+  if ( nBlocks < 30 ) {
     nBlocks = 30;
-    nThreads = (nStartHits)/30+1;
-    if( nThreads%32 ) nThreads = (nThreads/32+1)*32;
+    nThreads = ( nStartHits ) / 30 + 1;
+    if ( nThreads % 32 ) nThreads = ( nThreads / 32 + 1 ) * 32;
   }
 
   nThreads = nStartHits;
   nBlocks = 1;
 
-  AliHLTTPCCAProcess1<AliHLTTPCCATrackletConstructor>(nBlocks, nMemThreads+nThreads,*this);
+  AliHLTTPCCAProcess1<AliHLTTPCCATrackletConstructor>( nBlocks, nMemThreads + nThreads, *this );
 
   //std::cout<<"Slice "<<Param().ISlice()<<": NHits="<<fNHitsTotal<<", NTracklets="<<*NTracklets()<<std::endl;
 
-  { 
+  {
     nThreads = 128;
-    nBlocks = nStartHits/nThreads + 1;
-    if( nBlocks<12 ){
-      nBlocks = 12;  
-      nThreads = nStartHits/12+1;
-      nThreads = (nThreads/32+1)*32;
+    nBlocks = nStartHits / nThreads + 1;
+    if ( nBlocks < 12 ) {
+      nBlocks = 12;
+      nThreads = nStartHits / 12 + 1;
+      nThreads = ( nThreads / 32 + 1 ) * 32;
     }
-        
+
     *fNTrackHits = 0;
 
     nThreads = nStartHits;
     nBlocks = 1;
 
 
-    AliHLTTPCCAProcess<AliHLTTPCCATrackletSelector>(nBlocks, nThreads,*this);
+    AliHLTTPCCAProcess<AliHLTTPCCATrackletSelector>( nBlocks, nThreads, *this );
 
     //std::cout<<"Slice "<<Param().ISlice()<<": N start hits/tracklets/tracks = "<<nStartHits<<" "<<nStartHits<<" "<<*fNTracks<<std::endl;
-   }
+  }
 
   //std::cout<<"Memory used for slice "<<fParam.ISlice()<<" : "<<fCommonMemorySize/1024./1024.<<" + "<<fHitMemorySize/1024./1024.<<" + "<<fTrackMemorySize/1024./1024.<<" = "<<( fCommonMemorySize+fHitMemorySize+fTrackMemorySize )/1024./1024.<<" Mb "<<std::endl;
 
-  
-  WriteOutput();      
-  
+
+  WriteOutput();
+
 
 #endif
 
 #ifdef DRAW
- {
-   AliHLTTPCCADisplay &disp = AliHLTTPCCADisplay::Instance();
-   AliHLTTPCCATracker &slice = *this;
-   std::cout<<"N out tracks = "<<*slice.NOutTracks()<<std::endl;
-   //disp.Ask();
-   AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
-   AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
-   disp.DrawSliceHits(-1,.5);
-   for( Int_t itr=0; itr<*slice.NOutTracks(); itr++ ){
-     std::cout<<"track N "<<itr<<", nhits="<<slice.OutTracks()[itr].NHits()<<std::endl;
-     disp.DrawSliceOutTrack( itr, kBlue );
-     //disp.Ask();
-     //int id = slice.OutTracks()[itr].OrigTrackID();
-     //AliHLTTPCCATrack &tr = Tracks()[id];
-     //for( Int_t ih=0; ih<tr.NHits(); ih++ ){       
-     //Int_t ic = (fTrackHits[tr.FirstHitID()+ih]);
-     //std::cout<<ih<<" "<<ID2IRow(ic)<<" "<<ID2IHit(ic)<<std::endl;
-     //}
-     //disp.DrawSliceTrack( id, kBlue );
-     //disp.Ask();
-   }
-   disp.Ask();
- }
 {
+    AliHLTTPCCADisplay &disp = AliHLTTPCCADisplay::Instance();
+    AliHLTTPCCATracker &slice = *this;
+    std::cout << "N out tracks = " << *slice.NOutTracks() << std::endl;
+    //disp.Ask();
+    AliHLTTPCCADisplay::Instance().SetCurrentSlice( this );
+    AliHLTTPCCADisplay::Instance().DrawSlice( this, 1 );
+    disp.DrawSliceHits( -1, .5 );
+    for ( int itr = 0; itr < *slice.NOutTracks(); itr++ ) {
+      std::cout << "track N " << itr << ", nhits=" << slice.OutTracks()[itr].NHits() << std::endl;
+      disp.DrawSliceOutTrack( itr, kBlue );
+      //disp.Ask();
+      //int id = slice.OutTracks()[itr].OrigTrackID();
+      //AliHLTTPCCATrack &tr = Tracks()[id];
+      //for( int ih=0; ih<tr.NHits(); ih++ ){
+      //int ic = (fTrackHits[tr.FirstHitID()+ih]);
+      //std::cout<<ih<<" "<<ID2IRow(ic)<<" "<<ID2IHit(ic)<<std::endl;
+      //}
+      //disp.DrawSliceTrack( id, kBlue );
+      //disp.Ask();
+    }
+    disp.Ask();
 }
 #endif
 
-  timer0.Stop();  
-  fTimers[0] = timer0.CpuTime()/100.;
+  timer0.Stop();
+  fTimers[0] = timer0.CpuTime() / 100.;
 
- }
+}
 
 
 
@@ -719,190 +719,190 @@ GPUh() void AliHLTTPCCATracker::WriteOutput()
 
   TStopwatch timer;
 
-  //cout<<"output: nTracks = "<<*fNTracks<<", nHitsTotal="<<fNHitsTotal<<std::endl;  
+  //cout<<"output: nTracks = "<<*fNTracks<<", nHitsTotal="<<fNHitsTotal<<std::endl;
+
 
-  
   fOutput->SetNTracks( *fNTracks );
   fOutput->SetNTrackClusters( *fNTrackHits );
   fOutput->SetPointers();
 
-  Float_t *hitsXYZ = reinterpret_cast<Float_t*>( fInputEvent ) + 1+fParam.NRows()*2+1;
+  float *hitsXYZ = reinterpret_cast<float*>( fInputEvent ) + 1 + fParam.NRows() * 2 + 1;
+
+  int nStoredHits = 0;
 
-  Int_t nStoredHits = 0;
+  for ( int iTr = 0; iTr < *fNTracks; iTr++ ) {
+    AliHLTTPCCATrack &iTrack = fTracks[iTr];
 
-  for( Int_t iTr=0; iTr<*fNTracks; iTr++){
-    AliHLTTPCCATrack &iTrack = fTracks[iTr];       
     AliHLTTPCCASliceTrack out;
     out.SetFirstClusterRef( nStoredHits );
-    out.SetNClusters( iTrack.NHits() );    
+    out.SetNClusters( iTrack.NHits() );
     out.SetParam( iTrack.Param() );
 
     fOutput->SetTrack( iTr, out );
 
-    Int_t iID = iTrack.FirstHitID();
-    for( Int_t ith=0; ith<iTrack.NHits(); ith++ ){
-      Int_t ic = (fTrackHits[iID+ith]);
-      Int_t iRow = ID2IRow(ic);
-      Int_t ih = ID2IHit(ic);
+    int iID = iTrack.FirstHitID();
+    for ( int ith = 0; ith < iTrack.NHits(); ith++ ) {
+      int ic = ( fTrackHits[iID+ith] );
+      int iRow = ID2IRow( ic );
+      int ih = ID2IHit( ic );
+
+      const AliHLTTPCCARow &row = fRows[iRow];
 
-      const AliHLTTPCCARow &row = fRows[iRow];      
-  
-      //Float_t y0 = row.Grid().YMin();
-      //Float_t z0 = row.Grid().ZMin();
-      //Float_t stepY = row.HstepY();
-      //Float_t stepZ = row.HstepZ();      
-      //Float_t x = row.X();
+      //float y0 = row.Grid().YMin();
+      //float z0 = row.Grid().ZMin();
+      //float stepY = row.HstepY();
+      //float stepZ = row.HstepZ();
+      //float x = row.X();
 
       //const uint4 *tmpint4 = RowData() + row.FullOffset();
       //const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
       //ushort2 hh = hits[ih];
-      //Float_t y = y0 + hh.x*stepY;
-      //Float_t z = z0 + hh.y*stepZ;
+      //float y = y0 + hh.x*stepY;
+      //float z = z0 + hh.y*stepZ;
 
-      Int_t inpIDtot = fHitInputIDs[row.FirstHit()+ih];
-      Int_t inpID = inpIDtot - row.FirstHit();
+      int inpIDtot = fHitInputIDs[row.FirstHit()+ih];
+      int inpID = inpIDtot - row.FirstHit();
 
       float origX = hitsXYZ[inpIDtot*3+0];
       float origY = hitsXYZ[inpIDtot*3+1];
       float origZ = hitsXYZ[inpIDtot*3+2];
 
-      UInt_t hIDrc = AliHLTTPCCADataCompressor::IRowIClu2IDrc(iRow,inpID);
-      UShort_t hPackedYZ = 0;
+      unsigned int hIDrc = AliHLTTPCCADataCompressor::IRowIClu2IDrc( iRow, inpID );
+      unsigned short hPackedYZ = 0;
       UChar_t hPackedAmp = 0;
-      float2 hUnpackedYZ = CAMath::MakeFloat2(origY,origZ);
+      float2 hUnpackedYZ = CAMath::MakeFloat2( origY, origZ );
       float hUnpackedX = origX;
 
       fOutput->SetClusterIDrc( nStoredHits, hIDrc  );
       fOutput->SetClusterPackedYZ( nStoredHits, hPackedYZ );
-      fOutput->SetClusterPackedAmp( nStoredHits, hPackedAmp);
+      fOutput->SetClusterPackedAmp( nStoredHits, hPackedAmp );
       fOutput->SetClusterUnpackedYZ( nStoredHits, hUnpackedYZ );
       fOutput->SetClusterUnpackedX( nStoredHits, hUnpackedX );
       nStoredHits++;
     }
   }
-  
-  // old stuff 
+
+
+  // old stuff
 
   *fNOutTrackHits = 0;
   *fNOutTracks = 0;
 
 
-  for( Int_t iTr=0; iTr<*fNTracks; iTr++){
+  for ( int iTr = 0; iTr < *fNTracks; iTr++ ) {
 
     AliHLTTPCCATrack &iTrack = fTracks[iTr];
 
     //cout<<"iTr = "<<iTr<<", nHits="<<iTrack.NHits()<<std::endl;
 
     //if( !iTrack.Alive() ) continue;
-    if( iTrack.NHits()<3 ) continue;          
+    if ( iTrack.NHits() < 3 ) continue;
     AliHLTTPCCAOutTrack &out = fOutTracks[*fNOutTracks];
     out.SetFirstHitRef( *fNOutTrackHits );
     out.SetNHits( 0 );
-    out.SetOrigTrackID( iTr );    
+    out.SetOrigTrackID( iTr );
     out.SetStartPoint( iTrack.Param() );
-    out.SetEndPoint( iTrack.Param() );    
-
-    Int_t iID = iTrack.FirstHitID();
-    Int_t nOutTrackHitsOld = *fNOutTrackHits;
-    for( Int_t ith=0; ith<iTrack.NHits(); ith++ ){
-      Int_t ic = (fTrackHits[iID+ith]);
-      const AliHLTTPCCARow &row = ID2Row(ic);
-      Int_t ih = ID2IHit(ic);
-      fOutTrackHits[*fNOutTrackHits] = fHitInputIDs[row.FirstHit()+ih];      
-      (*fNOutTrackHits)++;
-      //cout<<"write i,row,hit,id="<<ith<<", "<<ID2IRow(ic)<<", "<<ih<<", "<<fHitInputIDs[row.FirstHit()+ih]<<std::endl;     
-      if( *fNOutTrackHits>=10*fNHitsTotal ){
-       std::cout<<"fNOutTrackHits>fNHitsTotal"<<std::endl;
-       //exit(0);
-       return;//SG!!!
+    out.SetEndPoint( iTrack.Param() );
+
+    int iID = iTrack.FirstHitID();
+    int nOutTrackHitsOld = *fNOutTrackHits;
+
+    for ( int ith = 0; ith < iTrack.NHits(); ith++ ) {
+      int ic = ( fTrackHits[iID+ith] );
+      const AliHLTTPCCARow &row = ID2Row( ic );
+      int ih = ID2IHit( ic );
+      fOutTrackHits[*fNOutTrackHits] = fHitInputIDs[row.FirstHit()+ih];
+      ( *fNOutTrackHits )++;
+      //cout<<"write i,row,hit,id="<<ith<<", "<<ID2IRow(ic)<<", "<<ih<<", "<<fHitInputIDs[row.FirstHit()+ih]<<std::endl;
+      if ( *fNOutTrackHits >= 10*fNHitsTotal ) {
+        std::cout << "fNOutTrackHits>fNHitsTotal" << std::endl;
+        //exit(0);
+        return;//SG!!!
       }
-      out.SetNHits( out.NHits() + 1 );      
-    }    
-    if( out.NHits() >= 2 ){
-      (*fNOutTracks)++;
-    }else {
-      (*fNOutTrackHits) = nOutTrackHitsOld;
+      out.SetNHits( out.NHits() + 1 );
+    }
+    if ( out.NHits() >= 2 ) {
+      ( *fNOutTracks )++;
+    } else {
+      ( *fNOutTrackHits ) = nOutTrackHitsOld;
     }
   }
 
 
   timer.Stop();
-  fTimers[5]+=timer.CpuTime();
+  fTimers[5] += timer.CpuTime();
 }
 
-GPUh() void AliHLTTPCCATracker::FitTrackFull( AliHLTTPCCATrack &/**/, Float_t * /**/ ) const 
-{  
+GPUh() void AliHLTTPCCATracker::FitTrackFull( AliHLTTPCCATrack &/**/, float * /**/ ) const
+{
   // fit track with material
-#ifdef XXX    
-  //* Fit the track   
+#ifdef XXX
+  //* Fit the track
   FitTrack( iTrack, tt0 );
-  if( iTrack.NHits()<=3 ) return;
-    
+  if ( iTrack.NHits() <= 3 ) return;
+
   AliHLTTPCCATrackParam &t = iTrack.Param();
   AliHLTTPCCATrackParam t0 = t;
 
   t.Chi2() = 0;
-  t.NDF() = -5;        
-  Bool_t first = 1;
-
-  Int_t iID = iTrack.FirstHitID();
-  for( Int_t ih=0; ih<iTrack.NHits(); ih++, iID++ ){
-    Int_t *ic = &(fTrackHits[iID]);
-    Int_t iRow = ID2IRow(*ic);
-    AliHLTTPCCARow &row = fRows[iRow];      
-    if( !t0.TransportToX( row.X() ) ) continue;      
-    Float_t dy, dz;
-    AliHLTTPCCAHit &h = ID2Hit(*ic);
-
-    // check for wrong hits    
-    if(0){
+  t.NDF() = -5;
+  bool first = 1;
+
+  int iID = iTrack.FirstHitID();
+  for ( int ih = 0; ih < iTrack.NHits(); ih++, iID++ ) {
+    int *ic = &( fTrackHits[iID] );
+    int iRow = ID2IRow( *ic );
+    AliHLTTPCCARow &row = fRows[iRow];
+    if ( !t0.TransportToX( row.X() ) ) continue;
+    float dy, dz;
+    AliHLTTPCCAHit &h = ID2Hit( *ic );
+
+    // check for wrong hits
+    if ( 0 ) {
       dy = t0.GetY() - h.Y();
       dz = t0.GetZ() - h.Z();
-      
+
       //if( dy*dy > 3.5*3.5*(/*t0.GetErr2Y() + */h.ErrY()*h.ErrY() ) ) continue;//SG!!!
-      //if( dz*dz > 3.5*3.5*(/*t0.GetErr2Z() + */h.ErrZ()*h.ErrZ() ) ) continue;      
+      //if( dz*dz > 3.5*3.5*(/*t0.GetErr2Z() + */h.ErrZ()*h.ErrZ() ) ) continue;
     }
 
-    if( !t.TransportToX( row.X() ) ) continue;  
+    if ( !t.TransportToX( row.X() ) ) continue;
 
     //* Update the track
-           
-    if( first ){
-      t.Cov()[ 0] = .5*.5;
+
+    if ( first ) {
+      t.Cov()[ 0] = .5 * .5;
       t.Cov()[ 1] = 0;
-      t.Cov()[ 2] = .5*.5;
+      t.Cov()[ 2] = .5 * .5;
       t.Cov()[ 3] = 0;
       t.Cov()[ 4] = 0;
-      t.Cov()[ 5] = .2*.2;
+      t.Cov()[ 5] = .2 * .2;
       t.Cov()[ 6] = 0;
       t.Cov()[ 7] = 0;
       t.Cov()[ 8] = 0;
-      t.Cov()[ 9] = .2*.2;
+      t.Cov()[ 9] = .2 * .2;
       t.Cov()[10] = 0;
       t.Cov()[11] = 0;
       t.Cov()[12] = 0;
       t.Cov()[13] = 0;
-      t.Cov()[14] = .2*.2;
+      t.Cov()[14] = .2 * .2;
       t.Chi2() = 0;
       t.NDF() = -5;
     }
-    Float_t err2Y, err2Z;
+    float err2Y, err2Z;
     GetErrors2( iRow, t, err2Y, err2Z );
 
-    if( !t.Filter2( h.Y(), h.Z(), err2Y, err2Z ) ) continue;
+    if ( !t.Filter2( h.Y(), h.Z(), err2Y, err2Z ) ) continue;
 
-    first = 0;      
-  }  
+    first = 0;
+  }
   /*
-  Float_t cosPhi = iTrack.Param().GetCosPhi();
+  float cosPhi = iTrack.Param().GetCosPhi();
   p0.Param().TransportToX(ID2Row( iTrack.PointID()[0] ).X());
-  p2.Param().TransportToX(ID2Row( iTrack.PointID()[1] ).X());  
+  p2.Param().TransportToX(ID2Row( iTrack.PointID()[1] ).X());
   if( p0.Param().GetCosPhi()*cosPhi<0 ){ // change direction
-  Float_t *par = p0.Param().Par();
-  Float_t *cov = p0.Param().Cov();
+  float *par = p0.Param().Par();
+  float *cov = p0.Param().Cov();
   par[2] = -par[2]; // sin phi
   par[3] = -par[3]; // DzDs
     par[4] = -par[4]; // kappa
@@ -918,24 +918,24 @@ GPUh() void AliHLTTPCCATracker::FitTrackFull( AliHLTTPCCATrack &/**/, Float_t *
 #endif
 }
 
-GPUh() void AliHLTTPCCATracker::FitTrack( AliHLTTPCCATrack &/*track*/, Float_t */*t0[]*/ ) const 
-{      
-  //* Fit the track   
+GPUh() void AliHLTTPCCATracker::FitTrack( AliHLTTPCCATrack &/*track*/, float */*t0[]*/ ) const
+{
+  //* Fit the track
 #ifdef XXX
-  AliHLTTPCCAEndPoint &p2 = ID2Point(track.PointID()[1]);
-  AliHLTTPCCAHit &c0 = ID2Hit(fTrackHits[p0.TrackHitID()].HitID());    
-  AliHLTTPCCAHit &c1 = ID2Hit(fTrackHits[track.HitID()[1]].HitID());   
-  AliHLTTPCCAHit &c2 = ID2Hit(fTrackHits[p2.TrackHitID()].HitID());    
-  AliHLTTPCCARow &row0 = ID2Row(fTrackHits[p0.TrackHitID()].HitID());
-  AliHLTTPCCARow &row1 = ID2Row(fTrackHits[track.HitID()[1]].HitID());
-  AliHLTTPCCARow &row2 = ID2Row(fTrackHits[p2.TrackHitID()].HitID());
-  Float_t sp0[5] = {row0.X(), c0.Y(), c0.Z(), c0.ErrY(), c0.ErrZ() };
-  Float_t sp1[5] = {row1.X(), c1.Y(), c1.Z(), c1.ErrY(), c1.ErrZ() };
-  Float_t sp2[5] = {row2.X(), c2.Y(), c2.Z(), c2.ErrY(), c2.ErrZ() };
+  AliHLTTPCCAEndPoint &p2 = ID2Point( track.PointID()[1] );
+  AliHLTTPCCAHit &c0 = ID2Hit( fTrackHits[p0.TrackHitID()].HitID() );
+  AliHLTTPCCAHit &c1 = ID2Hit( fTrackHits[track.HitID()[1]].HitID() );
+  AliHLTTPCCAHit &c2 = ID2Hit( fTrackHits[p2.TrackHitID()].HitID() );
+  AliHLTTPCCARow &row0 = ID2Row( fTrackHits[p0.TrackHitID()].HitID() );
+  AliHLTTPCCARow &row1 = ID2Row( fTrackHits[track.HitID()[1]].HitID() );
+  AliHLTTPCCARow &row2 = ID2Row( fTrackHits[p2.TrackHitID()].HitID() );
+  float sp0[5] = {row0.X(), c0.Y(), c0.Z(), c0.ErrY(), c0.ErrZ() };
+  float sp1[5] = {row1.X(), c1.Y(), c1.Z(), c1.ErrY(), c1.ErrZ() };
+  float sp2[5] = {row2.X(), c2.Y(), c2.Z(), c2.ErrY(), c2.ErrZ() };
   //cout<<"Fit track, points ="<<sp0[0]<<" "<<sp0[1]<<" / "<<sp1[0]<<" "<<sp1[1]<<" / "<<sp2[0]<<" "<<sp2[1]<<std::endl;
-  if( track.NHits()>=3 ){    
-    p0.Param().ConstructXYZ3(sp0,sp1,sp2,p0.Param().CosPhi(), t0);
-    p2.Param().ConstructXYZ3(sp2,sp1,sp0,p2.Param().CosPhi(), t0);
+  if ( track.NHits() >= 3 ) {
+    p0.Param().ConstructXYZ3( sp0, sp1, sp2, p0.Param().CosPhi(), t0 );
+    p2.Param().ConstructXYZ3( sp2, sp1, sp0, p2.Param().CosPhi(), t0 );
     //p2.Param() = p0.Param();
     //p2.Param().TransportToX(row2.X());
     //p2.Param().Par()[1] = -p2.Param().Par()[1];
@@ -944,20 +944,20 @@ GPUh() void AliHLTTPCCATracker::FitTrack( AliHLTTPCCATrack &/*track*/, Float_t *
     p0.Param().X() = row0.X();
     p0.Param().Y() = c0.Y();
     p0.Param().Z() = c0.Z();
-    p0.Param().Err2Y() = c0.ErrY()*c0.ErrY();
-    p0.Param().Err2Z() = c0.ErrZ()*c0.ErrZ();
+    p0.Param().Err2Y() = c0.ErrY() * c0.ErrY();
+    p0.Param().Err2Z() = c0.ErrZ() * c0.ErrZ();
     p2.Param().X() = row2.X();
     p2.Param().Y() = c2.Y();
     p2.Param().Z() = c2.Z();
-    p2.Param().Err2Y() = c2.ErrY()*c2.ErrY();
-    p2.Param().Err2Z() = c2.ErrZ()*c2.ErrZ();
+    p2.Param().Err2Y() = c2.ErrY() * c2.ErrY();
+    p2.Param().Err2Z() = c2.ErrZ() * c2.ErrZ();
   }
 #endif
 }
 
 
 
-GPUd() void AliHLTTPCCATracker::GetErrors2( Int_t iRow, Float_t z, Float_t sinPhi, Float_t cosPhi, Float_t DzDs, Float_t &Err2Y, Float_t &Err2Z ) const
+GPUd() void AliHLTTPCCATracker::GetErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const
 {
   //
   // Use calibrated cluster error from OCDB
@@ -966,7 +966,7 @@ GPUd() void AliHLTTPCCATracker::GetErrors2( Int_t iRow, Float_t z, Float_t sinPh
   fParam.GetClusterErrors2( iRow, z, sinPhi, cosPhi, DzDs, Err2Y, Err2Z );
 }
 
-GPUd() void AliHLTTPCCATracker::GetErrors2( Int_t iRow, const AliHLTTPCCATrackParam &t, Float_t &Err2Y, Float_t &Err2Z ) const
+GPUd() void AliHLTTPCCATracker::GetErrors2( int iRow, const AliHLTTPCCATrackParam &t, float &Err2Y, float &Err2Z ) const
 {
   //
   // Use calibrated cluster error from OCDB
@@ -976,138 +976,138 @@ GPUd() void AliHLTTPCCATracker::GetErrors2( Int_t iRow, const AliHLTTPCCATrackPa
 }
 
 
-#if !defined(HLTCA_GPUCODE)  
+#if !defined(HLTCA_GPUCODE)
 
-GPUh() void AliHLTTPCCATracker::WriteEvent( std::ostream &out ) 
+GPUh() void AliHLTTPCCATracker::WriteEvent( std::ostream &out )
 {
   // write event to the file
-  for( Int_t iRow=0; iRow<fParam.NRows(); iRow++ ){
-    out<<fRows[iRow].FirstHit()<<" "<<fRows[iRow].NHits()<<std::endl;
-  } 
-  out<<fNHitsTotal<<std::endl;
-  
-  Float_t *y = new Float_t [fNHitsTotal];
-  Float_t *z = new Float_t [fNHitsTotal];
-
-  for( Int_t iRow=0; iRow<fParam.NRows(); iRow++){
+  for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
+    out << fRows[iRow].FirstHit() << " " << fRows[iRow].NHits() << std::endl;
+  }
+  out << fNHitsTotal << std::endl;
+
+  float *y = new float [fNHitsTotal];
+  float *z = new float [fNHitsTotal];
+
+  for ( int iRow = 0; iRow < fParam.NRows(); iRow++ ) {
     AliHLTTPCCARow &row = fRows[iRow];
-    Float_t y0 = row.Grid().YMin();
-    Float_t z0 = row.Grid().ZMin();
-    Float_t stepY = row.HstepY();
-    Float_t stepZ = row.HstepZ();
+    float y0 = row.Grid().YMin();
+    float z0 = row.Grid().ZMin();
+    float stepY = row.HstepY();
+    float stepZ = row.HstepZ();
     const uint4* tmpint4 = RowData() + row.FullOffset();
-    const ushort2 *hits = reinterpret_cast<const ushort2*>(tmpint4);
-    for( Int_t ih=0; ih<fRows[iRow].NHits(); ih++ ){
-      Int_t ihTot = row.FirstHit() + ih;
-      Int_t id = fHitInputIDs[ihTot];
+    const ushort2 *hits = reinterpret_cast<const ushort2*>( tmpint4 );
+    for ( int ih = 0; ih < fRows[iRow].NHits(); ih++ ) {
+      int ihTot = row.FirstHit() + ih;
+      int id = fHitInputIDs[ihTot];
       ushort2 hh = hits[ih];
-      y[id] = y0 + hh.x*stepY;
-      z[id] = z0 + hh.y*stepZ;
+      y[id] = y0 + hh.x * stepY;
+      z[id] = z0 + hh.y * stepZ;
     }
   }
-  for( Int_t ih=0; ih<fNHitsTotal; ih++ ){
-    out<<y[ih]<<" "<<z[ih]<<std::endl;
+  for ( int ih = 0; ih < fNHitsTotal; ih++ ) {
+    out << y[ih] << " " << z[ih] << std::endl;
   }
   delete[] y;
   delete[] z;
 }
 
-GPUh() void AliHLTTPCCATracker::ReadEvent( std::istream &in ) 
+GPUh() void AliHLTTPCCATracker::ReadEvent( std::istream &in )
 {
-  //* Read event from file 
-  
-  Int_t *rowFirstHit = new Int_t[ Param().NRows()];
-  Int_t *rowNHits = new Int_t [ Param().NRows()];
+  //* Read event from file
+
+  int *rowFirstHit = new int[ Param().NRows()];
+  int *rowNHits = new int [ Param().NRows()];
 
-  for( Int_t iRow=0; iRow<Param().NRows(); iRow++ ){
-    in>>rowFirstHit[iRow]>>rowNHits[iRow];
+  for ( int iRow = 0; iRow < Param().NRows(); iRow++ ) {
+    in >> rowFirstHit[iRow] >> rowNHits[iRow];
   }
-  Int_t nHits;
+  int nHits;
   in >> nHits;
 
-  Float_t *y = new Float_t[ nHits ];
-  Float_t *z = new Float_t[ nHits ];
-  for( Int_t ih=0; ih<nHits; ih++ ){
-    in>>y[ih]>>z[ih];
+  float *y = new float[ nHits ];
+  float *z = new float[ nHits ];
+  for ( int ih = 0; ih < nHits; ih++ ) {
+    in >> y[ih] >> z[ih];
   }
   //ReadEvent( rowFirstHit, rowNHits, y, z, nHits );
-  if( rowFirstHit ) delete[] rowFirstHit;
-  if( rowNHits )delete[] rowNHits;
-  if( y )delete[] y;
-  if( z )delete[] z;
-} 
+  if ( rowFirstHit ) delete[] rowFirstHit;
+  if ( rowNHits )delete[] rowNHits;
+  if ( y )delete[] y;
+  if ( z )delete[] z;
+}
 
-GPUh() void AliHLTTPCCATracker::WriteTracks( std::ostream &out ) 
+GPUh() void AliHLTTPCCATracker::WriteTracks( std::ostream &out )
 {
-  //* Write tracks to file 
-   
-  out<<fTimers[0]<<std::endl;
-  out<<*fNOutTrackHits<<std::endl;
-  for( Int_t ih=0; ih<*fNOutTrackHits; ih++ ){
-    out<< fOutTrackHits[ih]<<" ";
+  //* Write tracks to file
+
+  out << fTimers[0] << std::endl;
+  out << *fNOutTrackHits << std::endl;
+  for ( int ih = 0; ih < *fNOutTrackHits; ih++ ) {
+    out << fOutTrackHits[ih] << " ";
   }
-  out<<std::endl;
-  
-  out<<*fNOutTracks<<std::endl;
-
-  for( Int_t itr=0; itr<*fNOutTracks; itr++ ){
-    AliHLTTPCCAOutTrack &t = fOutTracks[itr];    
-    AliHLTTPCCATrackParam p1 = t.StartPoint(); 
-    AliHLTTPCCATrackParam p2 = t.EndPoint();   
-    out<< t.NHits()<<" ";
-    out<< t.FirstHitRef()<<" ";
-    out<< t.OrigTrackID()<<" ";
-    out<<std::endl;
-    out<< p1.X()<<" ";
-    out<< p1.SignCosPhi()<<" ";
-    out<< p1.Chi2()<<" ";
-    out<< p1.NDF()<<std::endl;
-    for( Int_t i=0; i<5; i++ ) out<<p1.Par()[i]<<" ";
-    out<<std::endl;
-    for( Int_t i=0; i<15; i++ ) out<<p1.Cov()[i]<<" ";
-    out<<std::endl;
-    out<< p2.X()<<" ";
-    out<< p2.SignCosPhi()<<" ";
-    out<< p2.Chi2()<<" ";
-    out<< p2.NDF()<<std::endl;
-    for( Int_t i=0; i<5; i++ ) out<<p2.Par()[i]<<" ";
-    out<<std::endl;
-    for( Int_t i=0; i<15; i++ ) out<<p2.Cov()[i]<<" ";
-    out<<std::endl;
+  out << std::endl;
+
+  out << *fNOutTracks << std::endl;
+
+  for ( int itr = 0; itr < *fNOutTracks; itr++ ) {
+    AliHLTTPCCAOutTrack &t = fOutTracks[itr];
+    AliHLTTPCCATrackParam p1 = t.StartPoint();
+    AliHLTTPCCATrackParam p2 = t.EndPoint();
+    out << t.NHits() << " ";
+    out << t.FirstHitRef() << " ";
+    out << t.OrigTrackID() << " ";
+    out << std::endl;
+    out << p1.X() << " ";
+    out << p1.SignCosPhi() << " ";
+    out << p1.Chi2() << " ";
+    out << p1.NDF() << std::endl;
+    for ( int i = 0; i < 5; i++ ) out << p1.Par()[i] << " ";
+    out << std::endl;
+    for ( int i = 0; i < 15; i++ ) out << p1.Cov()[i] << " ";
+    out << std::endl;
+    out << p2.X() << " ";
+    out << p2.SignCosPhi() << " ";
+    out << p2.Chi2() << " ";
+    out << p2.NDF() << std::endl;
+    for ( int i = 0; i < 5; i++ ) out << p2.Par()[i] << " ";
+    out << std::endl;
+    for ( int i = 0; i < 15; i++ ) out << p2.Cov()[i] << " ";
+    out << std::endl;
   }
 }
 
 GPUh() void AliHLTTPCCATracker::ReadTracks( std::istream &in )
 {
-  //* Read tracks  from file 
-  in>>fTimers[0];
-  in>>*fNOutTrackHits;  
+  //* Read tracks  from file
+  in >> fTimers[0];
+  in >> *fNOutTrackHits;
 
-  for( Int_t ih=0; ih<*fNOutTrackHits; ih++ ){
-    in>>fOutTrackHits[ih];
+  for ( int ih = 0; ih < *fNOutTrackHits; ih++ ) {
+    in >> fOutTrackHits[ih];
   }
-  in>>*fNOutTracks;
+  in >> *fNOutTracks;
 
-  for( Int_t itr=0; itr<*fNOutTracks; itr++ ){
-    AliHLTTPCCAOutTrack &t = fOutTracks[itr];    
+  for ( int itr = 0; itr < *fNOutTracks; itr++ ) {
+    AliHLTTPCCAOutTrack &t = fOutTracks[itr];
     AliHLTTPCCATrackParam p1, p2;
-    Int_t i;
-    Float_t f;
-    in>> i; t.SetNHits( i );
-    in>> i; t.SetFirstHitRef( i );
-    in>> i; t.SetOrigTrackID( i );
-    in>> f; p1.SetX( f );
-    in>> f; p1.SetSignCosPhi( f );
-    in>> f; p1.SetChi2( f );
-    in>> i; p1.SetNDF( i );
-    for( Int_t j=0; j<5; j++ ){ in>>f; p1.SetPar(j,f); }
-    for( Int_t j=0; j<15; j++ ){ in>>f; p1.SetCov(j,f); }
-    in>> f; p2.SetX( f );
-    in>> f; p2.SetSignCosPhi( f );
-    in>> f; p2.SetChi2( f );
-    in>> i; p2.SetNDF( i );
-    for( Int_t j=0; j<5; j++ ){ in>>f; p2.SetPar(j,f); }
-    for( Int_t j=0; j<15; j++ ){ in>>f; p2.SetCov(j,f); }
+    int i;
+    float f;
+    in >> i; t.SetNHits( i );
+    in >> i; t.SetFirstHitRef( i );
+    in >> i; t.SetOrigTrackID( i );
+    in >> f; p1.SetX( f );
+    in >> f; p1.SetSignCosPhi( f );
+    in >> f; p1.SetChi2( f );
+    in >> i; p1.SetNDF( i );
+    for ( int j = 0; j < 5; j++ ) { in >> f; p1.SetPar( j, f ); }
+    for ( int j = 0; j < 15; j++ ) { in >> f; p1.SetCov( j, f ); }
+    in >> f; p2.SetX( f );
+    in >> f; p2.SetSignCosPhi( f );
+    in >> f; p2.SetChi2( f );
+    in >> i; p2.SetNDF( i );
+    for ( int j = 0; j < 5; j++ ) { in >> f; p2.SetPar( j, f ); }
+    for ( int j = 0; j < 15; j++ ) { in >> f; p2.SetCov( j, f ); }
     t.SetStartPoint( p1 );
     t.SetEndPoint( p2 );
   }
index 4fdd8aee7795cc63b0078ca0ad754b492cd1d24b..e748ea2c778f1c896829bcb40e10cc3c9d7fce01 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -25,160 +25,160 @@ class AliHLTTPCCASliceOutput;
 
 /**
  * @class AliHLTTPCCATracker
- * 
- * Slice tracker for ALICE HLT. 
+ *
+ * Slice tracker for ALICE HLT.
  * The class reconstructs tracks in one slice of TPC.
  * The reconstruction algorithm is based on the Cellular Automaton method
  *
- * The CA tracker is designed stand-alone. 
+ * The CA tracker is designed stand-alone.
  * It is integrated to the HLT framework via AliHLTTPCCATrackerComponent interface.
  * The class is under construction.
  *
  */
 class AliHLTTPCCATracker
 {
- public:
 public:
 
-#if !defined(HLTCA_GPUCODE)  
-  AliHLTTPCCATracker();
-  AliHLTTPCCATracker( const AliHLTTPCCATracker& );
-  AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker& );
+#if !defined(HLTCA_GPUCODE)
+    AliHLTTPCCATracker();
+    AliHLTTPCCATracker( const AliHLTTPCCATracker& );
+    AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker& );
 
-  GPUd() ~AliHLTTPCCATracker();
+    GPUd() ~AliHLTTPCCATracker();
 #endif
 
-  GPUd() void Initialize( const AliHLTTPCCAParam &param );
-
-  GPUd() void StartEvent();
-
-  GPUd() void ReadEvent( const Int_t *RowFirstHit, const Int_t *RowNHits, const Float_t *X, const Float_t *Y, const Float_t *Z, Int_t NHits );
-
-  GPUd() void SetupRowData();
-
-  void Reconstruct();
-  void WriteOutput();
-
-  GPUd() void GetErrors2( Int_t iRow,  const AliHLTTPCCATrackParam &t, Float_t &Err2Y, Float_t &Err2Z ) const;
-  GPUd() void GetErrors2( Int_t iRow, Float_t z, Float_t sinPhi, Float_t cosPhi, Float_t DzDs, Float_t &Err2Y, Float_t &Err2Z ) const;
-
-  GPUhd() static Int_t IRowIHit2ID( Int_t iRow, Int_t iHit ){ 
-    return (iHit<<8)+iRow; 
-  }
-  GPUhd() static Int_t ID2IRow( Int_t HitID ){ 
-    return ( HitID%256 ); 
-  }
-  GPUhd() static Int_t ID2IHit( Int_t HitID ){ 
-    return ( HitID>>8 ); 
-  }  
-
-  //GPUhd() AliHLTTPCCAHit &ID2Hit( Int_t HitID ) {
-  //return fHits[fRows[HitID%256].FirstHit() + (HitID>>8)];
-  //}
-  GPUhd() const AliHLTTPCCARow &ID2Row( Int_t HitID ) const {
-    return fRows[HitID%256];
-  }
-  
-  void FitTrack( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
-  void FitTrackFull( AliHLTTPCCATrack &track, Float_t *t0 = 0 ) const;
-  GPUhd() void SetPointersCommon();
-  GPUhd() void SetPointersHits( Int_t MaxNHits );
-  GPUhd() void SetPointersTracks( Int_t MaxNTracks, Int_t MaxNHits );
-
-#if !defined(HLTCA_GPUCODE)  
-  GPUh() void WriteEvent( std::ostream &out );
-  GPUh() void ReadEvent( std::istream &in );
-  GPUh() void WriteTracks( std::ostream &out ) ;
-  GPUh() void ReadTracks( std::istream &in );
+    GPUd() void Initialize( const AliHLTTPCCAParam &param );
+
+    GPUd() void StartEvent();
+
+    GPUd() void ReadEvent( const int *RowFirstHit, const int *RowNHits, const float *X, const float *Y, const float *Z, int NHits );
+
+    GPUd() void SetupRowData();
+
+    void Reconstruct();
+    void WriteOutput();
+
+    GPUd() void GetErrors2( int iRow,  const AliHLTTPCCATrackParam &t, float &Err2Y, float &Err2Z ) const;
+    GPUd() void GetErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const;
+
+    GPUhd() static int IRowIHit2ID( int iRow, int iHit ) {
+      return ( iHit << 8 ) + iRow;
+    }
+    GPUhd() static int ID2IRow( int HitID ) {
+      return ( HitID % 256 );
+    }
+    GPUhd() static int ID2IHit( int HitID ) {
+      return ( HitID >> 8 );
+    }
+
+    //GPUhd() AliHLTTPCCAHit &ID2Hit( int HitID ) {
+    //return fHits[fRows[HitID%256].FirstHit() + (HitID>>8)];
+    //}
+    GPUhd() const AliHLTTPCCARow &ID2Row( int HitID ) const {
+      return fRows[HitID%256];
+    }
+
+    void FitTrack( AliHLTTPCCATrack &track, float *t0 = 0 ) const;
+    void FitTrackFull( AliHLTTPCCATrack &track, float *t0 = 0 ) const;
+    GPUhd() void SetPointersCommon();
+    GPUhd() void SetPointersHits( int MaxNHits );
+    GPUhd() void SetPointersTracks( int MaxNTracks, int MaxNHits );
+
+#if !defined(HLTCA_GPUCODE)
+    GPUh() void WriteEvent( std::ostream &out );
+    GPUh() void ReadEvent( std::istream &in );
+    GPUh() void WriteTracks( std::ostream &out ) ;
+    GPUh() void ReadTracks( std::istream &in );
 #endif
 
-  GPUhd() const AliHLTTPCCAParam &Param() const { return fParam; }
-  GPUhd() void SetParam( const AliHLTTPCCAParam &v ){ fParam = v; }
-
-  GPUhd() const AliHLTTPCCARow &Row(Int_t i) const { return fRows[i]; }
-  GPUhd() Double_t Timer(Int_t i) const { return fTimers[i]; }
-  GPUhd() void SetTimer(Int_t i, Double_t v ){ fTimers[i] = v; }
-
-  GPUhd() Int_t NHitsTotal() const { return fNHitsTotal;}
-
-  GPUhd() const Char_t *InputEvent()    const { return fInputEvent; }
-  GPUhd() Int_t  InputEventSize() const { return fInputEventSize; }
-
-  GPUhd() const uint4  *RowData()    const   { return fRowData; }
-  GPUhd() Int_t  RowDataSize()  const { return fRowDataSize; }
-  GPUhd() Int_t *HitInputIDs() const { return fHitInputIDs; }
-  GPUhd() Int_t  *HitWeights() const { return fHitWeights; }  
-  
-  GPUhd() Int_t  *NTracklets() const { return fNTracklets; }
-  GPUhd() Int_t  *TrackletStartHits() const { return fTrackletStartHits; }
-  GPUhd() AliHLTTPCCATracklet  *Tracklets() const { return fTracklets;}
-  
-  GPUhd() Int_t *NTracks()  const { return fNTracks; }
-  GPUhd() AliHLTTPCCATrack *Tracks() const { return  fTracks; }
-  GPUhd() Int_t *NTrackHits()  const { return fNTrackHits; }
-  GPUhd() Int_t *TrackHits() const { return fTrackHits; }
-
-  GPUhd() const AliHLTTPCCASliceOutput * Output() const { return fOutput; }
-
-  GPUhd()  Int_t *NOutTracks() const { return  fNOutTracks; }
-  GPUhd()  AliHLTTPCCAOutTrack *OutTracks() const { return  fOutTracks; }
-  GPUhd()  Int_t *NOutTrackHits() const { return  fNOutTrackHits; }
-  GPUhd()  Int_t *OutTrackHits() const { return  fOutTrackHits; }
-  GPUh() void SetCommonMemory( Char_t * const mem ){ fCommonMemory = mem; }
-
-  private:  
-
-  AliHLTTPCCAParam fParam; // parameters
-  AliHLTTPCCARow fRows[200];// array of hit rows
-  Double_t fTimers[10]; // running CPU time for different parts of the algorithm
-  
-  // event
-
-  Int_t fNHitsTotal;// total number of hits in event
-  Char_t *fCommonMemory; // common event memory
-  Int_t   fCommonMemorySize; // size of the event memory [bytes]
-
-  Char_t *fHitMemory; // event memory for hits
-  Int_t   fHitMemorySize; // size of the event memory [bytes]
-
-  Char_t *fTrackMemory; // event memory for tracks
-  Int_t   fTrackMemorySize; // size of the event memory [bytes]
-
-  Char_t *fInputEvent;     // input event
-  Int_t   fInputEventSize; // size of the input event [bytes]
-
-  uint4  *fRowData;     // TPC rows: clusters, grid, links to neighbours
-  Int_t   fRowDataSize; // size of the row data
-  Int_t *fHitInputIDs; // cluster index in InputEvent  
-  Int_t *fHitWeights;  // the weight of the longest tracklet crossed the cluster
-  
-  Int_t *fNTracklets;     // number of tracklets 
-  Int_t *fTrackletStartHits;   // start hits for the tracklets
-  AliHLTTPCCATracklet *fTracklets; // tracklets
-
-  // 
-  Int_t *fNTracks;            // number of reconstructed tracks
-  AliHLTTPCCATrack *fTracks;  // reconstructed tracks
-  Int_t *fNTrackHits;           // number of track hits
-  Int_t *fTrackHits;          // array of track hit numbers
-
-  // output
-
-  AliHLTTPCCASliceOutput *fOutput;
-
-  // obsolete output
-
-  Int_t *fNOutTracks; // number of tracks in fOutTracks array
-  AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks
-  Int_t *fNOutTrackHits;  // number of hits in fOutTrackHits array
-  Int_t *fOutTrackHits;  // output array of ID's of the reconstructed hits
-  
-  //temporary
-  
-  Int_t *fTmpHitInputIDs; // temporary step
+    GPUhd() const AliHLTTPCCAParam &Param() const { return fParam; }
+    GPUhd() void SetParam( const AliHLTTPCCAParam &v ) { fParam = v; }
+
+    GPUhd() const AliHLTTPCCARow &Row( int i ) const { return fRows[i]; }
+    GPUhd() double Timer( int i ) const { return fTimers[i]; }
+    GPUhd() void SetTimer( int i, double v ) { fTimers[i] = v; }
+
+    GPUhd() int NHitsTotal() const { return fNHitsTotal;}
+
+    GPUhd() const char *InputEvent()    const { return fInputEvent; }
+    GPUhd() int  InputEventSize() const { return fInputEventSize; }
+
+    GPUhd() const uint4  *RowData()    const   { return fRowData; }
+    GPUhd() int  RowDataSize()  const { return fRowDataSize; }
+
+    GPUhd() int *HitInputIDs() const { return fHitInputIDs; }
+    GPUhd() int  *HitWeights() const { return fHitWeights; }
+
+    GPUhd() int  *NTracklets() const { return fNTracklets; }
+    GPUhd() int  *TrackletStartHits() const { return fTrackletStartHits; }
+    GPUhd() AliHLTTPCCATracklet  *Tracklets() const { return fTracklets;}
+
+    GPUhd() int *NTracks()  const { return fNTracks; }
+    GPUhd() AliHLTTPCCATrack *Tracks() const { return  fTracks; }
+    GPUhd() int *NTrackHits()  const { return fNTrackHits; }
+    GPUhd() int *TrackHits() const { return fTrackHits; }
+
+    GPUhd() const AliHLTTPCCASliceOutput * Output() const { return fOutput; }
+
+    GPUhd()  int *NOutTracks() const { return  fNOutTracks; }
+    GPUhd()  AliHLTTPCCAOutTrack *OutTracks() const { return  fOutTracks; }
+    GPUhd()  int *NOutTrackHits() const { return  fNOutTrackHits; }
+    GPUhd()  int *OutTrackHits() const { return  fOutTrackHits; }
+
+    GPUh() void SetCommonMemory( char * const mem ) { fCommonMemory = mem; }
+
+  private:
+
+    AliHLTTPCCAParam fParam; // parameters
+    AliHLTTPCCARow fRows[200];// array of hit rows
+    double fTimers[10]; // running CPU time for different parts of the algorithm
+
+    // event
+
+    int fNHitsTotal;// total number of hits in event
+
+    char *fCommonMemory; // common event memory
+    int   fCommonMemorySize; // size of the event memory [bytes]
+
+    char *fHitMemory; // event memory for hits
+    int   fHitMemorySize; // size of the event memory [bytes]
+
+    char *fTrackMemory; // event memory for tracks
+    int   fTrackMemorySize; // size of the event memory [bytes]
+
+    char *fInputEvent;     // input event
+    int   fInputEventSize; // size of the input event [bytes]
+
+    uint4  *fRowData;     // TPC rows: clusters, grid, links to neighbours
+    int   fRowDataSize; // size of the row data
+
+    int *fHitInputIDs; // cluster index in InputEvent
+    int *fHitWeights;  // the weight of the longest tracklet crossed the cluster
+
+    int *fNTracklets;     // number of tracklets
+    int *fTrackletStartHits;   // start hits for the tracklets
+    AliHLTTPCCATracklet *fTracklets; // tracklets
+
+    //
+    int *fNTracks;            // number of reconstructed tracks
+    AliHLTTPCCATrack *fTracks;  // reconstructed tracks
+    int *fNTrackHits;           // number of track hits
+    int *fTrackHits;          // array of track hit numbers
+
+    // output
+
+    AliHLTTPCCASliceOutput *fOutput;
+
+    // obsolete output
+
+    int *fNOutTracks; // number of tracks in fOutTracks array
+    AliHLTTPCCAOutTrack *fOutTracks; // output array of the reconstructed tracks
+    int *fNOutTrackHits;  // number of hits in fOutTrackHits array
+    int *fOutTrackHits;  // output array of ID's of the reconstructed hits
+
+    //temporary
+
+    int *fTmpHitInputIDs; // temporary step
 
 };
 
index 425680ee10f0d06af50d55723187443d5af8780c..79fdeb28a6f9ceec993f054ec907d5d4c76a48ed 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
@@ -17,7 +17,7 @@
 //                                                                          *
 //***************************************************************************
 
+
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
 // a TPC tracker processing component for the HLT based on CA by Ivan Kisel  //
@@ -54,26 +54,26 @@ using namespace std;
 const AliHLTComponentDataType AliHLTTPCCADefinitions::fgkTrackletsDataType = AliHLTComponentDataTypeInitializer( "CATRACKL", kAliHLTDataOriginTPC );
 
 /** ROOT macro for the implementation of ROOT specific class methods */
-ClassImp(AliHLTTPCCATrackerComponent)
+ClassImp( AliHLTTPCCATrackerComponent )
 
-/** global object for registration 
+/** global object for registration
  * Matthias 2009-01-13 temporarily using the global object approach again.
  * CA cade had to be disabled because of various compilation problems, so
  * the global object approach fits better for the moment.
  */
-  
+
 AliHLTTPCCATrackerComponent gAliHLTTPCCATrackerComponent;
 
 AliHLTTPCCATrackerComponent::AliHLTTPCCATrackerComponent()
-  :
-  fTracker(NULL),
-  fSolenoidBz(0),
-  fMinNTrackClusters(0),
-  fClusterZCut(500.),
-  fFullTime(0),
-  fRecoTime(0),
-  fNEvents(0),
-  fNewOutputType(0)
+    :
+    fTracker( NULL ),
+    fSolenoidBz( 0 ),
+    fMinNTrackClusters( 0 ),
+    fClusterZCut( 500. ),
+    fFullTime( 0 ),
+    fRecoTime( 0 ),
+    fNEvents( 0 ),
+    fNewOutputType( 0 )
 {
   // see header file for class documentation
   // or
@@ -82,26 +82,26 @@ AliHLTTPCCATrackerComponent::AliHLTTPCCATrackerComponent()
   // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
 }
 
-AliHLTTPCCATrackerComponent::AliHLTTPCCATrackerComponent(const AliHLTTPCCATrackerComponent&)
-  :
-  AliHLTProcessor(),
-  fTracker(NULL),
-  fSolenoidBz(0),
-  fMinNTrackClusters(30),
-  fClusterZCut(500.),
-  fFullTime(0),
-  fRecoTime(0),
-  fNEvents(0),
-  fNewOutputType(0)
+AliHLTTPCCATrackerComponent::AliHLTTPCCATrackerComponent( const AliHLTTPCCATrackerComponent& )
+    :
+    AliHLTProcessor(),
+    fTracker( NULL ),
+    fSolenoidBz( 0 ),
+    fMinNTrackClusters( 30 ),
+    fClusterZCut( 500. ),
+    fFullTime( 0 ),
+    fRecoTime( 0 ),
+    fNEvents( 0 ),
+    fNewOutputType( 0 )
 {
   // see header file for class documentation
-  HLTFatal("copy constructor untested");
+  HLTFatal( "copy constructor untested" );
 }
 
-AliHLTTPCCATrackerComponent& AliHLTTPCCATrackerComponent::operator=(const AliHLTTPCCATrackerComponent&)
+AliHLTTPCCATrackerComponent& AliHLTTPCCATrackerComponent::operator=( const AliHLTTPCCATrackerComponent& )
 {
   // see header file for class documentation
-  HLTFatal("assignment operator untested");
+  HLTFatal( "assignment operator untested" );
   return *this;
 }
 
@@ -116,42 +116,42 @@ AliHLTTPCCATrackerComponent::~AliHLTTPCCATrackerComponent()
 // These functions are required for the registration process
 //
 
-const char* AliHLTTPCCATrackerComponent::GetComponentID() 
+const char* AliHLTTPCCATrackerComponent::GetComponentID()
 {
   // see header file for class documentation
   return "TPCCATracker";
 }
 
-void AliHLTTPCCATrackerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list
+void AliHLTTPCCATrackerComponent::GetInputDataTypes( vector<AliHLTComponentDataType>& list )
 {
   // see header file for class documentation
   list.clear();
   list.push_back( AliHLTTPCDefinitions::fgkClustersDataType );
 }
 
-AliHLTComponentDataType AliHLTTPCCATrackerComponent::GetOutputDataType() 
+AliHLTComponentDataType AliHLTTPCCATrackerComponent::GetOutputDataType()
 {
   // see header file for class documentation
-  if( fNewOutputType ) return AliHLTTPCCADefinitions::fgkTrackletsDataType;
+  if ( fNewOutputType ) return AliHLTTPCCADefinitions::fgkTrackletsDataType;
   else return AliHLTTPCDefinitions::fgkTrackSegmentsDataType;
 }
 
-void AliHLTTPCCATrackerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) 
+void AliHLTTPCCATrackerComponent::GetOutputDataSize( unsigned long& constBase, double& inputMultiplier )
 {
   // define guess for the output data size
   constBase = 200;       // minimum size
-  inputMultiplier = 0.5; // size relative to input 
+  inputMultiplier = 0.5; // size relative to input
 }
 
-AliHLTComponent* AliHLTTPCCATrackerComponent::Spawn() 
+AliHLTComponent* AliHLTTPCCATrackerComponent::Spawn()
 {
   // see header file for class documentation
   return new AliHLTTPCCATrackerComponent;
 }
 
-Int_t AliHLTTPCCATrackerComponent::DoInit( Int_t argc, const char** argv )
+int AliHLTTPCCATrackerComponent::DoInit( int argc, const char** argv )
 {
-  // Configure the CA tracker component 
+  // Configure the CA tracker component
 
   fSolenoidBz = 5;
   fMinNTrackClusters = 0;
@@ -164,42 +164,42 @@ Int_t AliHLTTPCCATrackerComponent::DoInit( Int_t argc, const char** argv )
   if ( fTracker ) return EINPROGRESS;
   fTracker = new AliHLTTPCCATracker();
 
-  Int_t iResult = 0;
+  int iResult = 0;
 
-  TString arguments=""; 
-  for (int i=0; i<argc; i++) {
-    TString argument=argv[i];
-    if (!arguments.IsNull()) arguments+=" ";
-    arguments+=argument;
+  TString arguments = "";
+  for ( int i = 0; i < argc; i++ ) {
+    TString argument = argv[i];
+    if ( !arguments.IsNull() ) arguments += " ";
+    arguments += argument;
   }
-  if (!arguments.IsNull()) {
-    iResult=Configure(arguments.Data());
+  if ( !arguments.IsNull() ) {
+    iResult = Configure( arguments.Data() );
   } else {
-    iResult=Reconfigure(NULL, NULL);
-  }  
+    iResult = Reconfigure( NULL, NULL );
+  }
   return iResult;
 }
 
 
-Int_t AliHLTTPCCATrackerComponent::DoDeinit()
+int AliHLTTPCCATrackerComponent::DoDeinit()
 {
   // see header file for class documentation
   if ( fTracker ) delete fTracker;
-  fTracker = NULL;  
+  fTracker = NULL;
   return 0;
 }
 
-Int_t AliHLTTPCCATrackerComponent::Reconfigure(const char* /*cdbEntry*/, const char* /*chainId*/)
+int AliHLTTPCCATrackerComponent::Reconfigure( const char* /*cdbEntry*/, const char* /*chainId*/ )
 {
   // see header file for class documentation
-  HLTWarning("TODO: dummy Reconfigure() method" );
+
+  HLTWarning( "TODO: dummy Reconfigure() method" );
 
   return 0;
 
   /*
-  
-  Int_t iResult=0;
+
+  int iResult=0;
   const char* path="HLT/ConfigTPC/CATrackerComponent";
   const char* defaultNotify="";
   if (cdbEntry) {
@@ -212,330 +212,319 @@ Int_t AliHLTTPCCATrackerComponent::Reconfigure(const char* /*cdbEntry*/, const c
     if (pEntry) {
       TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
       if (pString) {
-       HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
-       iResult=Configure(pString->GetString().Data());
+  HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
+  iResult=Configure(pString->GetString().Data());
       } else {
-       HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
+  HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
       }
     } else {
       HLTError("cannot fetch object \"%s\" from CDB", path);
     }
   }
-  
+
   const char* pathBField=kAliHLTCDBSolenoidBz;
-  
+
   if (pathBField) {
     HLTInfo("reconfigure B-Field from entry %s, chain id %s", path,(chainId!=NULL && chainId[0]!=0)?chainId:"<none>");
     AliCDBEntry *pEntry = AliCDBManager::Instance()->Get(pathBField);//,GetRunNo());
     if (pEntry) {
       TObjString* pString=dynamic_cast<TObjString*>(pEntry->GetObject());
       if (pString) {
-       HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
-       iResult=Configure(pString->GetString().Data());
+  HLTInfo("received configuration object string: \'%s\'", pString->GetString().Data());
+  iResult=Configure(pString->GetString().Data());
       } else {
-       HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
+  HLTError("configuration object \"%s\" has wrong type, required TObjString", path);
       }
     } else {
       HLTError("cannot fetch object \"%s\" from CDB", path);
     }
-  }  
-  return iResult;  
-*/
+  }
+  return iResult;
+  */
 }
 
 
-Bool_t AliHLTTPCCATrackerComponent::CompareClusters(AliHLTTPCSpacePointData *a, AliHLTTPCSpacePointData *b)
+bool AliHLTTPCCATrackerComponent::CompareClusters( AliHLTTPCSpacePointData *a, AliHLTTPCSpacePointData *b )
 {
   //* Comparison function for sorting clusters
-  if( a->fPadRow<b->fPadRow ) return 1;
-  if( a->fPadRow>b->fPadRow ) return 0;
-  return (a->fZ < b->fZ);
+  if ( a->fPadRow < b->fPadRow ) return 1;
+  if ( a->fPadRow > b->fPadRow ) return 0;
+  return ( a->fZ < b->fZ );
 }
 
 
-Int_t AliHLTTPCCATrackerComponent::Configure( const char* arguments )
+int AliHLTTPCCATrackerComponent::Configure( const char* arguments )
 {
   //* Set parameters
 
-  Int_t iResult=0;
-  if (!arguments) return iResult;
-  
-  TString allArgs=arguments;
-  TString argument;
-  Int_t bMissingParam=0;
-  
-  TObjArray* pTokens=allArgs.Tokenize(" ");
+  int iResult = 0;
+  if ( !arguments ) return iResult;
 
-  Int_t nArgs =  pTokens ?pTokens->GetEntries() :0;
-
-  for (int i=0; i<nArgs; i++ ){
-    argument=((TObjString*)pTokens->At(i))->GetString();
-    if (argument.IsNull()){
-    }
-    else if (argument.CompareTo("-solenoidBz")==0 ){
-      if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; 
-      fSolenoidBz = ((TObjString*)pTokens->At(i))->GetString().Atof();
-      HLTInfo("Magnetic Field set to: %f", fSolenoidBz );
-    }
-    else if ( argument.CompareTo("-minNClustersOnTrack")==0 ||
-             argument.CompareTo("-minNTrackClusters")==0 ){
-      if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; 
-      fMinNTrackClusters = ((TObjString*)pTokens->At(i))->GetString().Atoi();
-      HLTInfo("minNClustersOnTrack set to: %d", fMinNTrackClusters );
-    }
-    else if ( argument.CompareTo("-clusterZCut")==0 ){
-      if ((bMissingParam=(++i>=pTokens->GetEntries()))) break; 
-      fClusterZCut = TMath::Abs( ((TObjString*)pTokens->At(i))->GetString().Atof());
-      HLTInfo("ClusterZCut set to: %f", fClusterZCut );
-    }
-    else if ( argument.CompareTo("-newOutputType")==0 ){
+  TString allArgs = arguments;
+  TString argument;
+  int bMissingParam = 0;
+
+  TObjArray* pTokens = allArgs.Tokenize( " " );
+
+  int nArgs =  pTokens ? pTokens->GetEntries() : 0;
+
+  for ( int i = 0; i < nArgs; i++ ) {
+    argument = ( ( TObjString* )pTokens->At( i ) )->GetString();
+    if ( argument.IsNull() ) {
+    } else if ( argument.CompareTo( "-solenoidBz" ) == 0 ) {
+      if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
+      fSolenoidBz = ( ( TObjString* )pTokens->At( i ) )->GetString().Atof();
+      HLTInfo( "Magnetic Field set to: %f", fSolenoidBz );
+    } else if ( argument.CompareTo( "-minNClustersOnTrack" ) == 0 ||
+                argument.CompareTo( "-minNTrackClusters" ) == 0 ) {
+      if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
+      fMinNTrackClusters = ( ( TObjString* )pTokens->At( i ) )->GetString().Atoi();
+      HLTInfo( "minNClustersOnTrack set to: %d", fMinNTrackClusters );
+    } else if ( argument.CompareTo( "-clusterZCut" ) == 0 ) {
+      if ( ( bMissingParam = ( ++i >= pTokens->GetEntries() ) ) ) break;
+      fClusterZCut = TMath::Abs( ( ( TObjString* )pTokens->At( i ) )->GetString().Atof() );
+      HLTInfo( "ClusterZCut set to: %f", fClusterZCut );
+    } else if ( argument.CompareTo( "-newOutputType" ) == 0 ) {
       fNewOutputType = 1;
-      HLTInfo("NewOutputType is set");
-    }
-    else {
-      HLTError("Unknown option %s ", argument.Data());
-      iResult=-EINVAL;
+      HLTInfo( "NewOutputType is set" );
+    } else {
+      HLTError( "Unknown option %s ", argument.Data() );
+      iResult = -EINVAL;
     }
   }
   delete pTokens;
 
-  if (bMissingParam) {
-    HLTError("Specifier missed for %s", argument.Data());    
-    iResult=-EINVAL;
+  if ( bMissingParam ) {
+    HLTError( "Specifier missed for %s", argument.Data() );
+    iResult = -EINVAL;
   }
 
   return iResult;
 }
-  
 
 
 
-Int_t AliHLTTPCCATrackerComponent::DoEvent
-( 
- const AliHLTComponentEventData& evtData, 
- const AliHLTComponentBlockData* blocks, 
- AliHLTComponentTriggerData& /*trigData*/, 
- AliHLTUInt8_t* outputPtr, 
- AliHLTUInt32_t& size, 
- vector<AliHLTComponentBlockData>& outputBlocks )
+
+int AliHLTTPCCATrackerComponent::DoEvent
+(
+  const AliHLTComponentEventData& evtData,
+  const AliHLTComponentBlockData* blocks,
+  AliHLTComponentTriggerData& /*trigData*/,
+  AliHLTUInt8_t* outputPtr,
+  AliHLTUInt32_t& size,
+  vector<AliHLTComponentBlockData>& outputBlocks )
 {
- //* process event
+//* process event
   AliHLTUInt32_t maxBufferSize = size;
   size = 0; // output size
 
-  if(GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR )){    
+  if ( GetFirstInputBlock( kAliHLTDataTypeSOR ) || GetFirstInputBlock( kAliHLTDataTypeEOR ) ) {
     return 0;
   }
 
   TStopwatch timer;
 
   // Event reconstruction in one TPC slice with CA Tracker
+
   //Logging( kHLTLogWarning, "HLT::TPCCATracker::DoEvent", "DoEvent", "CA::DoEvent()" );
-  if ( evtData.fBlockCnt<=0 )
-    {
-      HLTWarning("no blocks in event" );
-      return 0;
-    }
-  
+  if ( evtData.fBlockCnt <= 0 ) {
+    HLTWarning( "no blocks in event" );
+    return 0;
+  }
+
   const AliHLTComponentBlockData* iter = NULL;
   unsigned long ndx;
-  AliHLTTPCClusterData* inPtrSP; 
-  // Determine the slice number 
-  
-  Int_t slice=-1;
+  AliHLTTPCClusterData* inPtrSP;
+
+  // Determine the slice number
+
+  int slice = -1;
   {
-    std::vector<Int_t> slices;
-    std::vector<Int_t>::iterator slIter;
+    std::vector<int> slices;
+    std::vector<int>::iterator slIter;
     std::vector<unsigned> sliceCnts;
     std::vector<unsigned>::iterator slCntIter;
-  
-    for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ){
-      iter = blocks+ndx;
+
+    for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) {
+      iter = blocks + ndx;
       if ( iter->fDataType != AliHLTTPCDefinitions::fgkClustersDataType ) continue;
 
       slice = AliHLTTPCDefinitions::GetMinSliceNr( *iter );
 
-      Bool_t found = 0;
+      bool found = 0;
       slCntIter = sliceCnts.begin();
-      for( slIter = slices.begin(); slIter!=slices.end(); slIter++, slCntIter++ ){
-       if ( *slIter == slice ){
-         found = kTRUE;
-         break;
-       }
+      for ( slIter = slices.begin(); slIter != slices.end(); slIter++, slCntIter++ ) {
+        if ( *slIter == slice ) {
+          found = kTRUE;
+          break;
+        }
       }
-      if ( !found ){
-       slices.push_back( slice );
-       sliceCnts.push_back( 1 );
-      } else *slCntIter++;     
+      if ( !found ) {
+        slices.push_back( slice );
+        sliceCnts.push_back( 1 );
+      } else *slCntIter++;
     }
-  
-    
+
+
     // Determine slice number to really use.
-    if ( slices.size()>1 )
-      {
-       Logging( kHLTLogError, "HLT::TPCSliceTracker::DoEvent", "Multiple slices found in event",
-                "Multiple slice numbers found in event 0x%08lX (%lu). Determining maximum occuring slice number...",
-                evtData.fEventID, evtData.fEventID );
-       unsigned maxCntSlice=0;
-       slCntIter = sliceCnts.begin();
-       for( slIter = slices.begin(); slIter != slices.end(); slIter++, slCntIter++ )
-         {
-           Logging( kHLTLogError, "HLT::TPCSliceTracker::DoEvent", "Multiple slices found in event",
-                    "Slice %lu found %lu times.", *slIter, *slCntIter );
-           if ( maxCntSlice<*slCntIter )
-             {
-               maxCntSlice = *slCntIter;
-               slice = *slIter;
-             }
-         }
-       Logging( kHLTLogError, "HLT::TPCSliceTracker::DoEvent", "Multiple slices found in event",
-                "Using slice %lu.", slice );
-      }
-    else if ( slices.size()>0 )
-      {
-       slice = *(slices.begin());
+    if ( slices.size() > 1 ) {
+      Logging( kHLTLogError, "HLT::TPCSliceTracker::DoEvent", "Multiple slices found in event",
+               "Multiple slice numbers found in event 0x%08lX (%lu). Determining maximum occuring slice number...",
+               evtData.fEventID, evtData.fEventID );
+      unsigned maxCntSlice = 0;
+      slCntIter = sliceCnts.begin();
+      for ( slIter = slices.begin(); slIter != slices.end(); slIter++, slCntIter++ ) {
+        Logging( kHLTLogError, "HLT::TPCSliceTracker::DoEvent", "Multiple slices found in event",
+                 "Slice %lu found %lu times.", *slIter, *slCntIter );
+        if ( maxCntSlice < *slCntIter ) {
+          maxCntSlice = *slCntIter;
+          slice = *slIter;
+        }
       }
+      Logging( kHLTLogError, "HLT::TPCSliceTracker::DoEvent", "Multiple slices found in event",
+               "Using slice %lu.", slice );
+    } else if ( slices.size() > 0 ) {
+      slice = *( slices.begin() );
+    }
   }
-  
-  if( slice<0 ){
-    HLTWarning("no slices found in event" );
+
+  if ( slice < 0 ) {
+    HLTWarning( "no slices found in event" );
     return 0;
   }
 
 
   // Initialize the tracker
 
-  
+
   {
-    if( !fTracker ) fTracker = new AliHLTTPCCATracker;
-    Int_t iSec = slice;
-    Float_t inRmin = 83.65; 
-    //    Float_t inRmax = 133.3;
-    //    Float_t outRmin = 133.5; 
-    Float_t outRmax = 247.7;
-    Float_t plusZmin = 0.0529937; 
-    Float_t plusZmax = 249.778; 
-    Float_t minusZmin = -249.645; 
-    Float_t minusZmax = -0.0799937; 
-    Float_t dalpha = 0.349066;
-    Float_t alpha = 0.174533 + dalpha*iSec;
-    
-    Bool_t zPlus = (iSec<18 );
-    Float_t zMin =  zPlus ?plusZmin :minusZmin;
-    Float_t zMax =  zPlus ?plusZmax :minusZmax;
-    //TPCZmin = -249.645, ZMax = 249.778    
-    //    Float_t rMin =  inRmin;
-    //    Float_t rMax =  outRmax;
-    Int_t nRows = AliHLTTPCTransform::GetNRows();
-        
-    Float_t padPitch = 0.4;
-    Float_t sigmaZ = 0.228808;
-    
-    Float_t *rowX = new Float_t [nRows];
-    for( Int_t irow=0; irow<nRows; irow++){
+    if ( !fTracker ) fTracker = new AliHLTTPCCATracker;
+    int iSec = slice;
+    float inRmin = 83.65;
+    //    float inRmax = 133.3;
+    //    float outRmin = 133.5;
+    float outRmax = 247.7;
+    float plusZmin = 0.0529937;
+    float plusZmax = 249.778;
+    float minusZmin = -249.645;
+    float minusZmax = -0.0799937;
+    float dalpha = 0.349066;
+    float alpha = 0.174533 + dalpha * iSec;
+
+    bool zPlus = ( iSec < 18 );
+    float zMin =  zPlus ? plusZmin : minusZmin;
+    float zMax =  zPlus ? plusZmax : minusZmax;
+    //TPCZmin = -249.645, ZMax = 249.778
+    //    float rMin =  inRmin;
+    //    float rMax =  outRmax;
+    int nRows = AliHLTTPCTransform::GetNRows();
+
+    float padPitch = 0.4;
+    float sigmaZ = 0.228808;
+
+    float *rowX = new float [nRows];
+    for ( int irow = 0; irow < nRows; irow++ ) {
       rowX[irow] = AliHLTTPCTransform::Row2X( irow );
-    }     
-     
+    }
+
     AliHLTTPCCAParam param;
     param.Initialize( iSec, nRows, rowX, alpha, dalpha,
-                     inRmin, outRmax, zMin, zMax, padPitch, sigmaZ, fSolenoidBz );
+                      inRmin, outRmax, zMin, zMax, padPitch, sigmaZ, fSolenoidBz );
     param.SetHitPickUpFactor( 2 );
     param.Update();
-    fTracker->Initialize( param ); 
+    fTracker->Initialize( param );
     delete[] rowX;
   }
 
-    
+
   // min and max patch numbers and row numbers
 
-  Int_t row[2] = {0,0};
-  Int_t minPatch=100, maxPatch = -1;
+  int row[2] = {0, 0};
+  int minPatch = 100, maxPatch = -1;
 
   // total n Hits
 
-  Int_t nHitsTotal = 0;
+  int nHitsTotal = 0;
 
   // sort patches
 
   std::vector<unsigned long> patchIndices;
 
-  for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ){
-    iter = blocks+ndx;      
-    if( iter->fDataType != AliHLTTPCDefinitions::fgkClustersDataType ) continue;
-    if( slice!=AliHLTTPCDefinitions::GetMinSliceNr( *iter ) ) continue;
-    inPtrSP = (AliHLTTPCClusterData*)(iter->fPtr);
-    nHitsTotal+=inPtrSP->fSpacePointCnt;
-    Int_t patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
-    if ( minPatch>patch ){
+  for ( ndx = 0; ndx < evtData.fBlockCnt; ndx++ ) {
+    iter = blocks + ndx;
+    if ( iter->fDataType != AliHLTTPCDefinitions::fgkClustersDataType ) continue;
+    if ( slice != AliHLTTPCDefinitions::GetMinSliceNr( *iter ) ) continue;
+    inPtrSP = ( AliHLTTPCClusterData* )( iter->fPtr );
+    nHitsTotal += inPtrSP->fSpacePointCnt;
+    int patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
+    if ( minPatch > patch ) {
       minPatch = patch;
       row[0] = AliHLTTPCTransform::GetFirstRow( patch );
     }
-    if ( maxPatch<patch ){
+    if ( maxPatch < patch ) {
       maxPatch = patch;
       row[1] = AliHLTTPCTransform::GetLastRow( patch );
     }
-    std::vector<unsigned long>::iterator pIter = patchIndices.begin(); 
-    while( pIter!=patchIndices.end() && AliHLTTPCDefinitions::GetMinPatchNr( blocks[*pIter] ) < patch ){
+    std::vector<unsigned long>::iterator pIter = patchIndices.begin();
+    while ( pIter != patchIndices.end() && AliHLTTPCDefinitions::GetMinPatchNr( blocks[*pIter] ) < patch ) {
       pIter++;
     }
     patchIndices.insert( pIter, ndx );
   }
-           
+
 
   // pass event to CA Tracker
-  
+
   fTracker->StartEvent();
 
   Logging( kHLTLogDebug, "HLT::TPCCATracker::DoEvent", "Reading hits",
-          "Total %d hits to read for slice %d", nHitsTotal, slice );
+           "Total %d hits to read for slice %d", nHitsTotal, slice );
 
 
   AliHLTTPCSpacePointData** vOrigClusters = new AliHLTTPCSpacePointData* [ nHitsTotal];
 
-  Int_t nClusters=0;
+  int nClusters = 0;
 
-  for( std::vector<unsigned long>::iterator pIter = patchIndices.begin(); pIter!=patchIndices.end(); pIter++ ){
+  for ( std::vector<unsigned long>::iterator pIter = patchIndices.begin(); pIter != patchIndices.end(); pIter++ ) {
     ndx = *pIter;
-    iter = blocks+ndx;
-      
-    Int_t patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
-    inPtrSP = (AliHLTTPCClusterData*)(iter->fPtr);
-      
+    iter = blocks + ndx;
+
+    int patch = AliHLTTPCDefinitions::GetMinPatchNr( *iter );
+    inPtrSP = ( AliHLTTPCClusterData* )( iter->fPtr );
+
     Logging( kHLTLogDebug, "HLT::TPCCATracker::DoEvent", "Reading hits",
-            "Reading %d hits for slice %d - patch %d", inPtrSP->fSpacePointCnt, slice, patch );
-      
-    for (UInt_t i=0; i<inPtrSP->fSpacePointCnt; i++ ){ 
-      vOrigClusters[nClusters++] = &(inPtrSP->fSpacePoints[i]);
+             "Reading %d hits for slice %d - patch %d", inPtrSP->fSpacePointCnt, slice, patch );
+
+    for ( unsigned int i = 0; i < inPtrSP->fSpacePointCnt; i++ ) {
+      vOrigClusters[nClusters++] = &( inPtrSP->fSpacePoints[i] );
     }
   }
 
   // sort clusters since they are not sorted fore some reason
 
-  sort( vOrigClusters, vOrigClusters+nClusters, CompareClusters );
+  sort( vOrigClusters, vOrigClusters + nClusters, CompareClusters );
 
-  Float_t *vHitStoreX = new Float_t [nHitsTotal];       // hit X coordinates
-  Float_t *vHitStoreY = new Float_t [nHitsTotal];       // hit Y coordinates
-  Float_t *vHitStoreZ = new Float_t [nHitsTotal];       // hit Z coordinates
-  Int_t *vHitStoreIntID = new Int_t [nHitsTotal];            // hit ID's
-  Int_t *vHitStoreID = new Int_t [nHitsTotal];            // hit ID's
-  Int_t *vHitRowID = new Int_t [nHitsTotal];            // hit ID's
+  float *vHitStoreX = new float [nHitsTotal];       // hit X coordinates
+  float *vHitStoreY = new float [nHitsTotal];       // hit Y coordinates
+  float *vHitStoreZ = new float [nHitsTotal];       // hit Z coordinates
+  int *vHitStoreIntID = new int [nHitsTotal];            // hit ID's
+  int *vHitStoreID = new int [nHitsTotal];            // hit ID's
+  int *vHitRowID = new int [nHitsTotal];            // hit ID's
 
-  Int_t nHits = 0;
+  int nHits = 0;
 
   {
-    Int_t rowNHits[200];
-    Int_t rowFirstHits[200];
-    for( Int_t ir=0; ir<200; ir++ ) rowNHits[ir] = 0;
-    Int_t oldRow = -1;
-    for (Int_t i=0; i<nClusters; i++ ){
+    int rowNHits[200];
+    int rowFirstHits[200];
+    for ( int ir = 0; ir < 200; ir++ ) rowNHits[ir] = 0;
+    int oldRow = -1;
+    for ( int i = 0; i < nClusters; i++ ) {
       AliHLTTPCSpacePointData* pSP = vOrigClusters[i];
-      if( oldRow>=0 && pSP->fPadRow < oldRow )
-       HLTError("CA: clusters from row %d are readed twice",oldRow);      
-      
-      if( TMath::Abs(pSP->fZ)>fClusterZCut) continue;
-      
+      if ( oldRow >= 0 && pSP->fPadRow < oldRow )
+        HLTError( "CA: clusters from row %d are readed twice", oldRow );
+
+      if ( TMath::Abs( pSP->fZ ) > fClusterZCut ) continue;
+
       vHitStoreX[nHits] = pSP->fX;
       vHitStoreY[nHits] = pSP->fY;
       vHitStoreZ[nHits] = pSP->fZ;
@@ -544,20 +533,20 @@ Int_t AliHLTTPCCATrackerComponent::DoEvent
       vHitRowID[nHits] = pSP->fPadRow;
       nHits++;
       rowNHits[pSP->fPadRow]++;
-    }  
+    }
 
-    Int_t firstRowHit = 0;
-    for( Int_t ir=0; ir<200; ir++ ){
+    int firstRowHit = 0;
+    for ( int ir = 0; ir < 200; ir++ ) {
       rowFirstHits[ir] = firstRowHit;
-      firstRowHit+=rowNHits[ir];
+      firstRowHit += rowNHits[ir];
     }
 
     fTracker->ReadEvent( rowFirstHits, rowNHits, vHitStoreX, vHitStoreY, vHitStoreZ, nHits );
   }
 
-  if( vOrigClusters ) delete[] vOrigClusters;
+  if ( vOrigClusters ) delete[] vOrigClusters;
 
-  // reconstruct the event  
+  // reconstruct the event
 
   TStopwatch timerReco;
 
@@ -565,93 +554,93 @@ Int_t AliHLTTPCCATrackerComponent::DoEvent
 
   timerReco.Stop();
 
-  Int_t ret = 0;
+  int ret = 0;
 
   Logging( kHLTLogDebug, "HLT::TPCCATracker::DoEvent", "Reconstruct",
-          "%d tracks found for slice %d",fTracker->NOutTracks(), slice);
+           "%d tracks found for slice %d", fTracker->NOutTracks(), slice );
 
 
   // write reconstructed tracks
 
-  UInt_t mySize = 0;
-  Int_t ntracks = *fTracker->NOutTracks();
-
-  
-  if( !fNewOutputType ){
-
-    AliHLTTPCTrackletData* outPtr = (AliHLTTPCTrackletData*)(outputPtr);
-    
-    AliHLTTPCTrackSegmentData* currOutTracklet = outPtr->fTracklets;    
-    
-    mySize =   ((AliHLTUInt8_t *)currOutTracklet) -  ((AliHLTUInt8_t *)outputPtr);
-    
-    outPtr->fTrackletCnt = 0; 
-    
-    for( Int_t itr=0; itr<ntracks; itr++ ){
-      
-      AliHLTTPCCAOutTrack &t = fTracker->OutTracks()[itr];    
-      
+  unsigned int mySize = 0;
+  int ntracks = *fTracker->NOutTracks();
+
+
+  if ( !fNewOutputType ) {
+
+    AliHLTTPCTrackletData* outPtr = ( AliHLTTPCTrackletData* )( outputPtr );
+
+    AliHLTTPCTrackSegmentData* currOutTracklet = outPtr->fTracklets;
+
+    mySize =   ( ( AliHLTUInt8_t * )currOutTracklet ) -  ( ( AliHLTUInt8_t * )outputPtr );
+
+    outPtr->fTrackletCnt = 0;
+
+    for ( int itr = 0; itr < ntracks; itr++ ) {
+
+      AliHLTTPCCAOutTrack &t = fTracker->OutTracks()[itr];
+
       //Logging( kHLTLogDebug, "HLT::TPCCATracker::DoEvent", "Wrtite output","track %d with %d hits", itr, t.NHits());
-      
-      if( t.NHits()<fMinNTrackClusters ) continue;
-      
+
+      if ( t.NHits() < fMinNTrackClusters ) continue;
+
       // calculate output track size
-      
-      UInt_t dSize = sizeof(AliHLTTPCTrackSegmentData) + t.NHits()*sizeof(UInt_t);
-      
-      if( mySize + dSize > maxBufferSize ){
-       HLTWarning("Output buffer size exceed (buffer size %d, current size %d), %d tracks are not stored", maxBufferSize, mySize, ntracks-itr+1);
-       ret = -ENOSPC;
-       break;
+
+      unsigned int dSize = sizeof( AliHLTTPCTrackSegmentData ) + t.NHits() * sizeof( unsigned int );
+
+      if ( mySize + dSize > maxBufferSize ) {
+        HLTWarning( "Output buffer size exceed (buffer size %d, current size %d), %d tracks are not stored", maxBufferSize, mySize, ntracks - itr + 1 );
+        ret = -ENOSPC;
+        break;
       }
-      
+
       // convert CA track parameters to HLT Track Segment
-      
-      Int_t iFirstRow = 1000;
-      Int_t iLastRow = -1;
-      Int_t iFirstHit = fTracker->OutTrackHits()[t.FirstHitRef()];
-      Int_t iLastHit = iFirstHit;
-      for( Int_t ih=0; ih<t.NHits(); ih++ ){
-       Int_t hitID = fTracker->OutTrackHits()[t.FirstHitRef() + ih ];
-       Int_t iRow = vHitRowID[hitID];
-       if( iRow<iFirstRow ){  iFirstRow = iRow; iFirstHit = hitID; }
-       if( iRow>iLastRow ){ iLastRow = iRow; iLastHit = hitID; }
-      }   
-      
+
+      int iFirstRow = 1000;
+      int iLastRow = -1;
+      int iFirstHit = fTracker->OutTrackHits()[t.FirstHitRef()];
+      int iLastHit = iFirstHit;
+      for ( int ih = 0; ih < t.NHits(); ih++ ) {
+        int hitID = fTracker->OutTrackHits()[t.FirstHitRef() + ih ];
+        int iRow = vHitRowID[hitID];
+        if ( iRow < iFirstRow ) {  iFirstRow = iRow; iFirstHit = hitID; }
+        if ( iRow > iLastRow ) { iLastRow = iRow; iLastHit = hitID; }
+      }
+
       AliHLTTPCCATrackParam par = t.StartPoint();
-      
+
       par.TransportToX( vHitStoreX[iFirstHit], .99 );
-      
+
       AliExternalTrackParam tp;
       AliHLTTPCCATrackConvertor::GetExtParam( par, tp, 0 );
-      
+
       currOutTracklet->fX = tp.GetX();
       currOutTracklet->fY = tp.GetY();
       currOutTracklet->fZ = tp.GetZ();
-      currOutTracklet->fCharge = (Int_t ) tp.GetSign();
-      currOutTracklet->fPt = TMath::Abs(tp.GetSignedPt());
-      Float_t snp =  tp.GetSnp() ;
-      if( snp>.999 ) snp=.999;
-      if( snp<-.999 ) snp=-.999;
+      currOutTracklet->fCharge = ( int ) tp.GetSign();
+      currOutTracklet->fPt = TMath::Abs( tp.GetSignedPt() );
+      float snp =  tp.GetSnp() ;
+      if ( snp > .999 ) snp = .999;
+      if ( snp < -.999 ) snp = -.999;
       currOutTracklet->fPsi = TMath::ASin( snp );
       currOutTracklet->fTgl = tp.GetTgl();
-      
+
       currOutTracklet->fY0err = tp.GetSigmaY2();
       currOutTracklet->fZ0err = tp.GetSigmaZ2();
-      Float_t h = -currOutTracklet->fPt*currOutTracklet->fPt;
-      currOutTracklet->fPterr = h*h*tp.GetSigma1Pt2();
-      h = 1./TMath::Sqrt(1-snp*snp);
-      currOutTracklet->fPsierr = h*h*tp.GetSigmaSnp2();
+      float h = -currOutTracklet->fPt * currOutTracklet->fPt;
+      currOutTracklet->fPterr = h * h * tp.GetSigma1Pt2();
+      h = 1. / TMath::Sqrt( 1 - snp * snp );
+      currOutTracklet->fPsierr = h * h * tp.GetSigmaSnp2();
       currOutTracklet->fTglerr = tp.GetSigmaTgl2();
-      
-      if( par.TransportToX( vHitStoreX[iLastHit],.99 ) ){     
-       currOutTracklet->fLastX = par.GetX();
-       currOutTracklet->fLastY = par.GetY();
-       currOutTracklet->fLastZ = par.GetZ();
+
+      if ( par.TransportToX( vHitStoreX[iLastHit], .99 ) ) {
+        currOutTracklet->fLastX = par.GetX();
+        currOutTracklet->fLastY = par.GetY();
+        currOutTracklet->fLastZ = par.GetZ();
       } else {
-       currOutTracklet->fLastX = vHitStoreX[iLastHit];
-       currOutTracklet->fLastY = vHitStoreY[iLastHit];
-       currOutTracklet->fLastZ = vHitStoreZ[iLastHit];
+        currOutTracklet->fLastX = vHitStoreX[iLastHit];
+        currOutTracklet->fLastY = vHitStoreY[iLastHit];
+        currOutTracklet->fLastZ = vHitStoreZ[iLastHit];
       }
       //if( currOutTracklet->fLastX<10. ) {
       //HLTError("CA last point: hitxyz=%f,%f,%f, track=%f,%f,%f, tracklet=%f,%f,%f, nhits=%d",vHitStoreX[iLastHit],vHitStoreY[iLastHit],vHitStoreZ[iLastHit],
@@ -666,62 +655,62 @@ Int_t AliHLTTPCCATrackerComponent::DoEvent
       currOutTracklet->fPID = 211;
 #endif
 #endif // INCLUDE_TPC_HOUGH
-      
-      
+
+
       currOutTracklet->fNPoints = t.NHits();
-      
-      for( Int_t i=0; i<t.NHits(); i++ ){
-       currOutTracklet->fPointIDs[i] = vHitStoreID[fTracker->OutTrackHits()[t.FirstHitRef()+i]];
+
+      for ( int i = 0; i < t.NHits(); i++ ) {
+        currOutTracklet->fPointIDs[i] = vHitStoreID[fTracker->OutTrackHits()[t.FirstHitRef()+i]];
       }
-      
-      currOutTracklet = (AliHLTTPCTrackSegmentData*)( (Byte_t *)currOutTracklet + dSize );
-      mySize+=dSize;
-      outPtr->fTrackletCnt++; 
+
+      currOutTracklet = ( AliHLTTPCTrackSegmentData* )( ( Byte_t * )currOutTracklet + dSize );
+      mySize += dSize;
+      outPtr->fTrackletCnt++;
     }
   } else { // new output type
 
-    mySize = fTracker->Output()->EstimateSize( fTracker->Output()->NTracks(), 
-                                              fTracker->Output()->NTrackClusters() );
-    if( mySize <= maxBufferSize ){
-      const AliHLTUInt8_t* outputevent = reinterpret_cast<const AliHLTUInt8_t*>(fTracker->Output());
-      for( UInt_t i=0; i<mySize; i++ ) outputPtr[i] = outputevent[i];
-    } else {    
-      HLTWarning("Output buffer size exceed (buffer size %d, current size %d), tracks are not stored", maxBufferSize, mySize );
+    mySize = fTracker->Output()->EstimateSize( fTracker->Output()->NTracks(),
+             fTracker->Output()->NTrackClusters() );
+    if ( mySize <= maxBufferSize ) {
+      const AliHLTUInt8_t* outputevent = reinterpret_cast<const AliHLTUInt8_t*>( fTracker->Output() );
+      for ( unsigned int i = 0; i < mySize; i++ ) outputPtr[i] = outputevent[i];
+    } else {
+      HLTWarning( "Output buffer size exceed (buffer size %d, current size %d), tracks are not stored", maxBufferSize, mySize );
       mySize = 0;
       ret = -ENOSPC;
     }
   }
-  if( vHitStoreX ) delete[] vHitStoreX;
-  if( vHitStoreY ) delete[] vHitStoreY;
-  if( vHitStoreZ ) delete[] vHitStoreZ;
-  if( vHitStoreIntID ) delete[] vHitStoreIntID;
-  if( vHitStoreID ) delete[] vHitStoreID;
-  if( vHitRowID ) delete[] vHitRowID;
-
-  if( mySize>0 ){
+
+  if ( vHitStoreX ) delete[] vHitStoreX;
+  if ( vHitStoreY ) delete[] vHitStoreY;
+  if ( vHitStoreZ ) delete[] vHitStoreZ;
+  if ( vHitStoreIntID ) delete[] vHitStoreIntID;
+  if ( vHitStoreID ) delete[] vHitStoreID;
+  if ( vHitRowID ) delete[] vHitRowID;
+
+  if ( mySize > 0 ) {
     AliHLTComponentBlockData bd;
     FillBlockData( bd );
     bd.fOffset = 0;
     bd.fSize = mySize;
-    bd.fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification( slice, slice, minPatch, maxPatch ); 
+    bd.fSpecification = AliHLTTPCDefinitions::EncodeDataSpecification( slice, slice, minPatch, maxPatch );
     outputBlocks.push_back( bd );
   }
   size = mySize;
-  
+
   timer.Stop();
 
-  fFullTime+= timer.RealTime();
-  fRecoTime+= timerReco.RealTime();
+  fFullTime += timer.RealTime();
+  fRecoTime += timerReco.RealTime();
   fNEvents++;
 
   // Set log level to "Warning" for on-line system monitoring
-  Int_t hz = (Int_t) (fFullTime>1.e-10 ?fNEvents/fFullTime :100000);
-  Int_t hz1 = (Int_t) (fRecoTime>1.e-10 ?fNEvents/fRecoTime :100000);
-  HLTWarning( "CATracker slice %d: output %d tracks;  input %d clusters, patches %d..%d, rows %d..%d; reco time %d/%d Hz", 
-           slice, ntracks, nClusters, minPatch, maxPatch, row[0], row[1], hz, hz1 );
+  int hz = ( int ) ( fFullTime > 1.e-10 ? fNEvents / fFullTime : 100000 );
+  int hz1 = ( int ) ( fRecoTime > 1.e-10 ? fNEvents / fRecoTime : 100000 );
+  HLTWarning( "CATracker slice %d: output %d tracks;  input %d clusters, patches %d..%d, rows %d..%d; reco time %d/%d Hz",
+              slice, ntracks, nClusters, minPatch, maxPatch, row[0], row[1], hz, hz1 );
 
   return ret;
 }
 
-       
+
index 330f05bd51c894cb5bc4d2e6cf4757ac9d7435bf..6aebe0bb0923c77c885fee494c871fa7f783d10b 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // @(#) $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -21,77 +21,77 @@ class AliHLTTPCSpacePointData;
  */
 class AliHLTTPCCATrackerComponent : public AliHLTProcessor
 {
-public:
-  /** standard constructor */
-  AliHLTTPCCATrackerComponent();
-  
-  /** dummy copy constructor, defined according to effective C++ style */
-  AliHLTTPCCATrackerComponent(const AliHLTTPCCATrackerComponent&);
-  
-  /** dummy assignment op, but defined according to effective C++ style */
-  AliHLTTPCCATrackerComponent& operator=(const AliHLTTPCCATrackerComponent&);
-
-  /** standard destructor */
-  virtual ~AliHLTTPCCATrackerComponent();
-      
-  // Public functions to implement AliHLTComponent's interface.
-  // These functions are required for the registration process
-  
-  /** @see component interface @ref AliHLTComponent::GetComponentID */
-  const char* GetComponentID() ;
-  
-  /** @see component interface @ref AliHLTComponent::GetInputDataTypes */
-  void GetInputDataTypes( vector<AliHLTComponentDataType>& list)  ;
-  
-  /** @see component interface @ref AliHLTComponent::GetOutputDataType */
-  AliHLTComponentDataType GetOutputDataType() ;
-
-  /** @see component interface @ref AliHLTComponent::GetOutputDataSize */
-  virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) ;
-
-  /** @see component interface @ref AliHLTComponent::Spawn */
-  AliHLTComponent* Spawn() ;
-
-protected:
-
-  // Protected functions to implement AliHLTComponent's interface.
-  // These functions provide initialization as well as the actual processing
-  // capabilities of the component. 
-  
-  /** @see component interface @ref AliHLTComponent::DoInit */
-  Int_t DoInit( Int_t argc, const char** argv );
-  
-  /** @see component interface @ref AliHLTComponent::DoDeinit */
-  Int_t DoDeinit();
-
-  /** reconfigure **/
-  Int_t Reconfigure(const char* cdbEntry, const char* chainId);
-
-  /** @see component interface @ref AliHLTProcessor::DoEvent */
-  Int_t DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
-              AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
-              AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
-  
-private:
-  
-  /** the tracker object */
-  AliHLTTPCCATracker* fTracker;                                //! transient
-  
-  /** magnetic field */
-  Double_t fSolenoidBz;                                            // see above
-  Int_t fMinNTrackClusters; //* required min number of clusters on the track
-  Double_t fClusterZCut;  //* cut on cluster Z position (for noise rejection at the age of TPC)
-  Double_t fFullTime; //* total time for DoEvent() [s]
-  Double_t fRecoTime; //* total reconstruction time [s]
-  Long_t    fNEvents;  //* number of reconstructed events
-  Bool_t fNewOutputType; //* use new type of output (temporary flag)
-
-  static Bool_t CompareClusters(AliHLTTPCSpacePointData *a, AliHLTTPCSpacePointData *b);
-
-  /** set configuration parameters **/
-  Int_t Configure( const char* arguments );
-
-  ClassDef(AliHLTTPCCATrackerComponent, 0);
-  
+  public:
+    /** standard constructor */
+    AliHLTTPCCATrackerComponent();
+
+    /** dummy copy constructor, defined according to effective C++ style */
+    AliHLTTPCCATrackerComponent( const AliHLTTPCCATrackerComponent& );
+
+    /** dummy assignment op, but defined according to effective C++ style */
+    AliHLTTPCCATrackerComponent& operator=( const AliHLTTPCCATrackerComponent& );
+
+    /** standard destructor */
+    virtual ~AliHLTTPCCATrackerComponent();
+
+    // Public functions to implement AliHLTComponent's interface.
+    // These functions are required for the registration process
+
+    /** @see component interface @ref AliHLTComponent::GetComponentID */ 
+    const char* GetComponentID() ;
+
+    /** @see component interface @ref AliHLTComponent::GetInputDataTypes */
+    void GetInputDataTypes( vector<AliHLTComponentDataType>& list )  ;
+
+    /** @see component interface @ref AliHLTComponent::GetOutputDataType */
+    AliHLTComponentDataType GetOutputDataType() ;
+
+    /** @see component interface @ref AliHLTComponent::GetOutputDataSize */
+    virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier ) ;
+
+    /** @see component interface @ref AliHLTComponent::Spawn */
+    AliHLTComponent* Spawn() ;
+
+  protected:
+
+    // Protected functions to implement AliHLTComponent's interface.
+    // These functions provide initialization as well as the actual processing
+    // capabilities of the component.
+
+    /** @see component interface @ref AliHLTComponent::DoInit */
+    int DoInit( int argc, const char** argv );
+
+    /** @see component interface @ref AliHLTComponent::DoDeinit */
+    int DoDeinit();
+
+    /** reconfigure **/
+    int Reconfigure( const char* cdbEntry, const char* chainId );
+
+    /** @see component interface @ref AliHLTProcessor::DoEvent */
+    int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks,
+                   AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr,
+                   AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
+
+  private:
+
+    /** the tracker object */
+    AliHLTTPCCATracker* fTracker;                                //! transient
+
+    /** magnetic field */
+    double fSolenoidBz;                                            // see above
+    int fMinNTrackClusters; //* required min number of clusters on the track
+    double fClusterZCut;  //* cut on cluster Z position (for noise rejection at the age of TPC)
+    double fFullTime; //* total time for DoEvent() [s]
+    double fRecoTime; //* total reconstruction time [s]
+    Long_t    fNEvents;  //* number of reconstructed events
+    bool fNewOutputType; //* use new type of output (temporary flag)
+
+    static bool CompareClusters( AliHLTTPCSpacePointData *a, AliHLTTPCSpacePointData *b );
+
+    /** set configuration parameters **/
+    int Configure( const char* arguments );
+
+    ClassDef( AliHLTTPCCATrackerComponent, 0 );
+
 };
 #endif
index adf2a7ac691029f998a80ebc39133402a61de923..cacbbc317d025d0615b916924f556dd64ee5ad4f 100644 (file)
@@ -1,5 +1,5 @@
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
@@ -19,8 +19,8 @@
 
 #include "AliHLTTPCCATracklet.h"
 
-#if !defined(HLTCA_GPUCODE)  
-void AliHLTTPCCATracklet::Dummy() const 
+#if !defined(HLTCA_GPUCODE)
+void AliHLTTPCCATracklet::Dummy() const
 {
 }
 #endif
index 7aeb9944ef4511c4c610827c3804b1d28e4196c3..561e8049f7ec291451c18d72ecb01c9f6604fbc7 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
  */
 class AliHLTTPCCATracklet
 {
- public:
 public:
 
 #if !defined(HLTCA_GPUCODE)
-  AliHLTTPCCATracklet() : fStartHitID(0), fNHits(0), fFirstRow(0), fLastRow(0), fParam(){};
-  void Dummy() const ;
-  ~AliHLTTPCCATracklet(){}
+    AliHLTTPCCATracklet() : fStartHitID( 0 ), fNHits( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fParam() {};
+    void Dummy() const ;
+    ~AliHLTTPCCATracklet() {}
 #endif
 
-  GPUhd() Int_t StartHitID()            const { return fStartHitID; }
-  GPUhd() Int_t  NHits()                const { return fNHits;      }
-  GPUhd() Int_t  FirstRow()             const { return fFirstRow;   }
-  GPUhd() Int_t  LastRow()              const { return fLastRow;    }
-  GPUhd() const AliHLTTPCCATrackParam &Param() const { return fParam;      }
-  GPUhd() Int_t  RowHit(Int_t i)   const { return fRowHits[i];    }
-
-  GPUhd() void SetStartHitID( Int_t v )           { fStartHitID = v; }
-  GPUhd() void SetNHits( Int_t v )               {  fNHits = v;      }
-  GPUhd() void SetFirstRow( Int_t v )            {  fFirstRow = v;   }
-  GPUhd() void SetLastRow( Int_t v )             {  fLastRow = v;    }
-  GPUhd() void SetParam( const AliHLTTPCCATrackParam &v ){ fParam = v;      }
-  GPUhd() void SetRowHit( Int_t irow, Int_t ih)  { fRowHits[irow] = ih;    }
-
-
-private:
-
-  Int_t fStartHitID;            // ID of the starting hit
-  Int_t fNHits;                 // N hits
-  Int_t fFirstRow;              // first TPC row
-  Int_t fLastRow;               // last TPC row
-  AliHLTTPCCATrackParam fParam; // tracklet parameters
-  Int_t fRowHits[160];          // hit index for each TPC row  
+    GPUhd() int StartHitID()            const { return fStartHitID; }
+    GPUhd() int  NHits()                const { return fNHits;      }
+    GPUhd() int  FirstRow()             const { return fFirstRow;   }
+    GPUhd() int  LastRow()              const { return fLastRow;    }
+    GPUhd() const AliHLTTPCCATrackParam &Param() const { return fParam;      }
+    GPUhd() int  RowHit( int i )   const { return fRowHits[i];    }
+
+    GPUhd() void SetStartHitID( int v )           { fStartHitID = v; }
+    GPUhd() void SetNHits( int v )               {  fNHits = v;      }
+    GPUhd() void SetFirstRow( int v )            {  fFirstRow = v;   }
+    GPUhd() void SetLastRow( int v )             {  fLastRow = v;    }
+    GPUhd() void SetParam( const AliHLTTPCCATrackParam &v ) { fParam = v;      }
+    GPUhd() void SetRowHit( int irow, int ih )  { fRowHits[irow] = ih;    }
+
+
+  private:
+
+    int fStartHitID;            // ID of the starting hit
+    int fNHits;                 // N hits
+    int fFirstRow;              // first TPC row
+    int fLastRow;               // last TPC row
+    AliHLTTPCCATrackParam fParam; // tracklet parameters
+    int fRowHits[160];          // hit index for each TPC row
 };
 
 #endif
index c62488ea15e42c0a695663641be0b21b3b4ac08b..1be1ba94eaa464dcee54c9391c794f55d976bc65 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id: AliHLTTPCCATrackletConstructor.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #endif
 
 
-GPUd() void AliHLTTPCCATrackletConstructor::Step0 
-( Int_t nBlocks, Int_t /*nThreads*/, Int_t iBlock, Int_t iThread,
+GPUd() void AliHLTTPCCATrackletConstructor::Step0
+( int nBlocks, int /*nThreads*/, int iBlock, int iThread,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &/*tParam*/ )
 {
   // reconstruction of tracklets, step 0
-  
-  r.fIsMemThread = ( iThread<NMemThreads() );
-  if( iThread==0 ){
-    Int_t nTracks = *tracker.NTracklets();
-    Int_t nTrPerBlock = nTracks/nBlocks+1;
+
+  r.fIsMemThread = ( iThread < NMemThreads() );
+  if ( iThread == 0 ) {
+    int nTracks = *tracker.NTracklets();
+    int nTrPerBlock = nTracks / nBlocks + 1;
     s.fNRows = tracker.Param().NRows();
-    s.fItr0 = nTrPerBlock*iBlock;
+    s.fItr0 = nTrPerBlock * iBlock;
     s.fItr1 = s.fItr0 + nTrPerBlock;
-    if( s.fItr1> nTracks ) s.fItr1 = nTracks;
+    if ( s.fItr1 > nTracks ) s.fItr1 = nTracks;
     s.fUsedHits = tracker.HitWeights();
     s.fMinStartRow = 158;
     s.fMaxStartRow = 0;
   }
-  if( iThread<32 ){
-    s.fMinStartRow32[iThread] = 158;    
+  if ( iThread < 32 ) {
+    s.fMinStartRow32[iThread] = 158;
     s.fMaxStartRow32[iThread] = 0;
   }
 }
 
 
-GPUd() void AliHLTTPCCATrackletConstructor::Step1 
-( Int_t /*nBlocks*/, Int_t /*nThreads*/, Int_t /*iBlock*/, Int_t iThread,
+GPUd() void AliHLTTPCCATrackletConstructor::Step1
+( int /*nBlocks*/, int /*nThreads*/, int /*iBlock*/, int iThread,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam )
 {
-  // reconstruction of tracklets, step 1  
+  // reconstruction of tracklets, step 1
 
-  r.fItr= s.fItr0 + ( iThread - NMemThreads() ); 
-  r.fGo = (!r.fIsMemThread) && ( r.fItr<s.fItr1 );
+  r.fItr = s.fItr0 + ( iThread - NMemThreads() );
+  r.fGo = ( !r.fIsMemThread ) && ( r.fItr < s.fItr1 );
   r.fSave = r.fGo;
-  r.fNHits=0;
-  
-  if( !r.fGo ) return;
-  
+  r.fNHits = 0;
+
+  if ( !r.fGo ) return;
+
   r.fStage = 0;
-  
+
   AliHLTTPCCATracklet &tracklet = tracker.Tracklets()[r.fItr];
 
-  UInt_t kThread = iThread %32;//& 00000020;
-  if( SAVE() ) for( Int_t i=0; i<160; i++ ) tracklet.SetRowHit(i,-1);
-    
-  Int_t id = tracker.TrackletStartHits()[r.fItr];
-  r.fStartRow = AliHLTTPCCATracker::ID2IRow(id);
+  unsigned int kThread = iThread % 32;//& 00000020;
+  if ( SAVE() ) for ( int i = 0; i < 160; i++ ) tracklet.SetRowHit( i, -1 );
+
+  int id = tracker.TrackletStartHits()[r.fItr];
+  r.fStartRow = AliHLTTPCCATracker::ID2IRow( id );
   r.fEndRow = r.fStartRow;
   r.fFirstRow = r.fStartRow;
-  r.fLastRow = r.fFirstRow;  
-  r.fCurrIH =  AliHLTTPCCATracker::ID2IHit(id);
-  
-  CAMath::AtomicMin( &s.fMinStartRow32[kThread], r.fStartRow);    
-  CAMath::AtomicMax( &s.fMaxStartRow32[kThread], r.fStartRow);    
-  tParam.SetSinPhi(0);
-  tParam.SetDzDs(0);
-  tParam.SetQPt(0);
-  tParam.SetSignCosPhi(1);
-  tParam.SetChi2(0);
-  tParam.SetNDF(-3);
-  tParam.SetCov( 0,1); 
-  tParam.SetCov( 1,0); 
-  tParam.SetCov( 2,1);
-  tParam.SetCov( 3,0);
-  tParam.SetCov( 4,0);
-  tParam.SetCov( 5,1);
-  tParam.SetCov( 6,0); 
-  tParam.SetCov( 7,0); 
-  tParam.SetCov( 8,0); 
-  tParam.SetCov( 9,1);
-  tParam.SetCov(10,0); 
-  tParam.SetCov(11,0); 
-  tParam.SetCov(12,0); 
-  tParam.SetCov(13,0); 
-  tParam.SetCov(14,10.);     
+  r.fLastRow = r.fFirstRow;
+  r.fCurrIH =  AliHLTTPCCATracker::ID2IHit( id );
+
+  CAMath::AtomicMin( &s.fMinStartRow32[kThread], r.fStartRow );
+  CAMath::AtomicMax( &s.fMaxStartRow32[kThread], r.fStartRow );
+  tParam.SetSinPhi( 0 );
+  tParam.SetDzDs( 0 );
+  tParam.SetQPt( 0 );
+  tParam.SetSignCosPhi( 1 );
+  tParam.SetChi2( 0 );
+  tParam.SetNDF( -3 );
+  tParam.SetCov( 0, 1 );
+  tParam.SetCov( 1, 0 );
+  tParam.SetCov( 2, 1 );
+  tParam.SetCov( 3, 0 );
+  tParam.SetCov( 4, 0 );
+  tParam.SetCov( 5, 1 );
+  tParam.SetCov( 6, 0 );
+  tParam.SetCov( 7, 0 );
+  tParam.SetCov( 8, 0 );
+  tParam.SetCov( 9, 1 );
+  tParam.SetCov( 10, 0 );
+  tParam.SetCov( 11, 0 );
+  tParam.SetCov( 12, 0 );
+  tParam.SetCov( 13, 0 );
+  tParam.SetCov( 14, 10. );
 
 }
 
-GPUd() void AliHLTTPCCATrackletConstructor::Step2 
-( Int_t /*nBlocks*/, Int_t nThreads, Int_t /*iBlock*/, Int_t iThread,
+GPUd() void AliHLTTPCCATrackletConstructor::Step2
+( int /*nBlocks*/, int nThreads, int /*iBlock*/, int iThread,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &/*r*/, AliHLTTPCCATracker &/*tracker*/, AliHLTTPCCATrackParam &/*tParam*/ )
-{  
+{
   // reconstruction of tracklets, step 2
-  
-  if( iThread==0 ){
+
+  if ( iThread == 0 ) {
     //CAMath::AtomicMinGPU(&s.fMinRow, s.fMinRow32[iThread]);
-    Int_t minStartRow = 158;
-    Int_t maxStartRow = 0;
-    Int_t n = (nThreads>32 ) ?32 :nThreads;
-    for( Int_t i=0; i<n; i++ ){      
-      if( s.fMinStartRow32[i]<minStartRow ) minStartRow = s.fMinStartRow32[i];
-      if( s.fMaxStartRow32[i]>maxStartRow ) maxStartRow = s.fMaxStartRow32[i];
-    }   
+    int minStartRow = 158;
+    int maxStartRow = 0;
+    int n = ( nThreads > 32 ) ? 32 : nThreads;
+    for ( int i = 0; i < n; i++ ) {
+      if ( s.fMinStartRow32[i] < minStartRow ) minStartRow = s.fMinStartRow32[i];
+      if ( s.fMaxStartRow32[i] > maxStartRow ) maxStartRow = s.fMaxStartRow32[i];
+    }
     s.fMinStartRow = minStartRow;
     s.fMaxStartRow = maxStartRow;
-  } 
+  }
 }
 
-GPUd() void AliHLTTPCCATrackletConstructor::ReadData 
-( Int_t iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, Int_t iRow )
-{    
+GPUd() void AliHLTTPCCATrackletConstructor::ReadData
+( int iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, int iRow )
+{
   // reconstruction of tracklets, read data step
 
-  if( r.fIsMemThread ){
-    const AliHLTTPCCARow &row = tracker.Row(iRow);
-    Bool_t jr = !r.fCurrentData;
-    Int_t n = row.FullSize();
+  if ( r.fIsMemThread ) {
+    const AliHLTTPCCARow &row = tracker.Row( iRow );
+    bool jr = !r.fCurrentData;
+    int n = row.FullSize();
     const uint4* gMem = tracker.RowData() + row.FullOffset();
     uint4 *sMem = s.fData[jr];
-    for( Int_t i=iThread; i<n; i+=NMemThreads() ) sMem[i] = gMem[i];
-  } 
+    for ( int i = iThread; i < n; i += NMemThreads() ) sMem[i] = gMem[i];
+  }
 }
 
 
-GPUd() void AliHLTTPCCATrackletConstructor::StoreTracklet 
-( Int_t /*nBlocks*/, Int_t /*nThreads*/, Int_t /*iBlock*/, Int_t /*iThread*/,
+GPUd() void AliHLTTPCCATrackletConstructor::StoreTracklet
+( int /*nBlocks*/, int /*nThreads*/, int /*iBlock*/, int /*iThread*/,
   AliHLTTPCCASharedMemory &/*s*/, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam )
-{    
+{
   // reconstruction of tracklets, tracklet store step
-  
-  if( !r.fSave ) return;
+
+  if ( !r.fSave ) return;
 
   //AliHLTTPCCAPerformance::Instance().HNHitsPerTrackCand()->Fill(r.fNHits);
 
-  do
+  do {
     {
       //std::cout<<"tracklet to store: "<<r.fItr<<", nhits = "<<r.fNHits<<std::endl;
     }
 
-    if( r.fNHits<5 ){ 
+    if ( r.fNHits < 5 ) {
       r.fNHits = 0;
       break;
     }
 
-    if(0){ 
-      if( 1./.5 < CAMath::Abs(tParam.QPt()) ){ //SG!!!
-       r.fNHits = 0;
-       break;
+    if ( 0 ) {
+      if ( 1. / .5 < CAMath::Abs( tParam.QPt() ) ) { //SG!!!
+        r.fNHits = 0;
+        break;
       }
     }
-    
-    {  
-      Bool_t ok=1;
-      const Float_t *c = tParam.Cov();
-      for( Int_t i=0; i<15; i++ ) ok = ok && CAMath::Finite(c[i]);
-      for( Int_t i=0; i<5; i++ ) ok = ok && CAMath::Finite(tParam.Par()[i]);
-      ok = ok && (tParam.X()>50);
-      
-      if( c[0]<=0 || c[2]<=0 || c[5]<=0 || c[9]<=0 || c[14]<=0 ) ok = 0;      
-      
-      if(!ok){
-       r.fNHits = 0;
-       break; 
+
+    {
+      bool ok = 1;
+      const float *c = tParam.Cov();
+      for ( int i = 0; i < 15; i++ ) ok = ok && CAMath::Finite( c[i] );
+      for ( int i = 0; i < 5; i++ ) ok = ok && CAMath::Finite( tParam.Par()[i] );
+      ok = ok && ( tParam.X() > 50 );
+
+      if ( c[0] <= 0 || c[2] <= 0 || c[5] <= 0 || c[9] <= 0 || c[14] <= 0 ) ok = 0;
+
+      if ( !ok ) {
+        r.fNHits = 0;
+        break;
       }
-    }   
-  }while(0);
-  if( !SAVE() ) return;
-    
+    }
+  } while ( 0 );
+
+  if ( !SAVE() ) return;
+
   AliHLTTPCCATracklet &tracklet = tracker.Tracklets()[r.fItr];
 
-  tracklet.SetNHits(r.fNHits);
-  
-  if( r.fNHits>0 ){
+  tracklet.SetNHits( r.fNHits );
+
+  if ( r.fNHits > 0 ) {
 #ifdef DRAW
-    if(0){
-      std::cout<<"store tracklet "<<r.fItr<<", nhits = "<<r.fNHits<<std::endl;
-      if( AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kBlue,1.) ){  
-       AliHLTTPCCADisplay::Instance().Ask();
+    if ( 0 ) {
+      std::cout << "store tracklet " << r.fItr << ", nhits = " << r.fNHits << std::endl;
+      if ( AliHLTTPCCADisplay::Instance().DrawTracklet( tParam, hitstore, kBlue, 1. ) ) {
+        AliHLTTPCCADisplay::Instance().Ask();
       }
     }
 #endif
-    if( CAMath::Abs(tParam.Par()[4])<1.e-8 ) tParam.SetPar( 4, 1.e-8);
+    if ( CAMath::Abs( tParam.Par()[4] ) < 1.e-8 ) tParam.SetPar( 4, 1.e-8 );
     tracklet.SetFirstRow( r.fFirstRow );
     tracklet.SetLastRow( r.fLastRow );
     tracklet.SetParam( tParam );
-    Int_t w = (r.fNHits<<16)+r.fItr;
-    for( Int_t iRow=0; iRow<160; iRow++ ){
-      Int_t ih = tracklet.RowHit( iRow );
-      if( ih>=0 ){
-       Int_t ihTot = tracker.Row(iRow).FirstHit() + ih;
-       CAMath::AtomicMax( tracker.HitWeights() + ihTot, w );
+    int w = ( r.fNHits << 16 ) + r.fItr;
+    for ( int iRow = 0; iRow < 160; iRow++ ) {
+      int ih = tracklet.RowHit( iRow );
+      if ( ih >= 0 ) {
+        int ihTot = tracker.Row( iRow ).FirstHit() + ih;
+        CAMath::AtomicMax( tracker.HitWeights() + ihTot, w );
       }
     }
-  }  
+  }
 }
 
 GPUd() void AliHLTTPCCATrackletConstructor::UpdateTracklet
-( Int_t /*nBlocks*/, Int_t /*nThreads*/, Int_t /*iBlock*/, Int_t /*iThread*/,
-    AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam,Int_t iRow )
-{  
+( int /*nBlocks*/, int /*nThreads*/, int /*iBlock*/, int /*iThread*/,
+  AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam, int iRow )
+{
   // reconstruction of tracklets, tracklets update step
 
   //std::cout<<"Update tracklet: "<<r.fItr<<" "<<r.fGo<<" "<<r.fStage<<" "<<iRow<<std::endl;
-  Bool_t drawSearch = 0;//r.fItr==2;
-  Bool_t drawFit = 0;//r.fItr==2;
-  Bool_t drawFitted = drawFit ;//|| 1;//r.fItr==16;
+  bool drawSearch = 0;//r.fItr==2;
+  bool drawFit = 0;//r.fItr==2;
+  bool drawFitted = drawFit ;//|| 1;//r.fItr==16;
 
-  if( !r.fGo ) return;
+  if ( !r.fGo ) return;
+
+  const int kMaxRowGap = 4;
 
-  const Int_t kMaxRowGap = 4;  
-  
   AliHLTTPCCATracklet &tracklet = tracker.Tracklets()[r.fItr];
 
-  const AliHLTTPCCARow &row = tracker.Row(iRow);
-  
-  Float_t y0 = row.Grid().YMin();
-  Float_t stepY = row.HstepY();
-  Float_t z0 = row.Grid().ZMin();
-  Float_t stepZ = row.HstepZ();
-  Float_t stepYi = row.HstepYi();
-  Float_t stepZi = row.HstepZi();        
-  
-  if( r.fStage == 0 ){ // fitting part     
-    do{
-      
-      if( iRow<r.fStartRow || r.fCurrIH<0  ) break;
-      
-      if( (iRow-r.fStartRow)%2!=0 ) break; // SG!!! - jump over the row
-      uint4 *tmpint4 = s.fData[r.fCurrentData];   
-      ushort2 hh = reinterpret_cast<ushort2*>(tmpint4)[r.fCurrIH];
-      
-      Int_t oldIH = r.fCurrIH;
-      r.fCurrIH = reinterpret_cast<Short_t*>(tmpint4)[row.FullLinkOffset() + r.fCurrIH];         
-      
-      Float_t x = row.X();
-      Float_t y = y0 + hh.x*stepY;
-      Float_t z = z0 + hh.y*stepZ;
-      if( drawFit ) std::cout<<" fit tracklet: new hit "<<oldIH<<", xyz="<<x<<" "<<y<<" "<<z<<std::endl;
-    
-      if( iRow==r.fStartRow ){
-       tParam.SetX( x );
-       tParam.SetY( y );
-       tParam.SetZ( z );
-       r.fLastY = y;
-       r.fLastZ = z;
-       //#ifdef DRAW
-       if( drawFit ) std::cout<<" fit tracklet "<<r.fItr<<", row "<<iRow<<" first row"<<std::endl;
-       //#endif
-      }else{       
-
-       Float_t err2Y, err2Z;
-       Float_t dx = x - tParam.X();
-       Float_t dy = y - r.fLastY;//tParam.Y();
-       Float_t dz = z - r.fLastZ;//tParam.Z();
-       r.fLastY = y;
-       r.fLastZ = z;
-
-       Float_t ri = 1./CAMath::Sqrt(dx*dx+dy*dy);
-       if( iRow==r.fStartRow+1 ){
-         tParam.SetSinPhi( dy*ri );
-         tParam.SetSignCosPhi( dx );
-         tParam.SetDzDs( dz*ri );
-         std::cout<<"Init. errors... "<<r.fItr<<std::endl;
-         tracker.GetErrors2( iRow, tParam, err2Y, err2Z );
-         std::cout<<"Init. errors = "<<err2Y<<" "<<err2Z<<std::endl;
-         tParam.SetCov( 0, err2Y );
-         tParam.SetCov( 2, err2Z );
-       }
-       if( drawFit ){
-         //#ifdef DRAW
-         std::cout<<" fit tracklet "<<r.fItr<<", row "<<iRow<<" transporting.."<<std::endl;
-         std::cout<<" params before transport="<<std::endl;
-         tParam.Print();
-         //#endif
-       }
-       Float_t sinPhi, cosPhi;
-       if( r.fNHits>=10 && CAMath::Abs(tParam.SinPhi())<.99 ){
-         sinPhi = tParam.SinPhi();
-         cosPhi = CAMath::Sqrt(1-sinPhi*sinPhi);
-       }else{
-         sinPhi = dy*ri;
-         cosPhi = dx*ri;
-       }
-       //#ifdef DRAW
-       if( drawFit ) std::cout<<"sinPhi0 = "<<sinPhi<<", cosPhi0 = "<<cosPhi<<std::endl;
-       //#endif
-       if( !tParam.TransportToX( x, sinPhi, cosPhi, tracker.Param().Bz(),-1 ) ){ 
-         //#ifdef DRAW
-         if( drawFit ) std::cout<<" tracklet "<<r.fItr<<", row "<<iRow<<": can not transport!!"<<std::endl;
+  const AliHLTTPCCARow &row = tracker.Row( iRow );
+
+  float y0 = row.Grid().YMin();
+  float stepY = row.HstepY();
+  float z0 = row.Grid().ZMin();
+  float stepZ = row.HstepZ();
+  float stepYi = row.HstepYi();
+  float stepZi = row.HstepZi();
+
+  if ( r.fStage == 0 ) { // fitting part
+    do {
+
+      if ( iRow < r.fStartRow || r.fCurrIH < 0  ) break;
+
+      if ( ( iRow - r.fStartRow ) % 2 != 0 ) break; // SG!!! - jump over the row
+
+      uint4 *tmpint4 = s.fData[r.fCurrentData];
+      ushort2 hh = reinterpret_cast<ushort2*>( tmpint4 )[r.fCurrIH];
+
+      int oldIH = r.fCurrIH;
+      r.fCurrIH = reinterpret_cast<short*>( tmpint4 )[row.FullLinkOffset() + r.fCurrIH];
+
+      float x = row.X();
+      float y = y0 + hh.x * stepY;
+      float z = z0 + hh.y * stepZ;
+      if ( drawFit ) std::cout << " fit tracklet: new hit " << oldIH << ", xyz=" << x << " " << y << " " << z << std::endl;
+
+      if ( iRow == r.fStartRow ) {
+        tParam.SetX( x );
+        tParam.SetY( y );
+        tParam.SetZ( z );
+        r.fLastY = y;
+        r.fLastZ = z;
+        //#ifdef DRAW
+        if ( drawFit ) std::cout << " fit tracklet " << r.fItr << ", row " << iRow << " first row" << std::endl;
+        //#endif
+      } else {
+
+        float err2Y, err2Z;
+        float dx = x - tParam.X();
+        float dy = y - r.fLastY;//tParam.Y();
+        float dz = z - r.fLastZ;//tParam.Z();
+        r.fLastY = y;
+        r.fLastZ = z;
+
+        float ri = 1. / CAMath::Sqrt( dx * dx + dy * dy );
+        if ( iRow == r.fStartRow + 1 ) {
+          tParam.SetSinPhi( dy*ri );
+          tParam.SetSignCosPhi( dx );
+          tParam.SetDzDs( dz*ri );
+          std::cout << "Init. errors... " << r.fItr << std::endl;
+          tracker.GetErrors2( iRow, tParam, err2Y, err2Z );
+          std::cout << "Init. errors = " << err2Y << " " << err2Z << std::endl;
+          tParam.SetCov( 0, err2Y );
+          tParam.SetCov( 2, err2Z );
+        }
+        if ( drawFit ) {
+          //#ifdef DRAW
+          std::cout << " fit tracklet " << r.fItr << ", row " << iRow << " transporting.." << std::endl;
+          std::cout << " params before transport=" << std::endl;
+          tParam.Print();
+          //#endif
+        }
+        float sinPhi, cosPhi;
+        if ( r.fNHits >= 10 && CAMath::Abs( tParam.SinPhi() ) < .99 ) {
+          sinPhi = tParam.SinPhi();
+          cosPhi = CAMath::Sqrt( 1 - sinPhi * sinPhi );
+        } else {
+          sinPhi = dy * ri;
+          cosPhi = dx * ri;
+        }
+        //#ifdef DRAW
+        if ( drawFit ) std::cout << "sinPhi0 = " << sinPhi << ", cosPhi0 = " << cosPhi << std::endl;
+        //#endif
+        if ( !tParam.TransportToX( x, sinPhi, cosPhi, tracker.Param().Bz(), -1 ) ) {
+          //#ifdef DRAW
+          if ( drawFit ) std::cout << " tracklet " << r.fItr << ", row " << iRow << ": can not transport!!" << std::endl;
 //#endif
-         if( SAVE() ) tracklet.SetRowHit( iRow, -1 );
-         break; 
-       }
-       //std::cout<<"mark1 "<<r.fItr<<std::endl;
-       //tParam.Print();
-       tracker.GetErrors2( iRow, tParam.GetZ(), sinPhi, cosPhi, tParam.GetDzDs(), err2Y, err2Z );
-       //std::cout<<"mark2"<<std::endl;
-       
-       if( drawFit ){
-         //#ifdef DRAW
-         std::cout<<" params after transport="<<std::endl;
-         tParam.Print();       
-         std::cout<<"fit tracklet before filter: "<<r.fItr<<", row "<<iRow<<" errs="<<err2Y<<" "<<err2Z<<std::endl;
-         //#endif
+          if ( SAVE() ) tracklet.SetRowHit( iRow, -1 );
+          break;
+        }
+        //std::cout<<"mark1 "<<r.fItr<<std::endl;
+        //tParam.Print();
+        tracker.GetErrors2( iRow, tParam.GetZ(), sinPhi, cosPhi, tParam.GetDzDs(), err2Y, err2Z );
+        //std::cout<<"mark2"<<std::endl;
+
+        if ( drawFit ) {
+          //#ifdef DRAW
+          std::cout << " params after transport=" << std::endl;
+          tParam.Print();
+          std::cout << "fit tracklet before filter: " << r.fItr << ", row " << iRow << " errs=" << err2Y << " " << err2Z << std::endl;
+          //#endif
 #ifdef DRAW
-         AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kBlue, 2.,1);  
-         AliHLTTPCCADisplay::Instance().Ask();
+          AliHLTTPCCADisplay::Instance().DrawTracklet( tParam, hitstore, kBlue, 2., 1 );
+          AliHLTTPCCADisplay::Instance().Ask();
 #endif
-       }
-       if( !tParam.Filter( y, z, err2Y, err2Z, .99 ) ) { 
-         //#ifdef DRAW
-         if( drawFit ) std::cout<<" tracklet "<<r.fItr<<", row "<<iRow<<": can not filter!!"<<std::endl;
-         //#endif
-         if( SAVE() ) tracklet.SetRowHit( iRow, -1 );
-         break; 
-       }          
+        }
+        if ( !tParam.Filter( y, z, err2Y, err2Z, .99 ) ) {
+          //#ifdef DRAW
+          if ( drawFit ) std::cout << " tracklet " << r.fItr << ", row " << iRow << ": can not filter!!" << std::endl;
+          //#endif
+          if ( SAVE() ) tracklet.SetRowHit( iRow, -1 );
+          break;
+        }
       }
-      if( SAVE() ) tracklet.SetRowHit( iRow, oldIH );
-      if( drawFit ){
-       //#ifdef DRAW
-       std::cout<<"fit tracklet after filter "<<r.fItr<<", row "<<iRow<<std::endl;
-       tParam.Print();
-       //#endif
+      if ( SAVE() ) tracklet.SetRowHit( iRow, oldIH );
+      if ( drawFit ) {
+        //#ifdef DRAW
+        std::cout << "fit tracklet after filter " << r.fItr << ", row " << iRow << std::endl;
+        tParam.Print();
+        //#endif
 #ifdef DRAW
-       AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kGreen,2.);  
-       AliHLTTPCCADisplay::Instance().Ask();
+        AliHLTTPCCADisplay::Instance().DrawTracklet( tParam, hitstore, kGreen, 2. );
+        AliHLTTPCCADisplay::Instance().Ask();
 #endif
       }
       r.fNHits++;
       r.fLastRow = iRow;
       r.fEndRow = iRow;
       break;
-    } while(0);
-    
-    if( r.fCurrIH<0 ){
+    } while ( 0 );
+
+    if ( r.fCurrIH < 0 ) {
       //#ifdef DRAW
-      if( drawFitted ) std::cout<<"fitted tracklet "<<r.fItr<<", nhits="<<r.fNHits<<std::endl;
+      if ( drawFitted ) std::cout << "fitted tracklet " << r.fItr << ", nhits=" << r.fNHits << std::endl;
       //#endif
       r.fStage = 1;
       //AliHLTTPCCAPerformance::Instance().HNHitsPerSeed()->Fill(r.fNHits);
-      if( r.fNHits<3 ){ r.fNHits=0; r.fGo = 0;}//SG!!!
-      if( CAMath::Abs(tParam.SinPhi())>.999 ){
-       //#ifdef DRAW
-       if( drawFitted ) std::cout<<" fitted tracklet  error: sinPhi="<<tParam.SinPhi()<<std::endl;
-       //#endif
-       r.fNHits=0; r.fGo = 0;
-      }else{
-       //tParam.SetCosPhi( CAMath::Sqrt(1-tParam.SinPhi()*tParam.SinPhi()) );
+      if ( r.fNHits < 3 ) { r.fNHits = 0; r.fGo = 0;}//SG!!!
+      if ( CAMath::Abs( tParam.SinPhi() ) > .999 ) {
+        //#ifdef DRAW
+        if ( drawFitted ) std::cout << " fitted tracklet  error: sinPhi=" << tParam.SinPhi() << std::endl;
+        //#endif
+        r.fNHits = 0; r.fGo = 0;
+      } else {
+        //tParam.SetCosPhi( CAMath::Sqrt(1-tParam.SinPhi()*tParam.SinPhi()) );
       }
-      if( drawFitted ){
-       //#ifdef DRAW
-       std::cout<<"fitted tracklet "<<r.fItr<<" miss="<<r.fNMissed<<" go="<<r.fGo<<std::endl;
-       tParam.Print();
+      if ( drawFitted ) {
+        //#ifdef DRAW
+        std::cout << "fitted tracklet " << r.fItr << " miss=" << r.fNMissed << " go=" << r.fGo << std::endl;
+        tParam.Print();
 #ifdef DRAW
-       AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kBlue);  
-       AliHLTTPCCADisplay::Instance().Ask();
+        AliHLTTPCCADisplay::Instance().DrawTracklet( tParam, hitstore, kBlue );
+        AliHLTTPCCADisplay::Instance().Ask();
 #endif
       }
-    } 
-  }
-  else // forward/backward searching part
-    {               
-      do{ 
-       if( drawSearch ){
-         //#ifdef DRAW
-         std::cout<<"search tracklet "<<r.fItr<<" row "<<iRow<<" miss="<<r.fNMissed<<" go="<<r.fGo<<" stage="<<r.fStage<<std::endl;
-         //#endif
-       }
-
-       if( r.fStage == 2 && ( (iRow>=r.fEndRow) || 
-                              (iRow>=r.fStartRow && (iRow-r.fStartRow)%2==0 ) 
-                              ) ) break; 
-       if( r.fNMissed>kMaxRowGap  ){     
-         break;
-       }
-
-       r.fNMissed++;   
-
-       Float_t x = row.X();
-       Float_t err2Y, err2Z;
-       if( drawSearch ){
-         //#ifdef DRAW
-         std::cout<<"tracklet "<<r.fItr<<" before transport to row "<<iRow<<" : "<<std::endl;
-         tParam.Print();
-         //#endif
-       }
-       if( !tParam.TransportToX( x, tParam.SinPhi(), tParam.GetCosPhi(), tracker.Param().Bz(), .99 ) ){
-         //#ifdef DRAW
-         if( drawSearch ) std::cout<<" tracklet "<<r.fItr<<", row "<<iRow<<": can not transport!!"<<std::endl;
-         //#endif
-         break;
-       }
-       if( drawSearch ){
-         //#ifdef DRAW
-         std::cout<<"tracklet "<<r.fItr<<" after transport to row "<<iRow<<" : "<<std::endl;
-         tParam.Print();
+    }
+  } else { // forward/backward searching part
+    do {
+      if ( drawSearch ) {
+        //#ifdef DRAW
+        std::cout << "search tracklet " << r.fItr << " row " << iRow << " miss=" << r.fNMissed << " go=" << r.fGo << " stage=" << r.fStage << std::endl;
+        //#endif
+      }
+
+      if ( r.fStage == 2 && ( ( iRow >= r.fEndRow ) ||
+                              ( iRow >= r.fStartRow && ( iRow - r.fStartRow ) % 2 == 0 )
+                            ) ) break;
+      if ( r.fNMissed > kMaxRowGap  ) {
+        break;
+      }
+
+      r.fNMissed++;
+
+      float x = row.X();
+      float err2Y, err2Z;
+      if ( drawSearch ) {
+        //#ifdef DRAW
+        std::cout << "tracklet " << r.fItr << " before transport to row " << iRow << " : " << std::endl;
+        tParam.Print();
+        //#endif
+      }
+      if ( !tParam.TransportToX( x, tParam.SinPhi(), tParam.GetCosPhi(), tracker.Param().Bz(), .99 ) ) {
+        //#ifdef DRAW
+        if ( drawSearch ) std::cout << " tracklet " << r.fItr << ", row " << iRow << ": can not transport!!" << std::endl;
+        //#endif
+        break;
+      }
+      if ( drawSearch ) {
+        //#ifdef DRAW
+        std::cout << "tracklet " << r.fItr << " after transport to row " << iRow << " : " << std::endl;
+        tParam.Print();
 #ifdef DRAW
-         AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kBlue,2.,1);  
-         AliHLTTPCCADisplay::Instance().Ask();
+        AliHLTTPCCADisplay::Instance().DrawTracklet( tParam, hitstore, kBlue, 2., 1 );
+        AliHLTTPCCADisplay::Instance().Ask();
 #endif
-       }
-       uint4 *tmpint4 = s.fData[r.fCurrentData];   
-
-       ushort2 *hits = reinterpret_cast<ushort2*>(tmpint4);
-               
-       Float_t fY = tParam.GetY();
-       Float_t fZ = tParam.GetZ();
-       Int_t best = -1;                
-       
-       { // search for the closest hit
-         
-         Int_t ds;
-         Int_t fY0 = (Int_t) ((fY - y0)*stepYi);
-         Int_t fZ0 = (Int_t) ((fZ - z0)*stepZi);
-         Int_t ds0 = ( ((int)1)<<30);
-         ds = ds0;
-         
-         UInt_t fIndYmin;
-         UInt_t fHitYfst=1, fHitYlst=0, fHitYfst1=1, fHitYlst1=0;
-         
-         fIndYmin = row.Grid().GetBin( (float)(fY-1.), (float)(fZ-1.) );
-         if( drawSearch ){
+      }
+      uint4 *tmpint4 = s.fData[r.fCurrentData];
+
+      ushort2 *hits = reinterpret_cast<ushort2*>( tmpint4 );
+
+      float fY = tParam.GetY();
+      float fZ = tParam.GetZ();
+      int best = -1;
+
+      { // search for the closest hit
+
+        int ds;
+        int fY0 = ( int ) ( ( fY - y0 ) * stepYi );
+        int fZ0 = ( int ) ( ( fZ - z0 ) * stepZi );
+        int ds0 = ( ( ( int )1 ) << 30 );
+        ds = ds0;
+
+        unsigned int fIndYmin;
+        unsigned int fHitYfst = 1, fHitYlst = 0, fHitYfst1 = 1, fHitYlst1 = 0;
+
+        fIndYmin = row.Grid().GetBin( ( float )( fY - 1. ), ( float )( fZ - 1. ) );
+        if ( drawSearch ) {
 #ifdef DRAW
-           std::cout<<" tracklet "<<r.fItr<<", row "<<iRow<<": grid N="<<row.Grid().N() <<std::endl;
-           std::cout<<" tracklet "<<r.fItr<<", row "<<iRow<<": minbin="<<fIndYmin <<std::endl;
+          std::cout << " tracklet " << r.fItr << ", row " << iRow << ": grid N=" << row.Grid().N() << std::endl;
+          std::cout << " tracklet " << r.fItr << ", row " << iRow << ": minbin=" << fIndYmin << std::endl;
 #endif
-         }
-         {                 
-           Int_t nY = row.Grid().Ny();
-           
-           UShort_t *sGridP = (reinterpret_cast<UShort_t*>(tmpint4)) + row.FullGridOffset();
-           fHitYfst = sGridP[fIndYmin];
-           fHitYlst = sGridP[fIndYmin+2];
-           fHitYfst1 = sGridP[fIndYmin+nY];
-           fHitYlst1 = sGridP[fIndYmin+nY+2];
-           if( drawSearch ){
+        }
+        {
+          int nY = row.Grid().Ny();
+
+          unsigned short *sGridP = ( reinterpret_cast<unsigned short*>( tmpint4 ) ) + row.FullGridOffset();
+          fHitYfst = sGridP[fIndYmin];
+          fHitYlst = sGridP[fIndYmin+2];
+          fHitYfst1 = sGridP[fIndYmin+nY];
+          fHitYlst1 = sGridP[fIndYmin+nY+2];
+          if ( drawSearch ) {
 #ifdef DRAW
-             std::cout<<" Grid, row "<<iRow<<": nHits="<<row.NHits()<<", grid n="<<row.Grid().N()<<", c[n]="<<sGridP[row.Grid().N()]<<std::endl;
-             std::cout<<"hit steps = "<<stepY<<" "<<stepZ<<std::endl;
-             std::cout<<" Grid bins:"<<std::endl;
-             for( unsigned int i=0; i<row.Grid().N(); i++ ){
-               std::cout<<" bin "<<i<<": ";
-               for( int j=sGridP[i]; j<sGridP[i+1]; j++){
-                 ushort2 hh = hits[j];
-                 Float_t y = y0 + hh.x*stepY;
-                 Float_t z = z0 + hh.y*stepZ;
-                 std::cout<<"["<<j<<"|"<<y<<","<<z<<"] ";
-               }
-               std::cout<<std::endl;
-             }
+            std::cout << " Grid, row " << iRow << ": nHits=" << row.NHits() << ", grid n=" << row.Grid().N() << ", c[n]=" << sGridP[row.Grid().N()] << std::endl;
+            std::cout << "hit steps = " << stepY << " " << stepZ << std::endl;
+            std::cout << " Grid bins:" << std::endl;
+            for ( unsigned int i = 0; i < row.Grid().N(); i++ ) {
+              std::cout << " bin " << i << ": ";
+              for ( int j = sGridP[i]; j < sGridP[i+1]; j++ ) {
+                ushort2 hh = hits[j];
+                float y = y0 + hh.x * stepY;
+                float z = z0 + hh.y * stepZ;
+                std::cout << "[" << j << "|" << y << "," << z << "] ";
+              }
+              std::cout << std::endl;
+            }
 #endif
-           }
-           if( sGridP[row.Grid().N()]!=row.NHits() ){
+          }
+          if ( sGridP[row.Grid().N()] != row.NHits() ) {
 #ifdef DRAW
-             std::cout<<" grid, row "<<iRow<<": nHits="<<row.NHits()<<", grid n="<<row.Grid().N()<<", c[n]="<<sGridP[row.Grid().N()]<<std::endl;
-             //exit(0);
+            std::cout << " grid, row " << iRow << ": nHits=" << row.NHits() << ", grid n=" << row.Grid().N() << ", c[n]=" << sGridP[row.Grid().N()] << std::endl;
+            //exit(0);
 #endif
-           }
-         }
-         if( drawSearch ){
-           //#ifdef DRAW
-           std::cout<<" tracklet "<<r.fItr<<", row "<<iRow<<", yz= "<<fY<<","<<fZ<<": search hits="<<fHitYfst<<" "<<fHitYlst<<" / "<< fHitYfst1<<" "<<fHitYlst1<<std::endl;
-           std::cout<<" hit search :"<<std::endl;
-           //#endif
-         }
-         for( UInt_t fIh = fHitYfst; fIh<fHitYlst; fIh++ ){
-           ushort2 hh = hits[fIh];       
-           Int_t ddy = (Int_t)(hh.x) - fY0;
-           Int_t ddz = (Int_t)(hh.y) - fZ0;
-           Int_t dds = CAMath::Abs(ddy) + CAMath::Abs(ddz);
-           if( drawSearch ){
-             //#ifdef DRAW
-             std::cout<<fIh<<": hityz= "<<hh.x<<" "<<hh.y<<"("<<hh.x*stepY<<" "<<hh.y*stepZ<<"), trackyz="<<fY0<<" "<<fZ0<<"("<<fY0*stepY<<" "<<fZ0*stepZ<<"), dy,dz,ds= "<<ddy<<" "<<ddz<<" "<<dds<<"("<<ddy*stepY<<" "<<ddz*stepZ<<std::endl;
-             //#endif
-           }
-           if( dds<ds ){
-             ds = dds;
-             best = fIh;
-           }                 
-         }
-                 
-         for( UInt_t fIh = fHitYfst1; fIh<fHitYlst1; fIh++ ){
-           ushort2 hh = hits[fIh];
-           Int_t ddy = (Int_t)(hh.x) - fY0;
-           Int_t ddz = (Int_t)(hh.y) - fZ0;
-           Int_t dds = CAMath::Abs(ddy) + CAMath::Abs(ddz);
-           if( drawSearch ){
-             //#ifdef DRAW
-             std::cout<<fIh<<": hityz= "<<hh.x<<" "<<hh.y<<"("<<hh.x*stepY<<" "<<hh.y*stepZ<<"), trackyz="<<fY0<<" "<<fZ0<<"("<<fY0*stepY<<" "<<fZ0*stepZ<<"), dy,dz,ds= "<<ddy<<" "<<ddz<<" "<<dds<<"("<<ddy*stepY<<" "<<ddz*stepZ<<std::endl;
-             //#endif
-           }
-           if( dds<ds ){
-             ds = dds;
-             best = fIh;
-           }                         
-         }
-       }// end of search for the closest hit
-       
-       if( best<0 ) break;     
-       if( drawSearch ){
-         //#ifdef DRAW
-         std::cout<<"hit search "<<r.fItr<<", row "<<iRow<<" hit "<<best<<" found"<<std::endl;
+          }
+        }
+        if ( drawSearch ) {
+          //#ifdef DRAW
+          std::cout << " tracklet " << r.fItr << ", row " << iRow << ", yz= " << fY << "," << fZ << ": search hits=" << fHitYfst << " " << fHitYlst << " / " << fHitYfst1 << " " << fHitYlst1 << std::endl;
+          std::cout << " hit search :" << std::endl;
+          //#endif
+        }
+        for ( unsigned int fIh = fHitYfst; fIh < fHitYlst; fIh++ ) {
+          ushort2 hh = hits[fIh];
+          int ddy = ( int )( hh.x ) - fY0;
+          int ddz = ( int )( hh.y ) - fZ0;
+          int dds = CAMath::Abs( ddy ) + CAMath::Abs( ddz );
+          if ( drawSearch ) {
+            //#ifdef DRAW
+            std::cout << fIh << ": hityz= " << hh.x << " " << hh.y << "(" << hh.x*stepY << " " << hh.y*stepZ << "), trackyz=" << fY0 << " " << fZ0 << "(" << fY0*stepY << " " << fZ0*stepZ << "), dy,dz,ds= " << ddy << " " << ddz << " " << dds << "(" << ddy*stepY << " " << ddz*stepZ << std::endl;
+            //#endif
+          }
+          if ( dds < ds ) {
+            ds = dds;
+            best = fIh;
+          }
+        }
+
+        for ( unsigned int fIh = fHitYfst1; fIh < fHitYlst1; fIh++ ) {
+          ushort2 hh = hits[fIh];
+          int ddy = ( int )( hh.x ) - fY0;
+          int ddz = ( int )( hh.y ) - fZ0;
+          int dds = CAMath::Abs( ddy ) + CAMath::Abs( ddz );
+          if ( drawSearch ) {
+            //#ifdef DRAW
+            std::cout << fIh << ": hityz= " << hh.x << " " << hh.y << "(" << hh.x*stepY << " " << hh.y*stepZ << "), trackyz=" << fY0 << " " << fZ0 << "(" << fY0*stepY << " " << fZ0*stepZ << "), dy,dz,ds= " << ddy << " " << ddz << " " << dds << "(" << ddy*stepY << " " << ddz*stepZ << std::endl;
+            //#endif
+          }
+          if ( dds < ds ) {
+            ds = dds;
+            best = fIh;
+          }
+        }
+      }// end of search for the closest hit
+
+      if ( best < 0 ) break;
+      if ( drawSearch ) {
+        //#ifdef DRAW
+        std::cout << "hit search " << r.fItr << ", row " << iRow << " hit " << best << " found" << std::endl;
 #ifdef DRAW
-         AliHLTTPCCADisplay::Instance().DrawSliceHit( iRow, best, kRed, 1. );
-         AliHLTTPCCADisplay::Instance().Ask();
-         AliHLTTPCCADisplay::Instance().DrawSliceHit( iRow, best, kWhite, 1 );
-         AliHLTTPCCADisplay::Instance().DrawSliceHit( iRow, best );
+        AliHLTTPCCADisplay::Instance().DrawSliceHit( iRow, best, kRed, 1. );
+        AliHLTTPCCADisplay::Instance().Ask();
+        AliHLTTPCCADisplay::Instance().DrawSliceHit( iRow, best, kWhite, 1 );
+        AliHLTTPCCADisplay::Instance().DrawSliceHit( iRow, best );
 #endif
-       }
-
-       ushort2 hh = hits[best];
-
-       //std::cout<<"mark 3, "<<r.fItr<<std::endl;
-       //tParam.Print();
-       tracker.GetErrors2( iRow, *((AliHLTTPCCATrackParam*)&tParam), err2Y, err2Z );
-       //std::cout<<"mark 4"<<std::endl;
-
-       Float_t y = y0 + hh.x*stepY;
-       Float_t z = z0 + hh.y*stepZ;
-       Float_t dy = y - fY;
-       Float_t dz = z - fZ;      
-       
-       const Float_t kFactor = tracker.Param().HitPickUpFactor()*tracker.Param().HitPickUpFactor()*3.5*3.5;    
-       Float_t sy2 = kFactor*( tParam.GetErr2Y() +  err2Y );
-       Float_t sz2 = kFactor*( tParam.GetErr2Z() +  err2Z );
-       if( sy2 > 2. ) sy2 = 2.;
-       if( sz2 > 2. ) sz2 = 2.;
-
-       if( drawSearch ){
-         //#ifdef DRAW
-         std::cout<<"dy,sy= "<< dy <<" "<<CAMath::Sqrt(sy2)<<", dz,sz= "<< dz<<" "<<CAMath::Sqrt(sz2)<<std::endl;
-         std::cout<<"dy,dz= "<< dy <<" "<<dz<<", sy,sz= "<<CAMath::Sqrt(sy2)<<" "<<CAMath::Sqrt(sz2)<<", sy,sz= "<<CAMath::Sqrt(kFactor*( tParam.GetErr2Y() +  err2Y ))<<" "<<CAMath::Sqrt(kFactor*( tParam.GetErr2Z() +  err2Z ))<<std::endl;
-         //#endif
-       }
-       if( CAMath::FMulRZ(dy,dy)>sy2 || CAMath::FMulRZ(dz,dz)>sz2  ){
-         if( drawSearch ){
-           //#ifdef DRAW
-
-           std::cout<<"found hit is out of the chi2 window\n "<<std::endl;
-           //#endif
-         }
-         break; 
-       }       
+      }
+
+      ushort2 hh = hits[best];
+
+      //std::cout<<"mark 3, "<<r.fItr<<std::endl;
+      //tParam.Print();
+      tracker.GetErrors2( iRow, *( ( AliHLTTPCCATrackParam* )&tParam ), err2Y, err2Z );
+      //std::cout<<"mark 4"<<std::endl;
+
+      float y = y0 + hh.x * stepY;
+      float z = z0 + hh.y * stepZ;
+      float dy = y - fY;
+      float dz = z - fZ;
+
+      const float kFactor = tracker.Param().HitPickUpFactor() * tracker.Param().HitPickUpFactor() * 3.5 * 3.5;
+      float sy2 = kFactor * ( tParam.GetErr2Y() +  err2Y );
+      float sz2 = kFactor * ( tParam.GetErr2Z() +  err2Z );
+      if ( sy2 > 2. ) sy2 = 2.;
+      if ( sz2 > 2. ) sz2 = 2.;
+
+      if ( drawSearch ) {
+        //#ifdef DRAW
+        std::cout << "dy,sy= " << dy << " " << CAMath::Sqrt( sy2 ) << ", dz,sz= " << dz << " " << CAMath::Sqrt( sz2 ) << std::endl;
+        std::cout << "dy,dz= " << dy << " " << dz << ", sy,sz= " << CAMath::Sqrt( sy2 ) << " " << CAMath::Sqrt( sz2 ) << ", sy,sz= " << CAMath::Sqrt( kFactor*( tParam.GetErr2Y() +  err2Y ) ) << " " << CAMath::Sqrt( kFactor*( tParam.GetErr2Z() +  err2Z ) ) << std::endl;
+        //#endif
+      }
+      if ( CAMath::FMulRZ( dy, dy ) > sy2 || CAMath::FMulRZ( dz, dz ) > sz2  ) {
+        if ( drawSearch ) {
+          //#ifdef DRAW
+
+          std::cout << "found hit is out of the chi2 window\n " << std::endl;
+          //#endif
+        }
+        break;
+      }
 #ifdef DRAW
-       //if( SAVE() ) hitstore[ iRow ] = best;
-       //std::cout<<"hit search before filter: "<<r.fItr<<", row "<<iRow<<std::endl;
-       //AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kBlue);  
-       //AliHLTTPCCADisplay::Instance().Ask();
+      //if( SAVE() ) hitstore[ iRow ] = best;
+      //std::cout<<"hit search before filter: "<<r.fItr<<", row "<<iRow<<std::endl;
+      //AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kBlue);
+      //AliHLTTPCCADisplay::Instance().Ask();
 #endif
-       if( !tParam.Filter( y, z, err2Y, err2Z, .99 ) ){
-         if( drawSearch ){
-           //#ifdef DRAW
-           std::cout<<"tracklet "<<r.fItr<<" at row "<<iRow<<" : can not filter!!!! "<<std::endl;
-           //#endif
-         }
-         break;
-       }
-       if( SAVE() ) tracklet.SetRowHit( iRow, best );
-       if( drawSearch ){
-         //#ifdef DRAW
-         std::cout<<"tracklet "<<r.fItr<<" after filter at row "<<iRow<<" : "<<std::endl;
-         tParam.Print();
+      if ( !tParam.Filter( y, z, err2Y, err2Z, .99 ) ) {
+        if ( drawSearch ) {
+          //#ifdef DRAW
+          std::cout << "tracklet " << r.fItr << " at row " << iRow << " : can not filter!!!! " << std::endl;
+          //#endif
+        }
+        break;
+      }
+      if ( SAVE() ) tracklet.SetRowHit( iRow, best );
+      if ( drawSearch ) {
+        //#ifdef DRAW
+        std::cout << "tracklet " << r.fItr << " after filter at row " << iRow << " : " << std::endl;
+        tParam.Print();
 #ifdef DRAW
-         AliHLTTPCCADisplay::Instance().DrawTracklet(tParam, hitstore, kRed);  
-         AliHLTTPCCADisplay::Instance().Ask();
+        AliHLTTPCCADisplay::Instance().DrawTracklet( tParam, hitstore, kRed );
+        AliHLTTPCCADisplay::Instance().Ask();
 #endif
-       }
-       r.fNHits++;
-       r.fNMissed=0;           
-       if( r.fStage ==1 ) r.fLastRow = iRow;
-       else r.fFirstRow = iRow;
-      }while(0);
-    }
+      }
+      r.fNHits++;
+      r.fNMissed = 0;
+      if ( r.fStage == 1 ) r.fLastRow = iRow;
+      else r.fFirstRow = iRow;
+    } while ( 0 );
+  }
 }
 
 
 
 GPUd() void AliHLTTPCCATrackletConstructor::Thread
-( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
+( int nBlocks, int nThreads, int iBlock, int iThread, int iSync,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam )
-{    
+{
 
   // reconstruction of tracklets
-  if( iSync==0 )
-    {  
-      Step0( nBlocks, nThreads, iBlock, iThread, s, r, tracker, tParam );
-    }
-  else if( iSync==1 )
-    { 
-      Step1( nBlocks, nThreads, iBlock, iThread, s, r, tracker, tParam );
-    }
-  else if( iSync==2 )
-    {
-      Step2( nBlocks, nThreads, iBlock, iThread, s, r, tracker, tParam );
+  if ( iSync == 0 ) {
+    Step0( nBlocks, nThreads, iBlock, iThread, s, r, tracker, tParam );
+  } else if ( iSync == 1 ) {
+    Step1( nBlocks, nThreads, iBlock, iThread, s, r, tracker, tParam );
+  } else if ( iSync == 2 ) {
+    Step2( nBlocks, nThreads, iBlock, iThread, s, r, tracker, tParam );
+  }
+
+  else if ( iSync == 3 )
+
+  {
+    r.fCurrentData = 1;
+    ReadData( iThread, s, r, tracker, s.fMinStartRow );
+    r.fCurrentData = 0;
+    r.fNMissed = 0;
+  } else if ( iSync == 3 + 159 + 1 ) {
+    r.fCurrentData = 1;
+    int nextRow = s.fMaxStartRow - 1;
+    if ( nextRow < 0 ) nextRow = 0;
+    ReadData( iThread, s, r, tracker, nextRow );
+    r.fCurrentData = 0;
+    r.fNMissed = 0;
+    r.fStage = 2;
+    if ( r.fGo ) {
+      const AliHLTTPCCARow &row = tracker.Row( r.fEndRow );
+      float x = row.X();
+      if ( !tParam.TransportToX( x, tracker.Param().Bz(), .999 ) ) r.fGo = 0;
     }
-  
-  else if( iSync==3 )
-    
-    {
-      r.fCurrentData = 1;
-      ReadData( iThread, s, r, tracker, s.fMinStartRow );
-      r.fCurrentData = 0;
-      r.fNMissed = 0;           
+  }
+
+  else if ( iSync <= 3 + 159 + 1 + 159 ) {
+    int iRow, nextRow;
+    if (  iSync <= 3 + 159 ) {
+      iRow = iSync - 4;
+      if ( iRow < s.fMinStartRow ) return;
+      nextRow = iRow + 1;
+      if ( nextRow > 158 ) nextRow = 158;
+    } else {
+      iRow = 158 - ( iSync - 4 - 159 - 1 );
+      if ( iRow >= s.fMaxStartRow ) return;
+      nextRow = iRow - 1;
+      if ( nextRow < 0 ) nextRow = 0;
     }
-  else if( iSync==3+159 +1 )    
-    {
-      r.fCurrentData = 1;
-      Int_t nextRow = s.fMaxStartRow-1;
-      if( nextRow<0 ) nextRow = 0;
+
+    if ( r.fIsMemThread ) {
       ReadData( iThread, s, r, tracker, nextRow );
-      r.fCurrentData = 0;
-      r.fNMissed = 0;           
-      r.fStage = 2;
-      if( r.fGo ){
-       const AliHLTTPCCARow &row = tracker.Row(r.fEndRow);     
-       Float_t x = row.X();
-       if( !tParam.TransportToX( x, tracker.Param().Bz(),.999 ) ) r.fGo = 0;
-      }
-    }
-  
-  else if( iSync<=3+159+1+159 )    
-    {      
-      Int_t iRow, nextRow;
-      if(  iSync<=3+159 ){
-       iRow = iSync - 4;
-       if( iRow < s.fMinStartRow ) return;
-       nextRow = iRow+1;
-       if( nextRow>158 ) nextRow = 158;
-      }else{
-       iRow = 158 - (iSync - 4-159-1);
-       if( iRow >= s.fMaxStartRow ) return;
-       nextRow = iRow-1;
-       if( nextRow<0 ) nextRow = 0;
-      }
-      
-      if( r.fIsMemThread ){
-       ReadData( iThread, s, r, tracker, nextRow );  
-      }else{
-       UpdateTracklet( nBlocks, nThreads, iBlock, iThread,
-                       s, r, tracker, tParam, iRow );
-      }
-      r.fCurrentData = !r.fCurrentData;          
-    }    
-  
-  else if( iSync== 4+159*2 +1+1 ) //     
-    {
-      StoreTracklet( nBlocks, nThreads, iBlock, iThread, 
-                    s, r, tracker, tParam );
+    } else {
+      UpdateTracklet( nBlocks, nThreads, iBlock, iThread,
+                      s, r, tracker, tParam, iRow );
     }
+    r.fCurrentData = !r.fCurrentData;
+  }
+
+  else if ( iSync == 4 + 159*2 + 1 + 1 ) { //
+    StoreTracklet( nBlocks, nThreads, iBlock, iThread,
+                   s, r, tracker, tParam );
+  }
 }
 
index 29a7a895d0aa33842e698e1959c946b1eb107c0c..06a95d4cd27dc81e166ef2f75582a3f79c7b2b6d 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
 
 /**
  * @class AliHLTTPCCATrackletConstructor
- * 
+ *
  */
 class AliHLTTPCCATrackletConstructor
 {
- public:
 public:
 
-  class   AliHLTTPCCASharedMemory
+    class   AliHLTTPCCASharedMemory
     {
-      friend class AliHLTTPCCATrackletConstructor;
-    public:
+        friend class AliHLTTPCCATrackletConstructor;
+      public:
 #if !defined(HLTCA_GPUCODE)
-      AliHLTTPCCASharedMemory()
-       : fItr0(0), fItr1(0), fNRows(0), fUsedHits(0), fMinStartRow(0), fMaxStartRow(0)
-      {}
-
-      AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/) 
-       : fItr0(0), fItr1(0), fNRows(0), fUsedHits(0), fMinStartRow(0), fMaxStartRow(0)
-      {}
-      AliHLTTPCCASharedMemory& operator=(const AliHLTTPCCASharedMemory& /*dummy*/){ return *this; }
+        AliHLTTPCCASharedMemory()
+            : fItr0( 0 ), fItr1( 0 ), fNRows( 0 ), fUsedHits( 0 ), fMinStartRow( 0 ), fMaxStartRow( 0 ) {}
+
+        AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ )
+            : fItr0( 0 ), fItr1( 0 ), fNRows( 0 ), fUsedHits( 0 ), fMinStartRow( 0 ), fMaxStartRow( 0 ) {}
+        AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; }
 #endif
-    protected:
-      uint4 fData[2][(5000+5000+5000)/4]; // temp memory
-      Int_t fItr0; // start track index
-      Int_t fItr1; // end track index
-      Int_t fNRows; // n rows
-      Int_t *fUsedHits;   // array of used hits
-      Int_t fMinStartRow; // min start row
-      Int_t fMinStartRow32[32]; // min start row for each thread in warp
-      Int_t fMaxStartRow; // max start row
-      Int_t fMaxStartRow32[32];// max start row for each thread in warp
+      protected:
+        uint4 fData[2][( 5000+5000+5000 )/4]; // temp memory
+        int fItr0; // start track index
+        int fItr1; // end track index
+        int fNRows; // n rows
+        int *fUsedHits;   // array of used hits
+        int fMinStartRow; // min start row
+        int fMinStartRow32[32]; // min start row for each thread in warp
+        int fMaxStartRow; // max start row
+        int fMaxStartRow32[32];// max start row for each thread in warp
     };
 
-  class  AliHLTTPCCAThreadMemory
+    class  AliHLTTPCCAThreadMemory
     {
-      friend class AliHLTTPCCATrackletConstructor;
-     public:
+        friend class AliHLTTPCCATrackletConstructor;
+      public:
 #if !defined(HLTCA_GPUCODE)
-      AliHLTTPCCAThreadMemory()
-       : fItr(0), fFirstRow(0), fLastRow(0), fStartRow(0), fEndRow(0), fCurrIH(0), fIsMemThread(0), fGo(0), fSave(0), fCurrentData(0), fStage(0), fNHits(0), fNMissed(0), fLastY(0), fLastZ(0) 
-      {}
-
-      AliHLTTPCCAThreadMemory( const AliHLTTPCCAThreadMemory& /*dummy*/) 
-       : fItr(0), fFirstRow(0), fLastRow(0), fStartRow(0), fEndRow(0), fCurrIH(0), fIsMemThread(0), fGo(0), fSave(0), fCurrentData(0), fStage(0), fNHits(0), fNMissed(0), fLastY(0), fLastZ(0)
-      {}
-      AliHLTTPCCAThreadMemory& operator=(const AliHLTTPCCAThreadMemory& /*dummy*/){ return *this; }
+        AliHLTTPCCAThreadMemory()
+            : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fIsMemThread( 0 ), fGo( 0 ), fSave( 0 ), fCurrentData( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 ) {}
+
+        AliHLTTPCCAThreadMemory( const AliHLTTPCCAThreadMemory& /*dummy*/ )
+            : fItr( 0 ), fFirstRow( 0 ), fLastRow( 0 ), fStartRow( 0 ), fEndRow( 0 ), fCurrIH( 0 ), fIsMemThread( 0 ), fGo( 0 ), fSave( 0 ), fCurrentData( 0 ), fStage( 0 ), fNHits( 0 ), fNMissed( 0 ), fLastY( 0 ), fLastZ( 0 ) {}
+        AliHLTTPCCAThreadMemory& operator=( const AliHLTTPCCAThreadMemory& /*dummy*/ ) { return *this; }
 #endif
-    protected:
-      Int_t fItr; // track index
-      Int_t fFirstRow;  // first row index
-      Int_t fLastRow; // last row index
-      Int_t fStartRow;  // first row index
-      Int_t fEndRow;  // first row index
-      Int_t fCurrIH; // indef of the current hit
-      Bool_t fIsMemThread; // is the thread used for memory taken
-      Bool_t fGo; // do fit/searching flag
-      Bool_t fSave; // save flag
-      Bool_t fCurrentData; // index of the current memory array
-      Int_t fStage; // reco stage
-      Int_t fNHits; // n track hits
-      Int_t fNMissed; // n missed hits during search
-      Float_t fLastY; // Y of the last fitted cluster
-      Float_t fLastZ; // Z of the last fitted cluster
+      protected:
+        int fItr; // track index
+        int fFirstRow;  // first row index
+        int fLastRow; // last row index
+        int fStartRow;  // first row index
+        int fEndRow;  // first row index
+        int fCurrIH; // indef of the current hit
+        bool fIsMemThread; // is the thread used for memory taken
+        bool fGo; // do fit/searching flag
+        bool fSave; // save flag
+        bool fCurrentData; // index of the current memory array
+        int fStage; // reco stage
+        int fNHits; // n track hits
+        int fNMissed; // n missed hits during search
+        float fLastY; // Y of the last fitted cluster
+        float fLastZ; // Z of the last fitted cluster
     };
 
-  GPUd() static Int_t NThreadSyncPoints(){ return 4+159*2 +1+1; }  
+    GPUd() static int NThreadSyncPoints() { return 4 + 159*2 + 1 + 1; }
+
+    GPUd() static void Thread( int nBlocks, int nThreads, int iBlock, int iThread,
+                               int iSync, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r,
+                               AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam );
 
-  GPUd() static void Thread( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, 
-                            Int_t iSync, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, 
-                            AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam );
-  
-  GPUd() static void Step0
-    ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread,
+    GPUd() static void Step0
+    ( int nBlocks, int nThreads, int iBlock, int iThread,
       AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam );
-  GPUd() static void Step1
-    ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread,
+    GPUd() static void Step1
+    ( int nBlocks, int nThreads, int iBlock, int iThread,
       AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam );
-  GPUd() static void Step2
-    ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread,
+    GPUd() static void Step2
+    ( int nBlocks, int nThreads, int iBlock, int iThread,
       AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam );
 
-  GPUd() static void ReadData( Int_t iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, Int_t iRow );
+    GPUd() static void ReadData( int iThread, AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, int iRow );
 
-  GPUd() static void UpdateTracklet
-    ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread,
-      AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam, Int_t iRow );
+    GPUd() static void UpdateTracklet
+    ( int nBlocks, int nThreads, int iBlock, int iThread,
+      AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam, int iRow );
+
+    GPUd() static void StoreTracklet
+    ( int nBlocks, int nThreads, int iBlock, int iThread,
+      AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam );
 
-  GPUd() static void StoreTracklet
-    ( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread,
-      AliHLTTPCCASharedMemory &s, AliHLTTPCCAThreadMemory &r, AliHLTTPCCATracker &tracker, AliHLTTPCCATrackParam &tParam);
+    GPUd() static bool SAVE() { return 1; }
 
-  GPUd() static Bool_t SAVE(){ return 1; }
 #if defined(HLTCA_GPUCODE)
-  GPUhd() static Int_t NMemThreads(){ return 128; }
+    GPUhd() static int NMemThreads() { return 128; }
 #else
-  GPUhd() static Int_t NMemThreads(){ return 1; }
+    GPUhd() static int NMemThreads() { return 1; }
 #endif
 
 };
index 4cc920dcfcad4a91ab6fa83cc6bd9815bb7da7f3..b53f5a67f1e169e60ddd60357af5aaf088153917 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id: AliHLTTPCCATrackletSelector.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 #include "AliHLTTPCCAMath.h"
 
 GPUd() void AliHLTTPCCATrackletSelector::Thread
-( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
+( int nBlocks, int nThreads, int iBlock, int iThread, int iSync,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker )
 {
   // select best tracklets and kill clones
 
-  if( iSync==0 )
-    {
-      if( iThread==0 ){
-       if(iBlock==0){
-         CAMath::AtomicExch(tracker.NTracks(),0);
-         CAMath::AtomicExch(tracker.NTrackHits(),0);
-       }
-       s.fNTracklets = *tracker.NTracklets();
-       s.fNThreadsTotal = nThreads*nBlocks;
-       s.fItr0 = nThreads*iBlock;      
+  if ( iSync == 0 ) {
+    if ( iThread == 0 ) {
+      if ( iBlock == 0 ) {
+        CAMath::AtomicExch( tracker.NTracks(), 0 );
+        CAMath::AtomicExch( tracker.NTrackHits(), 0 );
       }
+      s.fNTracklets = *tracker.NTracklets();
+      s.fNThreadsTotal = nThreads * nBlocks;
+      s.fItr0 = nThreads * iBlock;
     }
-  else if( iSync==1 )
-    {
-      AliHLTTPCCATrack tout;
-      Int_t trackHits[160];
-       
-      for( Int_t itr= s.fItr0 + iThread; itr<s.fNTracklets; itr+=s.fNThreadsTotal ){                   
+  } else if ( iSync == 1 ) {
+    AliHLTTPCCATrack tout;
+    int trackHits[160];
 
-       AliHLTTPCCATracklet &tracklet = tracker.Tracklets()[itr];
+    for ( int itr = s.fItr0 + iThread; itr < s.fNTracklets; itr += s.fNThreadsTotal ) {
 
-       Int_t tNHits = tracklet.NHits();
-       if( tNHits<=0 ) continue;
+      AliHLTTPCCATracklet &tracklet = tracker.Tracklets()[itr];
 
-       const Int_t kMaxRowGap = 4;
-       const Float_t kMaxShared = .1;
+      int tNHits = tracklet.NHits();
+      if ( tNHits <= 0 ) continue;
 
-       Int_t firstRow = tracklet.FirstRow();
-       Int_t lastRow = tracklet.LastRow();
+      const int kMaxRowGap = 4;
+      const float kMaxShared = .1;
 
-       tout.SetNHits( 0 );
-       Int_t kind = 0;
-       if(0){ 
-         if( tNHits>=10 && 1./.5 >= CAMath::Abs(tracklet.Param().QPt()) ){ //SG!!!
-           kind = 1;
-         }    
-       }
+      int firstRow = tracklet.FirstRow();
+      int lastRow = tracklet.LastRow();
 
-       Int_t w = (kind<<29) + (tNHits<<16)+itr;
+      tout.SetNHits( 0 );
+      int kind = 0;
+      if ( 0 ) {
+        if ( tNHits >= 10 && 1. / .5 >= CAMath::Abs( tracklet.Param().QPt() ) ) { //SG!!!
+          kind = 1;
+        }
+      }
+
+      int w = ( kind << 29 ) + ( tNHits << 16 ) + itr;
+
+      //int w = (tNHits<<16)+itr;
+      //int nRows = tracker.Param().NRows();
+      int gap = 0;
+      int nShared = 0;
+      //std::cout<<" store tracklet: "<<firstRow<<" "<<lastRow<<std::endl;
+      for ( int irow = firstRow; irow <= lastRow; irow++ ) {
+        gap++;
+        int ih = tracklet.RowHit( irow );
+        if ( ih >= 0 ) {
+          int ihTot = tracker.Row( irow ).FirstHit() + ih;
+          bool own = ( tracker.HitWeights()[ihTot] <= w );
+          bool sharedOK = ( ( tout.NHits() < 0 ) || ( nShared < tout.NHits() * kMaxShared ) );
+          if ( own || sharedOK ) {//SG!!!
+            gap = 0;
+            int th = AliHLTTPCCATracker::IRowIHit2ID( irow, ih );
+            trackHits[tout.NHits()] = th;
+            tout.SetNHits( tout.NHits() + 1 );
+            if ( !own ) nShared++;
+          }
+        }
 
-       //Int_t w = (tNHits<<16)+itr;   
-       //Int_t nRows = tracker.Param().NRows();
-       Int_t gap = 0;
-       Int_t nShared = 0;
-       //std::cout<<" store tracklet: "<<firstRow<<" "<<lastRow<<std::endl;
-       for( Int_t irow=firstRow; irow<=lastRow; irow++ ){
-         gap++;
-         Int_t ih = tracklet.RowHit(irow);
-         if( ih>=0 ){
-           Int_t ihTot = tracker.Row(irow).FirstHit()+ih;
-           Bool_t own = ( tracker.HitWeights()[ihTot] <= w );
-           Bool_t sharedOK = ( (tout.NHits()<0) || (nShared<tout.NHits()*kMaxShared) );
-           if( own || sharedOK ){//SG!!!
-             gap = 0;
-             Int_t th = AliHLTTPCCATracker::IRowIHit2ID(irow,ih);
-             trackHits[tout.NHits()] = th;
-             tout.SetNHits( tout.NHits() + 1 );
-             if( !own ) nShared++;
-           }
-         }
-         
-         if( gap>kMaxRowGap || irow==lastRow ){ // store 
-           if( tout.NHits()>=10 ){ //SG!!!
-             Int_t itrout = CAMath::AtomicAdd(tracker.NTracks(),1);
-             tout.SetFirstHitID( CAMath::AtomicAdd( tracker.NTrackHits(), tout.NHits() ));
-             tout.SetParam( tracklet.Param() );
-             tout.SetAlive( 1 );
-             tracker.Tracks()[itrout] = tout;
-             for( Int_t jh=0; jh<tout.NHits(); jh++ ){
-               tracker.TrackHits()[tout.FirstHitID() + jh] = trackHits[jh];
-             }
-           }
-           tout.SetNHits( 0 ); 
-           gap = 0;
-           nShared = 0;
-         }
-       }
+        if ( gap > kMaxRowGap || irow == lastRow ) { // store
+          if ( tout.NHits() >= 10 ) { //SG!!!
+            int itrout = CAMath::AtomicAdd( tracker.NTracks(), 1 );
+            tout.SetFirstHitID( CAMath::AtomicAdd( tracker.NTrackHits(), tout.NHits() ) );
+            tout.SetParam( tracklet.Param() );
+            tout.SetAlive( 1 );
+            tracker.Tracks()[itrout] = tout;
+            for ( int jh = 0; jh < tout.NHits(); jh++ ) {
+              tracker.TrackHits()[tout.FirstHitID() + jh] = trackHits[jh];
+            }
+          }
+          tout.SetNHits( 0 );
+          gap = 0;
+          nShared = 0;
+        }
       }
     }
+  }
 }
index 833e3e211cea0dd544998671ed3f0ae7eb6b6652..f46faaab666caaf779efa1d1369f5f85c001aefd 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -15,25 +15,25 @@ class AliHLTTPCCATracker;
 
 /**
  * @class AliHLTTPCCATrackletSelector
- * 
+ *
  */
 class AliHLTTPCCATrackletSelector
 {
- public:
-  class AliHLTTPCCASharedMemory
 public:
+    class AliHLTTPCCASharedMemory
     {
-      friend class AliHLTTPCCATrackletSelector;
-    protected:
-      Int_t fItr0; // index of the first track in the block
-      Int_t fNThreadsTotal; // total n threads
-      Int_t fNTracklets; // n of tracklets
+        friend class AliHLTTPCCATrackletSelector;
+      protected:
+        int fItr0; // index of the first track in the block
+        int fNThreadsTotal; // total n threads
+        int fNTracklets; // n of tracklets
     };
 
-  GPUd() static Int_t NThreadSyncPoints(){ return 1; }  
-  
-  GPUd() static void Thread( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
-                            AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
-  
+    GPUd() static int NThreadSyncPoints() { return 1; }
+
+    GPUd() static void Thread( int nBlocks, int nThreads, int iBlock, int iThread, int iSync,
+                               AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
+
 };
 
 
index 7301253d63cc343b97a978920509b4a2f56f4365..b0248ab0d17237b6b59b4afe24f314af6d48e9b4 100644 (file)
@@ -1,6 +1,6 @@
 // @(#) $Id: AliHLTTPCCAUsedHitsInitialiser.cxx 27042 2008-07-02 12:06:02Z richterm $
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 
 
 void AliHLTTPCCAUsedHitsInitialiser::Thread
-( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
+( int nBlocks, int nThreads, int iBlock, int iThread, int iSync,
   AliHLTTPCCASharedMemory &s, AliHLTTPCCATracker &tracker )
 {
   // initialise used hit flags with 0
 
-  if( iSync==0 )
-    {
-      if( iThread==0 ){
-       s.fNHits = tracker.NHitsTotal();
-       s.fUsedHits = tracker.HitWeights();
-       s.fNThreadsTotal = nThreads*nBlocks;
-       s.fIh0 = nThreads*iBlock;
-      }
-    } 
-  else if( iSync==1 )
-    {
-      for( Int_t ih=s.fIh0 + iThread; ih<s.fNHits; ih+=s.fNThreadsTotal ) s.fUsedHits[ih] = 0;       
+  if ( iSync == 0 ) {
+    if ( iThread == 0 ) {
+      s.fNHits = tracker.NHitsTotal();
+      s.fUsedHits = tracker.HitWeights();
+      s.fNThreadsTotal = nThreads * nBlocks;
+      s.fIh0 = nThreads * iBlock;
     }
+  } else if ( iSync == 1 ) {
+    for ( int ih = s.fIh0 + iThread; ih < s.fNHits; ih += s.fNThreadsTotal ) s.fUsedHits[ih] = 0;
+  }
 }
 
index 1b213ec5c6a41d59bdc264287683b6633a894037..c680e06182df354cd5802ddee40086e41ededb27 100644 (file)
@@ -1,6 +1,6 @@
 //-*- Mode: C++ -*-
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -16,36 +16,34 @@ class AliHLTTPCCATracker;
 
 /**
  * @class AliHLTTPCCAUsedHitsInitialiser
- * 
+ *
  */
 class AliHLTTPCCAUsedHitsInitialiser
 {
- public:
-  class AliHLTTPCCASharedMemory
 public:
+    class AliHLTTPCCASharedMemory
     {
-      friend class AliHLTTPCCAUsedHitsInitialiser;
-     public:
+        friend class AliHLTTPCCAUsedHitsInitialiser;
+      public:
 #if !defined(HLTCA_GPUCODE)
-      AliHLTTPCCASharedMemory()
-       : fNHits(0), fUsedHits(0), fNThreadsTotal(0), fIh0(0)
-      {}
-
-      AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/) 
-       : fNHits(0), fUsedHits(0), fNThreadsTotal(0), fIh0(0)
-      {}
-      AliHLTTPCCASharedMemory& operator=(const AliHLTTPCCASharedMemory& /*dummy*/){ return *this; }
+        AliHLTTPCCASharedMemory()
+            : fNHits( 0 ), fUsedHits( 0 ), fNThreadsTotal( 0 ), fIh0( 0 ) {}
+
+        AliHLTTPCCASharedMemory( const AliHLTTPCCASharedMemory& /*dummy*/ )
+            : fNHits( 0 ), fUsedHits( 0 ), fNThreadsTotal( 0 ), fIh0( 0 ) {}
+        AliHLTTPCCASharedMemory& operator=( const AliHLTTPCCASharedMemory& /*dummy*/ ) { return *this; }
 #endif
-    protected:
-      Int_t fNHits; // n hits
-      Int_t *fUsedHits; // pointer to the used hits array
-      Int_t fNThreadsTotal; // total n threads
-      Int_t fIh0; // start hit index for the thread
-     };
+      protected:
+        int fNHits; // n hits
+        int *fUsedHits; // pointer to the used hits array
+        int fNThreadsTotal; // total n threads
+        int fIh0; // start hit index for the thread
+    };
 
-  GPUd() static Int_t NThreadSyncPoints(){ return 3; }  
+    GPUd() static int NThreadSyncPoints() { return 3; }
 
-  GPUd() static void Thread( Int_t nBlocks, Int_t nThreads, Int_t iBlock, Int_t iThread, Int_t iSync,
-                            AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );  
+    GPUd() static void Thread( int nBlocks, int nThreads, int iBlock, int iThread, int iSync,
+                               AliHLTTPCCASharedMemory &smem, AliHLTTPCCATracker &tracker );
 
 };
 
index 88a7f981b019c38107765b153ae487c7be0b5d1c..94dbac3dcefec92f3dc8ba3bee74e6dde94f97ab 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 // **************************************************************************
-// This file is property of and copyright by the ALICE HLT Project          * 
+// This file is property of and copyright by the ALICE HLT Project          *
 // ALICE Experiment at CERN, All rights reserved.                           *
 //                                                                          *
 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
 
 //#include <fstream.h>
 
-ClassImp(AliTPCtrackerCA)
+ClassImp( AliTPCtrackerCA )
 
 AliTPCtrackerCA::AliTPCtrackerCA()
-  :AliTracker(),fkParam(0), fClusters(0), fNClusters(0), fHLTTracker(0),fDoHLTPerformance(0),fDoHLTPerformanceClusters(0),fStatNEvents(0)
+    : AliTracker(), fkParam( 0 ), fClusters( 0 ), fNClusters( 0 ), fHLTTracker( 0 ), fDoHLTPerformance( 0 ), fDoHLTPerformanceClusters( 0 ), fStatNEvents( 0 )
 {
   //* default constructor
 }
 
-AliTPCtrackerCA::AliTPCtrackerCA(const AliTPCtrackerCA &):
-  AliTracker(),fkParam(0), fClusters(0), fNClusters(0), fHLTTracker(0),fDoHLTPerformance(0),fDoHLTPerformanceClusters(0),fStatNEvents(0)
+AliTPCtrackerCA::AliTPCtrackerCA( const AliTPCtrackerCA & ):
+    AliTracker(), fkParam( 0 ), fClusters( 0 ), fNClusters( 0 ), fHLTTracker( 0 ), fDoHLTPerformance( 0 ), fDoHLTPerformanceClusters( 0 ), fStatNEvents( 0 )
 {
   //* dummy
 }
 
-const AliTPCtrackerCA & AliTPCtrackerCA::operator=(const AliTPCtrackerCA& ) const
+const AliTPCtrackerCA & AliTPCtrackerCA::operator=( const AliTPCtrackerCA& ) const
 {
-  //* dummy 
+  //* dummy
   return *this;
 }
 
 
-AliTPCtrackerCA::~AliTPCtrackerCA() 
+AliTPCtrackerCA::~AliTPCtrackerCA()
 {
   //* destructor
-  if( fClusters ) delete[] fClusters;
-  if( fHLTTracker ) delete fHLTTracker;
+  if ( fClusters ) delete[] fClusters;
+  if ( fHLTTracker ) delete fHLTTracker;
 }
 
 //#include "AliHLTTPCCADisplay.h"
 
-AliTPCtrackerCA::AliTPCtrackerCA(const AliTPCParam *par): 
-  AliTracker(),fkParam(par), fClusters(0), fNClusters(0), fHLTTracker(0),fDoHLTPerformance(0),fDoHLTPerformanceClusters(0),fStatNEvents(0)
+AliTPCtrackerCA::AliTPCtrackerCA( const AliTPCParam *par ):
+    AliTracker(), fkParam( par ), fClusters( 0 ), fNClusters( 0 ), fHLTTracker( 0 ), fDoHLTPerformance( 0 ), fDoHLTPerformanceClusters( 0 ), fStatNEvents( 0 )
 {
   //* constructor
+
   fDoHLTPerformance = 0;
   fDoHLTPerformanceClusters = 0;
 
   fHLTTracker = new AliHLTTPCCAGBTracker;
-  fHLTTracker->SetNSlices( fkParam->GetNSector()/2 );
+  fHLTTracker->SetNSlices( fkParam->GetNSector() / 2 );
 
-  if( fDoHLTPerformance ){
+  if ( fDoHLTPerformance ) {
     AliHLTTPCCAPerformance::Instance().SetTracker( fHLTTracker );
   }
 
-  for( Int_t iSlice=0; iSlice<fHLTTracker->NSlices(); iSlice++ ){
-
-    const Double_t kCLight = 0.000299792458;
-
-    Float_t bz = AliTracker::GetBz()*kCLight;
-
-    Float_t inRmin = fkParam->GetInnerRadiusLow();
-    //Float_t inRmax = fkParam->GetInnerRadiusUp();
-    //Float_t outRmin = fkParam->GetOuterRadiusLow(); 
-    Float_t outRmax = fkParam->GetOuterRadiusUp();
-    Float_t plusZmin = 0.0529937; 
-    Float_t plusZmax = 249.778; 
-    Float_t minusZmin = -249.645; 
-    Float_t minusZmax = -0.0799937; 
-    Float_t dalpha = 0.349066;
-    Float_t alpha = 0.174533 + dalpha*iSlice;
-    
-    Bool_t zPlus = (iSlice<18 );
-    Float_t zMin =  zPlus ?plusZmin :minusZmin;
-    Float_t zMax =  zPlus ?plusZmax :minusZmax;
-    //TPCZmin = -249.645, ZMax = 249.778    
-    //Float_t rMin =  inRmin;
-    //Float_t rMax =  outRmax;
-        
-    Float_t padPitch = 0.4;
-    Float_t sigmaZ = 0.228808;
-
-    Int_t nRows = fkParam->GetNRowLow()+fkParam->GetNRowUp();
-    Float_t rowX[200];
-    for( Int_t irow=0; irow<fkParam->GetNRowLow(); irow++){
-      rowX[irow] = fkParam->GetPadRowRadiiLow(irow);
-    }     
-    for( Int_t irow=0; irow<fkParam->GetNRowUp(); irow++){
-      rowX[fkParam->GetNRowLow()+irow] = fkParam->GetPadRowRadiiUp(irow);
+  for ( int iSlice = 0; iSlice < fHLTTracker->NSlices(); iSlice++ ) {
+
+    const double kCLight = 0.000299792458;
+
+    float bz = AliTracker::GetBz() * kCLight;
+
+    float inRmin = fkParam->GetInnerRadiusLow();
+    //float inRmax = fkParam->GetInnerRadiusUp();
+    //float outRmin = fkParam->GetOuterRadiusLow();
+    float outRmax = fkParam->GetOuterRadiusUp();
+    float plusZmin = 0.0529937;
+    float plusZmax = 249.778;
+    float minusZmin = -249.645;
+    float minusZmax = -0.0799937;
+    float dalpha = 0.349066;
+    float alpha = 0.174533 + dalpha * iSlice;
+
+    bool zPlus = ( iSlice < 18 );
+    float zMin =  zPlus ? plusZmin : minusZmin;
+    float zMax =  zPlus ? plusZmax : minusZmax;
+    //TPCZmin = -249.645, ZMax = 249.778
+    //float rMin =  inRmin;
+    //float rMax =  outRmax;
+
+    float padPitch = 0.4;
+    float sigmaZ = 0.228808;
+
+    int nRows = fkParam->GetNRowLow() + fkParam->GetNRowUp();
+    float rowX[200];
+    for ( int irow = 0; irow < fkParam->GetNRowLow(); irow++ ) {
+      rowX[irow] = fkParam->GetPadRowRadiiLow( irow );
+    }
+    for ( int irow = 0; irow < fkParam->GetNRowUp(); irow++ ) {
+      rowX[fkParam->GetNRowLow()+irow] = fkParam->GetPadRowRadiiUp( irow );
     }
     AliHLTTPCCAParam param;
     param.Initialize( iSlice, nRows, rowX, alpha, dalpha,
-                     inRmin, outRmax, zMin, zMax, padPitch, sigmaZ, bz );
+                      inRmin, outRmax, zMin, zMax, padPitch, sigmaZ, bz );
     param.SetHitPickUpFactor( 1. );
     param.SetMaxTrackMatchDRow( 5 );
     param.SetTrackConnectionFactor( 3.5 );
 
     AliTPCClusterParam * clparam = AliTPCcalibDB::Instance()->GetClusterParam();
-    for( Int_t iRow=0; iRow<nRows; iRow++ ){
-      Int_t    type = (iRow<63) ? 0: ( (iRow>126) ? 1:2 );
-      for( int iyz=0; iyz<2; iyz++ ){
-       for( int k=0; k<7; k++ ){
-         //std::cout<<param.fParamS0Par[iyz][type][k]<<" "<<clparam->fParamS0Par[iyz][type][k] - param.fParamS0Par[iyz][type][k]<<std::endl;
-         param.SetParamS0Par(iyz,type,k,clparam->fParamS0Par[iyz][type][k]);
-       }
+    for ( int iRow = 0; iRow < nRows; iRow++ ) {
+      int    type = ( iRow < 63 ) ? 0 : ( ( iRow > 126 ) ? 1 : 2 );
+      for ( int iyz = 0; iyz < 2; iyz++ ) {
+        for ( int k = 0; k < 7; k++ ) {
+          //std::cout<<param.fParamS0Par[iyz][type][k]<<" "<<clparam->fParamS0Par[iyz][type][k] - param.fParamS0Par[iyz][type][k]<<std::endl;
+          param.SetParamS0Par( iyz, type, k, clparam->fParamS0Par[iyz][type][k] );
+        }
       }
     }
-    fHLTTracker->Slices()[iSlice].Initialize( param ); 
+    fHLTTracker->Slices()[iSlice].Initialize( param );
   }
 }
 
 
 
-Int_t AliTPCtrackerCA::LoadClusters (TTree * fromTree)
-{ 
+int AliTPCtrackerCA::LoadClusters ( TTree * fromTree )
+{
   // load clusters to the local arrays
   fNClusters = 0;
-  if( fClusters ) delete[] fClusters;
+  if ( fClusters ) delete[] fClusters;
 
   fHLTTracker->StartEvent();
-  if( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().StartEvent();
+  if ( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().StartEvent();
 
-  if( !fkParam ) return 1;
+  if ( !fkParam ) return 1;
 
   // load mc tracks
-  while( fDoHLTPerformance ){
-    if( !gAlice ) break;
-    AliRunLoader *rl = AliRunLoader::Instance();//gAlice->GetRunLoader(); 
-    if( !rl ) break;
+  while ( fDoHLTPerformance ) {
+    if ( !gAlice ) break;
+    AliRunLoader *rl = AliRunLoader::Instance();//gAlice->GetRunLoader();
+    if ( !rl ) break;
     rl->LoadKinematics();
     AliStack *stack = rl->Stack();
-    if( !stack ) break;
+    if ( !stack ) break;
 
     AliHLTTPCCAPerformance::Instance().SetNMCTracks( stack->GetNtrack() );
-    
-    for( Int_t itr=0; itr<stack->GetNtrack(); itr++ ){
-      TParticle *part = stack->Particle(itr);
+
+    for ( int itr = 0; itr < stack->GetNtrack(); itr++ ) {
+      TParticle *part = stack->Particle( itr );
       AliHLTTPCCAPerformance::Instance().ReadMCTrack( itr, part );
     }
 
     { // check for MC tracks at the TPC entrance
 
-      Bool_t *isTPC = 0;
-      isTPC = new Bool_t [stack->GetNtrack()];
-      for( Int_t i=0; i<stack->GetNtrack(); i++ ) isTPC[i] = 0;
+      bool *isTPC = 0;
+      isTPC = new bool [stack->GetNtrack()];
+      for ( int i = 0; i < stack->GetNtrack(); i++ ) isTPC[i] = 0;
       rl->LoadTrackRefs();
       TTree *mcTree = rl->TreeTR();
-      if( !mcTree ) break;
-      TBranch *branch=mcTree->GetBranch("TrackReferences");
-      if (!branch ) break;     
-      TClonesArray tpcdummy("AliTrackReference",1000), *tpcRefs=&tpcdummy;
-      branch->SetAddress(&tpcRefs);
-      Int_t nr=(Int_t)mcTree->GetEntries();
-      for (Int_t r=0; r<nr; r++) {
-       mcTree->GetEvent(r);
-       Int_t nref = tpcRefs->GetEntriesFast();
-       if (!nref) continue;
-       AliTrackReference *tpcRef= 0x0;  
-       for (Int_t iref=0; iref<nref; ++iref) {
-         tpcRef = (AliTrackReference*)tpcRefs->UncheckedAt(iref);
-         if (tpcRef->DetectorId() == AliTrackReference::kTPC) break;
-         tpcRef = 0x0;
-       }
-       if (!tpcRef) continue;
-
-       if( isTPC[tpcRef->Label()] ) continue;  
-
-       AliHLTTPCCAPerformance::Instance().ReadMCTPCTrack(tpcRef->Label(),
-                                       tpcRef->X(),tpcRef->Y(),tpcRef->Z(),
-                                       tpcRef->Px(),tpcRef->Py(),tpcRef->Pz() );
-       isTPC[tpcRef->Label()] = 1;
-       tpcRefs->Clear();
-      }        
-      if( isTPC ) delete[] isTPC;
+      if ( !mcTree ) break;
+      TBranch *branch = mcTree->GetBranch( "TrackReferences" );
+      if ( !branch ) break;
+      TClonesArray tpcdummy( "AliTrackReference", 1000 ), *tpcRefs = &tpcdummy;
+      branch->SetAddress( &tpcRefs );
+      int nr = ( int )mcTree->GetEntries();
+      for ( int r = 0; r < nr; r++ ) {
+        mcTree->GetEvent( r );
+        int nref = tpcRefs->GetEntriesFast();
+        if ( !nref ) continue;
+        AliTrackReference *tpcRef = 0x0;
+        for ( int iref = 0; iref < nref; ++iref ) {
+          tpcRef = ( AliTrackReference* )tpcRefs->UncheckedAt( iref );
+          if ( tpcRef->DetectorId() == AliTrackReference::kTPC ) break;
+          tpcRef = 0x0;
+        }
+        if ( !tpcRef ) continue;
+
+        if ( isTPC[tpcRef->Label()] ) continue;
+
+        AliHLTTPCCAPerformance::Instance().ReadMCTPCTrack( tpcRef->Label(),
+            tpcRef->X(), tpcRef->Y(), tpcRef->Z(),
+            tpcRef->Px(), tpcRef->Py(), tpcRef->Pz() );
+        isTPC[tpcRef->Label()] = 1;
+        tpcRefs->Clear();
+      }
+      if ( isTPC ) delete[] isTPC;
     }
 
-    while( fDoHLTPerformanceClusters ){
-      AliTPCLoader *tpcl = (AliTPCLoader*) rl->GetDetectorLoader("TPC");
-      if( !tpcl ) break;
-      if( tpcl->TreeH() == 0x0 ){
-       if( tpcl->LoadHits() ) break;
+    while ( fDoHLTPerformanceClusters ) {
+      AliTPCLoader *tpcl = ( AliTPCLoader* ) rl->GetDetectorLoader( "TPC" );
+      if ( !tpcl ) break;
+      if ( tpcl->TreeH() == 0x0 ) {
+        if ( tpcl->LoadHits() ) break;
       }
-      if( tpcl->TreeH() == 0x0 ) break;
-      
-      AliTPC *tpc = (AliTPC*) gAlice->GetDetector("TPC");
-      Int_t nEnt=(Int_t)tpcl->TreeH()->GetEntries();
-      Int_t nPoints = 0;
-      for (Int_t iEnt=0; iEnt<nEnt; iEnt++) {    
-       tpc->ResetHits();
-       tpcl->TreeH()->GetEvent(iEnt);
-       AliTPChit *phit = (AliTPChit*)tpc->FirstHit(-1);
-       for ( ; phit; phit=(AliTPChit*)tpc->NextHit() ) nPoints++;
+      if ( tpcl->TreeH() == 0x0 ) break;
+
+      AliTPC *tpc = ( AliTPC* ) gAlice->GetDetector( "TPC" );
+      int nEnt = ( int )tpcl->TreeH()->GetEntries();
+      int nPoints = 0;
+      for ( int iEnt = 0; iEnt < nEnt; iEnt++ ) {
+        tpc->ResetHits();
+        tpcl->TreeH()->GetEvent( iEnt );
+        AliTPChit *phit = ( AliTPChit* )tpc->FirstHit( -1 );
+        for ( ; phit; phit = ( AliTPChit* )tpc->NextHit() ) nPoints++;
       }
       AliHLTTPCCAPerformance::Instance().SetNMCPoints( nPoints );
 
-      for (Int_t iEnt=0; iEnt<nEnt; iEnt++) {    
-       tpc->ResetHits();
-       tpcl->TreeH()->GetEvent(iEnt);
-       AliTPChit *phit = (AliTPChit*)tpc->FirstHit(-1);
-       for ( ; phit; phit=(AliTPChit*)tpc->NextHit() ){
-         AliHLTTPCCAPerformance::Instance().ReadMCPoint( phit->GetTrack(),phit->X(), phit->Y(),phit->Z(),phit->Time(), phit->fSector%36);
-       }      
+      for ( int iEnt = 0; iEnt < nEnt; iEnt++ ) {
+        tpc->ResetHits();
+        tpcl->TreeH()->GetEvent( iEnt );
+        AliTPChit *phit = ( AliTPChit* )tpc->FirstHit( -1 );
+        for ( ; phit; phit = ( AliTPChit* )tpc->NextHit() ) {
+          AliHLTTPCCAPerformance::Instance().ReadMCPoint( phit->GetTrack(), phit->X(), phit->Y(), phit->Z(), phit->Time(), phit->fSector % 36 );
+        }
       }
       break;
     }
     break;
   }
-  
-  TBranch * br = fromTree->GetBranch("Segment");
-  if( !br ) return 1;
+
+  TBranch * br = fromTree->GetBranch( "Segment" );
+  if ( !br ) return 1;
 
   AliTPCClustersRow *clrow = new AliTPCClustersRow;
-  clrow->SetClass("AliTPCclusterMI");
-  clrow->SetArray(0);
-  clrow->GetArray()->ExpandCreateFast(10000);
-  
-  br->SetAddress(&clrow);
-  
+  clrow->SetClass( "AliTPCclusterMI" );
+  clrow->SetArray( 0 );
+  clrow->GetArray()->ExpandCreateFast( 10000 );
+
+  br->SetAddress( &clrow );
+
   //
-  Int_t nEnt=Int_t(fromTree->GetEntries());
+  int nEnt = int( fromTree->GetEntries() );
 
   fNClusters = 0;
-  for (Int_t i=0; i<nEnt; i++) {
-    br->GetEntry(i);
-    Int_t sec,row;
-    fkParam->AdjustSectorRow(clrow->GetID(),sec,row);
+  for ( int i = 0; i < nEnt; i++ ) {
+    br->GetEntry( i );
+    int sec, row;
+    fkParam->AdjustSectorRow( clrow->GetID(), sec, row );
     fNClusters += clrow->GetArray()->GetEntriesFast();
   }
 
   fClusters = new AliTPCclusterMI [fNClusters];
   fHLTTracker->SetNHits( fNClusters );
-  if( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().SetNHits( fNClusters );
-  Int_t ind=0;
-  for (Int_t i=0; i<nEnt; i++) {
-    br->GetEntry(i);
-    Int_t sec,row;
-    fkParam->AdjustSectorRow(clrow->GetID(),sec,row);
-    Int_t nClu = clrow->GetArray()->GetEntriesFast();
-    Float_t x = fkParam->GetPadRowRadii(sec,row);
-    for (Int_t icl=0; icl<nClu; icl++){
-      Int_t lab0 = -1;
-      Int_t lab1 = -1;
-      Int_t lab2 = -1;
-      AliTPCclusterMI* cluster = (AliTPCclusterMI*)(clrow->GetArray()->At(icl));
-      if( !cluster ) continue;
-      lab0 = cluster->GetLabel(0);
-      lab1 = cluster->GetLabel(1);
-      lab2 = cluster->GetLabel(2);
+  if ( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().SetNHits( fNClusters );
+  int ind = 0;
+  for ( int i = 0; i < nEnt; i++ ) {
+    br->GetEntry( i );
+    int sec, row;
+    fkParam->AdjustSectorRow( clrow->GetID(), sec, row );
+    int nClu = clrow->GetArray()->GetEntriesFast();
+    float x = fkParam->GetPadRowRadii( sec, row );
+    for ( int icl = 0; icl < nClu; icl++ ) {
+      int lab0 = -1;
+      int lab1 = -1;
+      int lab2 = -1;
+      AliTPCclusterMI* cluster = ( AliTPCclusterMI* )( clrow->GetArray()->At( icl ) );
+      if ( !cluster ) continue;
+      lab0 = cluster->GetLabel( 0 );
+      lab1 = cluster->GetLabel( 1 );
+      lab2 = cluster->GetLabel( 2 );
 
       AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
-      if (!transform) {
-       AliFatal("Tranformations not in calibDB");
+      if ( !transform ) {
+        AliFatal( "Tranformations not in calibDB" );
       }
-      Double_t xx[3]={cluster->GetRow(),cluster->GetPad(),cluster->GetTimeBin()};
-      Int_t id[1]={cluster->GetDetector()};
-      transform->Transform(xx,id,0,1);  
+      double xx[3] = {cluster->GetRow(), cluster->GetPad(), cluster->GetTimeBin()};
+      int id[1] = {cluster->GetDetector()};
+      transform->Transform( xx, id, 0, 1 );
       //if (!AliTPCReconstructor::GetRecoParam()->GetBYMirror()){
       //if (cluster->GetDetector()%36>17){
       //xx[1]*=-1;
       //}
       //}
 
-      cluster->SetX(xx[0]);
-      cluster->SetY(xx[1]);
-      cluster->SetZ(xx[2]);
+      cluster->SetX( xx[0] );
+      cluster->SetY( xx[1] );
+      cluster->SetZ( xx[2] );
 
-      TGeoHMatrix  *mat = fkParam->GetClusterMatrix(cluster->GetDetector());
-      Double_t pos[3]= {cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-      Double_t posC[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-      if (mat) mat->LocalToMaster(pos,posC);
-      else{
-       // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
+      TGeoHMatrix  *mat = fkParam->GetClusterMatrix( cluster->GetDetector() );
+      double pos[3] = {cluster->GetX(), cluster->GetY(), cluster->GetZ()};
+      double posC[3] = {cluster->GetX(), cluster->GetY(), cluster->GetZ()};
+      if ( mat ) mat->LocalToMaster( pos, posC );
+      else {
+        // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
       }
-      cluster->SetX(posC[0]);
-      cluster->SetY(posC[1]);
-      cluster->SetZ(posC[2]);
+      cluster->SetX( posC[0] );
+      cluster->SetY( posC[1] );
+      cluster->SetZ( posC[2] );
 
       x = cluster->GetX();
-      Float_t y = cluster->GetY();
-      Float_t z = cluster->GetZ();        
+      float y = cluster->GetY();
+      float z = cluster->GetZ();
 
-      if( sec>=36 ){
-       sec = sec - 36;
-       row = row + fkParam->GetNRowLow(); 
+      if ( sec >= 36 ) {
+        sec = sec - 36;
+        row = row + fkParam->GetNRowLow();
       }
-      
-      Int_t index = ind++;
+
+      int index = ind++;
       fClusters[index] = *cluster;
-      fHLTTracker->ReadHit( x, y, z, 
-                           TMath::Sqrt(cluster->GetSigmaY2()), TMath::Sqrt(cluster->GetSigmaZ2()),                         
-                           cluster->GetMax(), index, sec, row );
-      if( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().ReadHitLabel(index, lab0, lab1, lab2 );
+      fHLTTracker->ReadHit( x, y, z,
+                            TMath::Sqrt( cluster->GetSigmaY2() ), TMath::Sqrt( cluster->GetSigmaZ2() ),
+                            cluster->GetMax(), index, sec, row );
+      if ( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().ReadHitLabel( index, lab0, lab1, lab2 );
     }
   }
   delete clrow;
   return 0;
 }
 
-AliCluster * AliTPCtrackerCA::GetCluster(Int_t index) const
+AliCluster * AliTPCtrackerCA::GetCluster( int index ) const
 {
-  return &(fClusters[index]);
+  return &( fClusters[index] );
 }
 
-Int_t AliTPCtrackerCA::Clusters2Tracks( AliESDEvent *event )
+int AliTPCtrackerCA::Clusters2Tracks( AliESDEvent *event )
 {
   // reconstruction
   //cout<<"Start of AliTPCtrackerCA"<<endl;
@@ -355,135 +355,135 @@ Int_t AliTPCtrackerCA::Clusters2Tracks( AliESDEvent *event )
 
   fHLTTracker->FindTracks();
   //cout<<"Do performance.."<<endl;
-  if( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().Performance();
+  if ( fDoHLTPerformance ) AliHLTTPCCAPerformance::Instance().Performance();
 
-  if( 0 ) {// Write Event    
-    if( fStatNEvents == 0 ){
+  if ( 0 ) {// Write Event
+    if ( fStatNEvents == 0 ) {
       fstream geo;
-      geo.open("CAEvents/settings.dat", ios::out);
-      if( geo.is_open() ){
-       fHLTTracker->WriteSettings(geo);        
+      geo.open( "CAEvents/settings.dat", ios::out );
+      if ( geo.is_open() ) {
+        fHLTTracker->WriteSettings( geo );
       }
       geo.close();
     }
 
     fstream hits;
     char name[255];
-    sprintf( name,"CAEvents/%i.event.dat",fStatNEvents ); 
-    hits.open(name, ios::out);
-    if( hits.is_open() ){
-      fHLTTracker->WriteEvent(hits);   
+    sprintf( name, "CAEvents/%i.event.dat", fStatNEvents );
+    hits.open( name, ios::out );
+    if ( hits.is_open() ) {
+      fHLTTracker->WriteEvent( hits );
       fstream tracks;
-      sprintf( name,"CAEvents/%i.tracks.dat",fStatNEvents ); 
-      tracks.open(name, ios::out);
-      fHLTTracker->WriteTracks(tracks);        
+      sprintf( name, "CAEvents/%i.tracks.dat", fStatNEvents );
+      tracks.open( name, ios::out );
+      fHLTTracker->WriteTracks( tracks );
     }
-    hits.close();   
-    if( fDoHLTPerformance ){
+    hits.close();
+    if ( fDoHLTPerformance ) {
       fstream mcevent, mcpoints;
       char mcname[255];
-      sprintf( mcname,"CAEvents/%i.mcevent.dat",fStatNEvents ); 
-      mcevent.open(mcname, ios::out);
-      if( mcevent.is_open() ){      
-       AliHLTTPCCAPerformance::Instance().WriteMCEvent(mcevent);
+      sprintf( mcname, "CAEvents/%i.mcevent.dat", fStatNEvents );
+      mcevent.open( mcname, ios::out );
+      if ( mcevent.is_open() ) {
+        AliHLTTPCCAPerformance::Instance().WriteMCEvent( mcevent );
       }
-      if(1 && fDoHLTPerformanceClusters ){
-       sprintf( mcname,"CAEvents/%i.mcpoints.dat",fStatNEvents ); 
-       mcpoints.open(mcname, ios::out);
-       if( mcpoints.is_open() ){      
-         AliHLTTPCCAPerformance::Instance().WriteMCPoints(mcpoints);
-       }
-       mcpoints.close();
+      if ( 1 && fDoHLTPerformanceClusters ) {
+        sprintf( mcname, "CAEvents/%i.mcpoints.dat", fStatNEvents );
+        mcpoints.open( mcname, ios::out );
+        if ( mcpoints.is_open() ) {
+          AliHLTTPCCAPerformance::Instance().WriteMCPoints( mcpoints );
+        }
+        mcpoints.close();
       }
-      mcevent.close();   
+      mcevent.close();
     }
   }
   fStatNEvents++;
 
-  if( event ){
-   
-    for( Int_t itr=0; itr<fHLTTracker->NTracks(); itr++ ){
+  if ( event ) {
+
+    for ( int itr = 0; itr < fHLTTracker->NTracks(); itr++ ) {
       //AliTPCtrack tTPC;
       AliTPCseed tTPC;
       AliHLTTPCCAGBTrack &tCA = fHLTTracker->Tracks()[itr];
-      AliHLTTPCCATrackParam par = tCA.Param(); 
+      AliHLTTPCCATrackParam par = tCA.Param();
       AliHLTTPCCATrackConvertor::GetExtParam( par, tTPC, tCA.Alpha() );
-      tTPC.SetMass(0.13957);
+      tTPC.SetMass( 0.13957 );
       tTPC.SetdEdx( tCA.DeDx() );
-      if( TMath::Abs(tTPC.GetSigned1Pt())>1./0.02 ) continue;
-      Int_t nhits = tCA.NHits();
-      Int_t firstHit=0;
-      if( nhits>160 ){
-       firstHit = nhits-160;
-       nhits=160;
+      if ( TMath::Abs( tTPC.GetSigned1Pt() ) > 1. / 0.02 ) continue;
+      int nhits = tCA.NHits();
+      int firstHit = 0;
+      if ( nhits > 160 ) {
+        firstHit = nhits - 160;
+        nhits = 160;
       }
 
-      tTPC.SetNumberOfClusters(nhits);
-      Float_t alpha = tCA.Alpha();      
+      tTPC.SetNumberOfClusters( nhits );
+
+      float alpha = tCA.Alpha();
       AliHLTTPCCATrackParam t0 = par;
-      for( Int_t ih=0; ih<nhits; ih++ ){
-       Int_t index = fHLTTracker->TrackHits()[tCA.FirstHitRef()+firstHit+ih];
-       AliHLTTPCCAGBHit &h = fHLTTracker->Hits()[index];
-       Int_t extIndex = h.ID();
-       tTPC.SetClusterIndex(ih, extIndex);
-               
-       AliTPCclusterMI *c = &(fClusters[extIndex]);
-       tTPC.SetClusterPointer(h.IRow(), c );
-       AliTPCTrackerPoint &point = *(tTPC.GetTrackPoint(h.IRow()));
-       {
-         Int_t iSlice = h.ISlice();
-         AliHLTTPCCATracker &slice = fHLTTracker->Slices()[iSlice];
-         if( slice.Param().Alpha()!=alpha ){
-           if( ! t0.Rotate(  slice.Param().Alpha() - alpha, .999 ) ) continue;
-           alpha = slice.Param().Alpha();
-         }
-         Float_t x = slice.Row(h.IRow()).X();
-         if( !t0.TransportToX( x, fHLTTracker->Slices()[0].Param().GetBz(t0),.999 ) ) continue;
-         Float_t sy2, sz2;
-         slice.GetErrors2( h.IRow(), t0, sy2, sz2 );
-         point.SetSigmaY(c->GetSigmaY2()/sy2);
-         point.SetSigmaZ(c->GetSigmaZ2()/sz2);
-         point.SetAngleY(TMath::Abs(t0.GetSinPhi()/t0.GetCosPhi()));
-         point.SetAngleZ(TMath::Abs(t0.GetDzDs()));    
-       }       
+      for ( int ih = 0; ih < nhits; ih++ ) {
+        int index = fHLTTracker->TrackHits()[tCA.FirstHitRef()+firstHit+ih];
+        AliHLTTPCCAGBHit &h = fHLTTracker->Hits()[index];
+        int extIndex = h.ID();
+        tTPC.SetClusterIndex( ih, extIndex );
+
+        AliTPCclusterMI *c = &( fClusters[extIndex] );
+        tTPC.SetClusterPointer( h.IRow(), c );
+        AliTPCTrackerPoint &point = *( tTPC.GetTrackPoint( h.IRow() ) );
+        {
+          int iSlice = h.ISlice();
+          AliHLTTPCCATracker &slice = fHLTTracker->Slices()[iSlice];
+          if ( slice.Param().Alpha() != alpha ) {
+            if ( ! t0.Rotate(  slice.Param().Alpha() - alpha, .999 ) ) continue;
+            alpha = slice.Param().Alpha();
+          }
+          float x = slice.Row( h.IRow() ).X();
+          if ( !t0.TransportToX( x, fHLTTracker->Slices()[0].Param().GetBz( t0 ), .999 ) ) continue;
+          float sy2, sz2;
+          slice.GetErrors2( h.IRow(), t0, sy2, sz2 );
+          point.SetSigmaY( c->GetSigmaY2() / sy2 );
+          point.SetSigmaZ( c->GetSigmaZ2() / sz2 );
+          point.SetAngleY( TMath::Abs( t0.GetSinPhi() / t0.GetCosPhi() ) );
+          point.SetAngleZ( TMath::Abs( t0.GetDzDs() ) );
+        }
       }
-      tTPC.CookdEdx(0.02,0.6);
-
-      CookLabel(&tTPC,0.1);          
-
-      if(1){ // correction like in off-line --- Adding systematic error
-
-       const Double_t *param = AliTPCReconstructor::GetRecoParam()->GetSystematicError();
-       Double_t covar[15];
-       for (Int_t i=0;i<15;i++) covar[i]=0;
-       covar[0] = param[0]*param[0];
-       covar[2] = param[1]*param[1];
-       covar[5] = param[2]*param[2];
-       covar[9] = param[3]*param[3];
-       Double_t facC =  AliTracker::GetBz()*kB2C;
-       covar[14]= param[4]*param[4]*facC*facC;
-       tTPC.AddCovariance(covar);       
+      tTPC.CookdEdx( 0.02, 0.6 );
+
+      CookLabel( &tTPC, 0.1 );
+
+      if ( 1 ) { // correction like in off-line --- Adding systematic error
+
+        const double *param = AliTPCReconstructor::GetRecoParam()->GetSystematicError();
+        double covar[15];
+        for ( int i = 0; i < 15; i++ ) covar[i] = 0;
+        covar[0] = param[0] * param[0];
+        covar[2] = param[1] * param[1];
+        covar[5] = param[2] * param[2];
+        covar[9] = param[3] * param[3];
+        double facC =  AliTracker::GetBz() * kB2C;
+        covar[14] = param[4] * param[4] * facC * facC;
+        tTPC.AddCovariance( covar );
       }
 
       AliESDtrack tESD;
-      tESD.UpdateTrackParams( &(tTPC),AliESDtrack::kTPCin);
+      tESD.UpdateTrackParams( &( tTPC ), AliESDtrack::kTPCin );
       //tESD.SetStatus( AliESDtrack::kTPCrefit );
       //tESD.SetTPCPoints(tTPC.GetPoints());
-      Int_t   ndedx = tTPC.GetNCDEDX(0);
-      Float_t sdedx = tTPC.GetSDEDX(0);
-      Float_t dedx  = tTPC.GetdEdx();
-      tESD.SetTPCsignal(dedx, sdedx, ndedx); 
-      //tESD.myTPC = tTPC;            
+      int   ndedx = tTPC.GetNCDEDX( 0 );
+      float sdedx = tTPC.GetSDEDX( 0 );
+      float dedx  = tTPC.GetdEdx();
+      tESD.SetTPCsignal( dedx, sdedx, ndedx );
+      //tESD.myTPC = tTPC;
 
-      event->AddTrack(&tESD);
+      event->AddTrack( &tESD );
     }
   }
   timer.Stop();
-  static double time=0, time1 = 0;
-  static Int_t ncalls = 0;
-  time+=timer.CpuTime();
-  time1+=timer.RealTime();
+  static double time = 0, time1 = 0;
+  static int ncalls = 0;
+  time += timer.CpuTime();
+  time1 += timer.RealTime();
   ncalls++;
   //cout<<"\n\nCA tracker speed: cpu = "<<time/ncalls*1.e3<<" [ms/ev], real = "<<time1/ncalls*1.e3<<" [ms/ev], n calls = "<<ncalls<<endl<<endl;
 
@@ -492,88 +492,88 @@ Int_t AliTPCtrackerCA::Clusters2Tracks( AliESDEvent *event )
 }
 
 
-Int_t AliTPCtrackerCA::RefitInward (AliESDEvent *event)
-{ 
-  //* forward propagation of ESD tracks 
+int AliTPCtrackerCA::RefitInward ( AliESDEvent *event )
+{
+  //* forward propagation of ESD tracks
 
-  //Float_t bz = fHLTTracker->Slices()[0].Param().Bz();
-  Float_t xTPC = fkParam->GetInnerRadiusLow();
-  Float_t dAlpha = fkParam->GetInnerAngle()/180.*TMath::Pi();
-  Float_t yMax = xTPC*TMath::Tan(dAlpha/2.); 
+  //float bz = fHLTTracker->Slices()[0].Param().Bz();
+  float xTPC = fkParam->GetInnerRadiusLow();
+  float dAlpha = fkParam->GetInnerAngle() / 180.*TMath::Pi();
+  float yMax = xTPC * TMath::Tan( dAlpha / 2. );
 
-  Int_t nentr=event->GetNumberOfTracks();
-     
-  for (Int_t itr=0; itr<nentr; itr++) {
-    AliESDtrack *esd=event->GetTrack(itr);
-    ULong_t status=esd->GetStatus(); 
-    if (!(status&AliESDtrack::kTPCin)) continue;
+  int nentr = event->GetNumberOfTracks();
+
+  for ( int itr = 0; itr < nentr; itr++ ) {
+    AliESDtrack *esd = event->GetTrack( itr );
+    ULong_t status = esd->GetStatus();
+    if ( !( status&AliESDtrack::kTPCin ) ) continue;
     AliHLTTPCCATrackParam t0;
-    AliHLTTPCCATrackConvertor::SetExtParam(t0,*esd );
+    AliHLTTPCCATrackConvertor::SetExtParam( t0, *esd );
     AliHLTTPCCATrackParam t = t0;
-    Float_t alpha = esd->GetAlpha();
-    //Float_t dEdX=0;    
-    Int_t hits[1000];
-    Int_t nHits = esd->GetTPCclusters(hits);
-    
+    float alpha = esd->GetAlpha();
+    //float dEdX=0;
+    int hits[1000];
+    int nHits = esd->GetTPCclusters( hits );
+
     // convert clluster indices to AliHLTTPCCAGBHit indices
 
-    for( Int_t i=0; i<nHits; i++ ) hits[i] = fHLTTracker->Ext2IntHitID(hits[i]);
-   
-    Bool_t ok = fHLTTracker->FitTrack( t, t0, alpha, hits, nHits, 0 );
-    if( ok &&  nHits>15){
-      if( t.TransportToXWithMaterial( xTPC, fHLTTracker->Slices()[0].Param().GetBz(t)) ){
-       if (t.GetY() > yMax) {
-         if (t.Rotate(dAlpha)){ 
-           alpha+=dAlpha;  
-           t.TransportToXWithMaterial( xTPC, fHLTTracker->Slices()[0].Param().GetBz(t));
-         }
-       } else if (t.GetY() <-yMax) {
-         if (t.Rotate(-dAlpha)){
-           alpha+=-dAlpha;
-           t.TransportToXWithMaterial( xTPC, fHLTTracker->Slices()[0].Param().GetBz(t));
-         }
-       }    
+    for ( int i = 0; i < nHits; i++ ) hits[i] = fHLTTracker->Ext2IntHitID( hits[i] );
+
+    bool ok = fHLTTracker->FitTrack( t, t0, alpha, hits, nHits, 0 );
+    if ( ok &&  nHits > 15 ) {
+      if ( t.TransportToXWithMaterial( xTPC, fHLTTracker->Slices()[0].Param().GetBz( t ) ) ) {
+        if ( t.GetY() > yMax ) {
+          if ( t.Rotate( dAlpha ) ) {
+            alpha += dAlpha;
+            t.TransportToXWithMaterial( xTPC, fHLTTracker->Slices()[0].Param().GetBz( t ) );
+          }
+        } else if ( t.GetY() < -yMax ) {
+          if ( t.Rotate( -dAlpha ) ) {
+            alpha += -dAlpha;
+            t.TransportToXWithMaterial( xTPC, fHLTTracker->Slices()[0].Param().GetBz( t ) );
+          }
+        }
       }
-    
-      AliTPCtrack tt(*esd);
-      AliHLTTPCCATrackConvertor::GetExtParam(t,tt,alpha );
-      esd->UpdateTrackParams( &tt,AliESDtrack::kTPCrefit); 
+
+      AliTPCtrack tt( *esd );
+      AliHLTTPCCATrackConvertor::GetExtParam( t, tt, alpha );
+      esd->UpdateTrackParams( &tt, AliESDtrack::kTPCrefit );
     }
   }
   return 0;
 }
 
-Int_t AliTPCtrackerCA::PropagateBack(AliESDEvent *event)
-{ 
+int AliTPCtrackerCA::PropagateBack( AliESDEvent *event )
+{
+
+  //* backward propagation of ESD tracks
 
-  //* backward propagation of ESD tracks 
+  //float bz = fHLTTracker->Slices()[0].Param().Bz();
+  int nentr = event->GetNumberOfTracks();
 
-  //Float_t bz = fHLTTracker->Slices()[0].Param().Bz();
-  Int_t nentr=event->GetNumberOfTracks();
-     
-  for (Int_t itr=0; itr<nentr; itr++) {
+  for ( int itr = 0; itr < nentr; itr++ ) {
 
-    AliESDtrack *esd=event->GetTrack(itr);
-    ULong_t status=esd->GetStatus(); 
-    if (!(status&AliESDtrack::kTPCin)) continue;
+    AliESDtrack *esd = event->GetTrack( itr );
+    ULong_t status = esd->GetStatus();
+    if ( !( status&AliESDtrack::kTPCin ) ) continue;
 
     AliHLTTPCCATrackParam t0;
-    AliHLTTPCCATrackConvertor::SetExtParam(t0,*esd  );
+    AliHLTTPCCATrackConvertor::SetExtParam( t0, *esd  );
     AliHLTTPCCATrackParam t = t0;
-    Float_t alpha = esd->GetAlpha();
-    //Float_t dEdX=0;    
-    Int_t hits[1000];
-    Int_t nHits = esd->GetTPCclusters(hits);
-    
+    float alpha = esd->GetAlpha();
+    //float dEdX=0;
+    int hits[1000];
+    int nHits = esd->GetTPCclusters( hits );
+
     // convert clluster indices to AliHLTTPCCAGBHit indices
 
-    for( Int_t i=0; i<nHits; i++ ) hits[i] = fHLTTracker->Ext2IntHitID(hits[i]);
-   
-    Bool_t ok = fHLTTracker->FitTrack( t, t0, alpha, hits, nHits, 1 );
-    if( ok &&  nHits>15){
-      AliTPCtrack tt(*esd);
-      AliHLTTPCCATrackConvertor::GetExtParam(t,tt,alpha );
-      esd->UpdateTrackParams( &tt,AliESDtrack::kTPCout); 
+    for ( int i = 0; i < nHits; i++ ) hits[i] = fHLTTracker->Ext2IntHitID( hits[i] );
+
+    bool ok = fHLTTracker->FitTrack( t, t0, alpha, hits, nHits, 1 );
+    if ( ok &&  nHits > 15 ) {
+      AliTPCtrack tt( *esd );
+      AliHLTTPCCATrackConvertor::GetExtParam( t, tt, alpha );
+      esd->UpdateTrackParams( &tt, AliESDtrack::kTPCout );
     }
   }
   return 0;
index 85b6aefb5de7be558b4302bbeae0062f08e47103..6cdb0514ad837cdc6d3e3a01848ddc3e95f25421 100644 (file)
@@ -1,7 +1,7 @@
 //-*- Mode: C++ -*-
 // $Id$
 // ************************************************************************
-// This file is property of and copyright by the ALICE HLT Project        * 
+// This file is property of and copyright by the ALICE HLT Project        *
 // ALICE Experiment at CERN, All rights reserved.                         *
 // See cxx source for full Copyright notice                               *
 //                                                                        *
@@ -13,7 +13,7 @@
 #include "AliTracker.h"
 
 class AliTPCParam;
-class AliESD;   
+class AliESD;
 class TTree;
 class AliHLTTPCCAGBTracker;
 class AliTPCclusterMI;
@@ -21,42 +21,42 @@ class AliTPCtrack;
 
 /**
  * @class AliTPCtrackerCA
- * 
+ *
  * Interface from HLT TPC tracker AliHLTTPCCAGBTracker to off-line
  * The reconstruction algorithm is based on the Cellular Automaton method
  *
  */
-class AliTPCtrackerCA : public AliTracker 
+class AliTPCtrackerCA : public AliTracker
 {
-public:
-  AliTPCtrackerCA();
-  AliTPCtrackerCA(const AliTPCParam *par); 
-  AliTPCtrackerCA(const AliTPCtrackerCA &);
-  const AliTPCtrackerCA & operator=(const AliTPCtrackerCA& ) const;
-  virtual ~AliTPCtrackerCA();
-  //
-  Int_t RefitInward (AliESDEvent *event);
-  Int_t PropagateBack(AliESDEvent *event);
-  //
-  Int_t Clusters2Tracks (AliESDEvent *esd);
+  public:
+    AliTPCtrackerCA();
+    AliTPCtrackerCA( const AliTPCParam *par );
+    AliTPCtrackerCA( const AliTPCtrackerCA & );
+    const AliTPCtrackerCA & operator=( const AliTPCtrackerCA& ) const;
+    virtual ~AliTPCtrackerCA();
+    //
+    int RefitInward ( AliESDEvent *event );
+    int PropagateBack( AliESDEvent *event );
+    //
+    int Clusters2Tracks ( AliESDEvent *esd );
 
-  Int_t LoadClusters (TTree * tree);
-  void   UnloadClusters(){ return ; }
-  AliCluster * GetCluster(Int_t index) const;
-  Bool_t DoHLTPerformance() const { return fDoHLTPerformance; }
-  Bool_t DoHLTPerformanceClusters() const { return fDoHLTPerformanceClusters; }
-  //
- protected:
+    int LoadClusters ( TTree * tree );
+    void   UnloadClusters() { return ; }
+    AliCluster * GetCluster( int index ) const;
+    bool DoHLTPerformance() const { return fDoHLTPerformance; }
+    bool DoHLTPerformanceClusters() const { return fDoHLTPerformanceClusters; }
+    //
 protected:
 
-  const AliTPCParam *fkParam;  //* TPC parameters
-  AliTPCclusterMI *fClusters; //* array of clusters
-  Int_t fNClusters;           //* N clusters
-  AliHLTTPCCAGBTracker *fHLTTracker; //* pointer to the HLT tracker
-  Bool_t fDoHLTPerformance; //* flag for call AliHLTTPCCAPerformance
-  Bool_t fDoHLTPerformanceClusters; //* flag for call AliHLTTPCCAPerformance with cluster pulls (takes some time to load TPC MC points)
-  Int_t fStatNEvents; //* N of reconstructed events
+    const AliTPCParam *fkParam;  //* TPC parameters
+    AliTPCclusterMI *fClusters; //* array of clusters
+    int fNClusters;           //* N clusters
+    AliHLTTPCCAGBTracker *fHLTTracker; //* pointer to the HLT tracker
+    bool fDoHLTPerformance; //* flag for call AliHLTTPCCAPerformance
+    bool fDoHLTPerformanceClusters; //* flag for call AliHLTTPCCAPerformance with cluster pulls (takes some time to load TPC MC points)
+    int fStatNEvents; //* N of reconstructed events
 
-  ClassDef(AliTPCtrackerCA,1) 
+    ClassDef( AliTPCtrackerCA, 1 )
 };