]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPC.h
Precision parameter for pT sampling plus corresponding getter introduced.
[u/mrichter/AliRoot.git] / TPC / AliTPC.h
CommitLineData
fe4da5cc 1#ifndef TPC_H
2#define TPC_H
3da30618 3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
fe4da5cc 8////////////////////////////////////////////////
9// Manager class for TPC //
10////////////////////////////////////////////////
fe4da5cc 11#include "AliDetector.h"
12#include "AliHit.h"
13#include "AliDigit.h"
8c555625 14#include "AliTPCParam.h"
fe4da5cc 15#include <TMatrix.h>
8c555625 16#include <TTree.h>
17#include <TClonesArray.h>
fe4da5cc 18
fe4da5cc 19class AliTPCcluster;
20class AliTPCtrack;
8c555625 21class AliTPCParam;
cc80f89e 22
23class AliTPCDigitsArray;
24class AliTPCClustersArray;
fe4da5cc 25
26class AliTPC : public AliDetector {
27protected:
28 Int_t fSens; // ISENS
29 Int_t fSecAL; // Upper sector selector
30 Int_t fSecAU; // Lower sector selector
31 Int_t fSecLows[6]; // List of lower sectors selected
32 Int_t fSecUps[12]; // List of upper sectors selected
33 Int_t fNsectors; // Number of sectors in TPC
34 Int_t fNclusters; // Number of clusters in TPC
35 Int_t fNtracks; // Number of tracks in TPC
cc80f89e 36 TClonesArray *fClusters; // List of clusters for all sectors
37 TClonesArray *fTracks; // List of reconstructed tracks
38 //MI changes
39 AliTPCDigitsArray * fDigitsArray; //detector digit object
40 AliTPCClustersArray * fClustersArray; //detector cluster object
41 AliTPCParam *fTPCParam;
4b0fdcad 42
43 //MK changes
44
45 Float_t fSide; // selects left(-1), right(+1), or both(0) sides of the TPC
1283eee5 46 Int_t fNoComp; // number of a drift gas components
47 Int_t fMixtComp[3]; // drift gas components
48 Float_t fMixtProp[3]; // mixture proportions
49
fe4da5cc 50public:
51 AliTPC();
52 AliTPC(const char *name, const char *title);
53 virtual ~AliTPC();
54 virtual void AddCluster(Float_t*, Int_t*);
55 /*virtual*/void AddCluster(const AliTPCcluster&);
fe4da5cc 56 virtual void AddHit(Int_t, Int_t*, Float_t*);
57 virtual void AddTrack(Float_t*);
58 /*virtual*/void AddTrack(const AliTPCtrack&);
59 Int_t DistancetoPrimitive(Int_t px, Int_t py);
60 virtual void BuildGeometry();
61 virtual void CreateGeometry() {}
62 virtual void CreateMaterials();
63 virtual void Hits2Clusters();
cc80f89e 64 virtual void Hits2ExactClustersSector(Int_t isec); // MI change calculate "exact" cluster position
8c555625 65
66 virtual void Hits2Digits(); //MI change
67 virtual void Hits2DigitsSector(Int_t isec); //MI change
fe4da5cc 68 virtual void Init();
69 virtual Int_t IsVersion() const =0;
70 virtual void Digits2Clusters();
71 virtual void Clusters2Tracks();
72 TClonesArray *Clusters() {return fClusters;}
73 TClonesArray *Tracks() {return fTracks;}
cc80f89e 74
fe4da5cc 75 Int_t GetNsectors() {return fNsectors;}
76 virtual void MakeBranch(Option_t *opt=" ");
77 virtual void ResetDigits();
78 virtual void SetSecAL(Int_t sec);
79 virtual void SetSecAU(Int_t sec);
80 virtual void SetSecLows(Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6);
81 virtual void SetSecUps (Int_t s1,Int_t s2,Int_t s3,Int_t s4,Int_t s5, Int_t s6,
82 Int_t s7,Int_t s8,Int_t s9,Int_t s10, Int_t s11, Int_t s12);
83 virtual void SetSens(Int_t sens);
cc80f89e 84
85 //MK changes
86
4b0fdcad 87 //MK changes
88
89 virtual void SetSide(Float_t side);
1283eee5 90 virtual void SetGasMixt(Int_t nc,Int_t c1,Int_t c2,Int_t c3,Float_t p1,
91 Float_t p2,Float_t p3);
92
fe4da5cc 93 virtual void StepManager()=0;
8c555625 94 virtual void DrawDetector() {}
cc80f89e 95 AliTPCDigitsArray* GetDigitsArray() {return fDigitsArray;} //MI change
96 AliTPCClustersArray* GetClustersArray(){return fClustersArray;} //MI change
97 AliTPCParam *GetParam(){return fTPCParam;} // M.K, M.I changes
98 void SetParam(AliTPCParam *param){fTPCParam=param;} // M.K, M.I changes
99 void SetDigitsArray(AliTPCDigitsArray* param) {fDigitsArray=param;} //MI change
100 void SetClustersArray(AliTPCClustersArray *clusters) {fClustersArray = clusters;} //MI change
fe4da5cc 101private:
102 //
8c555625 103 void DigitizeRow(Int_t irow,Int_t isec,TObjArray **rowTriplet);
cc80f89e 104 Float_t GetSignal(TObjArray *p1, Int_t ntr, TMatrix *m1, TMatrix *m2,
8c555625 105 Int_t *IndexRange);
106 void GetList (Float_t label,Int_t np,TMatrix *m,Int_t *IndexRange,
107 Float_t **pList);
108 void MakeSector(Int_t isec,Int_t nrows,TTree *TH,Stat_t ntracks,TObjArray **row);
cc80f89e 109 void TransportElectron(Float_t *xyz, Int_t *index);
110 Int_t fCurrentIndex[4];// index[0] indicates coordinate system,
111 // index[1] sector number,
112 // index[2] pad row number
113 // index[3] pad row number for which signal is calculated
fe4da5cc 114
115 ClassDef(AliTPC,2) // Time Projection Chamber class
116};
117
118//_____________________________________________________________________________
119
120class AliTPCcluster : public TObject {
121public:
122 Int_t fTracks[3];//labels of overlapped tracks
123 Int_t fSector; //sector number
124 Int_t fPadRow; //PadRow number
cc80f89e 125 Float_t fY ; //Y of cluster
126 Float_t fZ ; //Z of cluster
127 Float_t fQ ; //Q of cluster (in ADC counts)
3c0f9266 128 Float_t fdEdX; //dE/dX inside this cluster
fe4da5cc 129 Float_t fSigmaY2; //Sigma Y square of cluster
130 Float_t fSigmaZ2; //Sigma Z square of cluster
131
132public:
133 AliTPCcluster() {
134 fTracks[0]=fTracks[1]=fTracks[2]=0;
135 fSector=fPadRow=0;
3c0f9266 136 fY=fZ=fQ=fdEdX=fSigmaY2=fSigmaZ2=0.;
fe4da5cc 137 }
138 AliTPCcluster(Float_t *hits, Int_t*);
139 virtual ~AliTPCcluster() {;}
3c0f9266 140 void Use() {fQ=-fQ;} //if fQ<0 cluster is already associated with a track
cc80f89e 141 Int_t IsUsed() const {return (fQ<0) ? 1 : 0;}
8c555625 142 void GetXYZ(Float_t *x, const AliTPCParam *) const; //Get global x,y,z
3c0f9266 143 Bool_t IsSortable() const;
8c555625 144 Int_t Compare(TObject *o) ;
fe4da5cc 145 ClassDef(AliTPCcluster,1) // Time Projection Chamber clusters
146};
147
148
149//_____________________________________________________________________________
150
151class AliTPCdigit : public AliDigit {
152public:
153 Int_t fSector; //array of volumes
154 Int_t fPadRow; //Row number
155 Int_t fPad ; //Pad number
156 Int_t fTime; //Time bucket
157 Int_t fSignal; //Signal amplitude
158
159public:
160 AliTPCdigit() {}
161 AliTPCdigit(Int_t *tracks, Int_t *digits);
162 virtual ~AliTPCdigit() {}
163
164 ClassDef(AliTPCdigit,1) // Time Projection Chamber digits
165};
166
167
168//_____________________________________________________________________________
169
170class AliTPChit : public AliHit {
171public:
172 Int_t fSector; //sector number
173 Int_t fPadRow; //Pad Row number
174 Float_t fQ ; //charge
175
176public:
177 AliTPChit() {}
178 AliTPChit(Int_t shunt, Int_t track, Int_t *vol, Float_t *hits);
179 virtual ~AliTPChit() {}
180
181 ClassDef(AliTPChit,1) // Time Projection Chamber hits
182};
183
184
185//_____________________________________________________________________________
fe4da5cc 186class AliTPCtrack : public TObject {
3c0f9266 187//-----------------------------------------------------------------
188// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
189//-----------------------------------------------------------------
fe4da5cc 190 Double_t fAlpha; // rotation angle
3c0f9266 191 Double_t fX; // X-coordinate of this track (reference plane)
fe4da5cc 192 TVector x; // vector of track parameters
193 TMatrix C; // covariance matrix of track parameters
3c0f9266 194 TObjArray fClusters; // clusters belonging to this track
195 Double_t fChi2; // total chi2 value for this track
fe4da5cc 196public:
cc80f89e 197 AliTPCtrack(): x(5), C(5,5), fClusters(200) {fAlpha=fX=fChi2=0.;}
fe4da5cc 198 AliTPCtrack(Float_t *hits);
3c0f9266 199 AliTPCtrack(const AliTPCcluster *c, const TVector& xx, const TMatrix& CC,
200 Double_t xr, Double_t alpha);
fe4da5cc 201 AliTPCtrack(const AliTPCtrack& t);
3c0f9266 202 Int_t Compare(TObject *o);
cc80f89e 203 Int_t PropagateTo(Double_t xr,
204 Double_t x0=28.94,Double_t rho=0.9e-3,Double_t pm=0.139);
fe4da5cc 205 void PropagateToVertex(
3c0f9266 206 Double_t x0=36.66,Double_t rho=1.2e-3,Double_t pm=0.139);
fe4da5cc 207 void Update(const AliTPCcluster* c, Double_t chi2);
cc80f89e 208 Int_t Rotate(Double_t angle);
fe4da5cc 209
3c0f9266 210 Bool_t IsSortable() const {return kTRUE;}
fe4da5cc 211 void UseClusters() const ;
212 Double_t GetPredictedChi2(const AliTPCcluster*) const ;
cc80f89e 213 Int_t GetLabel(Int_t nrows) const ;
3c0f9266 214 void GetPxPyPz(Double_t&, Double_t&, Double_t&) const ;
215 Double_t GetdEdX(Double_t low, Double_t up) const ;
216
217 Double_t GetX() const {return fX;}
fe4da5cc 218 Double_t GetY() const {return x(0);}
fe4da5cc 219 Double_t GetZ() const {return x(1);}
3c0f9266 220 Double_t GetC() const {return x(2);}
221 Double_t GetEta() const {return x(3);}
fe4da5cc 222 Double_t GetTgl() const {return x(4);}
3c0f9266 223 Double_t GetPt() const {return 0.3*0.2/GetC()/100;}
224 Double_t GetP() const {
225 return TMath::Abs(GetPt())*sqrt(1.+GetTgl()*GetTgl());
226 }
fe4da5cc 227 Double_t GetSigmaY2() const {return C(0,0);}
228 Double_t GetSigmaZ2() const {return C(1,1);}
229 Double_t GetSigmaC2() const {return C(2,2);}
230 Double_t GetSigmaTgl2() const {return C(4,4);}
231 Double_t GetAlpha() const {return fAlpha;}
3c0f9266 232 Double_t GetChi2() const {return fChi2;}
cc80f89e 233 operator Int_t() const {return fClusters.GetEntriesFast();}
234 const AliTPCcluster *GetCluster(Int_t i) const {
235 return (const AliTPCcluster *)fClusters.UncheckedAt(i);
236 }
fe4da5cc 237
238 ClassDef(AliTPCtrack,1) // Time Projection Chamber reconstructed tracks
239};
240
fe4da5cc 241
3c0f9266 242
243//-----------------------------------------------------------------
244// Classes for internal tracking use.
245//-----------------------------------------------------------------
246const unsigned MAX_CLUSTER_PER_ROW=3500;
fe4da5cc 247
248class AliTPCRow {
3c0f9266 249//-----------------------------------------------------------------
250// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
251//-----------------------------------------------------------------
fe4da5cc 252 unsigned num_of_clusters;
253 const AliTPCcluster *clusters[MAX_CLUSTER_PER_ROW];
254public:
255 AliTPCRow() {num_of_clusters=0;}
256 void InsertCluster(const AliTPCcluster*);
257
cc80f89e 258 operator Int_t() const {return num_of_clusters;}
259 const AliTPCcluster* operator[](Int_t i) const {return clusters[i];}
260 Int_t Find(Double_t y) const;
fe4da5cc 261};
262
263class AliTPCSector {
3c0f9266 264//-----------------------------------------------------------------
265// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
266//-----------------------------------------------------------------
8c555625 267protected:
fe4da5cc 268 unsigned num_of_rows;
269 AliTPCRow *row;
3c0f9266 270 static AliTPCParam *param;
fe4da5cc 271public:
3c0f9266 272 AliTPCSector() { row = 0; num_of_rows=0; }
fe4da5cc 273 virtual ~AliTPCSector() { delete[] row; }
3c0f9266 274 static void SetParam(AliTPCParam *p) { param=p; }
cc80f89e 275 AliTPCRow& operator[](Int_t i) const { return *(row+i); }
276 Int_t GetNRows() const { return num_of_rows; }
277 virtual Double_t GetX(Int_t l) const = 0;
278 virtual Double_t GetMaxY(Int_t l) const = 0;
fe4da5cc 279 virtual Double_t GetAlpha() const = 0;
3c0f9266 280 virtual Double_t GetAlphaShift() const = 0;
281 virtual Int_t GetRowNumber(Double_t x) const = 0;
cc80f89e 282 virtual Double_t GetPadPitchWidth() const = 0;
fe4da5cc 283};
284
285class AliTPCSSector : public AliTPCSector {
3c0f9266 286//-----------------------------------------------------------------
287// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
288//-----------------------------------------------------------------
fe4da5cc 289public:
3c0f9266 290 AliTPCSSector(){
291 if (!param) {
292 fprintf(stderr,"AliTPCSSector: parameters are not set !\n");
293 return;
294 }
295 num_of_rows=param->GetNRowLow();
296 row=new AliTPCRow[num_of_rows];
8c555625 297 }
3c0f9266 298 virtual ~AliTPCSSector() {}
cc80f89e 299 Double_t GetX(Int_t l) const { return param->GetPadRowRadiiLow(l); }
300 Double_t GetMaxY(Int_t l) const { return GetX(l)*tan(0.5*GetAlpha()); }
3c0f9266 301 Double_t GetAlpha() const {return param->GetInnerAngle();}
302 Double_t GetAlphaShift() const {return param->GetInnerAngleShift();}
cc80f89e 303 Double_t GetPadPitchWidth() const {
304 return param->GetInnerPadPitchWidth();
305 }
3c0f9266 306 Int_t GetRowNumber(Double_t x) const {
cc80f89e 307 Double_t r=param->GetPadRowRadiiLow(param->GetNRowLow()-1);
3c0f9266 308 if (x > r) return param->GetNRowLow();
cc80f89e 309 r=param->GetPadRowRadiiLow(0);
3c0f9266 310 if (x < r) return -1;
cc80f89e 311 return Int_t((x-r)/param->GetInnerPadPitchLength() + 0.5);
3c0f9266 312 }
fe4da5cc 313};
314
315class AliTPCLSector : public AliTPCSector {
3c0f9266 316//-----------------------------------------------------------------
317// Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch
318//-----------------------------------------------------------------
fe4da5cc 319public:
3c0f9266 320 AliTPCLSector(){
321 if (!param) {
322 fprintf(stderr,"AliTPCLSector: parameters are not set !\n");
323 return;
324 }
325 num_of_rows=param->GetNRowUp();
326 row=new AliTPCRow[num_of_rows];
8c555625 327 }
3c0f9266 328 virtual ~AliTPCLSector() {}
cc80f89e 329 Double_t GetX(Int_t l) const { return param->GetPadRowRadiiUp(l); }
330 Double_t GetMaxY(Int_t l) const { return GetX(l)*tan(0.5*GetAlpha()); }
3c0f9266 331 Double_t GetAlpha() const {return param->GetOuterAngle();}
332 Double_t GetAlphaShift() const {return param->GetOuterAngleShift();}
cc80f89e 333 Double_t GetPadPitchWidth() const {
334 return param->GetOuterPadPitchWidth();
335 }
3c0f9266 336 Int_t GetRowNumber(Double_t x) const {
cc80f89e 337 Double_t r=param->GetPadRowRadiiUp(param->GetNRowUp()-1);
3c0f9266 338 if (x > r) return param->GetNRowUp();
cc80f89e 339 r=param->GetPadRowRadiiUp(0);
3c0f9266 340 if (x < r) return -1;
cc80f89e 341 return Int_t((x-r)/param->GetOuterPadPitchLength() + 0.5);
3c0f9266 342 }
fe4da5cc 343};
344
345#endif
346