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