]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCATrackConvertor.cxx
Fit mathematics improved, obsollete GBTracker cleaned up
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCATrackConvertor.cxx
1 // $Id: AliHLTTPCCATrackConvertor.cxx 27042 2008-07-02 12:06:02Z richterm $
2 // **************************************************************************
3 // This file is property of and copyright by the ALICE HLT Project          * 
4 // ALICE Experiment at CERN, All rights reserved.                           *
5 //                                                                          *
6 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
7 //                  Ivan Kisel <kisel@kip.uni-heidelberg.de>                *
8 //                  for The ALICE HLT Project.                              *
9 //                                                                          *
10 // Permission to use, copy, modify and distribute this software and its     *
11 // documentation strictly for non-commercial purposes is hereby granted     *
12 // without fee, provided that the above copyright notice appears in all     *
13 // copies and that both the copyright notice and this permission notice     *
14 // appear in the supporting documentation. The authors make no claims       *
15 // about the suitability of this software for any purpose. It is            *
16 // provided "as is" without express or implied warranty.                    *
17 //                                                                          *
18 //***************************************************************************
19
20
21 #include "AliHLTTPCCATrackConvertor.h"
22 #include "AliExternalTrackParam.h"
23 #include "AliHLTTPCCATrackParam.h"
24 #include "AliHLTTPCCAMath.h"
25
26
27 void AliHLTTPCCATrackConvertor::GetExtParam( const AliHLTTPCCATrackParam &T1, AliExternalTrackParam &T2, Double_t alpha )
28 {
29   //* Convert from AliHLTTPCCATrackParam to AliExternalTrackParam parameterisation, 
30   //* the angle alpha is the global angle of the local X axis 
31
32   Double_t par[5], cov[15];
33   for( Int_t i=0; i<5; i++ ) par[i] = T1.GetPar()[i];
34   for( Int_t i=0; i<15; i++ ) cov[i] = T1.GetCov()[i];
35
36   if(par[2]>.99 ) par[2]=.99;
37   if(par[2]<-.99 ) par[2]=-.99;
38
39   if( T1.GetSignCosPhi()<0 ){ // change direction
40     par[2] = -par[2]; // sin phi
41     par[3] = -par[3]; // DzDs
42     par[4] = -par[4]; // kappa
43     cov[3] = -cov[3];
44     cov[4] = -cov[4];
45     cov[6] = -cov[6];
46     cov[7] = -cov[7];
47     cov[10] = -cov[10];
48     cov[11] = -cov[11];
49   }
50   T2.Set( (Double_t) T1.GetX(),alpha,par,cov);
51 }
52
53 void AliHLTTPCCATrackConvertor::SetExtParam( AliHLTTPCCATrackParam &T1, const AliExternalTrackParam &T2 )
54 {
55   //* Convert from AliExternalTrackParam parameterisation
56   
57   for( Int_t i=0; i<5; i++ ) T1.SetPar( i, T2.GetParameter()[i] );
58   for( Int_t i=0; i<15; i++ ) T1.SetCov( i, T2.GetCovariance()[i] );
59   T1.SetX( T2.GetX() );
60   if(T1.SinPhi()>.99 ) T1.SetSinPhi( .99 );
61   if(T1.SinPhi()<-.99 ) T1.SetSinPhi( -.99 );
62   T1.SetSignCosPhi( 1 );
63 }
64