]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TPC/AliTPCtracker.h
Set values to zero in constructor. Added print function.
[u/mrichter/AliRoot.git] / TPC / AliTPCtracker.h
CommitLineData
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"
17#include "AliBarrelTrack.h"
73042f01 18
19class TFile;
c630aafd 20class TTree;
21class TBranch;
b9de75e1 22class AliTPCParam;
c630aafd 23class TObjArray;
24class TClonesArray;
25class AliESD;
73042f01 26
b9de75e1 27class AliTPCtracker : public AliTracker {
73042f01 28public:
e502c8c2 29 AliTPCtracker():AliTracker(),fkNIS(0),fkNOS(0) {
30 fInnerSec=fOuterSec=0; fSeeds=0;
c630aafd 31 fParam = 0;
e502c8c2 32 }
c630aafd 33 AliTPCtracker(const AliTPCParam *par);
b9de75e1 34 ~AliTPCtracker();
35
36 Int_t ReadSeeds(const TFile *in);
37
c630aafd 38 Int_t LoadClusters(TTree *c);
39 void UnloadClusters();
73042f01 40
b9de75e1 41 AliCluster *GetCluster(Int_t index) const;
c630aafd 42 Int_t Clusters2Tracks(AliESD *event);
c630aafd 43 Int_t PropagateBack(AliESD *event);
c630aafd 44 Int_t RefitInward(AliESD *event);
b9de75e1 45
46 virtual void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
47
48public:
73042f01 49//**************** Internal tracker class **********************
50 class AliTPCRow {
51 public:
c630aafd 52 AliTPCRow() {
53 fN=0;
54 fSize=kMaxClusterPerRow/8;
55 fClusterArray=new AliTPCcluster[fSize];
56 }
57 ~AliTPCRow() {delete[] fClusterArray;}
58 void InsertCluster(const AliTPCcluster *c, Int_t sec, Int_t row);
59 void ResetClusters() {fN=0; delete[] fClusterArray; fClusterArray=0;}
73042f01 60 operator int() const {return fN;}
c630aafd 61 const AliTPCcluster *operator[](Int_t i) const {return fClusters[i];}
62 const AliTPCcluster *GetUnsortedCluster(Int_t i) const {
63 if ((i < 0) || (i >= fN)) return NULL;
64 return fClusterArray+i;
65 }
73042f01 66 UInt_t GetIndex(Int_t i) const {return fIndex[i];}
67 Int_t Find(Double_t y) const;
b9de75e1 68 void SetX(Double_t x) {fX=x;}
69 Double_t GetX() const {return fX;}
73042f01 70
71 private:
b9de75e1 72 Int_t fN; //number of clusters
73 const AliTPCcluster *fClusters[kMaxClusterPerRow]; //pointers to clusters
c630aafd 74 Int_t fSize; //size of array of clusters
75 AliTPCcluster *fClusterArray; //array of clusters
b9de75e1 76 UInt_t fIndex[kMaxClusterPerRow]; //indeces of clusters
77 Double_t fX; //X-coordinate of this row
73042f01 78
79 private:
80 AliTPCRow(const AliTPCRow& r); //dummy copy constructor
81 AliTPCRow &operator=(const AliTPCRow& r); //dummy assignment operator
82 };
83
84//**************** Internal tracker class **********************
85 class AliTPCSector {
86 public:
c630aafd 87 AliTPCSector() { fN=0; fRow = 0; }
b9de75e1 88 ~AliTPCSector() { delete[] fRow; }
73042f01 89 AliTPCRow& operator[](Int_t i) const { return *(fRow+i); }
90 Int_t GetNRows() const { return fN; }
b9de75e1 91 void Setup(const AliTPCParam *par, Int_t flag);
92 Double_t GetX(Int_t l) const {return fRow[l].GetX();}
93 Double_t GetMaxY(Int_t l) const {
94 return GetX(l)*TMath::Tan(0.5*GetAlpha());
95 }
96 Double_t GetAlpha() const {return fAlpha;}
97 Double_t GetAlphaShift() const {return fAlphaShift;}
98 Int_t GetRowNumber(Double_t x) const {
99 //return pad row number for this x
f03e3423 100 Double_t r;
b46635a4 101 if (fN < 64){
f03e3423 102 r=fRow[fN-1].GetX();
103 if (x > r) return fN;
104 r=fRow[0].GetX();
105 if (x < r) return -1;
29fe0389 106 return Int_t((x-r)/f1PadPitchLength + 0.5);}
f03e3423 107 else{
108 r=fRow[fN-1].GetX();
109 if (x > r) return fN;
110 r=fRow[0].GetX();
111 if (x < r) return -1;
112 Double_t r1=fRow[64].GetX();
113 if(x<r1){
114 return Int_t((x-r)/f1PadPitchLength + 0.5);}
115 else{
116 return (Int_t((x-r1)/f2PadPitchLength + 0.5)+64);}
117 }
b9de75e1 118 }
119 Double_t GetPadPitchWidth() const {return fPadPitchWidth;}
b9de75e1 120
121 private:
122 Int_t fN; //number of pad rows
73042f01 123 AliTPCRow *fRow; //array of pad rows
b9de75e1 124 Double_t fAlpha; //opening angle
125 Double_t fAlphaShift; //shift angle;
126 Double_t fPadPitchWidth; //pad pitch width
c630aafd 127 Double_t f1PadPitchLength; //pad pitch length
128 Double_t f2PadPitchLength; //pad pitch length
73042f01 129 private:
130 AliTPCSector(const AliTPCSector &s); //dummy copy contructor
131 AliTPCSector& operator=(const AliTPCSector &s);//dummy assignment operator
132 };
133
73042f01 134//**************** Internal tracker class **********************
135 class AliTPCseed : public AliTPCtrack {
136 public:
137 AliTPCseed():AliTPCtrack(){}
b9de75e1 138 AliTPCseed(const AliTPCtrack &t):AliTPCtrack(t){}
139 AliTPCseed(const AliKalmanTrack &t, Double_t a):AliTPCtrack(t,a){}
73042f01 140 AliTPCseed(UInt_t index, const Double_t xx[5],
141 const Double_t cc[15], Double_t xr, Double_t alpha):
142 AliTPCtrack(index, xx, cc, xr, alpha) {}
143 void SetSampledEdx(Float_t q, Int_t i) {
be9c5115 144 Double_t s=GetSnp(), t=GetTgl();
145 q *= TMath::Sqrt((1-s*s)/(1+t*t));
d4cf1daa 146 fdEdxSample[i]=q;
73042f01 147 }
73042f01 148 void CookdEdx(Double_t low=0.05, Double_t up=0.70);
149
150 private:
d4cf1daa 151 Float_t fdEdxSample[200]; //array of dE/dx samples
73042f01 152 };
153
154private:
c630aafd 155
b9de75e1 156 void MakeSeeds(Int_t i1, Int_t i2);
157 Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0);
158 Int_t FollowBackProlongation(AliTPCseed &s, const AliTPCtrack &t);
c630aafd 159 Int_t FollowRefitInward(AliTPCseed *seed, AliTPCtrack *track);
b9de75e1 160
161 AliTPCtracker(const AliTPCtracker& r); //dummy copy constructor
162 AliTPCtracker &operator=(const AliTPCtracker& r);//dummy assignment operator
163
164 const Int_t fkNIS; //number of inner sectors
c630aafd 165 AliTPCSector *fInnerSec; //array of inner sectors
b9de75e1 166 const Int_t fkNOS; //number of outer sectors
c630aafd 167 AliTPCSector *fOuterSec; //array of outer sectors
168
169 Int_t fN; //number of "active" sectors
170 AliTPCSector *fSectors; //pointer to "active" sectors;
171
172 AliTPCParam *fParam; //! TPC parameters for outer reference plane [SR, GSI, 18.02.2003]
173 TObjArray *fSeeds; //array of track seeds
174
175 // [SR, 01.04.2003]
176 void SetBarrelTree(const char *mode);
177 void StoreBarrelTrack(AliTPCtrack *ps, Int_t refPlane, Int_t isIn);
178
179 // [SR, 01.04.2003]
180 TFile *fBarrelFile; // file with "barrel" tracks
181 TTree *fBarrelTree; // tree with "barrel" tracks
182 TBranch *fBarrelBranch;
183 TClonesArray *fBarrelArray;
184 AliBarrelTrack *fBarrelTrack;
185
186 ClassDef(AliTPCtracker,1) // Time Projection Chamber tracker
b9de75e1 187};
73042f01 188
189#endif
190
191