]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCpolyTrack.h
new functionality added
[u/mrichter/AliRoot.git] / TPC / AliTPCpolyTrack.h
1 #ifndef ALITPCPOLYTRACK_H
2 #define ALITPCPOLYTRACK_H
3
4 //-------------------------------------------------------
5 //                    TPC Cluster Class
6 //
7 //   Origin: Marian Ivanov
8 //-------------------------------------------------------
9
10 #include "TObject.h"
11
12 //_____________________________________________________________________________
13 class AliTPCpolyTrack : public TObject {
14 public:
15   AliTPCpolyTrack();
16   void Reset();
17   void AddPoint(Double_t x, Double_t y, Double_t z, Double_t sy=1, Double_t sz=1);
18   inline void GetFitPoint(Double_t x, Double_t &y, Double_t &z);
19   inline void GetFitDerivation(Double_t x, Double_t &y, Double_t &z);
20   void UpdateParameters();
21   Int_t GetN(){return fNPoints;}
22   void GetBoundaries(Double_t &xmin, Double_t &xmax){xmin = fMinX;xmax=fMaxX;}
23   void Refit(AliTPCpolyTrack & track, Double_t deltay, Double_t deltaz); 
24 private: 
25   void   Fit2(Double_t fSumY, Double_t fSumYX, Double_t fSumYX2,
26               Double_t fSumX,  Double_t fSumX2, Double_t fSumX3, 
27               Double_t fSumX4, Double_t fSumW, Double_t &a, Double_t &b, Double_t &c);
28   void  Fit1(Double_t fSumY, Double_t fSumYX, 
29               Double_t fSumX,  Double_t fSumX2, 
30               Double_t fSumW, Double_t &a, Double_t &b, Double_t &c);
31   //
32   Double_t fA;
33   Double_t fB;
34   Double_t fC;
35   Double_t fD;
36   Double_t fE;
37   Double_t fF;
38   Double_t fMaxX;
39   Double_t fMinX;
40   //
41   Double_t fSumW;   // sum of the weight 
42
43   Double_t fSumX;    //
44   Double_t fSumX2;   //
45   Double_t fSumX3;   //  
46   Double_t fSumX4;   //
47   Double_t fSumY;    //
48   Double_t fSumYX;   //  
49   Double_t fSumYX2;  //
50   Double_t fSumZ;    //
51   Double_t fSumZX;   //
52   Double_t fSumZX2;  //
53   
54   Double_t fX[200];
55   Double_t fY[200];
56   Double_t fSY[200];
57   Double_t fZ[200];
58   Double_t fSZ[200];
59
60   Int_t fNPoints; 
61
62   ClassDef(AliTPCpolyTrack,1)  // Time Projection "polynomial track"
63 };
64
65 void AliTPCpolyTrack::GetFitPoint(Double_t x, Double_t &y, Double_t &z)
66 {
67   y = fA+fB*x+fC*x*x;
68   z = fD+fE*x+fF*x*x;
69 }
70
71
72 void AliTPCpolyTrack::GetFitDerivation(Double_t x, Double_t &y, Double_t &z)
73 {
74
75   y = fB+2.*fC*x;
76   z = fE+2.*fF*x;
77   
78 }
79
80
81 #endif
82
83