No need for libf95 in the list of Root libraries
[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 *****************************************************************************/
6c94f330 21#include "TMath.h"
a5e407e9 22
def9660e 23#include "AliVParticle.h"
24
49d13e89 25const Double_t kVeryBig=1./kAlmost0;
7b5ef2e6 26const Double_t kMostProbablePt=0.35;
5773defd 27
ee5dba5e 28Double_t ApproximateBetheBloch(Double_t);
29
c683ddc2 30class AliESDVertex;
0c19adf7 31class TPolyMarker3D;
c683ddc2 32
def9660e 33class AliExternalTrackParam: public AliVParticle {
51ad6848 34 public:
35 AliExternalTrackParam();
6c94f330 36 AliExternalTrackParam(const AliExternalTrackParam &);
def9660e 37 AliExternalTrackParam& operator=(const AliExternalTrackParam & trkPar);
51ad6848 38 AliExternalTrackParam(Double_t x, Double_t alpha,
39 const Double_t param[5], const Double_t covar[15]);
da4e3deb 40 AliExternalTrackParam(Double_t xyz[3],Double_t pxpypz[3],
41 Double_t cv[21],Short_t sign);
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]);
ed5f2849 46
47 static void SetMostProbablePt(Double_t pt) { fgMostProbablePt=pt; }
48 static Double_t GetMostProbablePt() { return fgMostProbablePt; }
49
c9ec41e8 50 void Reset();
ed5f2849 51 void ResetCovariance(Double_t s2);
3775b0ca 52 void AddCovariance(const Double_t cov[15]);
c9ec41e8 53
49d13e89 54 const Double_t *GetParameter() const {return fP;}
55 const Double_t *GetCovariance() const {return fC;}
6c94f330 56
57 Double_t GetAlpha() const {return fAlpha;}
c7bafca9 58 Double_t GetX() const {return fX;}
2d57349e 59 Double_t GetY() const {return fP[0];}
60 Double_t GetZ() const {return fP[1];}
6c94f330 61 Double_t GetSnp() const {return fP[2];}
62 Double_t GetTgl() const {return fP[3];}
def9660e 63 Double_t GetSigned1Pt() const {return fP[4];}
6c94f330 64
65 Double_t GetSigmaY2() const {return fC[0];}
66 Double_t GetSigmaZY() const {return fC[1];}
67 Double_t GetSigmaZ2() const {return fC[2];}
68 Double_t GetSigmaSnpY() const {return fC[3];}
69 Double_t GetSigmaSnpZ() const {return fC[4];}
70 Double_t GetSigmaSnp2() const {return fC[5];}
71 Double_t GetSigmaTglY() const {return fC[6];}
72 Double_t GetSigmaTglZ() const {return fC[7];}
73 Double_t GetSigmaTglSnp() const {return fC[8];}
74 Double_t GetSigmaTgl2() const {return fC[9];}
75 Double_t GetSigma1PtY() const {return fC[10];}
76 Double_t GetSigma1PtZ() const {return fC[11];}
77 Double_t GetSigma1PtSnp() const {return fC[12];}
78 Double_t GetSigma1PtTgl() const {return fC[13];}
79 Double_t GetSigma1Pt2() const {return fC[14];}
80
def9660e 81 // additional functions for AliVParticle
82 Double_t Px() const;
83 Double_t Py() const;
84 Double_t Pz() const;
85 Double_t Pt() const { return TMath::Abs(GetSignedPt()); }
86 Double_t P() const { return GetP(); }
c683ddc2 87 Bool_t PxPyPz(Double_t p[3]) const { return GetPxPyPz(p); }
88
89 Double_t Xv() const;
90 Double_t Yv() const;
91 Double_t Zv() const;
92 Bool_t XvYvZv(Double_t x[3]) const { return GetXYZ(x); }
93
def9660e 94 Double_t OneOverPt() const { return 1./Pt(); }
95 Double_t Phi() const;
96 Double_t Theta() const;
97 virtual Double_t E() const;
98 virtual Double_t M() const;
99 Double_t Eta() const;
100 virtual Double_t Y() const;
101 Short_t Charge() const { return (Short_t)GetSign(); }
102 const Double_t *PID() const { return 0x0; }
103
c9ec41e8 104 Double_t GetSign() const {return (fP[4]>0) ? 1 : -1;}
105 Double_t GetP() const;
def9660e 106 Double_t GetSignedPt() const {
6c94f330 107 return (TMath::Abs(fP[4])>kAlmost0) ? 1./fP[4]:TMath::Sign(kVeryBig,fP[4]);
108 }
1d99986f 109 Double_t Get1P() const;
1530f89c 110 Double_t GetC(Double_t b) const {return fP[4]*b*kB2C;}
111 void GetDZ(Double_t x,Double_t y,Double_t z,Double_t b,Float_t dz[2]) const;
c7bafca9 112 Double_t GetD(Double_t xv, Double_t yv, Double_t b) const;
49d13e89 113 Double_t GetLinearD(Double_t xv, Double_t yv) const;
116b445b 114 Bool_t CorrectForMeanMaterial(Double_t xOverX0, Double_t xTimesRho,
7dded1d5 115 Double_t mass, Bool_t anglecorr=kFALSE,
116 Double_t (*f)(Double_t)=ApproximateBetheBloch);
49d13e89 117 Double_t GetPredictedChi2(Double_t p[2],Double_t cov[3]) const;
1e023a36 118
4b189f98 119 Double_t
120 GetPredictedChi2(Double_t p[3],Double_t covyz[3],Double_t covxyz[3]) const;
1e023a36 121 Bool_t
122 PropagateTo(Double_t p[3],Double_t covyz[3],Double_t covxyz[3],Double_t b);
123
e23a38cb 124 Double_t *GetResiduals(Double_t *p,Double_t *cov,Bool_t updated=kTRUE) const;
49d13e89 125 Bool_t Update(Double_t p[2],Double_t cov[3]);
126 Bool_t Rotate(Double_t alpha);
127 Bool_t PropagateTo(Double_t x, Double_t b);
128 Bool_t Propagate(Double_t alpha, Double_t x, Double_t b) {
129 if (Rotate(alpha))
130 if (PropagateTo(x,b)) return kTRUE;
131 return kFALSE;
132 }
052daaff 133 void Propagate(Double_t len,Double_t x[3],Double_t p[3],Double_t bz) const;
134 Bool_t Intersect(Double_t pnt[3], Double_t norm[3], Double_t bz) const;
49d13e89 135
c7bafca9 136 void GetHelixParameters(Double_t h[6], Double_t b) const;
137 Double_t GetDCA(const AliExternalTrackParam *p, Double_t b,
138 Double_t &xthis,Double_t &xp) const;
139 Double_t PropagateToDCA(AliExternalTrackParam *p, Double_t b);
e99a34df 140 Bool_t PropagateToDCA(const AliESDVertex *vtx, Double_t b, Double_t maxd,
141 Double_t dz[2]=0, Double_t cov[3]=0);
142
b1149664 143 void GetDirection(Double_t d[3]) const;
c9ec41e8 144 Bool_t GetPxPyPz(Double_t *p) const;
145 Bool_t GetXYZ(Double_t *p) const;
146 Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const;
147 Bool_t GetPxPyPzAt(Double_t x, Double_t b, Double_t p[3]) const;
148 Bool_t GetXYZAt(Double_t x, Double_t b, Double_t r[3]) const;
7cf7bb6c 149 Bool_t GetYAt(Double_t x, Double_t b, Double_t &y) const;
6c94f330 150 Bool_t GetZAt(Double_t x, Double_t b, Double_t &z) const;
c9ec41e8 151 void Print(Option_t* option = "") const;
c194ba83 152 Double_t GetSnpAt(Double_t x,Double_t b) const;
6c94f330 153
116b445b 154 //Deprecated
155 Bool_t CorrectForMaterial(Double_t d, Double_t x0, Double_t mass,
156 Double_t (*f)(Double_t)=ApproximateBetheBloch);
157
bf00ebb8 158 Bool_t GetDistance(AliExternalTrackParam *param2, Double_t x, Double_t dist[3], Double_t b);
159 Int_t GetIndex(Int_t i, Int_t j) const {return i+(j+1)*j/2;}
3c43fb2b 160 Int_t GetLabel() const {return -1;}
0c19adf7 161 //
162 // visualization (M. Ivanov)
163 //
164 virtual void FillPolymarker(TPolyMarker3D *pol, Float_t magf, Float_t minR, Float_t maxR, Float_t stepR);
165 virtual void DrawTrack(Float_t magF, Float_t minR, Float_t maxR, Float_t stepR);
166 protected:
6c94f330 167 Double_t &Par(Int_t i) {return fP[i];}
168 Double_t &Cov(Int_t i) {return fC[i];}
0c19adf7 169
170 private:
bad5ac2c 171 Double32_t fX; // X coordinate for the point of parametrisation
172 Double32_t fAlpha; // Local <-->global coor.system rotation angle
173 Double32_t fP[5]; // The track parameters
174 Double32_t fC[15]; // The track parameter covariance matrix
c9ec41e8 175
ed5f2849 176 static Double32_t fgMostProbablePt; // "Most probable" pt
177 // (to be used if Bz=0)
def9660e 178 ClassDef(AliExternalTrackParam, 7)
51ad6848 179};
180
ed5f2849 181inline void AliExternalTrackParam::ResetCovariance(Double_t s2) {
182 //
183 // Reset the covarince matrix to "something big"
184 //
185 fC[0]*= s2;
186 fC[1] = 0.; fC[2]*= s2;
187 fC[3] = 0.; fC[4] = 0.; fC[5]*= s2;
188 fC[6] = 0.; fC[7] = 0.; fC[8] = 0.; fC[9]*= s2;
189 fC[10]= 0.; fC[11]= 0.; fC[12]= 0.; fC[13]= 0.; fC[14]*=s2;
190}
191
bf00ebb8 192
193
194
51ad6848 195#endif