]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPC.h
Use tgt_ prefix for binary target directories
[u/mrichter/AliRoot.git] / TPC / AliTPC.h
CommitLineData
fe4da5cc 1#ifndef TPC_H
2#define TPC_H
3////////////////////////////////////////////////
4// Manager class for TPC //
5////////////////////////////////////////////////
6
7#include "AliDetector.h"
8#include "AliHit.h"
9#include "AliDigit.h"
10#include "AliTPCSecGeo.h"
8c555625 11#include "AliTPCParam.h"
fe4da5cc 12#include <TMatrix.h>
8c555625 13#include <TTree.h>
14#include <TClonesArray.h>
fe4da5cc 15
16#define MAXTPCTBK 500
17
18class AliTPCcluster;
19class AliTPCtrack;
8c555625 20class AliTPCParam;
21//MI changes
22class AliTPCD;
fe4da5cc 23
24class AliTPC : public AliDetector {
25protected:
26 Int_t fSens; // ISENS
27 Int_t fSecAL; // Upper sector selector
28 Int_t fSecAU; // Lower sector selector
29 Int_t fSecLows[6]; // List of lower sectors selected
30 Int_t fSecUps[12]; // List of upper sectors selected
31 Int_t fNsectors; // Number of sectors in TPC
32 Int_t fNclusters; // Number of clusters in TPC
33 Int_t fNtracks; // Number of tracks in TPC
34 Int_t *fClustersIndex; // Index for each sector in fClusters
35 Int_t *fDigitsIndex; // Index for each sector in fDigits
36 TClonesArray *fClusters; // List of clusters for all sectors
37 TClonesArray *fTracks; // List of reconstructed tracks
8c555625 38 //MI changes
39 AliTPCD * fDigParam; //detector parameters
fe4da5cc 40public:
41 AliTPC();
42 AliTPC(const char *name, const char *title);
43 virtual ~AliTPC();
44 virtual void AddCluster(Float_t*, Int_t*);
45 /*virtual*/void AddCluster(const AliTPCcluster&);
46 virtual void AddDigit(Int_t*, Int_t*);
47 virtual void AddHit(Int_t, Int_t*, Float_t*);
48 virtual void AddTrack(Float_t*);
49 /*virtual*/void AddTrack(const AliTPCtrack&);
50 Int_t DistancetoPrimitive(Int_t px, Int_t py);
51 virtual void BuildGeometry();
52 virtual void CreateGeometry() {}
53 virtual void CreateMaterials();
54 virtual void Hits2Clusters();
8c555625 55
56 virtual void Hits2Digits(); //MI change
57 virtual void Hits2DigitsSector(Int_t isec); //MI change
fe4da5cc 58 virtual void Init();
59 virtual Int_t IsVersion() const =0;
60 virtual void Digits2Clusters();
61 virtual void Clusters2Tracks();
62 TClonesArray *Clusters() {return fClusters;}
63 TClonesArray *Tracks() {return fTracks;}
64 Int_t *GetClustersIndex() {return fClustersIndex;}
65 Int_t *GetDigitsIndex() {return fDigitsIndex;}
66 Int_t GetNsectors() {return fNsectors;}
67 virtual void MakeBranch(Option_t *opt=" ");
68 virtual void ResetDigits();
69 virtual void SetSecAL(Int_t sec);
70 virtual void SetSecAU(Int_t sec);
71 virtual void SetSecLows(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6);
72 virtual void SetSecUps (Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6,
73 Int_t s7,Int_t s8,Int_t s9,Int_t s10, Int_t s11, Int_t s12);
74 virtual void SetSens(Int_t sens);
75 virtual void StepManager()=0;
8c555625 76 virtual void DrawDetector() {}
77 AliTPCD* GetDigParam() {return fDigParam;} //MI change8
78 void SetDigParam(AliTPCD* param) {fDigParam=param;} //MI must think about it
fe4da5cc 79private:
80 //
8c555625 81 void ElDiff(Float_t *xyz);
82 void MakeTriplet(Int_t row,TObjArray **rowTriplet,
83 TObjArray **prow);
fe4da5cc 84
8c555625 85 void ExB(Float_t *xyz);
86 void DigitizeRow(Int_t irow,Int_t isec,TObjArray **rowTriplet);
87 Float_t GetSignal(TObjArray *p1, Int_t ntr, Int_t np, TMatrix *m1, TMatrix *m2,
88 Int_t *IndexRange);
89 void GetList (Float_t label,Int_t np,TMatrix *m,Int_t *IndexRange,
90 Float_t **pList);
91 void MakeSector(Int_t isec,Int_t nrows,TTree *TH,Stat_t ntracks,TObjArray **row);
92 void GetCrossTalk (Int_t iFlag,TObjArray *p,Int_t ntracks,Int_t *npads,
93 TMatrix *m);
fe4da5cc 94
fe4da5cc 95
96 ClassDef(AliTPC,2) // Time Projection Chamber class
97};
98
99//_____________________________________________________________________________
100
101class AliTPCcluster : public TObject {
102public:
103 Int_t fTracks[3];//labels of overlapped tracks
104 Int_t fSector; //sector number
105 Int_t fPadRow; //PadRow number
106 Float_t fY ; //Y of cluster
107 Float_t fZ ; //Z of cluster
108 Float_t fQ ; //Q of cluster (in ADC counts)
109 Float_t fSigmaY2; //Sigma Y square of cluster
110 Float_t fSigmaZ2; //Sigma Z square of cluster
111
112public:
113 AliTPCcluster() {
114 fTracks[0]=fTracks[1]=fTracks[2]=0;
115 fSector=fPadRow=0;
116 fY=fZ=fQ=fSigmaY2=fSigmaZ2=0.;
117 }
118 AliTPCcluster(Float_t *hits, Int_t*);
119 virtual ~AliTPCcluster() {;}
120 void Use() {fTracks[0]=-fTracks[0];}
121 int IsUsed() const {return (fTracks[0]<0) ? 1 : 0;}
8c555625 122 void GetXYZ(Float_t *x, const AliTPCParam *) const; //Get global x,y,z
123 Bool_t IsSortable() const;
124 Int_t Compare(TObject *o) ;
fe4da5cc 125 ClassDef(AliTPCcluster,1) // Time Projection Chamber clusters
126};
127
128
129//_____________________________________________________________________________
130
131class AliTPCdigit : public AliDigit {
132public:
133 Int_t fSector; //array of volumes
134 Int_t fPadRow; //Row number
135 Int_t fPad ; //Pad number
136 Int_t fTime; //Time bucket
137 Int_t fSignal; //Signal amplitude
138
139public:
140 AliTPCdigit() {}
141 AliTPCdigit(Int_t *tracks, Int_t *digits);
142 virtual ~AliTPCdigit() {}
143
144 ClassDef(AliTPCdigit,1) // Time Projection Chamber digits
145};
146
147
148//_____________________________________________________________________________
149
150class AliTPChit : public AliHit {
151public:
152 Int_t fSector; //sector number
153 Int_t fPadRow; //Pad Row number
154 Float_t fQ ; //charge
155
156public:
157 AliTPChit() {}
158 AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
159 virtual ~AliTPChit() {}
160
161 ClassDef(AliTPChit,1) // Time Projection Chamber hits
162};
163
164
165//_____________________________________________________________________________
166
8c555625 167const unsigned MAX_CLUSTER_PER_ROW=1500;
fe4da5cc 168const Double_t FIELD=0.2;
169
170class AliTPCtrack : public TObject {
171 Double_t fAlpha; // rotation angle
172 Double_t ref; // track reference plane (X-coordinate)
173 TVector x; // vector of track parameters
174 TMatrix C; // covariance matrix of track parameters
175 TObjArray clusters; // pointers to clusters belonging to this track
176 Double_t chi2; // total chi2 value for this track
177public:
178 AliTPCtrack(Float_t *hits);
8c555625 179 AliTPCtrack(const AliTPCcluster& c, const TVector& xx, const TMatrix& CC,
180 const AliTPCParam *);
fe4da5cc 181 AliTPCtrack(const AliTPCtrack& t);
182 int PropagateTo(Double_t x,
183 Double_t x0=28.94,Double_t rho=0.9e-3,Double_t pm=0.139);
184 void PropagateToVertex(
185 Double_t x0=36.66,Double_t rho=1.2e-3,Double_t pm=0.139);
186 void Update(const AliTPCcluster* c, Double_t chi2);
187 int Rotate(Double_t angle);
188
189 void UseClusters() const ;
190 Double_t GetPredictedChi2(const AliTPCcluster*) const ;
191 Double_t GetX() const {return ref;}
192 Double_t GetY() const {return x(0);}
193 Double_t GetC() const {return x(2);}
194 Double_t GetY(Double_t x) const;
195 Double_t GetZ() const {return x(1);}
196 Double_t GetTgl() const {return x(4);}
197 Double_t GetPt() const {return 0.3*FIELD/x(2)/100;}
198 int GetLab() const ;
199 Double_t GetSigmaY2() const {return C(0,0);}
200 Double_t GetSigmaZ2() const {return C(1,1);}
201 Double_t GetSigmaC2() const {return C(2,2);}
202 Double_t GetSigmaTgl2() const {return C(4,4);}
203 Double_t GetAlpha() const {return fAlpha;}
204 Double_t GetChi2() const {return chi2;}
205 operator int() const {return clusters.GetEntriesFast();}
206 AliTPCcluster& operator[](int i) {
207 return *((AliTPCcluster*)clusters.UncheckedAt(i));
208 }
209 void GetPxPyPz(Double_t&, Double_t&, Double_t&) const ;
210 void GetXYZ(Double_t& X,Double_t& Y,Double_t& Z) const {X=ref;Y=x(0);Z=x(1);}
211
212 ClassDef(AliTPCtrack,1) // Time Projection Chamber reconstructed tracks
213};
214
215//_____Classes for internal tracking use ______________________________________
216
217class TrackSeed : public AliTPCtrack {
218public:
8c555625 219 TrackSeed(const AliTPCcluster& c, const TVector& x, const TMatrix& C,
220 const AliTPCParam *p) : AliTPCtrack(c,x,C,p) {}
fe4da5cc 221 Bool_t IsSortable() const {return kTRUE;}
222 Int_t Compare(TObject *o) {
223 AliTPCtrack *t=(AliTPCtrack*)o;
224 Double_t c =GetSigmaY2();
225 Double_t co=t->GetSigmaY2();
226 if (c>co) return 1;
227 else if (c<co) return -1;
228 return 0;
229 }
230};
231
232class AliTPCRow {
233 unsigned num_of_clusters;
234 const AliTPCcluster *clusters[MAX_CLUSTER_PER_ROW];
235public:
236 AliTPCRow() {num_of_clusters=0;}
237 void InsertCluster(const AliTPCcluster*);
238
239 operator int() const {return num_of_clusters;}
240 const AliTPCcluster* operator[](int i) const {return clusters[i];}
241 int Find(Double_t y) const;
242};
243
8c555625 244
fe4da5cc 245class AliTPCSector {
8c555625 246protected:
fe4da5cc 247 unsigned num_of_rows;
248 AliTPCRow *row;
8c555625 249 const AliTPCParam *param;
fe4da5cc 250public:
8c555625 251 AliTPCSector() {
252 row = 0; num_of_rows=0;
253 param=0;
fe4da5cc 254 }
8c555625 255 virtual void SetUp(AliTPCParam *p) {param=p;}
fe4da5cc 256 virtual ~AliTPCSector() { delete[] row; }
257 AliTPCRow& operator[](int i) const { return *(row+i); }
258 virtual Double_t GetX(int l) const = 0;
259 virtual Double_t GetMaxY(int l) const = 0;
260 virtual Double_t GetAlpha() const = 0;
261};
262
263class AliTPCSSector : public AliTPCSector {
264public:
8c555625 265 AliTPCSSector(){}
fe4da5cc 266 virtual ~AliTPCSSector() {}
8c555625 267 virtual void SetUp(AliTPCParam *p) {
268 param=p;
269 num_of_rows=p->GetNRowLow();
270 row=new AliTPCRow[num_of_rows];
271 }
272 Double_t GetX(int l) const { return param->GetPadRowRadiiLow(l); }
fe4da5cc 273 Double_t GetAlpha() const {return alpha_low;}
8c555625 274 Double_t GetMaxY(int l) const { return GetX(l)*tan(0.5*GetAlpha()); }
fe4da5cc 275};
276
277class AliTPCLSector : public AliTPCSector {
278public:
8c555625 279 AliTPCLSector(){}
fe4da5cc 280 virtual ~AliTPCLSector() {}
8c555625 281 virtual void SetUp(AliTPCParam *p) {
282 param=p;
283 num_of_rows=p->GetNRowUp();
284 row=new AliTPCRow[num_of_rows];
285 }
286 Double_t GetX(int l) const { return param->GetPadRowRadiiUp(l); }
fe4da5cc 287 Double_t GetAlpha() const {return alpha_up;}
8c555625 288 Double_t GetMaxY(int l) const { return GetX(l)*tan(0.5*GetAlpha()); }
fe4da5cc 289};
290
8c555625 291
292
293
fe4da5cc 294#endif
295