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