]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCtracker.h
Noninitialized pointers set to 0 (J. Belikov)
[u/mrichter/AliRoot.git] / TPC / AliTPCtracker.h
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 //-------------------------------------------------------
13 #include "AliTracker.h"
14 #include "AliTPCtrack.h"
15 #include "AliTPCClustersArray.h"
16
17 #include "AliTPCreco.h"
18
19 class TFile;
20 class AliTPCParam;
21
22 class AliTPCtracker : public AliTracker {
23 public:
24    AliTPCtracker():AliTracker(),fkNIS(0),fkNOS(0) {
25       fInnerSec=fOuterSec=0; fSeeds=0; 
26    }
27    AliTPCtracker(const AliTPCParam *par, Int_t eventn=0);
28   ~AliTPCtracker();
29
30    Int_t ReadSeeds(const TFile *in);
31
32    void LoadInnerSectors();
33    void UnloadInnerSectors();
34    void LoadOuterSectors();
35    void UnloadOuterSectors();
36
37    AliCluster *GetCluster(Int_t index) const;
38    Int_t Clusters2Tracks(const TFile *in, TFile *out);
39    Int_t PropagateBack(const TFile *in, TFile *out);
40
41    virtual void  CookLabel(AliKalmanTrack *t,Float_t wrong) const; 
42
43 public:
44 //**************** Internal tracker class ********************** 
45    class AliTPCRow {
46    public:
47      AliTPCRow() {fN=0;}
48      void InsertCluster(const AliTPCcluster *c, UInt_t index);
49      operator int() const {return fN;}
50      const AliTPCcluster* operator[](Int_t i) const {return fClusters[i];}
51      UInt_t GetIndex(Int_t i) const {return fIndex[i];}
52      Int_t Find(Double_t y) const; 
53      void SetX(Double_t x) {fX=x;}
54      Double_t GetX() const {return fX;}
55
56    private:
57      Int_t fN;                                          //number of clusters 
58      const AliTPCcluster *fClusters[kMaxClusterPerRow]; //pointers to clusters
59      UInt_t fIndex[kMaxClusterPerRow];                  //indeces of clusters
60      Double_t fX;                                 //X-coordinate of this row
61
62    private:
63      AliTPCRow(const AliTPCRow& r);            //dummy copy constructor
64      AliTPCRow &operator=(const AliTPCRow& r); //dummy assignment operator
65    };
66
67 //**************** Internal tracker class ********************** 
68    class AliTPCSector {
69    public:
70      AliTPCSector() { fN=0; fRow = 0; }
71     ~AliTPCSector() { delete[] fRow; }
72      AliTPCRow& operator[](Int_t i) const { return *(fRow+i); }
73      Int_t GetNRows() const { return fN; }
74      void Setup(const AliTPCParam *par, Int_t flag);
75      Double_t GetX(Int_t l) const {return fRow[l].GetX();}
76      Double_t GetMaxY(Int_t l) const {
77          return GetX(l)*TMath::Tan(0.5*GetAlpha());
78      } 
79      Double_t GetAlpha() const {return fAlpha;}
80      Double_t GetAlphaShift() const {return fAlphaShift;}
81      Int_t GetRowNumber(Double_t x) const {
82         //return pad row number for this x
83         Double_t r=fRow[fN-1].GetX();
84         if (x > r) return fN;
85         r=fRow[0].GetX();
86         if (x < r) return -1;
87         return Int_t((x-r)/fPadPitchLength + 0.5);
88      }
89      Double_t GetPadPitchWidth()  const {return fPadPitchWidth;}
90      Double_t GetPadPitchLength() const {return fPadPitchLength;}
91
92    private:
93      Int_t fN;                        //number of pad rows 
94      AliTPCRow *fRow;                    //array of pad rows
95      Double_t fAlpha;                    //opening angle
96      Double_t fAlphaShift;               //shift angle;
97      Double_t fPadPitchWidth;            //pad pitch width
98      Double_t fPadPitchLength;           //pad pitch length    
99    private:
100      AliTPCSector(const AliTPCSector &s);           //dummy copy contructor
101      AliTPCSector& operator=(const AliTPCSector &s);//dummy assignment operator
102    };
103
104 //**************** Internal tracker class ********************** 
105    class AliTPCseed : public AliTPCtrack {
106    public:
107      AliTPCseed():AliTPCtrack(){}
108      AliTPCseed(const AliTPCtrack &t):AliTPCtrack(t){}
109      AliTPCseed(const AliKalmanTrack &t, Double_t a):AliTPCtrack(t,a){}
110      AliTPCseed(UInt_t index, const Double_t xx[5], 
111                 const Double_t cc[15], Double_t xr, Double_t alpha): 
112                 AliTPCtrack(index, xx, cc, xr, alpha) {}
113      void SetSampledEdx(Float_t q, Int_t i) {
114         Double_t s=GetSnp(), t=GetTgl();
115         q *= TMath::Sqrt((1-s*s)/(1+t*t));
116         fdEdxSample[i]=q;
117      }
118      void CookdEdx(Double_t low=0.05, Double_t up=0.70);
119
120    private:
121      Float_t fdEdxSample[200]; //array of dE/dx samples 
122    };
123
124 private:
125    void MakeSeeds(Int_t i1, Int_t i2);
126    Int_t FollowProlongation(AliTPCseed& t, Int_t rf=0);
127    Int_t FollowBackProlongation(AliTPCseed &s, const AliTPCtrack &t);
128
129    AliTPCtracker(const AliTPCtracker& r);           //dummy copy constructor
130    AliTPCtracker &operator=(const AliTPCtracker& r);//dummy assignment operator
131
132    const Int_t fkNIS;        //number of inner sectors
133    AliTPCSector *fInnerSec;  //array of inner sectors;
134    const Int_t fkNOS;        //number of outer sectors
135    AliTPCSector *fOuterSec;  //array of outer sectors;
136
137    Int_t fN;               //number of loaded sectors
138    AliTPCSector *fSectors; //pointer to loaded sectors;
139
140    Int_t fEventN;                      //event number
141    AliTPCClustersArray fClustersArray; //array of TPC clusters
142    TObjArray *fSeeds;                  //array of track seeds
143 };
144
145 #endif
146
147