Missing constant included.
[u/mrichter/AliRoot.git] / TRD / AliTRDtrack.h
CommitLineData
46d29e70 1#ifndef ALITRDTRACK_H
b3a5a838 2#define ALITRDTRACK_H
46d29e70 3
4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
b3a5a838 5 * See cxx source for full Copyright notice */
46d29e70 6
5443e65e 7#include <AliKalmanTrack.h>
b3a5a838 8#include <TMath.h>
46d29e70 9
9c9d2487 10#include "AliBarrelTrack.h"
11#include "AliTRDgeometry.h"
12#include "TVector2.h"
13
46d29e70 14class AliTRDcluster;
b3a5a838 15class AliTPCtrack;
79e94bf8 16class AliESDtrack;
5443e65e 17
18const unsigned kMAX_CLUSTERS_PER_TRACK=210;
46d29e70 19
5443e65e 20class AliTRDtrack : public AliKalmanTrack {
46d29e70 21
22// Represents reconstructed TRD track
23
46d29e70 24public:
25
5443e65e 26 AliTRDtrack():AliKalmanTrack(){}
a819a5f7 27 AliTRDtrack(const AliTRDcluster *c, UInt_t index, const Double_t xx[5],
46d29e70 28 const Double_t cc[15], Double_t xr, Double_t alpha);
29 AliTRDtrack(const AliTRDtrack& t);
5443e65e 30 AliTRDtrack(const AliKalmanTrack& t, Double_t alpha);
79e94bf8 31 AliTRDtrack(const AliESDtrack& t);
46d29e70 32
a819a5f7 33 Int_t Compare(const TObject *o) const;
34 void CookdEdx(Double_t low=0.05, Double_t up=0.70);
46d29e70 35
36 Double_t GetAlpha() const {return fAlpha;}
9c9d2487 37 Int_t GetSector() const {
38 //if (fabs(fAlpha) < AliTRDgeometry::GetAlpha()/2) return 0;
39 return Int_t(TVector2::Phi_0_2pi(fAlpha)/AliTRDgeometry::GetAlpha())%AliTRDgeometry::kNsect;}
40
46d29e70 41 Double_t GetC() const {return fC;}
42 Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
a819a5f7 43 Float_t GetClusterdQdl(Int_t i) const {return fdQdl[i];}
5443e65e 44
46d29e70 45 void GetCovariance(Double_t cov[15]) const;
c5507f6d 46 Double_t GetdEdx() const {return fdEdx;}
79e94bf8 47 Double_t GetPIDsignal() const {return GetdEdx();}
46d29e70 48 Double_t GetEta() const {return fE;}
5443e65e 49
50 void GetExternalCovariance(Double_t cov[15]) const ;
51 void GetExternalParameters(Double_t& xr, Double_t x[5]) const ;
52
53 Double_t GetLikelihoodElectron() const { return fLhElectron; };
54
b8dc2353 55 Double_t Get1Pt() const {return (1e-9*TMath::Abs(fC)/fC + fC)*GetConvConst(); }
46d29e70 56 Double_t GetP() const {
57 return TMath::Abs(GetPt())*sqrt(1.+GetTgl()*GetTgl());
58 }
fd621f36 59 Double_t GetPredictedChi2(const AliTRDcluster*, Double_t h01) const ;
5443e65e 60 Double_t GetPt() const {return 1./Get1Pt();}
46d29e70 61 void GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const ;
5443e65e 62 void GetGlobalXYZ(Double_t &x, Double_t &y, Double_t &z) const ;
63 Int_t GetSeedLabel() const { return fSeedLab; }
46d29e70 64 Double_t GetSigmaC2() const {return fCcc;}
65 Double_t GetSigmaTgl2() const {return fCtt;}
66 Double_t GetSigmaY2() const {return fCyy;}
67 Double_t GetSigmaZ2() const {return fCzz;}
5443e65e 68 Double_t GetSnp() const {return fX*fC - fE;}
69 Double_t GetTgl() const {return fT;}
70 Double_t GetX() const {return fX;}
71 Double_t GetY() const {return fY;}
72 Double_t GetZ() const {return fZ;}
46d29e70 73
1e9bb598 74 Double_t GetYat(Double_t xk) const {
75//-----------------------------------------------------------------
76// This function calculates the Y-coordinate of a track at the plane x=xk.
77// Needed for matching with the TOF (I.Belikov)
78//-----------------------------------------------------------------
79 Double_t c1=fC*fX - fE, r1=TMath::Sqrt(1.- c1*c1);
80 Double_t c2=fC*xk - fE, r2=TMath::Sqrt(1.- c2*c2);
81 return fY + (xk-fX)*(c1+c2)/(r1+r2);
82 }
83
b3a5a838 84 Int_t PropagateTo(Double_t xr, Double_t x0=8.72, Double_t rho=5.86e-3);
5443e65e 85 void ResetCovariance();
1e9bb598 86 void ResetClusters() { SetChi2(0.); SetNumberOfClusters(0); }
46d29e70 87 Int_t Rotate(Double_t angle);
88
46d29e70 89 void SetdEdx(Float_t dedx) {fdEdx=dedx;}
5443e65e 90 void SetLikelihoodElectron(Float_t l) { fLhElectron = l; };
91
92 void SetSampledEdx(Float_t q, Int_t i) {
93 Double_t s=GetSnp(), t=GetTgl();
94 q*= TMath::Sqrt((1-s*s)/(1+t*t));
95 fdQdl[i]=q;
96 }
97
98 void SetSeedLabel(Int_t lab) { fSeedLab=lab; }
99
fd621f36 100 Int_t Update(const AliTRDcluster* c, Double_t chi2, UInt_t i,
b8dc2353 101 Double_t h01);
fd621f36 102
9c9d2487 103 //
104 void GetBarrelTrack(AliBarrelTrack *track);
105 void AddNWrong() {fNWrong++;}
106
107 Int_t GetNWrong() const {return fNWrong;}
108 Int_t GetNRotate() const {return fNRotate;}
109 //
110
111
bbf92647 112protected:
113
5443e65e 114 Int_t fSeedLab; // track label taken from seeding
bbf92647 115 Float_t fdEdx; // dE/dx
116
117 Double_t fAlpha; // rotation angle
118 Double_t fX; // running local X-coordinate of the track (time bin)
119
b8dc2353 120
121 Double_t fY; // Y-coordinate of the track
122 Double_t fZ; // Z-coordinate of the track
123 Double_t fE; // C*x0
124 Double_t fT; // tangent of the track momentum dip angle
125 Double_t fC; // track curvature
bbf92647 126
127 Double_t fCyy; // covariance
128 Double_t fCzy, fCzz; // matrix
b3a5a838 129 Double_t fCey, fCez, fCee; // of the
130 Double_t fCty, fCtz, fCte, fCtt; // track
131 Double_t fCcy, fCcz, fCce, fCct, fCcc; // parameters
b8dc2353 132
5443e65e 133 UInt_t fIndex[kMAX_CLUSTERS_PER_TRACK]; // global indexes of clusters
134 Float_t fdQdl[kMAX_CLUSTERS_PER_TRACK]; // cluster amplitudes corrected
135 // for track angles
b8dc2353 136
a819a5f7 137 Float_t fLhElectron; // Likelihood to be an electron
9c9d2487 138 Int_t fNWrong; // number of wrong clusters
139 Int_t fNRotate;
bbf92647 140
a819a5f7 141 ClassDef(AliTRDtrack,2) // TRD reconstructed tracks
a2b90f83 142
46d29e70 143};
144
145
46d29e70 146#endif