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