]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDtrack.h
TRD PID included in the ESD schema (T.Kuhr)
[u/mrichter/AliRoot.git] / TRD / AliTRDtrack.h
1 #ifndef ALITRDTRACK_H
2 #define ALITRDTRACK_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 #include <AliKalmanTrack.h>
8 #include <TMath.h>
9
10 #include "AliBarrelTrack.h"
11 #include "AliTRDgeometry.h"
12 #include "TVector2.h"
13
14 class AliTRDcluster;
15 class AliTPCtrack;
16 class AliESDtrack;
17
18 const unsigned kMAX_CLUSTERS_PER_TRACK=210; 
19
20 class AliTRDtrack : public AliKalmanTrack {
21
22 // Represents reconstructed TRD track
23
24 public:
25
26    AliTRDtrack():AliKalmanTrack(){}
27    AliTRDtrack(const AliTRDcluster *c, UInt_t index, const Double_t xx[5],
28                const Double_t cc[15], Double_t xr, Double_t alpha);  
29    AliTRDtrack(const AliTRDtrack& t);    
30    AliTRDtrack(const AliKalmanTrack& t, Double_t alpha); 
31    AliTRDtrack(const AliESDtrack& t);    
32
33    Int_t    Compare(const TObject *o) const;
34    void     CookdEdx(Double_t low=0.05, Double_t up=0.70);   
35
36    Double_t GetAlpha() const {return fAlpha;}
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
41    Double_t GetC()     const {return fC;}
42    Int_t    GetClusterIndex(Int_t i) const {return fIndex[i];}    
43    Float_t  GetClusterdQdl(Int_t i) const {return fdQdl[i];}    
44
45    void     GetCovariance(Double_t cov[15]) const;  
46    Double_t GetdEdx()  const {return fdEdx;}
47    Double_t GetPIDsignal()  const {return GetdEdx();}
48    Double_t GetEta()   const {return fE;}
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
55    Double_t Get1Pt()   const {return (1e-9*TMath::Abs(fC)/fC + fC)*GetConvConst(); } 
56    Double_t GetP()     const {  
57      return TMath::Abs(GetPt())*sqrt(1.+GetTgl()*GetTgl());
58    }
59    Double_t GetPredictedChi2(const AliTRDcluster*, Double_t h01) const ;
60    Double_t GetPt()    const {return 1./Get1Pt();}   
61    void     GetPxPyPz(Double_t &px, Double_t &py, Double_t &pz) const ;
62    void     GetGlobalXYZ(Double_t &x, Double_t &y, Double_t &z) const ;
63    Int_t    GetSeedLabel() const { return fSeedLab; }
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;}
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;}
73
74    Int_t    PropagateTo(Double_t xr, Double_t x0=8.72, Double_t rho=5.86e-3);
75    void     ResetCovariance();   
76    Int_t    Rotate(Double_t angle);
77
78    void     SetdEdx(Float_t dedx) {fdEdx=dedx;}  
79    void     SetLikelihoodElectron(Float_t l) { fLhElectron = l; };  
80
81    void     SetSampledEdx(Float_t q, Int_t i) {
82               Double_t s=GetSnp(), t=GetTgl();
83               q*= TMath::Sqrt((1-s*s)/(1+t*t));
84               fdQdl[i]=q;
85             }     
86
87    void     SetSeedLabel(Int_t lab) { fSeedLab=lab; }
88
89    Int_t    Update(const AliTRDcluster* c, Double_t chi2, UInt_t i, 
90                    Double_t h01);
91
92   //
93   void GetBarrelTrack(AliBarrelTrack *track);
94   void AddNWrong() {fNWrong++;}
95   
96   Int_t GetNWrong() const {return fNWrong;}
97   Int_t GetNRotate() const {return fNRotate;}
98   //
99
100
101 protected:
102
103    Int_t    fSeedLab;     // track label taken from seeding  
104    Float_t  fdEdx;        // dE/dx 
105
106    Double_t fAlpha;       // rotation angle
107    Double_t fX;           // running local X-coordinate of the track (time bin)
108
109
110    Double_t fY;             // Y-coordinate of the track
111    Double_t fZ;             // Z-coordinate of the track
112    Double_t fE;             // C*x0
113    Double_t fT;             // tangent of the track momentum dip angle
114    Double_t fC;             // track curvature
115
116    Double_t fCyy;                         // covariance
117    Double_t fCzy, fCzz;                   // matrix
118    Double_t fCey, fCez, fCee;             // of the
119    Double_t fCty, fCtz, fCte, fCtt;       // track
120    Double_t fCcy, fCcz, fCce, fCct, fCcc; // parameters   
121    
122    UInt_t  fIndex[kMAX_CLUSTERS_PER_TRACK];  // global indexes of clusters  
123    Float_t fdQdl[kMAX_CLUSTERS_PER_TRACK];   // cluster amplitudes corrected 
124                                              // for track angles    
125                            
126    Float_t fLhElectron;    // Likelihood to be an electron    
127    Int_t fNWrong;    // number of wrong clusters
128    Int_t fNRotate;
129
130    ClassDef(AliTRDtrack,2) // TRD reconstructed tracks
131
132 };                     
133
134
135 #endif