]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLT3DTrackParam.h
bug fix: reconstruction crash when the output buffer size exceed
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLT3DTrackParam.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3 // ***************************************************************************
4 // This file is property of and copyright by the ALICE HLT Project           *
5 // ALICE Experiment at CERN, All rights reserved.                            *
6 // See cxx source for full Copyright notice                                  *
7 //                                                                           *
8 // AliHLT3DTrackParam class is under development and currently not in use    *
9 //                                                                           *
10 //****************************************************************************
11
12 #ifndef ALIHLT3DTRACKPARAM_H
13 #define ALIHLT3DTRACKPARAM_H
14
15 #include "TObject.h"
16
17 /**
18  * @class AliHLT3DTrackParam
19  */
20 class AliHLT3DTrackParam : public TObject
21 {
22   public:
23
24     //*
25     //*  INITIALIZATION
26     //*
27
28     //* Constructor
29
30     AliHLT3DTrackParam(): fChi2( 0 ), fNDF( 0 ), fSignQ( 0 ) {}
31
32     //* Destructor (empty)
33
34     virtual ~AliHLT3DTrackParam() {}
35
36     //*
37     //*  ACCESSORS
38     //*
39
40
41     //* Simple accessors
42
43     double GetX()      const { return fParam[0]; }
44     double GetY()      const { return fParam[1]; }
45     double GetZ()      const { return fParam[2]; }
46     double GetPx()     const { return fParam[3]; }
47     double GetPy()     const { return fParam[4]; }
48     double GetPz()     const { return fParam[5]; }
49     double GetChi2()   const { return fChi2;  }
50     int    GetNDF()    const { return fNDF;   }
51     int    GetCharge() const { return fSignQ; }
52
53     double GetParameter ( int i ) const { return fParam[i]; }
54     double GetCovariance( int i ) const { return fCov[i]; }
55     double GetCovariance( int i, int j ) const { return fCov[( j<=i ) ? i*( i+1 )/2+j :j*( j+1 )/2+i]; }
56
57     //*
58     //* Accessors
59     //*
60
61     const double *Param()  const { return fParam; }
62     const double *Cov() const   { return fCov;   }
63     double X()      const  { return fParam[0]; }
64     double Y()      const  { return fParam[1]; }
65     double Z()      const  { return fParam[2]; }
66     double Px()     const  { return fParam[3]; }
67     double Py()     const  { return fParam[4]; }
68     double Pz()     const  { return fParam[5]; }
69     double Chi2()   const  { return fChi2;  }
70     int    NDF()    const  { return fNDF;   }
71     int    Charge()  const { return fSignQ; }
72
73     //* Accessors with calculations( &value, &estimated sigma )
74     //* error flag returned (0 means no error during calculations)
75
76
77     //*
78     //*  MODIFIERS
79     //*
80
81     void SetParam( int i, double v )  { fParam[i] = v; }
82     void SetCov( int i, double v ) { fCov[i] = v;   }
83     void SetX( double v )      { fParam[0] = v; }
84     void SetY( double v )      { fParam[1] = v; }
85     void SetZ( double v )      { fParam[2] = v; }
86     void SetPx( double v )     { fParam[3] = v; }
87     void SetPy( double v )     { fParam[4] = v; }
88     void SetPz( double v )     { fParam[5] = v; }
89     void SetChi2( double v )   { fChi2 = v;  }
90     void SetNDF( int v )       { fNDF = v;   }
91     void SetCharge( int v )    { fSignQ = v; }
92
93
94     //*
95     //*  UTILITIES
96     //*
97
98     //* Transport utilities
99
100     double GetDStoPoint( double Bz, const double xyz[3], const double *T0 = 0 ) const;
101
102     void TransportToDS( double Bz, double DS, double *T0 = 0 );
103
104     void TransportToPoint( double Bz, const double xyz[3], double *T0 = 0 ) {
105       TransportToDS( Bz, GetDStoPoint( Bz, xyz, T0 ), T0 ) ;
106     }
107
108     void TransportToPoint( double Bz, double x, double y, double z, const double *T0 = 0 ) {
109       double xyz[3] = {x, y, z};
110       TransportToPoint( Bz, xyz, T0 );
111     }
112
113     //* Fit utilities
114
115     void InitializeCovarianceMatrix();
116
117     void GetGlueMatrix( const double p[3], double G[6], const double *T0 = 0  ) const ;
118
119     void Filter( const double m[3], const double V[6], const double G[6] );
120
121     //* Other utilities
122
123     void SetDirection( double Direction[3] );
124
125     void RotateCoordinateSystem( double alpha );
126
127     void Get5Parameters( double alpha, double T[6], double C[15] ) const;
128
129   protected:
130
131     double fParam[6]; // Parameters ( x, y, z, px, py, pz ): 3-position and 3-momentum
132     double fCov[21];  // Covariance matrix
133     double fChi2;     // Chi^2
134     int    fNDF;      // Number of Degrees of Freedom
135     int    fSignQ;    // Charge
136
137     ClassDef( AliHLT3DTrackParam, 1 );
138
139 };
140
141
142 #endif