]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCCATracker.h
rootcint sees ALI_DATE and not DATE_ROOT
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCCATracker.h
1 // @(#) $Id$
2
3 #ifndef ALIHLTTPCCATRACKER_H
4 #define ALIHLTTPCCATRACKER_H
5
6 //
7 // CA Tracking class 
8 // !
9 // !
10 // Author: Ivan Kisel 
11 //*-- Copyright &copy ALICE HLT Group
12
13 #include <vector>
14
15 class AliHLTTPCTrackSegmentData;
16 class AliHLTTPCConfMapPoint;
17 class AliHLTTPCConfMapTrack;
18 class AliHLTTPCVertex;
19 class AliHLTTPCTrackArray;
20 class AliHLTTPCSpacePointData;
21 class TApplication;
22 class TCanvas;
23 class TList;
24 class TH1F;
25 class TH2F;
26
27 #include "TCanvas.h"
28
29 class AliHLTTPCCATracker {
30
31  public:
32
33   AliHLTTPCCATracker();
34   AliHLTTPCCATracker( const AliHLTTPCCATracker &x );
35   AliHLTTPCCATracker &operator=( const AliHLTTPCCATracker &x );
36
37   virtual ~AliHLTTPCCATracker();
38
39   Bool_t ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits );
40
41   //getters
42 #if 0
43   Int_t GetNumberOfTracks()    const {return fNTracks;}
44   AliHLTTPCTrackArray *GetTracks() const {return fTrack;}
45   Double_t GetMaxDca()         const {return fMaxDca;}
46   AliHLTTPCVertex* GetVertex()     const {return fVertex;}
47 #endif
48
49
50   //setters
51 #if 0
52   void SetNSegments(Int_t f,Int_t g) {fNumPhiSegment=f,fNumEtaSegment=g;} //Set number of subvolumes (#segments in (phi,eta)
53   void SetMaxDca(Double_t f) {fMaxDca = f;}
54
55   //setter:
56   void SetMinPoints(Int_t f,Bool_t vconstraint) {fMinPoints[(Int_t)vconstraint] = f; }  
57   void SetVertexConstraint(Bool_t f) {fVertexConstraint =f;}
58   
59   void SetHitChi2Cut(Double_t f,Bool_t vert) {fHitChi2Cut[(Int_t)vert]=f;}
60   void SetGoodHitChi2(Double_t f,Bool_t vert) {fGoodHitChi2[(Int_t)vert]=f;}
61   void SetTrackChi2Cut(Double_t f,Bool_t vert) {fTrackChi2Cut[(Int_t)vert]=f;}
62   void SetMaxDist(Int_t f,Bool_t vert) {fMaxDist[(Int_t)vert]=f;}
63   void SetTrackletLength(Int_t f,Bool_t vert) {fTrackletLength[(Int_t)vert]=f;}
64   void SetRowScopeTrack(Int_t f, Bool_t vc){fRowScopeTrack[(Int_t)vc] = f;}
65   void SetRowScopeTracklet(Int_t f, Bool_t vc){fRowScopeTracklet[(Int_t)vc] = f;}
66   void SetMaxAngleTracklet(Double_t f, Bool_t vc){fMaxAngleTracklet[(Int_t)vc] = f;}
67 #endif
68
69   void CACreateHistos() ;
70   void CAWriteHistos();
71
72   void CAInitialize();
73   void CAReadPatchHits(Int_t patch, UInt_t count, AliHLTTPCSpacePointData* hits );
74   void CAFindPatchTracks(Int_t patch);
75   void CAFindSliceTracks();
76
77
78   // JMT 2006/11/13
79   void SetOutPtr( AliHLTTPCTrackSegmentData* tr ){fOutputPtr = tr;}
80   UInt_t GetOutputSize()  const { return fOutputSize; }
81   UInt_t GetOutputNTracks()  const { return fOutputNTracks; }
82
83
84  private:
85
86   AliHLTTPCTrackSegmentData* fOutputPtr; //!
87   UInt_t fOutputNTracks; //!
88   UInt_t fOutputSize;    //!
89
90   struct AliHLTTPCCAHit{
91     Double_t fX, fY, fZ;          // position
92     Double_t fErrx, fErry, fErrz; // position errors 
93     Int_t fIndex, fCounter;       // addidtional
94   };
95   
96   std::vector<AliHLTTPCCAHit> fVecHits; //!
97   Int_t fPatchFirstHitInd, fPatchLastHitInd; // indices of the first and the last hits in the current patch
98
99   struct AliHLTTPCCATrack{
100     Int_t fPatch, fNhits, fNdf, fGood, fUsed, fNext; // flags    
101     Double_t fX, fY, fZ, fTy, fTz;//parameters    
102     Double_t fCovy, fCovty, fCovyty, fCovz, fCovtz, fCovztz, fChi2;//cov matrix    
103     std::vector<Int_t> fVecIHits;//indices of hits
104   };
105
106   std::vector<AliHLTTPCCATrack> fVecPatchTracks; //!
107   Int_t fPatchFirstTrackInd, fPatchLastTrackInd; // indices of the first and the last tracks in the current patch
108   std::vector<AliHLTTPCCATrack> fVecSliceTracks; // tracks
109
110   static bool CompareCATracks(const AliHLTTPCCATrack &a, const AliHLTTPCCATrack &b){
111     if (a.fPatch != b.fPatch) return (a.fPatch < b.fPatch);
112     else return (a.fNhits > b.fNhits);
113   }
114
115   static bool CompareCAHitsX(const Int_t &i, const Int_t &j){
116     return (i < j);
117   }
118
119   Bool_t fBench; //run-time measurements
120   Int_t fNTracks; //number of tracks build.
121
122   AliHLTTPCVertex *fVertex; //!
123   Bool_t fParamSet[2];  //!
124   Bool_t fVertexFinder; //Include vertexfinding or not 
125                         //(latter case vertex=(0,0,0))
126
127   AliHLTTPCConfMapPoint *fHit;  //!
128   AliHLTTPCTrackArray *fTrack;  //!
129   Double_t fMaxDca;      //cut value for momentum fit
130   
131    //Number of cells (segments)
132   Int_t  fNumRowSegment;          // Total number of padrows
133   Int_t  fNumPhiSegment;          // number of phi segments 
134   Int_t  fNumEtaSegment;          // number of eta segments
135   Int_t  fNumRowSegmentPlusOne;   // row+1
136   Int_t  fNumPhiSegmentPlusOne;   // phi+1
137   Int_t  fNumEtaSegmentPlusOne;   // eta+1
138   Int_t  fNumPhiEtaSegmentPlusOne;// phieta+1
139   Int_t  fBounds;                 // bounds
140   Int_t  fPhiHitsOutOfRange;      // phi hits out of range
141   Int_t  fEtaHitsOutOfRange;      // eta hits out of range
142
143   //tracking range:
144   Float_t fPhiMin; //MinPhi angle to consider
145   Float_t fPhiMax; //MaxPhi angle to consider
146   Float_t fEtaMin; //MinEta to consider
147   Float_t fEtaMax; //MaxEta to consider
148   Int_t fRowMin;   //Minimum row to consider
149   Int_t fRowMax;   //Maximum row to consider
150
151   Bool_t fVertexConstraint;       //vertex constraint (true or false)
152   Int_t fTrackletLength[2];       //minimal length of tracks 
153   Int_t fRowScopeTracklet[2];     //number of row segments to look for the next point of a tracklet
154   Int_t fRowScopeTrack[2];        //number of row segments to look for the next point of a track
155   Int_t fMinPoints[2];            //minimum number of points on one track
156   
157   // Cuts
158   Double_t fMaxAngleTracklet[2];  //limit of angle between to pieces of a tracklet
159   Int_t fMaxDist[2];              //maximum distance between two hits 
160   Double_t fHitChi2Cut[2];        //Maximum hit chi2
161   Double_t fGoodHitChi2[2];       //Chi2 to stop looking for next hit
162   Double_t fTrackChi2Cut[2];      //Maximum track chi2
163   Double_t fGoodDist;             //In segment building, distance consider good enough
164   Double_t fMaxPhi;               //Maximum phi
165   Double_t fMaxEta;               //Maximum eta
166
167   // Tracking informtion
168   Int_t fMainVertexTracks;  //number of tracks coming from the main vertex
169   Int_t fClustersUnused;    //number of unused clusters
170
171   Int_t fHistEvent;         //!
172   Bool_t fDRAW;             //!
173   Bool_t fAsk;              //!
174
175   TApplication *fMyapp;     //!
176   TCanvas *fYX, *fZX;       //!
177   
178   TList *fListHisto;        //!
179   TH1F *fHistNClusters;     //!
180   TH2F *fHistClustersXY[10];//!
181
182
183   ClassDef(AliHLTTPCCATracker,1) //class for cellular automaton tracking
184 };
185
186 #endif