]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TRD/AliTRDtrackV1.h
The present commit corresponds to an important change in the way the
[u/mrichter/AliRoot.git] / TRD / AliTRDtrackV1.h
1 #ifndef ALITRDTRACKV1_H
2 #define ALITRDTRACKV1_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 ///////////////////////////////////////////////////////////////////////////////
9 //                                                                           //
10 //  Represents a reconstructed TRD track                                     //
11 //                                                                           //
12 ///////////////////////////////////////////////////////////////////////////////
13
14 #ifndef ALIKALMANTRACK_H
15 #include "AliKalmanTrack.h"
16 #endif
17
18 #ifndef ALIESDTRACK_H
19 #include "AliESDtrack.h"
20 #endif
21
22 #ifndef ALITRDSEEDV1_H
23 #include "AliTRDseedV1.h"
24 #endif
25
26 class AliTRDcluster;
27 class AliESDtrack;
28 class AliTRDReconstructor;
29 class AliTRDtrackV1 : public AliKalmanTrack
30 {
31 public:
32   enum { kMAXCLUSTERSPERTRACK = 210 };
33     
34   enum { kNdet      = 540
35         , kNstacks   =  90
36         , kNplane    =   AliESDtrack::kTRDnPlanes
37         , kNcham     =   5
38         , kNsect     =  18
39         , kNslice    =   3
40         , kNMLPslice =   8 };
41   
42   // bits from 0-13 are reserved by ROOT (see TObject.h)
43   enum AliTRDtrackStatus {
44           kOwner   = BIT(14)
45         , kStopped = BIT(15) 
46   };
47
48   AliTRDtrackV1();
49   AliTRDtrackV1(AliTRDseedV1 *trklts, const Double_t p[5], const Double_t cov[15], Double_t x, Double_t alpha);
50   AliTRDtrackV1(const AliESDtrack &ref);
51   AliTRDtrackV1(const AliTRDtrackV1 &ref);
52   virtual ~AliTRDtrackV1();
53   AliTRDtrackV1 &operator=(const AliTRDtrackV1 &ref) { *(new(this) AliTRDtrackV1(ref)); return *this; }
54   
55   Bool_t         CookPID();
56   Bool_t         CookLabel(Float_t wrong);
57   AliTRDtrackV1* GetBackupTrack() const {return fBackupTrack;}
58   Double_t       GetBudget(Int_t i) const { return fBudget[i];}
59   AliTRDcluster* GetCluster(Int_t id);
60   Int_t          GetClusterIndex(Int_t id) const;
61   Float_t        GetEdep() const {return fDE;}
62   inline Float_t GetMomentum(Int_t plane) const;
63   inline Int_t   GetNCross();
64   inline Int_t   GetNumberOfTracklets() const;
65   Double_t       GetPIDsignal() const   { return 0.;}
66   Double_t       GetPID(Int_t is) const { return (is >=0 && is < AliPID::kSPECIES) ? fPID[is] : -1.;}
67   UChar_t        GetPIDquality() const  { return fPIDquality;}
68   Double_t       GetPredictedChi2(const AliTRDseedV1 *tracklet) const;
69   Double_t       GetPredictedChi2(const AliCluster* /*c*/) const                   { return 0.0; }
70   Int_t          GetProlongation(Double_t xk, Double_t &y, Double_t &z);
71   AliTRDseedV1*  GetTracklet(Int_t plane) const {return plane >=0 && plane <kNplane ? fTracklet[plane] : 0x0;}
72   Int_t          GetTrackletIndex(Int_t plane) const          { return (plane>=0 && plane<kNplane) ? fTrackletIndex[plane] : -1;} 
73   UShort_t*      GetTrackletIndexes() {return &fTrackletIndex[0];}
74   
75   Bool_t         IsEqual(const TObject *inTrack) const;
76   Bool_t         IsOwner() const {return TestBit(kOwner);};
77   Bool_t         IsStopped() const {return TestBit(kStopped);};
78   Bool_t         IsElectron() const;
79   
80   void           MakeBackupTrack();
81   void           Print(Option_t *o="") const;
82
83   Bool_t         PropagateTo(Double_t xr, Double_t x0 = 8.72, Double_t rho = 5.86e-3);
84   Int_t          PropagateToR(Double_t xr, Double_t step);
85   Bool_t         Rotate(Double_t angle, Bool_t absolute = kFALSE);
86   void           SetBudget(Int_t i, Double_t b) {if(i>=0 && i<3) fBudget[i] = b;}
87   void           SetEdep(Double32_t inDE){fDE = inDE;};
88   void           SetNumberOfClusters();
89   void           SetOwner();
90   void           SetPID(Short_t is, Double_t inPID){if (is >=0 && is < AliPID::kSPECIES) fPID[is]=inPID;};
91   void           SetPIDquality(UChar_t inPIDquality){fPIDquality = inPIDquality;};
92   void           SetStopped(Bool_t stop) {SetBit(kStopped, stop);}
93   void           SetTracklet(AliTRDseedV1 *trklt,  Int_t index);
94   inline void    SetReconstructor(const AliTRDReconstructor *rec);
95   inline Float_t StatusForTOF();
96   void           UnsetTracklet(Int_t plane);
97   Bool_t         Update(AliTRDseedV1 *tracklet, Double_t chi2);
98   //Bool_t         Update(const AliTRDcluster *c, Double_t chi2, Int_t index, Double_t h01){ return AliTRDtrack::Update(c,chi2,index,h01); };
99   Bool_t         Update(const AliCluster *, Double_t, Int_t)                        { return kFALSE; };
100   void           UpdateESDtrack(AliESDtrack *t);
101
102 private:
103   UChar_t      fPIDquality;           //  No of planes used for PID calculation 
104   UShort_t     fTrackletIndex[kNplane];//  Tracklets index in the tracker list
105   Double32_t   fPID[AliPID::kSPECIES];//  PID probabilities
106   Double32_t   fBudget[3];            //  Integrated material budget
107   Double32_t   fDE;                   //  Integrated delta energy
108   const AliTRDReconstructor *fReconstructor;//! reconstructor link 
109   AliTRDseedV1 *fTracklet[kNplane];   //  Tracklets array defining the track
110   AliTRDtrackV1 *fBackupTrack;        // Backup track
111
112
113   ClassDef(AliTRDtrackV1, 3)          // new TRD track
114 };
115
116 //____________________________________________________
117 inline Float_t AliTRDtrackV1::GetMomentum(Int_t plane) const
118 {
119   return plane >=0 && plane < kNplane && fTrackletIndex[plane] != 0xff ? fTracklet[plane]->GetMomentum() : -1.;
120 }
121
122 //____________________________________________________
123 inline Int_t AliTRDtrackV1::GetNCross()
124 {
125   Int_t ncross = 0;
126   for(Int_t ip=0; ip<kNplane; ip++){
127     if(!fTracklet[ip]) continue;
128     ncross += fTracklet[ip]->IsRowCross();
129   }
130   return ncross;
131 }
132
133 //____________________________________________________
134 inline Int_t AliTRDtrackV1::GetNumberOfTracklets() const
135 {
136   Int_t n = 0;
137   for(Int_t ip=0; ip<kNplane; ip++){
138     if(!fTracklet[ip]) continue;
139     n++;
140   }
141   return n;
142 }
143
144
145 //____________________________________________________
146 inline void AliTRDtrackV1::SetReconstructor(const AliTRDReconstructor *rec)
147 {
148   for(Int_t ip=0; ip<kNplane; ip++){
149     if(!fTracklet[ip]) continue;
150     fTracklet[ip]->SetReconstructor(rec);
151   }
152   fReconstructor = rec;
153 }
154
155
156 //____________________________________________________________________________
157 inline Float_t AliTRDtrackV1::StatusForTOF()
158 {
159   //
160   // Defines the status of the TOF extrapolation
161   //
162
163   if(!fTracklet[5]) return 0.;
164
165   // Definition of res ????
166   Float_t res = /*(0.2 + 0.8 * (fN / (fNExpected + 5.0))) **/ (0.4 + 0.6 * fTracklet[5]->GetN() / 20.0);
167   res *= (0.25 + 0.8 * 40.0 / (40.0 + fBudget[2]));
168   return res;
169 }
170
171 #endif
172
173
174