]>
Commit | Line | Data |
---|---|---|
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 | 24 | const Double_t kAlmost1=0.999; |
25 | const Double_t kAlmost0=1e-33; | |
26 | const Double_t kVeryBig=1./kAlmost0; | |
27 | ||
5773defd | 28 | const Double_t kB2C=0.299792458e-3; |
29 | const Double_t kAlmost0Field=1.e-13; | |
7b5ef2e6 | 30 | const Double_t kMostProbablePt=0.35; |
5773defd | 31 | |
f76701bf | 32 | class AliESDVertex; |
51ad6848 | 33 | |
ee5dba5e | 34 | Double_t ApproximateBetheBloch(Double_t); |
35 | ||
a5e407e9 | 36 | class 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]); | |
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); |
c9ec41e8 | 52 | |
49d13e89 | 53 | const Double_t *GetParameter() const {return fP;} |
54 | const Double_t *GetCovariance() const {return fC;} | |
6c94f330 | 55 | |
56 | Double_t GetAlpha() const {return fAlpha;} | |
c7bafca9 | 57 | Double_t GetX() const {return fX;} |
2d57349e | 58 | Double_t GetY() const {return fP[0];} |
59 | Double_t GetZ() const {return fP[1];} | |
6c94f330 | 60 | Double_t GetSnp() const {return fP[2];} |
61 | Double_t GetTgl() const {return fP[3];} | |
62 | Double_t Get1Pt() const {return fP[4];} | |
63 | ||
64 | Double_t GetSigmaY2() const {return fC[0];} | |
65 | Double_t GetSigmaZY() const {return fC[1];} | |
66 | Double_t GetSigmaZ2() const {return fC[2];} | |
67 | Double_t GetSigmaSnpY() const {return fC[3];} | |
68 | Double_t GetSigmaSnpZ() const {return fC[4];} | |
69 | Double_t GetSigmaSnp2() const {return fC[5];} | |
70 | Double_t GetSigmaTglY() const {return fC[6];} | |
71 | Double_t GetSigmaTglZ() const {return fC[7];} | |
72 | Double_t GetSigmaTglSnp() const {return fC[8];} | |
73 | Double_t GetSigmaTgl2() const {return fC[9];} | |
74 | Double_t GetSigma1PtY() const {return fC[10];} | |
75 | Double_t GetSigma1PtZ() const {return fC[11];} | |
76 | Double_t GetSigma1PtSnp() const {return fC[12];} | |
77 | Double_t GetSigma1PtTgl() const {return fC[13];} | |
78 | Double_t GetSigma1Pt2() const {return fC[14];} | |
79 | ||
c9ec41e8 | 80 | Double_t GetSign() const {return (fP[4]>0) ? 1 : -1;} |
81 | Double_t GetP() const; | |
6c94f330 | 82 | Double_t GetPt() const { |
83 | return (TMath::Abs(fP[4])>kAlmost0) ? 1./fP[4]:TMath::Sign(kVeryBig,fP[4]); | |
84 | } | |
1d99986f | 85 | Double_t Get1P() const; |
1530f89c | 86 | Double_t GetC(Double_t b) const {return fP[4]*b*kB2C;} |
87 | void GetDZ(Double_t x,Double_t y,Double_t z,Double_t b,Float_t dz[2]) const; | |
c7bafca9 | 88 | Double_t GetD(Double_t xv, Double_t yv, Double_t b) const; |
49d13e89 | 89 | Double_t GetLinearD(Double_t xv, Double_t yv) const; |
ee5dba5e | 90 | Bool_t CorrectForMaterial(Double_t d, Double_t x0, Double_t mass, |
91 | Double_t (*f)(Double_t)=ApproximateBetheBloch); | |
49d13e89 | 92 | Double_t GetPredictedChi2(Double_t p[2],Double_t cov[3]) const; |
1e023a36 | 93 | |
4b189f98 | 94 | Double_t |
95 | GetPredictedChi2(Double_t p[3],Double_t covyz[3],Double_t covxyz[3]) const; | |
1e023a36 | 96 | Bool_t |
97 | PropagateTo(Double_t p[3],Double_t covyz[3],Double_t covxyz[3],Double_t b); | |
98 | ||
49d13e89 | 99 | Bool_t Update(Double_t p[2],Double_t cov[3]); |
100 | Bool_t Rotate(Double_t alpha); | |
101 | Bool_t PropagateTo(Double_t x, Double_t b); | |
102 | Bool_t Propagate(Double_t alpha, Double_t x, Double_t b) { | |
103 | if (Rotate(alpha)) | |
104 | if (PropagateTo(x,b)) return kTRUE; | |
105 | return kFALSE; | |
106 | } | |
052daaff | 107 | void Propagate(Double_t len,Double_t x[3],Double_t p[3],Double_t bz) const; |
108 | Bool_t Intersect(Double_t pnt[3], Double_t norm[3], Double_t bz) const; | |
49d13e89 | 109 | |
c7bafca9 | 110 | void GetHelixParameters(Double_t h[6], Double_t b) const; |
111 | Double_t GetDCA(const AliExternalTrackParam *p, Double_t b, | |
112 | Double_t &xthis,Double_t &xp) const; | |
113 | Double_t PropagateToDCA(AliExternalTrackParam *p, Double_t b); | |
f76701bf | 114 | Bool_t PropagateToDCA(const AliESDVertex *vtx, Double_t b, Double_t maxd); |
c7bafca9 | 115 | |
b1149664 | 116 | void GetDirection(Double_t d[3]) const; |
c9ec41e8 | 117 | Bool_t GetPxPyPz(Double_t *p) const; |
118 | Bool_t GetXYZ(Double_t *p) const; | |
119 | Bool_t GetCovarianceXYZPxPyPz(Double_t cv[21]) const; | |
120 | Bool_t GetPxPyPzAt(Double_t x, Double_t b, Double_t p[3]) const; | |
121 | Bool_t GetXYZAt(Double_t x, Double_t b, Double_t r[3]) const; | |
7cf7bb6c | 122 | Bool_t GetYAt(Double_t x, Double_t b, Double_t &y) const; |
6c94f330 | 123 | Bool_t GetZAt(Double_t x, Double_t b, Double_t &z) const; |
c9ec41e8 | 124 | void Print(Option_t* option = "") const; |
c194ba83 | 125 | Double_t GetSnpAt(Double_t x,Double_t b) const; |
6c94f330 | 126 | |
127 | protected: | |
128 | Double_t &Par(Int_t i) {return fP[i];} | |
129 | Double_t &Cov(Int_t i) {return fC[i];} | |
130 | ||
c9ec41e8 | 131 | private: |
bad5ac2c | 132 | Double32_t fX; // X coordinate for the point of parametrisation |
133 | Double32_t fAlpha; // Local <-->global coor.system rotation angle | |
134 | Double32_t fP[5]; // The track parameters | |
135 | Double32_t fC[15]; // The track parameter covariance matrix | |
c9ec41e8 | 136 | |
ed5f2849 | 137 | static Double32_t fgMostProbablePt; // "Most probable" pt |
138 | // (to be used if Bz=0) | |
139 | ClassDef(AliExternalTrackParam, 6) | |
51ad6848 | 140 | }; |
141 | ||
ed5f2849 | 142 | inline void AliExternalTrackParam::ResetCovariance(Double_t s2) { |
143 | // | |
144 | // Reset the covarince matrix to "something big" | |
145 | // | |
146 | fC[0]*= s2; | |
147 | fC[1] = 0.; fC[2]*= s2; | |
148 | fC[3] = 0.; fC[4] = 0.; fC[5]*= s2; | |
149 | fC[6] = 0.; fC[7] = 0.; fC[8] = 0.; fC[9]*= s2; | |
150 | fC[10]= 0.; fC[11]= 0.; fC[12]= 0.; fC[13]= 0.; fC[14]*=s2; | |
151 | } | |
152 | ||
51ad6848 | 153 | #endif |