]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDtrack.h
Common track parametrization in the barrel detectors (Yu.Belikov)
[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 /* $Id$ */
8
9 ///////////////////////////////////////////////////////////////////////////////
10 //                                                                           //
11 //  Represents a reconstructed TRD track                                     //
12 //                                                                           //
13 ///////////////////////////////////////////////////////////////////////////////
14
15 #include "AliKalmanTrack.h"
16 #include "AliTRDtracklet.h"
17
18 class AliESDtrack;
19 class AliTrackReference;
20
21 const unsigned kMAXCLUSTERSPERTRACK = 210; 
22
23 class AliTRDtrack : public AliKalmanTrack {
24    
25   enum { kNdet      = 540
26        , kNstacks   =  90
27        , kNplane    =   6
28        , kNcham     =   5
29        , kNsect     =  18
30        , kNslice    =   3
31        , kNtimeBins =  22 };
32
33   friend class AliTRDtracker;
34
35  public:
36
37    AliTRDtrack();
38    AliTRDtrack(const AliTRDcluster *c, Int_t index, const Double_t xx[5],
39                const Double_t cc[15], Double_t xr, Double_t alpha);  
40    AliTRDtrack(const AliTRDtrack& t);    
41    AliTRDtrack(const AliESDtrack& t);
42    ~AliTRDtrack();
43
44    AliTRDtrack(const AliKalmanTrack& t, Double_t alpha); 
45
46    Int_t           Compare(const TObject *o) const;
47
48    void SetdEdx(Double_t dedx) {fdEdx=dedx;}
49    Double_t GetdEdx()  const {return fdEdx;}
50    Double_t GetPIDsignal()  const {return GetdEdx();}
51
52    Int_t GetClusterIndex(Int_t i) const {return fIndex[i];}
53
54    Double_t GetC() const {return AliExternalTrackParam::GetC(GetBz());}
55
56    Double_t GetPredictedChi2(const AliTRDcluster* c, Double_t h01) const;
57    Bool_t PropagateTo(Double_t xr, Double_t x0=8.72, Double_t rho=5.86e-3);
58    Bool_t Update(const AliTRDcluster* c, Double_t chi2, Int_t i, Double_t h01);
59    Bool_t Rotate(Double_t angle, Bool_t absolute=kFALSE);
60
61    void ResetClusters() { SetChi2(0.); SetNumberOfClusters(0); }
62
63    void            CookdEdx(Double_t low=0.05, Double_t up=0.7);   
64    Float_t         StatusForTOF();
65  
66    Int_t           GetSector() const;
67
68    Float_t         GetClusterdQdl(Int_t i) const { return fdQdl[i]; }    
69
70    Float_t GetPIDsignals(Int_t iPlane, Int_t iSlice) const 
71            { return fdEdxPlane[iPlane][iSlice]; }
72    Int_t  GetPIDTimBin(Int_t i) const { return fTimBinPlane[i];}
73
74    Double_t GetLikelihoodElectron() const { return fLhElectron;    }
75
76  
77    Int_t   GetSeedLabel() const  { return fSeedLab; }
78
79    Int_t *GetBackupIndexes() { return fIndexBackup;   }
80    Int_t *GetIndexes()       { return fIndex;         }
81
82    Int_t           GetProlongation(Double_t xk, Double_t &y, Double_t &z);
83
84    void SetStop(Bool_t stop) { fStopped = stop; }
85    Bool_t GetStop() const    { return fStopped; }
86
87    Int_t           PropagateToX(Double_t xr, Double_t step);
88    Int_t           PropagateToR(Double_t xr, Double_t step);
89
90    void SetPIDsignals(Float_t dedx, Int_t iPlane, Int_t iSlice) 
91                       { fdEdxPlane[iPlane][iSlice] = dedx; }
92    void SetPIDTimBin(Int_t timbin, Int_t i)  { fTimBinPlane[i] = timbin; }
93    void SetLikelihoodElectron(Float_t l)     { fLhElectron     = l;      }
94
95    void SetSampledEdx(Float_t q, Int_t i);
96    void SetSampledEdx(Float_t q);
97    void SetSeedLabel(Int_t lab) { fSeedLab = lab; }
98
99    Int_t UpdateMI(const AliTRDcluster* c, Double_t chi2, Int_t i, Double_t h01, Int_t plane);
100   //Int_t  UpdateMI(const AliTRDtracklet & tracklet);
101
102    void AddNWrong() { fNWrong++; }
103   
104    Int_t GetNWrong() const  { return fNWrong;  }
105    Int_t GetNRotate() const { return fNRotate; }
106    Int_t GetNCross() const  { return fNCross;  }
107    void  IncCross() { fNCross++; if (fBackupTrack) fBackupTrack->IncCross(); }
108    AliTRDtrack *GetBackupTrack() { return fBackupTrack; }
109    void         MakeBackupTrack();
110
111  protected:
112    Double_t GetBz() const;
113    Bool_t Update(const AliCluster */*c*/, Double_t /*chi2*/, Int_t /*idx*/) {
114      return 0;
115    }
116    Double_t GetPredictedChi2(const AliCluster */*c*/) const {return 0.;}
117
118    AliTRDtrack     &operator=(const AliTRDtrack &t);
119
120    Int_t           fSeedLab;                               // track label taken from seeding  
121    Float_t         fdEdx;                                  // dE/dx 
122    Float_t         fdEdxT;                                 // dE/dx  - truncated mean
123    Float_t         fDE;                                    // integrated delta energy
124    Float_t         fdEdxPlane[kNplane][kNslice];           // dE/dx from all 6 planes in 3 slices each
125    Int_t           fTimBinPlane[kNplane];                  // time bin of Max cluster from all 6 planes
126
127    Bool_t          fStopped;                               // track stop indication
128    Int_t           fIndex[kMAXCLUSTERSPERTRACK];           // global indexes of clusters  
129    Int_t           fIndexBackup[kMAXCLUSTERSPERTRACK];     // backup indexes of clusters - used in iterations
130    Float_t         fdQdl[kMAXCLUSTERSPERTRACK];            // cluster amplitudes corrected for track angles    
131                            
132    Float_t         fLhElectron;                            // Likelihood to be an electron    
133    Int_t           fNWrong;                                // number of wrong clusters
134    Int_t           fNRotate;                               // number of rotation
135    Int_t           fNCross;                                // number of the cross materials
136    Int_t           fNExpected;                             // expected number of cluster
137    Int_t           fNLast;                                 // number of clusters in last 2 layers
138    Int_t           fNExpectedLast;                         // number of expected clusters on last 2 layers
139    Int_t           fNdedx;                                 // number of clusters for dEdx measurment
140    Float_t         fChi2Last;                              // chi2 in the  last 2 layers
141    AliTRDtracklet  fTracklets[6];                          // tracklets
142    Float_t         fBudget[3];                             // integrated material budget
143    AliTRDtrack    *fBackupTrack;                           //! backup track
144
145    ClassDef(AliTRDtrack,7)                                 // TRD reconstructed tracks
146
147 };                     
148
149 #endif