]>
Commit | Line | Data |
---|---|---|
73042f01 | 1 | #ifndef ALITPCTRACKER_H |
2 | #define ALITPCTRACKER_H | |
3 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * | |
4 | * See cxx source for full Copyright notice */ | |
5 | ||
6 | /* $Id$ */ | |
7 | ||
8 | //------------------------------------------------------- | |
9 | // TPC tracker | |
10 | // | |
11 | // Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch | |
12 | //------------------------------------------------------- | |
b9de75e1 | 13 | #include "AliTracker.h" |
73042f01 | 14 | #include "AliTPCtrack.h" |
b9de75e1 | 15 | #include "AliTPCreco.h" |
c630aafd | 16 | #include "AliTPCcluster.h" |
73042f01 | 17 | |
18 | class TFile; | |
c630aafd | 19 | class TTree; |
20 | class TBranch; | |
b9de75e1 | 21 | class AliTPCParam; |
c630aafd | 22 | class TObjArray; |
23 | class TClonesArray; | |
24 | class AliESD; | |
73042f01 | 25 | |
b9de75e1 | 26 | class AliTPCtracker : public AliTracker { |
73042f01 | 27 | public: |
e502c8c2 | 28 | AliTPCtracker():AliTracker(),fkNIS(0),fkNOS(0) { |
29 | fInnerSec=fOuterSec=0; fSeeds=0; | |
c630aafd | 30 | fParam = 0; |
e502c8c2 | 31 | } |
c630aafd | 32 | AliTPCtracker(const AliTPCParam *par); |
b9de75e1 | 33 | ~AliTPCtracker(); |
34 | ||
35 | Int_t ReadSeeds(const TFile *in); | |
36 | ||
c630aafd | 37 | Int_t LoadClusters(TTree *c); |
38 | void UnloadClusters(); | |
73042f01 | 39 | |
b9de75e1 | 40 | AliCluster *GetCluster(Int_t index) const; |
c630aafd | 41 | Int_t Clusters2Tracks(AliESD *event); |
c630aafd | 42 | Int_t PropagateBack(AliESD *event); |
c630aafd | 43 | Int_t RefitInward(AliESD *event); |
b9de75e1 | 44 | |
45 | virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const; | |
46 | ||
47 | public: | |
73042f01 | 48 | //**************** Internal tracker class ********************** |
49 | class AliTPCRow { | |
50 | public: | |
c630aafd | 51 | AliTPCRow() { |
52 | fN=0; | |
53 | fSize=kMaxClusterPerRow/8; | |
54 | fClusterArray=new AliTPCcluster[fSize]; | |
55 | } | |
56 | ~AliTPCRow() {delete[] fClusterArray;} | |
57 | void InsertCluster(const AliTPCcluster *c, Int_t sec, Int_t row); | |
58 | void ResetClusters() {fN=0; delete[] fClusterArray; fClusterArray=0;} | |
73042f01 | 59 | operator int() const {return fN;} |
c630aafd | 60 | const AliTPCcluster *operator[](Int_t i) const {return fClusters[i];} |
61 | const AliTPCcluster *GetUnsortedCluster(Int_t i) const { | |
62 | if ((i < 0) || (i >= fN)) return NULL; | |
63 | return fClusterArray+i; | |
64 | } | |
73042f01 | 65 | UInt_t GetIndex(Int_t i) const {return fIndex[i];} |
66 | Int_t Find(Double_t y) const; | |
b9de75e1 | 67 | void SetX(Double_t x) {fX=x;} |
68 | Double_t GetX() const {return fX;} | |
73042f01 | 69 | |
70 | private: | |
b9de75e1 | 71 | Int_t fN; //number of clusters |
72 | const AliTPCcluster *fClusters[kMaxClusterPerRow]; //pointers to clusters | |
c630aafd | 73 | Int_t fSize; //size of array of clusters |
74 | AliTPCcluster *fClusterArray; //array of clusters | |
b9de75e1 | 75 | UInt_t fIndex[kMaxClusterPerRow]; //indeces of clusters |
76 | Double_t fX; //X-coordinate of this row | |
73042f01 | 77 | |
78 | private: | |
79 | AliTPCRow(const AliTPCRow& r); //dummy copy constructor | |
80 | AliTPCRow &operator=(const AliTPCRow& r); //dummy assignment operator | |
81 | }; | |
82 | ||
83 | //**************** Internal tracker class ********************** | |
84 | class AliTPCSector { | |
85 | public: | |
c630aafd | 86 | AliTPCSector() { fN=0; fRow = 0; } |
b9de75e1 | 87 | ~AliTPCSector() { delete[] fRow; } |
73042f01 | 88 | AliTPCRow& operator[](Int_t i) const { return *(fRow+i); } |
89 | Int_t GetNRows() const { return fN; } | |
b9de75e1 | 90 | void Setup(const AliTPCParam *par, Int_t flag); |
91 | Double_t GetX(Int_t l) const {return fRow[l].GetX();} | |
92 | Double_t GetMaxY(Int_t l) const { | |
93 | return GetX(l)*TMath::Tan(0.5*GetAlpha()); | |
94 | } | |
95 | Double_t GetAlpha() const {return fAlpha;} | |
96 | Double_t GetAlphaShift() const {return fAlphaShift;} | |
97 | Int_t GetRowNumber(Double_t x) const { | |
98 | //return pad row number for this x | |
f03e3423 | 99 | Double_t r; |
b46635a4 | 100 | if (fN < 64){ |
f03e3423 | 101 | r=fRow[fN-1].GetX(); |
102 | if (x > r) return fN; | |
103 | r=fRow[0].GetX(); | |
104 | if (x < r) return -1; | |
29fe0389 | 105 | return Int_t((x-r)/f1PadPitchLength + 0.5);} |
f03e3423 | 106 | else{ |
107 | r=fRow[fN-1].GetX(); | |
108 | if (x > r) return fN; | |
109 | r=fRow[0].GetX(); | |
110 | if (x < r) return -1; | |
111 | Double_t r1=fRow[64].GetX(); | |
112 | if(x<r1){ | |
113 | return Int_t((x-r)/f1PadPitchLength + 0.5);} | |
114 | else{ | |
115 | return (Int_t((x-r1)/f2PadPitchLength + 0.5)+64);} | |
116 | } | |
b9de75e1 | 117 | } |
118 | Double_t GetPadPitchWidth() const {return fPadPitchWidth;} | |
b9de75e1 | 119 | |
120 | private: | |
121 | Int_t fN; //number of pad rows | |
73042f01 | 122 | AliTPCRow *fRow; //array of pad rows |
b9de75e1 | 123 | Double_t fAlpha; //opening angle |
124 | Double_t fAlphaShift; //shift angle; | |
125 | Double_t fPadPitchWidth; //pad pitch width | |
c630aafd | 126 | Double_t f1PadPitchLength; //pad pitch length |
127 | Double_t f2PadPitchLength; //pad pitch length | |
73042f01 | 128 | private: |
129 | AliTPCSector(const AliTPCSector &s); //dummy copy contructor | |
130 | AliTPCSector& operator=(const AliTPCSector &s);//dummy assignment operator | |
131 | }; | |
132 | ||
73042f01 | 133 | //**************** Internal tracker class ********************** |
134 | class AliTPCseed : public AliTPCtrack { | |
135 | public: | |
136 | AliTPCseed():AliTPCtrack(){} | |
b9de75e1 | 137 | AliTPCseed(const AliTPCtrack &t):AliTPCtrack(t){} |
73042f01 | 138 | AliTPCseed(UInt_t index, const Double_t xx[5], |
139 | const Double_t cc[15], Double_t xr, Double_t alpha): | |
140 | AliTPCtrack(index, xx, cc, xr, alpha) {} | |
141 | void SetSampledEdx(Float_t q, Int_t i) { | |
be9c5115 | 142 | Double_t s=GetSnp(), t=GetTgl(); |
143 | q *= TMath::Sqrt((1-s*s)/(1+t*t)); | |
d4cf1daa | 144 | fdEdxSample[i]=q; |
73042f01 | 145 | } |
73042f01 | 146 | void CookdEdx(Double_t low=0.05, Double_t up=0.70); |
147 | ||
148 | private: | |
d4cf1daa | 149 | Float_t fdEdxSample[200]; //array of dE/dx samples |
73042f01 | 150 | }; |
151 | ||
152 | private: | |
c630aafd | 153 | |
b9de75e1 | 154 | void MakeSeeds(Int_t i1, Int_t i2); |
155 | Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0); | |
156 | Int_t FollowBackProlongation(AliTPCseed &s, const AliTPCtrack &t); | |
c630aafd | 157 | Int_t FollowRefitInward(AliTPCseed *seed, AliTPCtrack *track); |
b9de75e1 | 158 | |
159 | AliTPCtracker(const AliTPCtracker& r); //dummy copy constructor | |
160 | AliTPCtracker &operator=(const AliTPCtracker& r);//dummy assignment operator | |
161 | ||
162 | const Int_t fkNIS; //number of inner sectors | |
c630aafd | 163 | AliTPCSector *fInnerSec; //array of inner sectors |
b9de75e1 | 164 | const Int_t fkNOS; //number of outer sectors |
c630aafd | 165 | AliTPCSector *fOuterSec; //array of outer sectors |
166 | ||
167 | Int_t fN; //number of "active" sectors | |
168 | AliTPCSector *fSectors; //pointer to "active" sectors; | |
169 | ||
170 | AliTPCParam *fParam; //! TPC parameters for outer reference plane [SR, GSI, 18.02.2003] | |
171 | TObjArray *fSeeds; //array of track seeds | |
172 | ||
24de2d6d | 173 | ClassDef(AliTPCtracker,2) // Time Projection Chamber tracker |
b9de75e1 | 174 | }; |
73042f01 | 175 | |
176 | #endif | |
177 | ||
178 |