]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/AliITStrackerV2.h
Possibility to set the errors on the primary vertex position in AliITStrackerV2 ...
[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);
25   AliCluster *GetCluster(Int_t index) const;
26   Int_t LoadClusters();
27   void UnloadClusters();
28   Int_t Clusters2Tracks(const TFile *in, TFile *out);
29   Int_t PropagateBack(const TFile *in, TFile *out);
30   void SetupFirstPass(Int_t *flags, Double_t *cuts=0);
31   void SetupSecondPass(Int_t *flags, Double_t *cuts=0);
32   Bool_t RefitAt(Double_t x, AliITStrackV2 *t, Int_t *index);
33
34   void UseClusters(const AliKalmanTrack *t, Int_t from=0) const;
35
36   class AliITSdetector {
37   public:
38     AliITSdetector(){}
39     AliITSdetector(Double_t r,Double_t phi) {fR=r; fPhi=phi;}
40     void *operator new(size_t s,AliITSdetector *p) {return p;}
41     Double_t GetR()   const {return fR;}
42     Double_t GetPhi() const {return fPhi;}
43   private:
44     Double_t fR;    // polar coordinates 
45     Double_t fPhi;  // of this detector
46   };
47
48   class AliITSlayer {
49   public:
50     AliITSlayer();
51     AliITSlayer(Double_t r, Double_t p, Double_t z, Int_t nl, Int_t nd);
52    ~AliITSlayer();
53     Int_t InsertCluster(AliITSclusterV2 *c);
54     void ResetClusters();
55     void SelectClusters(Double_t zmi,Double_t zma,Double_t ymi,Double_t yma);
56     const AliITSclusterV2 *GetNextCluster(Int_t &ci);
57     void *operator new(size_t s, AliITSlayer *p) {return p;}
58     void ResetRoad();
59     Double_t GetRoad() const {return fRoad;}
60     Double_t GetR() const {return fR;}
61     AliITSclusterV2 *GetCluster(Int_t i) const {return fClusters[i];} 
62     AliITSdetector &GetDetector(Int_t n) const { return fDetectors[n]; }
63     Int_t FindDetectorIndex(Double_t phi, Double_t z) const;
64     Double_t GetThickness(Double_t y, Double_t z, Double_t &x0) const;
65     Int_t InRoad() const ;
66     Int_t GetNumberOfClusters() const {return fN;}
67     Int_t GetNladders() const {return fNladders;}
68     Int_t GetNdetectors() const {return fNdetectors;}
69   private:
70     Double_t fR;                // mean radius of this layer
71     Double_t fPhiOffset;        // offset of the first detector in Phi
72     Int_t fNladders;            // number of ladders
73     Double_t fZOffset;          // offset of the first detector in Z
74     Int_t fNdetectors;          // detectors/ladder
75     AliITSdetector *fDetectors; // array of detectors
76     Int_t fN;                   // number of clusters
77     AliITSclusterV2 *fClusters[kMaxClusterPerLayer]; // pointers to clusters
78     Double_t fZmax;      //    edges
79     Double_t fYmin;      //   of  the
80     Double_t fYmax;      //   "window"
81     Int_t fI;            // index of the current cluster within the "window"
82     Double_t fRoad;      // road defined by the cluster density
83     Int_t FindClusterIndex(Double_t z) const;
84   };
85
86 private:
87   void CookLabel(AliKalmanTrack *t,Float_t wrong) const;
88   Double_t GetEffectiveThickness(Double_t y, Double_t z) const;
89   void  FollowProlongation();
90   Int_t TakeNextProlongation();
91   void ResetBestTrack() {
92      fBestTrack.~AliITStrackV2();
93      new(&fBestTrack) AliITStrackV2(fTrackToFollow);
94   }
95   void ResetTrackToFollow(const AliITStrackV2 &t) {
96      fTrackToFollow.~AliITStrackV2();
97      new(&fTrackToFollow) AliITStrackV2(t);
98   }
99   Int_t fI;                              // index of the current layer
100   static AliITSlayer fLayers[kMaxLayer]; // ITS layers
101   AliITStrackV2 fTracks[kMaxLayer];      // track estimations at the ITS layers
102   AliITStrackV2 fBestTrack;              // "best" track 
103   AliITStrackV2 fTrackToFollow;          // followed track
104   Int_t fPass;                           // current pass through the data 
105   Int_t fConstraint[2];                  // constraint flags
106
107   ClassDef(AliITStrackerV2,1)   //ITS tracker V2
108 };
109
110
111 inline void AliITStrackerV2::SetupFirstPass(Int_t *flags, Double_t *cuts) {
112   // This function sets up flags and cuts for the first tracking pass   
113   //
114   //   flags[0] - vertex constaint flag                                
115   //              negative means "skip the pass"                        
116   //              0        means "no constraint"                        
117   //              positive means "normal constraint"                    
118
119    fConstraint[0]=flags[0];
120    if (cuts==0) return;
121 }
122
123 inline void AliITStrackerV2::SetupSecondPass(Int_t *flags, Double_t *cuts) {
124   // This function sets up flags and cuts for the second tracking pass   
125   //
126   //   flags[0] - vertex constaint flag                                
127   //              negative means "skip the pass"                        
128   //              0        means "no constraint"                        
129   //              positive means "normal constraint"                    
130
131    fConstraint[1]=flags[0];
132    if (cuts==0) return;
133 }
134
135 inline void AliITStrackerV2::CookLabel(AliKalmanTrack *t,Float_t wrong) const {
136   //--------------------------------------------------------------------
137   //This function "cooks" a track label. If label<0, this track is fake.
138   //--------------------------------------------------------------------
139    Int_t tpcLabel=t->GetLabel();
140    if (tpcLabel<0) return;
141    AliTracker::CookLabel(t,wrong);
142    if (tpcLabel != t->GetLabel()) t->SetLabel(-tpcLabel); 
143 }
144
145 #endif