]>
Commit | Line | Data |
---|---|---|
87594435 | 1 | #ifndef ALIKALMANTRACK_H |
2 | #define ALIKALMANTRACK_H | |
3 | ||
4 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | ||
fb17acd4 | 7 | /* $Id$ */ |
8 | ||
87594435 | 9 | //------------------------------------------------------------------------- |
10 | // Class AliKalmanTrack | |
9b859005 | 11 | // fixed the interface for the derived reconstructed track classes |
12 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
87594435 | 13 | //------------------------------------------------------------------------- |
14 | ||
15 | #include <TObject.h> | |
c84a5e9e | 16 | #include "AliLog.h" |
304864ab | 17 | #include "AliPID.h" |
c84a5e9e | 18 | #include "AliMagF.h" |
87594435 | 19 | |
20 | class AliCluster; | |
21 | ||
22 | class AliKalmanTrack : public TObject { | |
23 | public: | |
e2afb3b6 | 24 | AliKalmanTrack(); |
25 | AliKalmanTrack(const AliKalmanTrack &t); | |
26 | ||
be9c5115 | 27 | virtual ~AliKalmanTrack(){}; |
28 | void SetLabel(Int_t lab) {fLab=lab;} | |
babd135a | 29 | void SetFakeRatio(Float_t ratio) {fFakeRatio=ratio;} |
be9c5115 | 30 | |
31 | Bool_t IsSortable() const {return kTRUE;} | |
32 | Int_t GetLabel() const {return fLab;} | |
babd135a | 33 | Float_t GetFakeRatio() const {return fFakeRatio;} |
be9c5115 | 34 | Double_t GetChi2() const {return fChi2;} |
7f6ddf58 | 35 | Double_t GetMass() const {return fMass;} |
be9c5115 | 36 | Int_t GetNumberOfClusters() const {return fN;} |
e2afb3b6 | 37 | virtual Int_t GetClusterIndex(Int_t) const { //reserved for AliTracker |
c84a5e9e | 38 | AliWarning("Method must be overloaded !\n"); |
be9c5115 | 39 | return 0; |
40 | } | |
ae982df3 | 41 | virtual Double_t GetPIDsignal() const { |
c84a5e9e | 42 | AliWarning("Method must be overloaded !\n"); |
ae982df3 | 43 | return 0.; |
44 | } | |
be9c5115 | 45 | |
fc7be9e3 | 46 | virtual Double_t GetDCA(const AliKalmanTrack *p,Double_t &xthis,Double_t &xp) const; |
49a7a79a | 47 | virtual |
fc7be9e3 | 48 | Double_t PropagateToDCA(AliKalmanTrack *p, Double_t d=0., Double_t x0=0.); |
49a7a79a | 49 | virtual Double_t GetAlpha() const { |
c84a5e9e | 50 | AliWarning("Method must be overloaded !\n"); |
49a7a79a | 51 | return 0.; |
52 | } | |
53 | virtual Double_t GetSigmaY2() const { | |
c84a5e9e | 54 | AliWarning("Method must be overloaded !\n"); |
49a7a79a | 55 | return 0.; |
56 | } | |
57 | virtual Double_t GetSigmaZ2() const { | |
c84a5e9e | 58 | AliWarning("Method must be overloaded !\n"); |
49a7a79a | 59 | return 0.; |
60 | } | |
61 | ||
e2afb3b6 | 62 | virtual Int_t Compare(const TObject *) const {return 0;} |
be9c5115 | 63 | |
c84a5e9e | 64 | virtual void GetExternalParameters(Double_t&/*xr*/,Double_t/*x*/[5]) const=0; |
65 | virtual void GetExternalCovariance(Double_t /*cov*/[15]) const = 0; | |
be9c5115 | 66 | |
c84a5e9e | 67 | virtual Double_t GetPredictedChi2(const AliCluster *) const = 0; |
68 | virtual Int_t PropagateTo(Double_t/*xr*/,Double_t/*x0*/,Double_t/*rho*/) = 0; | |
69 | //virtual Int_t PropagateToVertex(Double_t /*d*/=0., Double_t /*x0*/=0.) = 0; | |
70 | virtual Int_t Update(const AliCluster*, Double_t /*chi2*/, UInt_t) = 0; | |
be9c5115 | 71 | |
c84a5e9e | 72 | static void SetFieldMap(const AliMagF *map) { fgkFieldMap=map; } |
73 | static const AliMagF *GetFieldMap() { return fgkFieldMap; } | |
9b280d80 | 74 | |
c84a5e9e | 75 | static void SetUniformFieldTracking() { |
76 | if (fgkFieldMap==0) { | |
77 | printf("AliKalmanTrack: Field map has not been set !\n"); | |
78 | exit(1); | |
79 | } | |
80 | fgConvConst=1000/0.299792458/(fgkFieldMap->SolenoidField()+1e-13); | |
e1a65e92 | 81 | } |
c84a5e9e | 82 | static void SetNonuniformFieldTracking() { fgConvConst=0.; } |
e1a65e92 | 83 | |
c84a5e9e | 84 | static Double_t GetConvConst(); |
4557b520 | 85 | static Double_t MeanMaterialBudget(Double_t *start, Double_t *end, Double_t *mparam); |
c84a5e9e | 86 | |
49a7a79a | 87 | // Time integration (S.Radomski@gsi.de) |
74f9526e | 88 | void StartTimeIntegral(); |
ae982df3 | 89 | void SetIntegratedLength(Double_t l) {fIntegratedLength=l;} |
90 | void SetIntegratedTimes(const Double_t *times); | |
91 | ||
74f9526e | 92 | Bool_t IsStartedTimeIntegral() const {return fStartTimeIntegral;} |
93 | void AddTimeStep(Double_t length); | |
ae982df3 | 94 | void GetIntegratedTimes(Double_t *times) const; |
74f9526e | 95 | Double_t GetIntegratedTime(Int_t pdg) const; |
96 | Double_t GetIntegratedLength() const {return fIntegratedLength;} | |
97 | void PrintTime() const; | |
4095d1ca | 98 | |
be9c5115 | 99 | protected: |
c84a5e9e | 100 | virtual void GetXYZ(Float_t r[3]) const = 0; |
101 | void SaveLocalConvConst(); | |
102 | Double_t GetLocalConvConst() const; | |
103 | ||
104 | void External2Helix(Double_t helix[6]) const; | |
105 | ||
be9c5115 | 106 | void SetChi2(Double_t chi2) {fChi2=chi2;} |
7f6ddf58 | 107 | void SetMass(Double_t mass) {fMass=mass;} |
be9c5115 | 108 | void SetNumberOfClusters(Int_t n) {fN=n;} |
109 | ||
87594435 | 110 | Int_t fLab; // track label |
babd135a | 111 | Float_t fFakeRatio; // fake ratio |
87594435 | 112 | Double_t fChi2; // total chi2 value for this track |
7f6ddf58 | 113 | Double_t fMass; // mass hypothesis |
be9c5115 | 114 | Int_t fN; // number of associated clusters |
c84a5e9e | 115 | |
116 | private: | |
117 | static const AliMagF *fgkFieldMap;//pointer to the magnetic field map | |
118 | static Double_t fgConvConst; //conversion "curvature(1/cm) -> pt(GeV/c)" | |
119 | Double_t fLocalConvConst; //local conversion "curvature(1/cm) -> pt(GeV/c)" | |
9b280d80 | 120 | |
49a7a79a | 121 | // variables for time integration (S.Radomski@gsi.de) |
74f9526e | 122 | Bool_t fStartTimeIntegral; // indicator wether integrate time |
304864ab | 123 | Double_t fIntegratedTime[AliPID::kSPECIES]; // integrated time |
9c75d176 | 124 | Double_t fIntegratedLength; // integrated length |
74f9526e | 125 | |
c84a5e9e | 126 | ClassDef(AliKalmanTrack,4) // Reconstructed track |
87594435 | 127 | }; |
128 | ||
c84a5e9e | 129 | inline Double_t AliKalmanTrack::GetConvConst() { |
130 | // | |
131 | // For backward compatibility only ! | |
132 | // | |
133 | if (fgConvConst > 0 || fgConvConst < 0) return fgConvConst; | |
134 | return 1000/0.299792458/(fgkFieldMap->SolenoidField()+1e-13); | |
135 | } | |
136 | ||
137 | inline void AliKalmanTrack::SaveLocalConvConst() { | |
138 | //--------------------------------------------------------------------- | |
139 | // Saves local conversion constant "curvature (1/cm) -> pt (GeV/c)" | |
140 | //--------------------------------------------------------------------- | |
141 | if (fgConvConst > 0 || fgConvConst < 0) return; //uniform field tracking | |
142 | Float_t r[3]={0.,0.,0.}; GetXYZ(r); | |
143 | Float_t b[3]; fgkFieldMap->Field(r,b); | |
144 | fLocalConvConst=1000/0.299792458/(1e-13 - b[2]); | |
145 | } | |
146 | ||
147 | inline Double_t AliKalmanTrack::GetLocalConvConst() const { | |
148 | //--------------------------------------------------------------------- | |
149 | // Returns conversion constant "curvature (1/cm) -> pt (GeV/c)" | |
150 | //--------------------------------------------------------------------- | |
151 | if (fgConvConst > 0 || fgConvConst < 0) return fgConvConst; //uniform field tracking | |
152 | return fLocalConvConst; | |
153 | } | |
154 | ||
87594435 | 155 | #endif |
156 | ||
157 |