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