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