]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ITS/UPGRADE/AliITSUTrackerCooked.h
Merge branch 'master' into TPCdev
[u/mrichter/AliRoot.git] / ITS / UPGRADE / AliITSUTrackerCooked.h
1 #ifndef ALIITSUTRACKERCooked_H
2 #define ALIITSUTRACKERCooked_H
3
4 //-------------------------------------------------------------------------
5 //                   The stand-alone ITSU tracker
6 //    The pattern recongintion based on the "cooked covariance" approach
7 //-------------------------------------------------------------------------
8
9 #include "AliITSUTrackerGlo.h"
10
11 class TTree;
12 class TClonesArray;
13 class TObjArray;
14
15 class AliESDEvent;
16 class AliCluster;
17 class AliITSUClusterPix;
18 class AliITSUTrackCooked;
19 class AliITSUReconstructor;
20
21 //-------------------------------------------------------------------------
22 class AliITSUTrackerCooked : public AliITSUTrackerGlo {
23 public:
24   enum {
25      kNLayers=7, kMaxClusterPerLayer=15000, kMaxSelected=kMaxClusterPerLayer/10
26   };
27   AliITSUTrackerCooked(AliITSUReconstructor *rec);
28   virtual ~AliITSUTrackerCooked();
29
30   // These functions must be implemented 
31   Int_t Clusters2Tracks(AliESDEvent *event);
32   Int_t PropagateBack(AliESDEvent *event);
33   Int_t RefitInward(AliESDEvent *event);
34   Int_t LoadClusters(TTree *ct);
35   void UnloadClusters();
36   Bool_t 
37   RefitAt(Double_t x, AliITSUTrackCooked *seed, const AliITSUTrackCooked *t);
38
39   AliCluster *GetCluster(Int_t index) const;
40
41   void SetSAonly(Bool_t sa=kTRUE) {fSAonly=sa;}
42   Bool_t GetSAonly() const {return fSAonly;}
43
44   // internal helper classes
45   class AliITSUlayer;
46
47 protected:
48   AliITSUTrackerCooked(const AliITSUTrackerCooked&);
49   // Other protected functions
50   Int_t MakeSeeds();
51   Bool_t AddCookedSeed(const Float_t r1[3], Int_t l1, Int_t i1,
52                        const Float_t r2[3], Int_t l2, Int_t i2,
53                        const AliCluster *c3,Int_t l3, Int_t i3);
54   void  FollowProlongation();
55   Int_t TakeNextProlongation();
56   void ResetTrackToFollow(const AliITSUTrackCooked &t);
57   void ResetBestTrack();
58
59 private:
60   AliITSUTrackerCooked &operator=(const AliITSUTrackerCooked &tr);
61
62   // Data members
63   // Internal tracker arrays, layers, modules, etc
64   static AliITSUlayer fgLayers[kNLayers];// Layers
65     
66   TObjArray *fSeeds; // Track seeds
67
68   Int_t fI;                              // index of the current layer
69   AliITSUTrackCooked *fBestTrack;        // "best" track 
70   AliITSUTrackCooked *fTrackToFollow;    // followed track
71   
72   Bool_t fSAonly; // kTRUE if the standalone tracking only
73
74   ClassDef(AliITSUTrackerCooked,2)   //ITSU stand-alone tracker
75 };
76
77
78
79 // The helper classes
80 class AliITSUTrackerCooked::AliITSUlayer {
81   public:
82     AliITSUlayer();
83     ~AliITSUlayer();
84
85     void InsertClusters(TClonesArray *clusters, Bool_t seedingLayer, Bool_t sa);
86     void SetR(Double_t r) {fR=r;}
87     void DeleteClusters();
88     void ResetSelectedClusters() {fI=0;}
89     void SelectClusters(Float_t phi, Float_t dy, Float_t z, Float_t dz);
90     const AliCluster *GetNextCluster(Int_t &i); 
91     void ResetTrack(const AliITSUTrackCooked &t);
92     Int_t FindClusterIndex(Double_t z) const;
93     Float_t GetR() const {return fR;}
94     AliCluster *GetCluster(Int_t i) const { return fClusters[i]; } 
95     Float_t GetXRef(Int_t i) const { return fXRef[i]; } 
96     Float_t GetAlphaRef(Int_t i) const { return fAlphaRef[i]; } 
97     Float_t GetClusterPhi(Int_t i) const { return fPhi[i]; } 
98     Int_t GetNumberOfClusters() const {return fN;}
99     const AliITSUTrackCooked *GetTrack() const {return fTrack;}
100
101   protected:
102     AliITSUlayer(const AliITSUlayer&);
103     AliITSUlayer &operator=(const AliITSUlayer &tr);  
104     Int_t InsertCluster(AliCluster *c);
105
106     Float_t fR;                // mean radius of this layer
107
108     AliCluster *fClusters[kMaxClusterPerLayer]; // All clusters
109     Float_t fXRef[kMaxClusterPerLayer];     // x of the reference plane
110     Float_t fAlphaRef[kMaxClusterPerLayer]; // alpha of the reference plane
111     Float_t fPhi[kMaxClusterPerLayer]; // cluster phi 
112     Int_t fN; // Total number of clusters 
113
114     Int_t fIndex[kMaxSelected]; 
115     Int_t fNsel;      // Number of selected clusters
116     Int_t fI;         // Running index for the selected clusters  
117
118     AliITSUTrackCooked *fTrack; // track estimation at this layer
119   };
120
121
122 #endif