Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / STEER / STEER / AliHelix.h
CommitLineData
7f572c00 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
18class AliCluster;
19class AliKalmanTrack;
51ad6848 20class AliExternalTrackParam;
7f572c00 21
22class AliHelix : public TObject {
23public:
24 AliHelix();
25 AliHelix(const AliHelix &t);
26 AliHelix(const AliKalmanTrack &t);
51ad6848 27 AliHelix(const AliExternalTrackParam &t);
7f572c00 28 AliHelix(Double_t x[3], Double_t p[3], Double_t charge=1, Double_t conversion=0.);
29 virtual ~AliHelix(){};
30 inline void Evaluate(Double_t t, Double_t r[3]);
31 void Evaluate(Double_t t, Double_t r[3], //radius vector
32 Double_t g[3], //first defivatives
33 Double_t gg[3]); //second derivatives
81e97e0d 34 void GetMomentum(Double_t phase, Double_t p[4], Double_t conversion=0., Double_t *xr=0); // return momentum
7f572c00 35 void GetAngle(Double_t t1, AliHelix &h, Double_t t2, Double_t angle[3]);
36 inline Double_t GetHelixR(Double_t phase=0);
37 inline Double_t GetHelixZ(Double_t phase=0);
38
39 Double_t GetPhase(Double_t x0, Double_t y0); //return phase for nearest point
40 Double_t GetPhaseZ(Double_t z0); // return phase for given z
41 Int_t GetPhase(Double_t r0, Double_t t[2]); //return phase for the nearest point
42 Int_t GetRPHIintersections(AliHelix &h, Double_t phase[2][2], Double_t ri[2], Double_t cut=3.);
9be2fe3a 43 Int_t GetClosestPhases(AliHelix &h, Double_t phase[2][2]);
81e97e0d 44 Double_t GetPointAngle(AliHelix &h, Double_t phase[2],const Float_t *vertex);
7f572c00 45 Int_t LinearDCA(AliHelix &h, Double_t &t1, Double_t &t2,
46 Double_t &R, Double_t &dist);
47 //
48 Int_t ParabolicDCA(AliHelix&h, //helixes
49 Double_t &t1, Double_t &t2,
50 Double_t &R, Double_t &dist, Int_t iter=1);
9be2fe3a 51 Int_t ParabolicDCA2(AliHelix&h, //helixes
52 Double_t &t1, Double_t &t2,
53 Double_t &R, Double_t &dist, Double_t err[3], Int_t iter=1);
54 Double_t GetHelix(Int_t i) const{return fHelix[i];}
55 public:
7f572c00 56 Double_t fHelix[9]; //helix parameters
57 private:
8376ba25 58 AliHelix &operator=(const AliHelix&helix);
59
7f572c00 60 ClassDef(AliHelix,1) // AliHelix
61};
62
63void AliHelix::Evaluate(Double_t t, Double_t r[3]){
64 //
65 // calculate poitition at given phase t
66 Double_t phase=fHelix[4]*t+fHelix[2];
67 r[0] = fHelix[5] + TMath::Sin(phase)/fHelix[4];
68 r[1] = fHelix[0] - TMath::Cos(phase)/fHelix[4];
69 r[2] = fHelix[1] + fHelix[3]*t;
70}
71
72inline Double_t AliHelix::GetHelixR(Double_t phase)
73{
74 Double_t x[3];
75 Evaluate(phase,x);
76 return TMath::Sqrt(x[0]*x[0]+x[1]*x[1]);
77}
78
79inline Double_t AliHelix::GetHelixZ(Double_t phase)
80{
81 Double_t x[3];
82 Evaluate(phase,x);
83 return x[2];
84}
85
86
87#endif
88
89