]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliExternalTrackParam.h
Additional protections, corrected creation of kinks, neutral clusters included
[u/mrichter/AliRoot.git] / STEER / AliExternalTrackParam.h
CommitLineData
51ad6848 1#ifndef ALIEXTERNALTRACKPARAM_H
2#define ALIEXTERNALTRACKPARAM_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
49d13e89 8/*****************************************************************************
9 * "External" track parametrisation class *
10 * *
11 * external param0: local Y-coordinate of a track (cm) *
12 * external param1: local Z-coordinate of a track (cm) *
13 * external param2: local sine of the track momentum azimuthal angle *
14 * external param3: tangent of the track momentum dip angle *
15 * external param4: 1/pt (1/(GeV/c)) *
16 * *
17 * The parameters are estimated at an exact position x in a local coord. *
18 * system rotated by angle alpha with respect to the global coord.system. *
19 * Origin: I.Belikov, CERN, Jouri.Belikov@cern.ch *
20 *****************************************************************************/
a5e407e9 21#include "TObject.h"
6c94f330 22#include "TMath.h"
a5e407e9 23
49d13e89 24const Double_t kAlmost1=0.999;
25const Double_t kAlmost0=1e-33;
26const Double_t kVeryBig=1./kAlmost0;
27
5773defd 28const Double_t kB2C=0.299792458e-3;
29const Double_t kAlmost0Field=1.e-13;
7b5ef2e6 30const Double_t kMostProbablePt=0.35;
5773defd 31
f76701bf 32class AliESDVertex;
51ad6848 33
ee5dba5e 34Double_t ApproximateBetheBloch(Double_t);
35
a5e407e9 36class AliExternalTrackParam: public TObject {
51ad6848 37 public:
38 AliExternalTrackParam();
6c94f330 39 AliExternalTrackParam(const AliExternalTrackParam &);
51ad6848 40 AliExternalTrackParam(Double_t x, Double_t alpha,
41 const Double_t param[5], const Double_t covar[15]);
1530f89c 42 virtual ~AliExternalTrackParam(){}
ac3eaff4 43
6c94f330 44 void Set(Double_t x,Double_t alpha,
45 const Double_t param[5], const Double_t covar[15]);
c9ec41e8 46 void Reset();
6c94f330 47 void ResetCovariance(Double_t s2) {
48 fC[0]*= s2;
49 fC[1] = 0.; fC[2]*= s2;
50 fC[3] = 0.; fC[4] = 0.; fC[5]*= s2;
51 fC[6] = 0.; fC[7] = 0.; fC[8] = 0.; fC[9]*= s2;
7b5ef2e6 52 fC[10]= 0.; fC[11]= 0.; fC[12]= 0.; fC[13]= 0.; fC[14]*=s2;
6c94f330 53 }
c9ec41e8 54
49d13e89 55 const Double_t *GetParameter() const {return fP;}
56 const Double_t *GetCovariance() const {return fC;}
6c94f330 57
58 Double_t GetAlpha() const {return fAlpha;}
c7bafca9 59 Double_t GetX() const {return fX;}
2d57349e 60 Double_t GetY() const {return fP[0];}
61 Double_t GetZ() const {return fP[1];}
6c94f330 62 Double_t GetSnp() const {return fP[2];}
63 Double_t GetTgl() const {return fP[3];}
64 Double_t Get1Pt() const {return fP[4];}
65
66 Double_t GetSigmaY2() const {return fC[0];}
67 Double_t GetSigmaZY() const {return fC[1];}
68 Double_t GetSigmaZ2() const {return fC[2];}
69 Double_t GetSigmaSnpY() const {return fC[3];}
70 Double_t GetSigmaSnpZ() const {return fC[4];}
71 Double_t GetSigmaSnp2() const {return fC[5];}
72 Double_t GetSigmaTglY() const {return fC[6];}
73 Double_t GetSigmaTglZ() const {return fC[7];}
74 Double_t GetSigmaTglSnp() const {return fC[8];}
75 Double_t GetSigmaTgl2() const {return fC[9];}
76 Double_t GetSigma1PtY() const {return fC[10];}
77 Double_t GetSigma1PtZ() const {return fC[11];}
78 Double_t GetSigma1PtSnp() const {return fC[12];}
79 Double_t GetSigma1PtTgl() const {return fC[13];}
80 Double_t GetSigma1Pt2() const {return fC[14];}
81
c9ec41e8 82 Double_t GetSign() const {return (fP[4]>0) ? 1 : -1;}
83 Double_t GetP() const;
6c94f330 84 Double_t GetPt() const {
85 return (TMath::Abs(fP[4])>kAlmost0) ? 1./fP[4]:TMath::Sign(kVeryBig,fP[4]);
86 }
1d99986f 87 Double_t Get1P() const;
1530f89c 88 Double_t GetC(Double_t b) const {return fP[4]*b*kB2C;}
89 void GetDZ(Double_t x,Double_t y,Double_t z,Double_t b,Float_t dz[2]) const;
c7bafca9 90 Double_t GetD(Double_t xv, Double_t yv, Double_t b) const;
49d13e89 91 Double_t GetLinearD(Double_t xv, Double_t yv) const;
ee5dba5e 92 Bool_t CorrectForMaterial(Double_t d, Double_t x0, Double_t mass,
93 Double_t (*f)(Double_t)=ApproximateBetheBloch);
49d13e89 94 Double_t GetPredictedChi2(Double_t p[2],Double_t cov[3]) const;
95 Bool_t Update(Double_t p[2],Double_t cov[3]);
96 Bool_t Rotate(Double_t alpha);
97 Bool_t PropagateTo(Double_t x, Double_t b);
98 Bool_t Propagate(Double_t alpha, Double_t x, Double_t b) {
99 if (Rotate(alpha))
100 if (PropagateTo(x,b)) return kTRUE;
101 return kFALSE;
102 }
052daaff 103 void Propagate(Double_t len,Double_t x[3],Double_t p[3],Double_t bz) const;
104 Bool_t Intersect(Double_t pnt[3], Double_t norm[3], Double_t bz) const;
49d13e89 105
c7bafca9 106 void GetHelixParameters(Double_t h[6], Double_t b) const;
107 Double_t GetDCA(const AliExternalTrackParam *p, Double_t b,
108 Double_t &xthis,Double_t &xp) const;
109 Double_t PropagateToDCA(AliExternalTrackParam *p, Double_t b);
f76701bf 110 Bool_t PropagateToDCA(const AliESDVertex *vtx, Double_t b, Double_t maxd);
c7bafca9 111
b1149664 112 void GetDirection(Double_t d[3]) const;
c9ec41e8 113 Bool_t GetPxPyPz(Double_t *p) const;
114 Bool_t GetXYZ(Double_t *p) const;
115 Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const;
116 Bool_t GetPxPyPzAt(Double_t x, Double_t b, Double_t p[3]) const;
117 Bool_t GetXYZAt(Double_t x, Double_t b, Double_t r[3]) const;
7cf7bb6c 118 Bool_t GetYAt(Double_t x, Double_t b, Double_t &y) const;
6c94f330 119 Bool_t GetZAt(Double_t x, Double_t b, Double_t &z) const;
c9ec41e8 120 void Print(Option_t* option = "") const;
c194ba83 121 Double_t GetSnpAt(Double_t x,Double_t b) const;
6c94f330 122
123protected:
124 Double_t &Par(Int_t i) {return fP[i];}
125 Double_t &Cov(Int_t i) {return fC[i];}
126
c9ec41e8 127private:
bad5ac2c 128 Double32_t fX; // X coordinate for the point of parametrisation
129 Double32_t fAlpha; // Local <-->global coor.system rotation angle
130 Double32_t fP[5]; // The track parameters
131 Double32_t fC[15]; // The track parameter covariance matrix
c9ec41e8 132
bad5ac2c 133 ClassDef(AliExternalTrackParam, 5)
51ad6848 134};
135
136#endif