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