]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITStrackerV2.h
New version including the full 3D vertex finder
[u/mrichter/AliRoot.git] / ITS / AliITStrackerV2.h
1 #ifndef ALIITSTRACKER_H
2 #define ALIITSTRACKER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 //-------------------------------------------------------------------------
7 //                          ITS tracker
8 //
9 //       Origin: Iouri Belikov, CERN, Jouri.Belikov@cern.ch 
10 //-------------------------------------------------------------------------
11 #include "AliTracker.h"
12 #include "AliITSrecoV2.h"
13 #include "AliITStrackV2.h"
14
15 class AliITSclusterV2;
16 class AliITSgeom;
17 class TFile;
18
19
20 //-------------------------------------------------------------------------
21 class AliITStrackerV2 : public AliTracker {
22 public:
23   AliITStrackerV2():AliTracker(){}
24   AliITStrackerV2(const AliITSgeom *geom) throw (const Char_t *);
25
26   AliCluster *GetCluster(Int_t index) const;
27   Int_t Clusters2Tracks(const TFile *in, TFile *out);
28   Int_t PropagateBack(const TFile *in, TFile *out);
29
30 private:
31
32   Double_t GetEffectiveThickness(Double_t phi, Double_t z) const;
33
34   void  FollowProlongation();
35   Int_t TakeNextProlongation();
36
37   void ResetBestTrack() {
38      fBestTrack.~AliITStrackV2();
39      new(&fBestTrack) AliITStrackV2(fTrackToFollow);
40   }
41
42   void ResetTrackToFollow(const AliITStrackV2 &t) {
43      fTrackToFollow.~AliITStrackV2();
44      new(&fTrackToFollow) AliITStrackV2(t);
45   }
46
47   //The two subclasses are public in order to access one from the another
48  public: 
49 class AliITSdetector {
50 private:
51   Double_t fR;    // polar coordinates 
52   Double_t fPhi;  // of this detector
53
54 public:
55   AliITSdetector(){}
56   AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi;}
57
58   void *operator new(size_t s,AliITSdetector *p) {return p;}
59
60   Double_t GetR()   const {return fR;}
61   Double_t GetPhi() const {return fPhi;}
62 };
63
64 class AliITSlayer {
65   Double_t fR;                // mean radius of this layer
66   Double_t fPhiOffset;        // offset of the first detector in Phi
67   Int_t fNladders;            // number of ladders
68   Double_t fZOffset;          // offset of the first detector in Z
69   Int_t fNdetectors;          // detectors/ladder
70   AliITSdetector *fDetectors; // array of detectors
71
72   Int_t fN;                   // number of clusters
73   AliITSclusterV2 *fClusters[kMaxClusterPerLayer];    // pointers to clusters
74
75   Double_t fZmax;      //       edges
76   Double_t fYmin;      //      of  the
77   Double_t fYmax;      //      "window"
78   Int_t fI;            // index of the current cluster within the "window"
79
80   Int_t FindClusterIndex(Double_t z) const;
81
82 public:
83   AliITSlayer();
84   AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
85  ~AliITSlayer();
86   Int_t InsertCluster(AliITSclusterV2 *c);
87   void SelectClusters(Double_t zmin,Double_t zmax,Double_t ymin,Double_t ymax);
88   const AliITSclusterV2 *GetNextCluster(Int_t &ci);
89
90   void *operator new(size_t s, AliITSlayer *p) {return p;}
91
92   Double_t GetR() const {return fR;}
93   AliITSclusterV2 *GetCluster(Int_t i) const {return fClusters[i];} 
94   AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; }
95   Int_t FindDetectorIndex(Double_t phi, Double_t z) const;
96   Double_t GetThickness(Double_t phi, Double_t z) const;
97
98   Int_t InRoad() const ;
99   Int_t GetNumberOfClusters() const {return fN;}
100 };
101
102  private:
103   Int_t fI;                       // index of the current layer
104   static AliITSlayer fLayers[kMaxLayer]; // ITS layers
105   AliITStrackV2 fTracks[kMaxLayer]; // track estimations at the ITS layers
106   AliITStrackV2 fBestTrack;         // "best" track 
107   AliITStrackV2 fTrackToFollow;     // followed track
108
109   Double_t fYV;                   // Y-coordinate of the primary vertex
110   Double_t fZV;                   // Z-coordinate of the primary vertex
111 };
112
113
114
115 #endif