]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliHelix.h
Reconstruction of raw data (T.Kuhr)
[u/mrichter/AliRoot.git] / TPC / AliHelix.h
1 #ifndef ALIHELIX_H
2 #define ALIHELIX_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7
8 //-------------------------------------------------------------------------
9 //                          Class AliHelix
10 //
11 //         Origin: Marian Ivanov marian.ivanov@cern.ch 
12 //-------------------------------------------------------------------------
13
14 #include <TObject.h>
15 #include <TMath.h>
16
17
18 class AliCluster;
19 class AliKalmanTrack;
20
21 class AliHelix : public TObject {
22 public:
23   AliHelix();
24   AliHelix(const AliHelix &t);
25   AliHelix(const AliKalmanTrack &t);
26   AliHelix(Double_t x[3], Double_t p[3], Double_t charge=1, Double_t conversion=0.);
27   virtual ~AliHelix(){};
28   inline void Evaluate(Double_t t, Double_t r[3]);
29   void Evaluate(Double_t t, Double_t r[3],  //radius vector
30                      Double_t g[3],  //first defivatives
31                 Double_t gg[3]);     //second derivatives
32   void GetMomentum(Double_t phase, Double_t p[4], Double_t conversion=0.);  // return  momentum  
33   void  GetAngle(Double_t t1, AliHelix &h, Double_t t2, Double_t angle[3]);
34   inline Double_t GetHelixR(Double_t phase=0);
35   inline Double_t GetHelixZ(Double_t phase=0);
36
37   Double_t  GetPhase(Double_t x0, Double_t y0);  //return phase for nearest point  
38   Double_t  GetPhaseZ(Double_t z0);               // return phase for given z
39   Int_t     GetPhase(Double_t r0, Double_t t[2]);               //return phase for the nearest point
40   Int_t     GetRPHIintersections(AliHelix &h, Double_t phase[2][2], Double_t ri[2], Double_t cut=3.);
41   Int_t     LinearDCA(AliHelix &h, Double_t &t1, Double_t &t2, 
42                       Double_t &R, Double_t &dist);
43   //
44   Int_t     ParabolicDCA(AliHelix&h,  //helixes
45                          Double_t &t1, Double_t &t2, 
46                          Double_t &R, Double_t &dist, Int_t iter=1);    
47
48   Double_t fHelix[9];    //helix parameters
49  private:  
50   ClassDef(AliHelix,1)    // AliHelix
51 };
52
53 void AliHelix::Evaluate(Double_t t, Double_t r[3]){
54   //
55   // calculate poitition at given phase t 
56   Double_t phase=fHelix[4]*t+fHelix[2];  
57   r[0] = fHelix[5] + TMath::Sin(phase)/fHelix[4];
58   r[1] = fHelix[0] - TMath::Cos(phase)/fHelix[4];  
59   r[2] = fHelix[1] + fHelix[3]*t;
60 }
61
62 inline Double_t  AliHelix::GetHelixR(Double_t phase)
63 {
64   Double_t x[3];
65   Evaluate(phase,x);
66   return TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
67 }
68
69 inline Double_t  AliHelix::GetHelixZ(Double_t phase)
70 {
71   Double_t x[3];
72   Evaluate(phase,x);
73   return x[2];
74 }
75
76
77 #endif
78
79