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