]>
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 | ||
8 | ||
a5e407e9 | 9 | #include "TObject.h" |
10 | #include "AliMagF.h" | |
11 | #include "TVector3.h" | |
12 | ||
51ad6848 | 13 | class AliKalmanTrack; |
a5e407e9 | 14 | class AliTrackReference; |
51ad6848 | 15 | |
a5e407e9 | 16 | class AliExternalTrackParam: public TObject { |
51ad6848 | 17 | public: |
18 | AliExternalTrackParam(); | |
19 | AliExternalTrackParam(Double_t x, Double_t alpha, | |
20 | const Double_t param[5], const Double_t covar[15]); | |
21 | AliExternalTrackParam(const AliKalmanTrack& track); | |
a5e407e9 | 22 | static AliExternalTrackParam * MakeTrack(const AliTrackReference *ref, Double_t mass); |
51ad6848 | 23 | |
24 | virtual const Double_t* GetParameter() const; | |
25 | virtual const Double_t* GetCovariance() const; | |
26 | virtual Double_t X() const {return fX;}; | |
27 | virtual Double_t Alpha() const {return fAlpha;}; | |
28 | virtual AliExternalTrackParam* CreateExternalParam() const; | |
29 | virtual void ResetCovariance(Double_t factor = 10., | |
30 | Bool_t clearOffDiagonal = kTRUE); | |
31 | virtual Double_t Y() const {return fParam[0];}; | |
32 | virtual Double_t Z() const {return fParam[1];}; | |
a5e407e9 | 33 | virtual void GetXYZ(Float_t r[3]) const; |
34 | virtual void GetGlobalXYZ(Double_t &x, Double_t &y, Double_t &z ) const; | |
35 | virtual Bool_t PropagateTo(Double_t x, Double_t x0, Double_t rho); | |
36 | virtual Bool_t PropagateToDCA(Double_t x, Double_t y, Double_t x0, Double_t rho); | |
51ad6848 | 37 | virtual Bool_t RotateTo(Double_t alpha); |
a5e407e9 | 38 | virtual Bool_t CorrectForMaterial(Double_t d, Double_t x0, Double_t rho); |
51ad6848 | 39 | virtual Bool_t GetProlongationAt(Double_t x, Double_t& y, |
40 | Double_t& z) const; | |
41 | virtual Double_t GetXAtVertex(Double_t x = 0, Double_t y = 0) const; | |
42 | ||
a5e407e9 | 43 | // virtual Double_t GetPredictedChi2(const AliCluster* cluster); |
44 | // virtual Bool_t Update(const AliCluster* cluster); | |
51ad6848 | 45 | |
46 | virtual Double_t SigmaPhi() const; | |
47 | virtual Double_t SigmaTheta() const; | |
48 | virtual Double_t SigmaPt() const; | |
49 | virtual TVector3 Momentum() const; | |
50 | virtual TVector3 Position() const; | |
51 | ||
52 | virtual void Print(Option_t* option = "") const; | |
a5e407e9 | 53 | // local magnetic field manipulation |
54 | void SaveLocalConvConst(); | |
55 | Double_t GetLocalConvConst() const; | |
56 | ||
57 | static void SetFieldMap(const AliMagF *map) { fgkFieldMap=map; } | |
58 | static const AliMagF *GetFieldMap() { return fgkFieldMap; } | |
59 | ||
60 | static void SetUniformFieldTracking() { | |
61 | if (fgkFieldMap==0) { | |
62 | printf("AliKalmanTrack: Field map has not been set !\n"); | |
63 | exit(1); | |
64 | } | |
65 | fgConvConst=1000/0.299792458/(fgkFieldMap->SolenoidField()+1e-13); | |
66 | } | |
67 | static void SetNonuniformFieldTracking() { fgConvConst=0.; } | |
51ad6848 | 68 | |
69 | private: | |
a5e407e9 | 70 | Double_t fMass; // mass associated to the particle |
51ad6848 | 71 | Double_t fX; // x coordinate for the parametrisation |
72 | Double_t fAlpha; // azimuthal angle for the parametrisation | |
73 | Double_t fParam[5]; // track parameter (y, z, sin(azimuthal angel), tan(dip angle), 1/pt) | |
74 | Double_t fCovar[15]; // track parameter covariance | |
a5e407e9 | 75 | // |
76 | static const AliMagF *fgkFieldMap;//pointer to the magnetic field map | |
77 | static Double_t fgConvConst; //conversion "curvature(1/cm) -> pt(GeV/c)" | |
78 | Double_t fLocalConvConst; //local conversion "curvature(1/cm) -> pt(GeV/c)" | |
79 | ||
51ad6848 | 80 | |
a5e407e9 | 81 | ClassDef(AliExternalTrackParam, 3) |
51ad6848 | 82 | }; |
83 | ||
a5e407e9 | 84 | |
85 | inline void AliExternalTrackParam::SaveLocalConvConst() { | |
86 | //--------------------------------------------------------------------- | |
87 | // Saves local conversion constant "curvature (1/cm) -> pt (GeV/c)" | |
88 | //--------------------------------------------------------------------- | |
89 | if (fgConvConst > 0 || fgConvConst < 0) return; //uniform field tracking | |
90 | Float_t r[3]={0.,0.,0.}; GetXYZ(r); | |
91 | Float_t b[3]; fgkFieldMap->Field(r,b); | |
92 | fLocalConvConst=1000/0.299792458/(1e-13 - b[2]); | |
93 | } | |
94 | ||
95 | inline Double_t AliExternalTrackParam::GetLocalConvConst() const { | |
96 | //--------------------------------------------------------------------- | |
97 | // Returns conversion constant "curvature (1/cm) -> pt (GeV/c)" | |
98 | //--------------------------------------------------------------------- | |
99 | if (fgConvConst > 0 || fgConvConst < 0) return fgConvConst; //uniform field tracking | |
100 | return fLocalConvConst; | |
101 | } | |
102 | ||
103 | ||
104 | inline void AliExternalTrackParam::GetXYZ(Float_t r[3]) const { | |
105 | //--------------------------------------------------------------------- | |
106 | // Returns the position of the track in the global coord. system | |
107 | //--------------------------------------------------------------------- | |
108 | Double_t cs=TMath::Cos(fAlpha), sn=TMath::Sin(fAlpha); | |
109 | r[0]=fX*cs - fParam[0]*sn; r[1]=fX*sn + fParam[0]*cs; r[2]=fParam[1]; | |
110 | } | |
111 | ||
112 | inline void AliExternalTrackParam::GetGlobalXYZ(Double_t &x, Double_t &y, Double_t &z) const { | |
113 | //--------------------------------------------------------------------- | |
114 | // Returns the position of the track in the global coord. system | |
115 | //--------------------------------------------------------------------- | |
116 | Double_t cs=TMath::Cos(fAlpha), sn=TMath::Sin(fAlpha); | |
117 | x=fX*cs - fParam[0]*sn; y=fX*sn + fParam[0]*cs; z=fParam[1]; | |
118 | } | |
119 | ||
120 | ||
121 | ||
122 | ||
51ad6848 | 123 | #endif |