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