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 */
9 //-------------------------------------------------------
14 //-------------------------------------------------------
17 #include "AliTracker.h"
18 #include "AliTPCreco.h"
20 #include "AliTPCclusterMI.h"
21 #include "AliTPCtrackerSector.h"
27 class AliTPCTrackerPoint;
31 class TTreeSRedirector;
36 class AliTPCtrackerMI : public AliTracker {
39 AliTPCtrackerMI(const AliTPCParam *par);
40 virtual ~AliTPCtrackerMI();
42 void SetIteration(Int_t iteration){fIteration = iteration;}
43 virtual Int_t Clusters2Tracks (AliESDEvent *esd);
44 virtual Int_t RefitInward (AliESDEvent *esd);
45 virtual Int_t LoadClusters (TTree * tree);
46 virtual Int_t LoadClusters (TObjArray * arr); // another input
48 void UnloadClusters();
49 void Transform(AliTPCclusterMI * cluster);
51 void FillESD(TObjArray* arr);
53 void SetDebug(Int_t debug){ fDebug = debug;}
54 void FindKinks(TObjArray * array, AliESDEvent * esd);
56 void FindCurling(TObjArray * array, AliESDEvent * esd, Int_t iter);
57 void FindSplitted(TObjArray * array, AliESDEvent * esd, Int_t iter);
58 void FindMultiMC(TObjArray * array, AliESDEvent * esd, Int_t iter);
60 void FindV0s(TObjArray * array, AliESDEvent * esd);
61 void UpdateKinkQualityM(AliTPCseed * seed);
62 void UpdateKinkQualityD(AliTPCseed * seed);
63 Int_t CheckKinkPoint(AliTPCseed*seed, AliTPCseed &mother, AliTPCseed &daughter, AliESDkink &kink);
64 Int_t RefitKink(AliTPCseed &mother, AliTPCseed &daughter, AliESDkink &kink);
65 Int_t ReadSeeds(const TFile *in);
66 TObjArray * GetSeeds(){return fSeeds;}
68 AliCluster * GetCluster(Int_t index) const {return (AliCluster*)GetClusterMI(index);}
69 AliTPCclusterMI *GetClusterMI(Int_t index) const;
70 Int_t Clusters2Tracks();
71 virtual void CookLabel(AliKalmanTrack *tk,Float_t wrong) const;
72 virtual Int_t CookLabel(AliTPCseed *t,Float_t wrong, Int_t first,Int_t last ) const;
74 void RotateToLocal(AliTPCseed *seed);
77 Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0, Int_t step=1);
78 Int_t FollowProlongationFast(AliTPCseed& t, Int_t rf=0, Int_t step=1);
79 Bool_t GetTrackPoint(Int_t index, AliTrackPoint &p ) const;
81 Int_t FollowBackProlongation(AliTPCseed& t, Int_t rf);
82 Int_t FollowToNext(AliTPCseed& t, Int_t nr);
83 Int_t FollowToNextFast(AliTPCseed& t, Int_t nr);
84 Int_t UpdateClusters(AliTPCseed& t, Int_t nr);
85 Int_t FollowToNextCluster( AliTPCseed& t, Int_t nr);
87 Int_t PropagateBack(TObjArray * arr);
88 Int_t PropagateBack(AliESDEvent * event);
89 Int_t PropagateBack(AliTPCseed *pt, Int_t row0, Int_t row1);
90 Int_t PropagateForward();
91 Int_t PropagateForward2(TObjArray * arr);
93 void SortTracks(TObjArray * arr, Int_t mode) const;
95 virtual Double_t ErrY2(AliTPCseed* seed, AliTPCclusterMI * cl = 0);
96 virtual Double_t ErrZ2(AliTPCseed* seed, AliTPCclusterMI * cl = 0);
98 Double_t F1(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
99 Double_t F1old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
100 Double_t F2(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
101 Double_t F2old(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
103 Double_t F3(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2);
104 Double_t F3n(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2,
106 Bool_t GetProlongation(Double_t x1, Double_t x2, Double_t x[5], Double_t &y, Double_t &z);
111 Float_t OverlapFactor(AliTPCseed * s1, AliTPCseed * s2, Int_t &sum1, Int_t &sum2);
112 void SignShared(AliTPCseed * s1, AliTPCseed * s2);
113 void SignShared(TObjArray * arr);
115 void RemoveUsed2(TObjArray * arr, Float_t factor1, Float_t factor2, Int_t minimal);
117 void StopNotActive(TObjArray * arr, Int_t row0, Float_t th0, Float_t th1, Float_t th2) const;
118 void StopNotActive(AliTPCseed * seed, Int_t row0, Float_t th0, Float_t th1, Float_t th2) const;
119 Int_t AcceptCluster(AliTPCseed * seed, AliTPCclusterMI * cluster);
122 AliTPCtrackerMI(const AliTPCtrackerMI& r); //dummy copy constructor
123 AliTPCtrackerMI &operator=(const AliTPCtrackerMI& r);//dummy assignment operator
124 inline AliTPCtrackerRow &GetRow(Int_t sec, Int_t row);
125 inline Bool_t IsActive(Int_t sec, Int_t row);
126 inline Double_t GetXrow(Int_t row) const;
127 inline Double_t GetMaxY(Int_t row) const;
128 inline Int_t GetRowNumber(Double_t x) const;
129 Int_t GetRowNumber(Double_t x[3]) const;
130 inline Double_t GetPadPitchLength(Double_t x) const;
131 inline Double_t GetPadPitchLength(Int_t row) const;
133 void GetShape(AliTPCseed * seed, Int_t row);
135 void ReadSeeds(AliESDEvent *event, Int_t direction); //read seeds from the event
137 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);
138 void MakeSeeds5(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2, Float_t cuts[4], Float_t deltay = -1);
140 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);
143 AliTPCseed *MakeSeed(AliTPCseed *t, Float_t r0, Float_t r1, Float_t r2); //reseed
144 AliTPCseed *ReSeed(AliTPCseed *t, Float_t r0, Float_t r1, Float_t r2); //reseed
145 AliTPCseed *ReSeed(AliTPCseed *t, Int_t r0, Bool_t forward); //reseed
149 AliTPCseed * ReSeed(AliTPCseed *t);
150 Int_t LoadInnerSectors();
151 Int_t LoadOuterSectors();
152 void UnsignClusters();
153 void SignClusters(TObjArray * arr, Float_t fnumber=3., Float_t fdensity=2.);
155 void ParallelTracking(TObjArray * arr, Int_t rfirst, Int_t rlast);
156 void Tracking(TObjArray * arr);
157 TObjArray * Tracking(Int_t seedtype, Int_t i1, Int_t i2, Float_t cuts[4], Float_t dy=-1, Int_t dsec=0);
158 TObjArray * Tracking();
159 TObjArray * TrackingSpecial();
160 void SumTracks(TObjArray *arr1,TObjArray *&arr2) const;
161 void PrepareForBackProlongation(TObjArray * arr, Float_t fac) const;
162 void PrepareForProlongation(TObjArray * arr, Float_t fac) const;
164 void SetSampledEdx(AliTPCseed */*t*/, Float_t /*q*/, Int_t /*i*/) {;}
165 Int_t UpdateTrack(AliTPCseed *t, Int_t accept); //update trackinfo
167 void MakeBitmaps(AliTPCseed *t);
169 const Int_t fkNIS; //number of inner sectors
170 AliTPCtrackerSector *fInnerSec; //array of inner sectors;
171 const Int_t fkNOS; //number of outer sectors
172 AliTPCtrackerSector *fOuterSec; //array of outer sectors;
174 Int_t fN; //number of loaded sectors
175 AliTPCtrackerSector *fSectors; //pointer to loaded sectors;
177 TTree * fInput; // input tree with clusters
178 TTree * fOutput; // output tree with tracks
179 TTree * fSeedTree; // output tree with seeds - filled in debug mode 1
180 TTree * fTreeDebug; // output with a debug information about track
181 AliESDEvent * fEvent; // output with esd tracks
182 Int_t fDebug; // debug option
183 Bool_t fNewIO; // indicated if we have data using New IO
184 Int_t fNtracks; //current number of tracks
185 TObjArray *fSeeds; //array of track seeds
186 Int_t fIteration; // indicate iteration - 0 - froward -1 back - 2forward - back->forward
187 // TObjArray * fTrackPointPool; // ! pool with track points
188 // TObjArray * fSeedPool; //! pool with seeds
189 Double_t fXRow[200]; // radius of the pad row
190 Double_t fYMax[200]; // max y for given pad row
191 Double_t fPadLength[200]; // max y for given pad row
192 const AliTPCParam *fParam; //pointer to the parameters
193 TTreeSRedirector *fDebugStreamer; //!debug streamer
194 ClassDef(AliTPCtrackerMI,2)
198 AliTPCtrackerRow & AliTPCtrackerMI::GetRow(Int_t sec, Int_t row)
201 return (row>=fInnerSec->GetNRows()) ? fOuterSec[sec][row-fInnerSec->GetNRows()]:fInnerSec[sec][row];
204 Bool_t AliTPCtrackerMI::IsActive(Int_t sec, Int_t row)
207 // check if the given sector row is active
209 return (row>=fInnerSec->GetNRows()) ? fOuterSec[sec][row-fInnerSec->GetNRows()].GetN()>0:fInnerSec[sec][row].GetN()>0;
213 Double_t AliTPCtrackerMI::GetXrow(Int_t row) const {
214 // return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetX(row-fInnerSec->GetNRows()):fInnerSec->GetX(row);
218 Double_t AliTPCtrackerMI::GetMaxY(Int_t row) const {
219 //return (row>=fInnerSec->GetNRows()) ? fOuterSec->GetMaxY(row-fInnerSec->GetNRows()):fInnerSec->GetMaxY(row);
223 Int_t AliTPCtrackerMI::GetRowNumber(Double_t x) const
226 return (x>133.) ? fOuterSec->GetRowNumber(x)+fInnerSec->GetNRows():fInnerSec->GetRowNumber(x);
229 Double_t AliTPCtrackerMI::GetPadPitchLength(Double_t x) const
232 return (x>133.) ? fOuterSec->GetPadPitchLength(x):fInnerSec->GetPadPitchLength(x);
233 //return fPadLength[row];
236 Double_t AliTPCtrackerMI::GetPadPitchLength(Int_t row) const
239 return fPadLength[row];