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 */
8 ///////////////////////////////////////////////////////////////////////////////
10 // Represents a reconstructed TRD track //
12 ///////////////////////////////////////////////////////////////////////////////
14 #ifndef ALIKALMANTRACK_H
15 #include "AliKalmanTrack.h"
19 #include "AliESDtrack.h"
22 #ifndef ALITRDSEEDV1_H
23 #include "AliTRDseedV1.h"
28 class AliTRDReconstructor;
29 class AliTRDtrackV1 : public AliKalmanTrack
33 kNdet = AliTRDgeometry::kNdet
34 ,kNstacks = AliTRDgeometry::kNstack*AliTRDgeometry::kNsector
35 ,kNplane = AliTRDgeometry::kNlayer
36 ,kNcham = AliTRDgeometry::kNstack
37 ,kNsect = AliTRDgeometry::kNsector
40 ,kMAXCLUSTERSPERTRACK = 210
43 // bits from 0-13 are reserved by ROOT (see TObject.h)
44 enum ETRDtrackStatus {
50 // propagation/update error codes (up to 4 bits)
60 // data/clusters/tracklet error codes (up to 4 bits/layer)
72 AliTRDtrackV1(AliTRDseedV1 *trklts, const Double_t p[5], const Double_t cov[15], Double_t x, Double_t alpha);
73 AliTRDtrackV1(const AliESDtrack &ref);
74 AliTRDtrackV1(const AliTRDtrackV1 &ref);
75 virtual ~AliTRDtrackV1();
76 AliTRDtrackV1 &operator=(const AliTRDtrackV1 &ref) { *(new(this) AliTRDtrackV1(ref)); return *this; }
79 Bool_t CookLabel(Float_t wrong);
80 AliTRDtrackV1* GetBackupTrack() const {return fBackupTrack;}
81 Double_t GetBudget(Int_t i) const { return fBudget[i];}
82 AliTRDcluster* GetCluster(Int_t id);
83 Int_t GetClusterIndex(Int_t id) const;
84 Float_t GetEdep() const {return fDE;}
85 inline Float_t GetMomentum(Int_t plane) const;
86 inline Int_t GetNCross();
87 inline Int_t GetNumberOfTracklets() const;
88 Double_t GetPIDsignal() const { return 0.;}
89 Double_t GetPID(Int_t is) const { return (is >=0 && is < AliPID::kSPECIES) ? fPID[is] : -1.;}
90 UChar_t GetNumberOfTrackletsPID() const;
91 Double_t GetPredictedChi2(const AliTRDseedV1 *tracklet) const;
92 Double_t GetPredictedChi2(const AliCluster* /*c*/) const { return 0.0; }
93 Int_t GetProlongation(Double_t xk, Double_t &y, Double_t &z);
94 inline UChar_t GetStatusTRD(Int_t ly=-1) const;
95 Int_t GetSector() const;
96 AliTRDseedV1* GetTracklet(Int_t plane) const {return plane >=0 && plane <kNplane ? fTracklet[plane] : 0x0;}
97 Int_t GetTrackletIndex(Int_t plane) const { return (plane>=0 && plane<kNplane) ? fTrackletIndex[plane] : -1;}
98 AliExternalTrackParam*
99 GetTrackLow() const { return fTrackLow;}
100 AliExternalTrackParam*
101 GetTrackHigh() const { return fTrackHigh;}
102 UShort_t* GetTrackletIndexes() { return &fTrackletIndex[0];}
104 Bool_t IsEqual(const TObject *inTrack) const;
105 Bool_t IsKink() const { return TestBit(kKink);}
106 Bool_t IsOwner() const { return TestBit(kOwner);};
107 Bool_t IsStopped() const { return TestBit(kStopped);};
108 Bool_t IsElectron() const;
109 inline static Bool_t IsTrackError(ETRDtrackError error, UInt_t status);
110 inline static Bool_t IsLayerError(ETRDlayerError error, Int_t layer, UInt_t status);
112 void MakeBackupTrack();
113 void Print(Option_t *o="") const;
115 Bool_t PropagateTo(Double_t xr, Double_t x0 = 8.72, Double_t rho = 5.86e-3);
116 Int_t PropagateToR(Double_t xr, Double_t step);
117 Bool_t Rotate(Double_t angle, Bool_t absolute = kFALSE);
118 void SetBudget(Int_t i, Double_t b) {if(i>=0 && i<3) fBudget[i] = b;}
119 void SetEdep(Double32_t inDE){fDE = inDE;};
120 void SetKink(Bool_t k) { SetBit(kKink, k);}
121 void SetNumberOfClusters();
122 UChar_t SetNumberOfTrackletsPID(Bool_t recalc);
124 void SetPID(Short_t is, Double_t inPID){if (is >=0 && is < AliPID::kSPECIES) fPID[is]=inPID;};
125 void SetPIDquality(UChar_t /*inPIDquality*/){/*fPIDquality = inPIDquality*/;};
126 inline void SetStatus(UChar_t stat, Int_t ly=-1);
127 void SetStopped(Bool_t stop) {SetBit(kStopped, stop);}
128 void SetTracklet(AliTRDseedV1 *trklt, Int_t index);
130 void SetTrackHigh(const AliExternalTrackParam *op=0x0);
131 inline void SetReconstructor(const AliTRDReconstructor *rec);
132 inline Float_t StatusForTOF();
133 void UnsetTracklet(Int_t plane);
134 Bool_t Update(AliTRDseedV1 *tracklet, Double_t chi2);
135 //Bool_t Update(const AliTRDcluster *c, Double_t chi2, Int_t index, Double_t h01){ return AliTRDtrack::Update(c,chi2,index,h01); };
136 Bool_t Update(const AliCluster *, Double_t, Int_t) { return kFALSE; };
137 void UpdateESDtrack(AliESDtrack *t);
140 UInt_t fStatus; // Bit map for the status of propagation
141 UShort_t fTrackletIndex[kNplane];// Tracklets index in the tracker list
142 Double32_t fPID[AliPID::kSPECIES]; // PID probabilities
143 Double32_t fBudget[3]; // Integrated material budget
144 Double32_t fDE; // Integrated delta energy
145 const AliTRDReconstructor *fReconstructor;//! reconstructor link
146 AliTRDtrackV1 *fBackupTrack; //! Backup track
147 AliTRDseedV1 *fTracklet[kNplane]; // Tracklets array defining the track
148 AliExternalTrackParam *fTrackLow; // parameters of the track which enter TRD from below (TPC)
149 AliExternalTrackParam *fTrackHigh; // parameters of the track which enter TRD from above (HMPID, PHOS)
151 ClassDef(AliTRDtrackV1, 5) // TRD track - tracklet based
154 //____________________________________________________
155 inline Float_t AliTRDtrackV1::GetMomentum(Int_t plane) const
157 return plane >=0 && plane < kNplane && fTrackletIndex[plane] != 0xff ? fTracklet[plane]->GetMomentum() : -1.;
160 //____________________________________________________
161 inline Int_t AliTRDtrackV1::GetNCross()
164 for(Int_t ip=0; ip<kNplane; ip++){
165 if(!fTracklet[ip]) continue;
166 ncross += fTracklet[ip]->IsRowCross();
171 //____________________________________________________
172 inline Int_t AliTRDtrackV1::GetNumberOfTracklets() const
175 for(Int_t ip=0; ip<kNplane; ip++){
176 if(!fTracklet[ip]) continue;
182 //____________________________________________________
183 inline UChar_t AliTRDtrackV1::GetStatusTRD(Int_t ly) const
185 if(ly<kNplane) return (fStatus>>((ly+1)*4))&0xf;
189 //____________________________________________________
190 inline Bool_t AliTRDtrackV1::IsTrackError(ETRDtrackError error, UInt_t status)
192 return (status&0xf)==UChar_t(error);
195 //____________________________________________________
196 inline Bool_t AliTRDtrackV1::IsLayerError(ETRDlayerError error, Int_t ly, UInt_t status)
198 if(ly>=kNplane || ly<0) return kFALSE;
199 return ((status>>((ly+1)*4))&0xf) == UChar_t(error);
202 //____________________________________________________
203 inline void AliTRDtrackV1::SetReconstructor(const AliTRDReconstructor *rec)
205 for(Int_t ip=0; ip<kNplane; ip++){
206 if(!fTracklet[ip]) continue;
207 fTracklet[ip]->SetReconstructor(rec);
209 fReconstructor = rec;
212 //____________________________________________________
213 inline void AliTRDtrackV1::SetStatus(UChar_t status, Int_t ly)
215 if(ly<kNplane) fStatus|=((status&0xf)<<((ly+1)*4));
220 //____________________________________________________________________________
221 inline Float_t AliTRDtrackV1::StatusForTOF()
224 // Defines the status of the TOF extrapolation
227 if(!fTracklet[5]) return 0.;
229 // Definition of res ????
230 Float_t res = /*(0.2 + 0.8 * (fN / (fNExpected + 5.0))) **/ (0.4 + 0.6 * fTracklet[5]->GetN() / 20.0);
231 res *= (0.25 + 0.8 * 40.0 / (40.0 + fBudget[2]));