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 */
8 //-------------------------------------------------------
12 //-------------------------------------------------------
13 #include "AliTracker.h"
14 #include "AliTPCtrack.h"
15 #include "AliTPCClustersArray.h"
17 #include "AliTPCreco.h"
23 class AliTPCclusterMI;
24 class AliTPCTrackPoint;
28 class AliTPCclusterTracks {
30 AliTPCclusterTracks();
31 Float_t fDistance[3]; // distance to the 3 nerest track if there overlap with cluster
32 Short_t fTrackIndex[3]; // indexes of the tracks overlapped with clusters
36 class AliTPCseed : public AliTPCtrack {
39 virtual ~AliTPCseed();
40 AliTPCseed(const AliTPCtrack &t);
41 AliTPCseed(const AliKalmanTrack &t, Double_t a);
42 Int_t Compare(const TObject *o) const;
44 Int_t GetProlongation(Double_t xr, Double_t &y, Double_t & z) const;
45 virtual Double_t GetPredictedChi2(const AliTPCclusterMI *cluster) const;
46 virtual Int_t Update(const AliTPCclusterMI* c, Double_t chi2, UInt_t i);
47 AliTPCTrackPoint * GetTrackPoint(Int_t i);
48 void RebuildSeed(); // rebuild seed to be ready for storing
49 AliTPCseed(UInt_t index, const Double_t xx[5],
50 const Double_t cc[15], Double_t xr, Double_t alpha);
51 void SetClusterIndex(Int_t index){
52 fClusterIndex[fRow] = index;
54 void SetErrorY2(Float_t sy2){fErrorY2=sy2;}
55 void SetErrorZ2(Float_t sz2){fErrorZ2=sz2;}
56 void CookdEdx(Double_t low=0.05, Double_t up=0.70);
57 Bool_t IsActive(){ return !(fRemoval);}
58 void Desactivate(Int_t reason){ fRemoval = reason;}
59 Int_t fRelativeSector; // ! index of current relative sector
60 Int_t fClusterIndex[200]; //array of cluster indexes
62 Int_t fRemoval; //reason - why was track removed - 0 - means still active
63 TClonesArray * fPoints; // array with points along the track
64 TClonesArray * fEPoints; // array with exact points - calculated in special macro not used in tracking
65 Int_t fRow; //! current row number
66 Int_t fSector; //!current sector number
67 Float_t fCurrentSigmaY; //!expected current cluster sigma Y
68 Float_t fCurrentSigmaZ; //!expected current cluster sigma Z
69 AliTPCclusterMI * fCurrentCluster; //!pointer to the current cluster for prolongation
70 Int_t fCurrentClusterIndex1; //! index of the current cluster
71 Int_t fCurrentClusterIndex2; //! index of the current cluster
73 Float_t fErrorY2; //!sigma of current cluster
74 Float_t fErrorZ2; //!sigma of current cluster
75 Int_t fNFoundable; //number of foundable clusters - dead zone taken to the account
76 Bool_t fInDead; // indicate if the track is in dead zone
77 Int_t fFirstPoint; // first cluster position
78 Int_t fLastPoint; // last cluster position
79 Int_t fNShared; // number of shared points
80 Bool_t fIsSeeding; //indicates if it is proces of seeading
82 Float_t fSdEdx; // sigma of dedx
83 Float_t fMAngular; // mean angular factor
84 AliTPCTrackPoint ** fTrackPoints; //!track points - array track points
85 Float_t fDEDX[4]; // dedx according padrows
86 Float_t fSDEDX[4]; // sdedx according padrows
87 Int_t fNCDEDX[4]; // number of clusters for dedx measurment
89 ClassDef(AliTPCseed,1)
95 class AliTPCtrackerMI : public AliTracker {
97 AliTPCtrackerMI():AliTracker(),fkNIS(0),fkNOS(0) {
98 fInnerSec=fOuterSec=0; fSeeds=0;
100 AliTPCtrackerMI(const AliTPCParam *par, Int_t eventn=0);
103 Int_t ReadSeeds(const TFile *in);
105 void UnloadClusters();
107 void LoadInnerSectors();
108 void LoadOuterSectors();
109 AliCluster * GetCluster (int) const {return 0;}
110 AliTPCclusterMI *GetClusterMI(Int_t index) const;
111 Int_t Clusters2Tracks(const TFile *in, TFile *out);
112 // Int_t PropagateBack(const TFile *in, TFile *out);
114 virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
116 virtual Double_t ErrY2(AliTPCseed* seed, AliTPCclusterMI * cl = 0);
117 virtual Double_t ErrZ2(AliTPCseed* seed, AliTPCclusterMI * cl = 0);
119 Double_t f1(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
120 Double_t f2(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t x3,Double_t y3);
121 Double_t f3(Double_t x1,Double_t y1, Double_t x2,Double_t y2, Double_t z1,Double_t z2);
123 //**************** Internal tracker class **********************
126 AliTPCRow() {fN=0; fClusterTracks=0;}
128 void InsertCluster(const AliTPCclusterMI *c, UInt_t index);
129 operator int() const {return fN;}
130 const AliTPCclusterMI* operator[](Int_t i) const {return fClusters[i];}
131 UInt_t GetIndex(Int_t i) const {return fIndex[i];}
132 Int_t Find(Double_t z) const;
133 void SetX(Double_t x) {fX=x;}
134 Double_t GetX() const {return fX;}
135 AliTPCclusterTracks * GetClusterTracks(Int_t index){ return ( (index<fN) && fClusterTracks!=0)? &(fClusterTracks[index]):0;}
136 void UpdateClusterTrack(Int_t clindex, Int_t trindex,AliTPCseed * seed);
137 void MakeClusterTracks();
138 void ClearClusterTracks();
139 Float_t fDeadZone; // the width of the dead zone
141 Int_t fN; //number of clusters
142 const AliTPCclusterMI *fClusters[kMaxClusterPerRow]; //pointers to clusters
143 UInt_t fIndex[kMaxClusterPerRow]; //indeces of clusters
144 Double_t fX; //X-coordinate of this row
145 AliTPCclusterTracks * fClusterTracks; // array of cluster tracks - for overlap calculation
147 AliTPCRow(const AliTPCRow& r); //dummy copy constructor
148 AliTPCRow &operator=(const AliTPCRow& r); //dummy assignment operator
151 //**************** Internal tracker class **********************
154 AliTPCSector() { fN=0; fRow = 0; }
155 ~AliTPCSector() { delete[] fRow; }
156 AliTPCRow& operator[](Int_t i) const { return *(fRow+i); }
157 Int_t GetNRows() const { return fN; }
158 void Setup(const AliTPCParam *par, Int_t flag);
159 Double_t GetX(Int_t l) const {return fRow[l].GetX();}
160 Double_t GetMaxY(Int_t l) const {
161 return GetX(l)*TMath::Tan(0.5*GetAlpha());
163 Double_t GetAlpha() const {return fAlpha;}
164 Double_t GetAlphaShift() const {return fAlphaShift;}
165 Int_t GetRowNumber(Double_t x) const {
166 //return pad row number for this x
170 if (x > r) return fN;
172 if (x < r) return -1;
173 return Int_t((x-r)/fPadPitchLength + 0.5);}
176 if (x > r) return fN;
178 if (x < r) return -1;
179 Double_t r1=fRow[64].GetX();
181 return Int_t((x-r)/f1PadPitchLength + 0.5);}
183 return (Int_t((x-r1)/f2PadPitchLength + 0.5)+64);}
186 Double_t GetPadPitchWidth() const {return fPadPitchWidth;}
187 Double_t GetPadPitchLength() const {return fPadPitchLength;}
188 Double_t GetPadPitchLength(Float_t x) const {return (x<200) ? fPadPitchLength:f2PadPitchLength ;}
191 Int_t fN; //number of pad rows
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
201 AliTPCSector(const AliTPCSector &s); //dummy copy contructor
202 AliTPCSector& operator=(const AliTPCSector &s);//dummy assignment operator
205 Float_t OverlapFactor(AliTPCseed * s1, AliTPCseed * s2, Int_t &sum1, Int_t &sum2);
206 void SignShared(AliTPCseed * s1, AliTPCseed * s2);
207 void RemoveOverlap(TObjArray * arr, Float_t factor, Int_t removalindex, Bool_t shared=kFALSE);
209 Float_t GetSigmaY(AliTPCseed * seed);
210 Float_t GetSigmaZ(AliTPCseed * seed);
212 void MakeSeeds(TObjArray * arr, Int_t sec, Int_t i1, Int_t i2);
213 TObjArray * MakeSeedsSectors(Int_t sec1, Int_t sec2); // make seeds from all sectors
215 Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0);
216 //Int_t FollowProlongationFast(AliTPCseed& t, Int_t step);
217 Int_t FollowBackProlongation(AliTPCseed& t, Int_t rf=0);
219 Int_t FollowToNext(AliTPCseed& t, Int_t nr);
220 Int_t UpdateClusters(AliTPCseed& t, Int_t trindex, Int_t nr);
221 Int_t FollowToNextCluster( Int_t trindex, Int_t nr);
223 virtual Int_t PropagateBack (const TFile *, TFile *){return 0;}
224 void ParallelTracking(Int_t rfirst, Int_t rlast);
225 void SetSampledEdx(AliTPCseed *t, Float_t q, Int_t i) {;}
226 Int_t UpdateTrack(AliTPCseed *t,AliTPCclusterMI* c, Double_t chi2, UInt_t i); //update trackinfo
228 // Int_t FollowBackProlongation(AliTPCseed &s, const AliTPCtrack &t);
230 AliTPCtrackerMI(const AliTPCtrackerMI& r); //dummy copy constructor
231 AliTPCtrackerMI &operator=(const AliTPCtrackerMI& r);//dummy assignment operator
233 const Int_t fkNIS; //number of inner sectors
234 AliTPCSector *fInnerSec; //array of inner sectors;
235 const Int_t fkNOS; //number of outer sectors
236 AliTPCSector *fOuterSec; //array of outer sectors;
238 Int_t fN; //number of loaded sectors
239 AliTPCSector *fSectors; //pointer to loaded sectors;
241 Int_t fEventN; //event number
242 AliTPCClustersArray fClustersArray; //array of TPC clusters
243 Int_t fNtracks; //current number of tracks
244 TObjArray *fSeeds; //array of track seeds
245 // TObjArray * fTrackPointPool; // ! pool with track points
246 const AliTPCParam *fParam; //pointer to the parameters