]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCtrackerMI.h
Add virtual 'void FillClusterArray(TObjArray* array)' that will allow for extraction...
[u/mrichter/AliRoot.git] / TPC / AliTPCtrackerMI.h
CommitLineData
1c53abe2 1#ifndef ALITPCTRACKERMI_H
2#define ALITPCTRACKERMI_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
91162307 6
1c53abe2 7/* $Id$ */
8
9//-------------------------------------------------------
47966a6d 10// TPC tracker
11// Parallel tracker
1c53abe2 12//
13// Origin:
14//-------------------------------------------------------
6d171107 15
81e97e0d 16#include <TError.h>
1c53abe2 17#include "AliTracker.h"
81e97e0d 18#include "AliTPCreco.h"
19#include "AliPID.h"
b9671574 20#include "AliTPCclusterMI.h"
81e97e0d 21
b67e07dc 22
1c53abe2 23class TFile;
24class AliTPCParam;
25class AliTPCseed;
91162307 26class AliTPCTrackerPoint;
af885e0f 27class AliESDEvent;
91162307 28class TTree;
eea478d3 29class AliESDkink;
81e97e0d 30class TTreeSRedirector;
2ccb4dfc 31class AliTrackPoint;
1c53abe2 32
33class AliTPCtrackerMI : public AliTracker {
34public:
e046d791 35 AliTPCtrackerMI();
d26d9159 36 AliTPCtrackerMI(const AliTPCParam *par);
b67e07dc 37 virtual ~AliTPCtrackerMI();
91162307 38 //
d26d9159 39 void SetIteration(Int_t iteration){fIteration = iteration;}
af885e0f 40 virtual Int_t Clusters2Tracks (AliESDEvent *esd);
41 virtual Int_t RefitInward (AliESDEvent *esd);
d26d9159 42 virtual Int_t LoadClusters (TTree * tree);
af86c1fd 43 virtual Int_t LoadClusters (TObjArray * arr); // another input
d26d9159 44 Int_t LoadClusters();
45 void UnloadClusters();
75fb37cc 46 void Transform(AliTPCclusterMI * cluster);
91162307 47 //
d26d9159 48 void FillESD(TObjArray* arr);
91162307 49 void DeleteSeeds();
50 void SetDebug(Int_t debug){ fDebug = debug;}
af885e0f 51 void FindKinks(TObjArray * array, AliESDEvent * esd);
6d493ea0 52 //
53 void FindCurling(TObjArray * array, AliESDEvent * esd, Int_t iter);
54 void FindSplitted(TObjArray * array, AliESDEvent * esd, Int_t iter);
55 void FindMultiMC(TObjArray * array, AliESDEvent * esd, Int_t iter);
56 //
af885e0f 57 void FindV0s(TObjArray * array, AliESDEvent * esd);
51ad6848 58 void UpdateKinkQualityM(AliTPCseed * seed);
eea478d3 59 void UpdateKinkQualityD(AliTPCseed * seed);
60 Int_t CheckKinkPoint(AliTPCseed*seed, AliTPCseed &mother, AliTPCseed &daughter, AliESDkink &kink);
61 Int_t RefitKink(AliTPCseed &mother, AliTPCseed &daughter, AliESDkink &kink);
1c53abe2 62 Int_t ReadSeeds(const TFile *in);
91162307 63 TObjArray * GetSeeds(){return fSeeds;}
64 //
34acb742 65 AliCluster * GetCluster(Int_t index) const {return (AliCluster*)GetClusterMI(index);}
1c53abe2 66 AliTPCclusterMI *GetClusterMI(Int_t index) const;
f8aae377 67 Int_t Clusters2Tracks();
af32720d 68 virtual void CookLabel(AliKalmanTrack *tk,Float_t wrong) const;
51ad6848 69 virtual Int_t CookLabel(AliTPCseed *t,Float_t wrong, Int_t first,Int_t last ) const;
91162307 70
c9427e08 71 void RotateToLocal(AliTPCseed *seed);
91162307 72
73
74 Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0, Int_t step=1);
75 Int_t FollowProlongationFast(AliTPCseed& t, Int_t rf=0, Int_t step=1);
2ccb4dfc 76 Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p ) const;
77
91162307 78 Int_t FollowBackProlongation(AliTPCseed& t, Int_t rf);
79 Int_t FollowToNext(AliTPCseed& t, Int_t nr);
80 Int_t FollowToNextFast(AliTPCseed& t, Int_t nr);
81 Int_t UpdateClusters(AliTPCseed& t, Int_t nr);
82 Int_t FollowToNextCluster( AliTPCseed& t, Int_t nr);
83
91162307 84 Int_t PropagateBack(TObjArray * arr);
af885e0f 85 Int_t PropagateBack(AliESDEvent * event);
91162307 86 Int_t PropagateBack(AliTPCseed *pt, Int_t row0, Int_t row1);
87 Int_t PropagateForward();
88 Int_t PropagateForward2(TObjArray * arr);
89
47966a6d 90 void SortTracks(TObjArray * arr, Int_t mode) const;
91162307 91
1c53abe2 92 virtual Double_t ErrY2(AliTPCseed* seed, AliTPCclusterMI * cl = 0);
93 virtual Double_t ErrZ2(AliTPCseed* seed, AliTPCclusterMI * cl = 0);
94
b67e07dc 95 Double_t F1(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
96 Double_t F1old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
97 Double_t F2(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
98 Double_t F2old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
91162307 99
b67e07dc 100 Double_t F3(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2);
101 Double_t F3n(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2,
91162307 102 Double_t c);
103 Bool_t GetProlongation(Double_t x1, Double_t x2, Double_t x[5], Double_t &y, Double_t &z);
104
b67e07dc 105 public:
1c53abe2 106//**************** Internal tracker class **********************
b67e07dc 107 class AliTPCSector;
1c53abe2 108 class AliTPCRow {
109 public:
b67e07dc 110 AliTPCRow();
1c53abe2 111 ~AliTPCRow();
112 void InsertCluster(const AliTPCclusterMI *c, UInt_t index);
982aff31 113 void ResetClusters();
1c53abe2 114 operator int() const {return fN;}
91162307 115 Int_t GetN() const {return fN;}
1c53abe2 116 const AliTPCclusterMI* operator[](Int_t i) const {return fClusters[i];}
117 UInt_t GetIndex(Int_t i) const {return fIndex[i];}
91162307 118 inline Int_t Find(Double_t z) const;
1627d1c4 119 AliTPCclusterMI * FindNearest(Double_t y, Double_t z, Double_t roady, Double_t roadz) const;
91162307 120 AliTPCclusterMI * FindNearest2(Double_t y, Double_t z, Double_t roady, Double_t roadz, UInt_t & index) const;
6d493ea0 121
1c53abe2 122 void SetX(Double_t x) {fX=x;}
123 Double_t GetX() const {return fX;}
b9671574 124 Float_t GetDeadZone() const {return fDeadZone;}
125 void SetDeadZone(Float_t d) {fDeadZone=d;}
126 Int_t GetN1() const {return fN1;}
127 void SetN1(Int_t n) {fN1=n;}
128 Int_t GetN2() const {return fN2;}
129 void SetN2(Int_t n) {fN2=n;}
130 AliTPCclusterMI* GetClusters1() const {return fClusters1;}
131 AliTPCclusterMI* GetClusters2() const {return fClusters2;}
132 void SetClusters1(AliTPCclusterMI* cl) {fClusters1=cl;}
133 void SetClusters2(AliTPCclusterMI* cl) {fClusters2=cl;}
c1ea348f 134 void SetCluster1(Int_t i, const AliTPCclusterMI &cl) {fClusters1[i]=cl;}
135 void SetCluster2(Int_t i, const AliTPCclusterMI &cl) {fClusters2[i]=cl;}
b9671574 136 AliTPCclusterMI* GetCluster1(Int_t i) const {return &fClusters1[i];}
137 AliTPCclusterMI* GetCluster2(Int_t i) const {return &fClusters2[i];}
138 Short_t GetFastCluster(Int_t i) const {return fFastCluster[i];}
64996bea 139 void SetFastCluster(Int_t i, Short_t cl);
b9671574 140
6d171107 141private:
9996a03b 142 AliTPCRow & operator=(const AliTPCRow & );
143 AliTPCRow(const AliTPCRow& /*r*/); //dummy copy constructor
1c53abe2 144 Float_t fDeadZone; // the width of the dead zone
91162307 145 AliTPCclusterMI *fClusters1; //array with clusters 1
b67e07dc 146 Int_t fN1; //number of clusters on left side
91162307 147 AliTPCclusterMI *fClusters2; //array with clusters 2
b67e07dc 148 Int_t fN2; // number of clusters on right side of the TPC
149 Short_t fFastCluster[510]; //index of the nearest cluster at given position
1c53abe2 150 Int_t fN; //number of clusters
151 const AliTPCclusterMI *fClusters[kMaxClusterPerRow]; //pointers to clusters
91162307 152 // indexes for cluster at given position z
153 // AliTPCclusterMI *fClustersArray; //
1c53abe2 154 UInt_t fIndex[kMaxClusterPerRow]; //indeces of clusters
155 Double_t fX; //X-coordinate of this row
2fc0c115 156
1c53abe2 157 };
158
159//**************** Internal tracker class **********************
160 class AliTPCSector {
161 public:
e046d791 162 AliTPCSector():
163 fN(0),
164 fRow(0),
165 fAlpha(0.),
166 fAlphaShift(0.),
167 fPadPitchWidth(0.),
168 fPadPitchLength(0.),
169 f1PadPitchLength(0.),
170 f2PadPitchLength(0.){}
1c53abe2 171 ~AliTPCSector() { delete[] fRow; }
9996a03b 172 AliTPCRow& operator[](Int_t i) const { return *(fRow+i); }
173 Int_t GetNRows() const { return fN; }
174 void Setup(const AliTPCParam *par, Int_t flag);
175 Double_t GetX(Int_t l) const {return fRow[l].GetX();}
176 Double_t GetMaxY(Int_t l) const {
177 return GetX(l)*TMath::Tan(0.5*GetAlpha());
178 }
179 Double_t GetAlpha() const {return fAlpha;}
180 Double_t GetAlphaShift() const {return fAlphaShift;}
181 //Int_t GetFirst(){return fFirstRow;}
182 Int_t GetRowNumber(Double_t x) const;
183 Double_t GetPadPitchWidth() const {return fPadPitchWidth;}
184 Double_t GetPadPitchLength() const {return fPadPitchLength;}
185 Double_t GetPadPitchLength(Float_t x) const {return (x<200) ? fPadPitchLength:f2PadPitchLength ;}
186
1c53abe2 187 private:
9996a03b 188 AliTPCSector & operator=(const AliTPCSector & );
189 AliTPCSector(const AliTPCSector &/*s*/); //dummy copy contructor
190 Int_t fN; //number of pad rows
191 //Int_t fFirstRow; //offset
192 AliTPCRow *fRow; //array of pad rows
193 Double_t fAlpha; //opening angle
194 Double_t fAlphaShift; //shift angle;
195 Double_t fPadPitchWidth; //pad pitch width
196 Double_t fPadPitchLength; //pad pitch length
197 Double_t f1PadPitchLength; //pad pitch length
198 Double_t f2PadPitchLength; //pad pitch length
1c53abe2 199
1c53abe2 200 };
201
202 Float_t OverlapFactor(AliTPCseed * s1, AliTPCseed * s2, Int_t &sum1, Int_t &sum2);
203 void SignShared(AliTPCseed * s1, AliTPCseed * s2);
91162307 204 void SignShared(TObjArray * arr);
205
51ad6848 206 void RemoveUsed2(TObjArray * arr, Float_t factor1, Float_t factor2, Int_t minimal);
91162307 207
47966a6d 208 void StopNotActive(TObjArray * arr, Int_t row0, Float_t th0, Float_t th1, Float_t th2) const;
209 void StopNotActive(AliTPCseed * seed, Int_t row0, Float_t th0, Float_t th1, Float_t th2) const;
00055a22 210 Int_t AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster);
c9427e08 211
1c53abe2 212private:
6c94f330 213 AliTPCtrackerMI(const AliTPCtrackerMI& r); //dummy copy constructor
214 AliTPCtrackerMI &operator=(const AliTPCtrackerMI& r);//dummy assignment operator
91162307 215 inline AliTPCRow &GetRow(Int_t sec, Int_t row);
5afd7dbd 216 inline Bool_t IsActive(Int_t sec, Int_t row);
47966a6d 217 inline Double_t GetXrow(Int_t row) const;
218 inline Double_t GetMaxY(Int_t row) const;
219 inline Int_t GetRowNumber(Double_t x) const;
eea478d3 220 Int_t GetRowNumber(Double_t x[3]) const;
47966a6d 221 inline Double_t GetPadPitchLength(Double_t x) const;
222 inline Double_t GetPadPitchLength(Int_t row) const;
91162307 223
fd065ea2 224 void GetShape(AliTPCseed * seed, Int_t row);
91162307 225
af885e0f 226 void ReadSeeds(AliESDEvent *event, Int_t direction); //read seeds from the event
1c53abe2 227
91162307 228 void MakeSeeds3(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1, Int_t ddsec=0);
229 void MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1);
1627d1c4 230
91162307 231 void MakeSeeds2(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1, Bool_t bconstrain=kTRUE);
232
1c53abe2 233
91162307 234 AliTPCseed *MakeSeed(AliTPCseed *t, Float_t r0, Float_t r1, Float_t r2); //reseed
d26d9159 235 AliTPCseed *ReSeed(AliTPCseed *t, Float_t r0, Float_t r1, Float_t r2); //reseed
eea478d3 236 AliTPCseed *ReSeed(AliTPCseed *t, Int_t r0, Bool_t forward); //reseed
91162307 237
238
239
240 AliTPCseed * ReSeed(AliTPCseed *t);
241 Int_t LoadInnerSectors();
242 Int_t LoadOuterSectors();
243 void UnsignClusters();
244 void SignClusters(TObjArray * arr, Float_t fnumber=3., Float_t fdensity=2.);
245
246 void ParallelTracking(TObjArray * arr, Int_t rfirst, Int_t rlast);
247 void Tracking(TObjArray * arr);
248 TObjArray * Tracking(Int_t seedtype, Int_t i1, Int_t i2, Float_t cuts[4], Float_t dy=-1, Int_t dsec=0);
249 TObjArray * Tracking();
a395b09f 250 TObjArray * TrackingSpecial();
c1ea348f 251 void SumTracks(TObjArray *arr1,TObjArray *&arr2) const;
47966a6d 252 void PrepareForBackProlongation(TObjArray * arr, Float_t fac) const;
253 void PrepareForProlongation(TObjArray * arr, Float_t fac) const;
1c53abe2 254
4c57c771 255 void SetSampledEdx(AliTPCseed */*t*/, Float_t /*q*/, Int_t /*i*/) {;}
91162307 256 Int_t UpdateTrack(AliTPCseed *t, Int_t accept); //update trackinfo
1c53abe2 257
19b00333 258 void MakeBitmaps(AliTPCseed *t);
1c53abe2 259
1c53abe2 260 const Int_t fkNIS; //number of inner sectors
261 AliTPCSector *fInnerSec; //array of inner sectors;
262 const Int_t fkNOS; //number of outer sectors
263 AliTPCSector *fOuterSec; //array of outer sectors;
264
265 Int_t fN; //number of loaded sectors
266 AliTPCSector *fSectors; //pointer to loaded sectors;
91162307 267 //
268 TTree * fInput; // input tree with clusters
269 TTree * fOutput; // output tree with tracks
270 TTree * fSeedTree; // output tree with seeds - filled in debug mode 1
271 TTree * fTreeDebug; // output with a debug information about track
af885e0f 272 AliESDEvent * fEvent; // output with esd tracks
91162307 273 Int_t fDebug; // debug option
274 Bool_t fNewIO; // indicated if we have data using New IO
1c53abe2 275 Int_t fNtracks; //current number of tracks
276 TObjArray *fSeeds; //array of track seeds
91162307 277 Int_t fIteration; // indicate iteration - 0 - froward -1 back - 2forward - back->forward
1c53abe2 278 // TObjArray * fTrackPointPool; // ! pool with track points
91162307 279 // TObjArray * fSeedPool; //! pool with seeds
280 Double_t fXRow[200]; // radius of the pad row
281 Double_t fYMax[200]; // max y for given pad row
282 Double_t fPadLength[200]; // max y for given pad row
1c53abe2 283 const AliTPCParam *fParam; //pointer to the parameters
81e97e0d 284 TTreeSRedirector *fDebugStreamer; //!debug streamer
af885e0f 285 ClassDef(AliTPCtrackerMI,2)
1c53abe2 286};
287
91162307 288
289AliTPCtrackerMI::AliTPCRow & AliTPCtrackerMI::GetRow(Int_t sec, Int_t row)
290{
291 //
292 return (row>=fInnerSec->GetNRows()) ? fOuterSec[sec][row-fInnerSec->GetNRows()]:fInnerSec[sec][row];
293}
294
5afd7dbd 295Bool_t AliTPCtrackerMI::IsActive(Int_t sec, Int_t row)
296{
297 //
298 // check if the given sector row is active
299 //
300 return (row>=fInnerSec->GetNRows()) ? fOuterSec[sec][row-fInnerSec->GetNRows()].GetN()>0:fInnerSec[sec][row].GetN()>0;
301}
302
303
47966a6d 304Double_t AliTPCtrackerMI::GetXrow(Int_t row) const {
91162307 305 // return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetX(row-fInnerSec->GetNRows()):fInnerSec->GetX(row);
306 return fXRow[row];
307}
308
47966a6d 309Double_t AliTPCtrackerMI::GetMaxY(Int_t row) const {
91162307 310 //return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetMaxY(row-fInnerSec->GetNRows()):fInnerSec->GetMaxY(row);
311 return fYMax[row];
312}
313
47966a6d 314Int_t AliTPCtrackerMI::GetRowNumber(Double_t x) const
91162307 315{
316 //
317 return (x>133.) ? fOuterSec->GetRowNumber(x)+fInnerSec->GetNRows():fInnerSec->GetRowNumber(x);
318}
319
47966a6d 320Double_t AliTPCtrackerMI::GetPadPitchLength(Double_t x) const
91162307 321{
322 //
323 return (x>133.) ? fOuterSec->GetPadPitchLength(x):fInnerSec->GetPadPitchLength(x);
324 //return fPadLength[row];
325}
326
47966a6d 327Double_t AliTPCtrackerMI::GetPadPitchLength(Int_t row) const
91162307 328{
329 //
330 return fPadLength[row];
331}
332
333
334
1c53abe2 335#endif
336
337