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