]>
Commit | Line | Data |
---|---|---|
251a2c81 | 1 | #ifndef ALIFLATEXTERNALTRACKPARAM_H |
2 | #define ALIFLATEXTERNALTRACKPARAM_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice * | |
6 | * Primary Authors : Sergey Gorbunov, Jochen Thaeder, Chiara Zampolli */ | |
7 | ||
8 | /** | |
9 | * >> Flat structure representing parameters of an external track << | |
10 | */ | |
11 | ||
12 | #include "Rtypes.h" | |
0d577a2c | 13 | #include "AliExternalTrackParam.h" |
f009a562 | 14 | |
6a33e0e9 | 15 | struct AliFlatExternalTrackParam |
251a2c81 | 16 | { |
17 | Float_t fAlpha; // azimuthal angle of reference frame | |
18 | Float_t fX; // x: radial distance | |
19 | Float_t fY; // local Y-coordinate of a track (cm) | |
20 | Float_t fZ; // local Z-coordinate of a track (cm) | |
21 | Float_t fSnp; // local sine of the track momentum azimuthal angle | |
22 | Float_t fTgl; // tangent of the track momentum dip angle | |
23 | Float_t fSigned1Pt; // 1/pt (1/(GeV/c)) | |
24 | Float_t fC[15]; // covariance matrix | |
25 | ||
26 | void SetAlpha(Float_t alpha) {fAlpha = alpha;} | |
27 | void SetX(Float_t x) {fX = x;} | |
28 | void SetY(Float_t y) {fY = y;} | |
29 | void SetZ(Float_t z) {fZ = z;} | |
30 | void SetSnp(Float_t snp) {fSnp = snp;} | |
31 | void SetTgl(Float_t tgl) {fTgl = tgl;} | |
32 | void SetSigned1Pt(Float_t signed1Pt) {fSigned1Pt = signed1Pt;} | |
33 | void SetCovEntry(Int_t idx, Float_t cov) {(idx >= 0 && idx < 15) ? fC[idx] = cov : 0.;} | |
34 | ||
35 | Float_t GetAlpha() const {return fAlpha;} | |
36 | Float_t GetX() const {return fX;} | |
37 | Float_t GetY() const {return fY;} | |
38 | Float_t GetZ() const {return fZ;} | |
39 | Float_t GetSnp() const {return fSnp;} | |
40 | Float_t GetTgl() const {return fTgl;} | |
41 | Float_t GetSigned1Pt() const {return fSigned1Pt;} | |
42 | Float_t* GetCov() const {return const_cast<Float_t*>(fC);} | |
43 | Float_t GetCovEntry(Int_t idx) const {return (idx >= 0 && idx < 15) ? fC[idx] : 0.;} | |
0d577a2c | 44 | Float_t GetPt() const { |
45 | Double_t pt1 = fabs( fSigned1Pt ); | |
46 | return (pt1>kAlmost0) ? 1./pt1 : kVeryBig; | |
48ec9ee6 | 47 | } |
0d577a2c | 48 | void GetExternalTrackParam( AliExternalTrackParam &p ) const; |
48ec9ee6 | 49 | void SetExternalTrackParam( const AliExternalTrackParam *p ); |
251a2c81 | 50 | }; |
51 | ||
6a33e0e9 | 52 | typedef struct AliFlatExternalTrackParam AliFlatExternalTrackParam; |
251a2c81 | 53 | |
48ec9ee6 | 54 | inline void AliFlatExternalTrackParam::GetExternalTrackParam( AliExternalTrackParam &p ) const |
55 | { | |
56 | // Get external track parameters | |
57 | Float_t par[5] = { fY, fZ, fSnp, fTgl, fSigned1Pt }; | |
58 | p.Set( fX, fAlpha, par, fC ); | |
59 | } | |
60 | ||
61 | inline void AliFlatExternalTrackParam::SetExternalTrackParam( const AliExternalTrackParam *p ) | |
62 | { | |
63 | // Set external track parameters | |
64 | if( !p ) return; | |
65 | fAlpha = p->GetAlpha(); | |
66 | fX = p->GetX(); | |
67 | fY = p->GetY(); | |
68 | fZ = p->GetZ(); | |
69 | fSnp = p->GetSnp(); | |
70 | fTgl = p->GetTgl(); | |
71 | fSigned1Pt = p->GetSigned1Pt(); | |
72 | for (Int_t idx = 0; idx <15; ++idx) fC[idx] = p->GetCovariance()[idx]; | |
73 | } | |
74 | ||
251a2c81 | 75 | #endif |