]> git.uio.no Git - u/mrichter/AliRoot.git/blob - TPC/AliTPCtrackerSector.h
1. Protection against 0 error estimate
[u/mrichter/AliRoot.git] / TPC / AliTPCtrackerSector.h
1 #ifndef ALITPCTRACKERSECTOR_H
2 #define ALITPCTRACKERSECTOR_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6
7 /* $Id: AliTPCtrackerSector.h 25837 2008-05-16 16:39:00Z marian $ */
8
9 //-------------------------------------------------------
10 //   TPC tracker - helper classes for cluster storing
11 //                 and navigation                   
12 //   
13 //
14 //   Origin: 
15 //-------------------------------------------------------
16
17
18 //class TFile;
19 class AliTPCParam;
20 class TTreeSRedirector;
21
22
23
24 class AliTPCtrackerRow : public TObject{
25 public:
26   AliTPCtrackerRow();
27   ~AliTPCtrackerRow();
28   void InsertCluster(const AliTPCclusterMI *c, UInt_t index);
29   void ResetClusters();
30   operator int() const {return fN;}
31   Int_t GetN() const {return fN;}
32   const AliTPCclusterMI* operator[](Int_t i) const {return fClusters[i];}
33   UInt_t GetIndex(Int_t i) const {return fIndex[i];}
34   Int_t Find(Double_t z) const; 
35   AliTPCclusterMI *  FindNearest(Double_t y, Double_t z, Double_t roady, Double_t roadz) const;
36   AliTPCclusterMI *  FindNearest2(Double_t y, Double_t z, Double_t roady, Double_t roadz, UInt_t & index) const;
37   
38   void SetX(Double_t x) {fX=x;}
39   Double_t GetX() const {return fX;}
40   Float_t GetDeadZone() const {return fDeadZone;}
41   void SetDeadZone(Float_t d) {fDeadZone=d;}
42   Int_t GetN1() const {return fN1;}
43   void SetN1(Int_t n) {fN1=n;}
44   Int_t GetN2() const {return fN2;}
45   void SetN2(Int_t n) {fN2=n;}
46   TClonesArray* GetClusters1() const {return fClusters1;}
47   TClonesArray* GetClusters2() const {return fClusters2;}
48   void SetCluster1(Int_t i, const AliTPCclusterMI &cl);
49   void SetCluster2(Int_t i, const AliTPCclusterMI &cl);
50   AliTPCclusterMI* GetCluster1(Int_t i) const {return (AliTPCclusterMI*) fClusters1->At(i);}
51   AliTPCclusterMI* GetCluster2(Int_t i) const {return (AliTPCclusterMI*) fClusters2->At(i);}
52   Short_t GetFastCluster(Int_t i) const {return fFastCluster[i];}
53   void SetFastCluster(Int_t i, Short_t cl);
54   Int_t IncrementN1() { return ++fN1;}
55   Int_t IncrementN2() { return ++fN2;}
56   
57 private:  
58   AliTPCtrackerRow & operator=(const AliTPCtrackerRow & );
59   AliTPCtrackerRow(const AliTPCtrackerRow& /*r*/);           //dummy copy constructor
60   Float_t fDeadZone;  // the width of the dead zone
61   TClonesArray *fClusters1; //array with clusters 1
62   Int_t fN1;  //number of clusters on left side
63   TClonesArray *fClusters2; //array with clusters 2
64   Int_t fN2; // number of clusters on right side of the TPC
65   Short_t fFastCluster[510];   //index of the nearest cluster at given position
66   Int_t fN;                                          //number of clusters 
67   const AliTPCclusterMI *fClusters[kMaxClusterPerRow]; //pointers to clusters
68   // indexes for cluster at given position z  
69   // AliTPCclusterMI *fClustersArray;                     // 
70   UInt_t fIndex[kMaxClusterPerRow];                  //indeces of clusters
71   Double_t fX;                                 //X-coordinate of this row  
72   ClassDef(AliTPCtrackerRow,0)
73 };
74
75
76 //**************** Internal tracker class ********************** 
77 class AliTPCtrackerSector: public TObject {
78  public:
79   AliTPCtrackerSector():
80     fN(0),
81     fRow(0),
82     fAlpha(0.),
83     fAlphaShift(0.),
84     fPadPitchWidth(0.),
85     fPadPitchLength(0.),
86     f1PadPitchLength(0.),
87     f2PadPitchLength(0.) {}
88     ~AliTPCtrackerSector() { delete[] fRow; }
89     AliTPCtrackerRow& operator[](Int_t i) const { return *(fRow+i); }
90     Int_t GetNRows() const { return fN; }
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 GetFirst(){return fFirstRow;}
99     Int_t GetRowNumber(Double_t  x) const;
100     Double_t GetPadPitchWidth()  const {return fPadPitchWidth;}
101     Double_t GetPadPitchLength() const {return fPadPitchLength;}
102     Double_t GetPadPitchLength(Float_t x) const {return (x<200) ? fPadPitchLength:f2PadPitchLength ;}
103     
104     void InsertCluster(AliTPCclusterMI *cl, Int_t size, const AliTPCParam *par);
105
106  private:
107     AliTPCtrackerSector & operator=(const AliTPCtrackerSector & );
108     AliTPCtrackerSector(const AliTPCtrackerSector &/*s*/);           //dummy copy contructor 
109     Int_t fN;                           //number of pad rows 
110     //Int_t fFirstRow;                  //offset
111     AliTPCtrackerRow *fRow;             //array of pad rows
112     Double_t fAlpha;                    //opening angle
113     Double_t fAlphaShift;               //shift angle;
114     Double_t fPadPitchWidth;            //pad pitch width
115     Double_t fPadPitchLength;           //pad pitch length
116     Double_t f1PadPitchLength;          //pad pitch length
117     Double_t f2PadPitchLength;          //pad pitch length  
118     ClassDef(AliTPCtrackerSector,1)
119 };
120
121
122
123 #endif
124
125