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