]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCCATracker.h
Bogdan: new version of MUON visualization.
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCCATracker.h
1 // @(#) $Id$
2 // Original: AliL3ConfMapper.h,v 1.11 2004/07/05 09:03:11 loizides 
3
4 #ifndef ALIHLTTPCCATRACKER_H
5 #define ALIHLTTPCCATRACKER_H
6
7 //
8 // CA Tracking class 
9 //
10 // Author: Ivan Kisel 
11 //*-- Copyright &copy ALICE HLT Group
12
13 #include <vector>
14
15 #include "TFile.h"
16 #include "TH1.h"
17 #include "TH2.h"
18 #include "TProfile.h"
19 #include "TProfile2D.h"
20 #include "TCanvas.h"
21
22 #include "AliHLTTPCTrackSegmentData.h"
23
24 class AliHLTTPCConfMapPoint;
25 class AliHLTTPCConfMapTrack;
26 class AliHLTTPCVertex;
27 class AliHLTTPCTrackArray;
28 class AliHLTTPCSpacePointData;
29
30 class AliHLTTPCCATracker {
31
32  public:
33
34   AliHLTTPCCATracker();
35   //  AliHLTTPCCATracker(AliTPCParam *param,AliHLTTPCVertex *vertex,Bool_t bench=(Bool_t)false);
36   virtual ~AliHLTTPCCATracker();
37
38   Bool_t ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits );
39
40   //getters
41 #if 0
42   Int_t GetNumberOfTracks()    const {return fNTracks;}
43   AliHLTTPCTrackArray *GetTracks() const {return fTrack;}
44   Double_t GetMaxDca()         const {return fMaxDca;}
45   AliHLTTPCVertex* GetVertex()     const {return fVertex;}
46 #endif
47
48
49   //setters
50 #if 0
51   void SetNSegments(Int_t f,Int_t g) {fNumPhiSegment=f,fNumEtaSegment=g;} //Set number of subvolumes (#segments in (phi,eta)
52   void SetMaxDca(Double_t f) {fMaxDca = f;}
53
54   //setter:
55   void SetMinPoints(Int_t f,Bool_t vconstraint) {fMinPoints[(Int_t)vconstraint] = f; }  
56   void SetVertexConstraint(Bool_t f) {fVertexConstraint =f;}
57   
58   void SetHitChi2Cut(Double_t f,Bool_t vert) {fHitChi2Cut[(Int_t)vert]=f;}
59   void SetGoodHitChi2(Double_t f,Bool_t vert) {fGoodHitChi2[(Int_t)vert]=f;}
60   void SetTrackChi2Cut(Double_t f,Bool_t vert) {fTrackChi2Cut[(Int_t)vert]=f;}
61   void SetMaxDist(Int_t f,Bool_t vert) {fMaxDist[(Int_t)vert]=f;}
62   void SetTrackletLength(Int_t f,Bool_t vert) {fTrackletLength[(Int_t)vert]=f;}
63   void SetRowScopeTrack(Int_t f, Bool_t vc){fRowScopeTrack[(Int_t)vc] = f;}
64   void SetRowScopeTracklet(Int_t f, Bool_t vc){fRowScopeTracklet[(Int_t)vc] = f;}
65   void SetMaxAngleTracklet(Double_t f, Bool_t vc){fMaxAngleTracklet[(Int_t)vc] = f;}
66 #endif
67
68   void CACreateHistos();
69   void CAWriteHistos();
70
71   void CAInitialize();
72   void CAReadPatchHits(Int_t patch, UInt_t count, AliHLTTPCSpacePointData* hits );
73   void CAFindPatchTracks(Int_t patch);
74   void CAFindSliceTracks();
75
76
77   // JMT 2006/11/13
78   void SetOutPtr( AliHLTTPCTrackSegmentData* tr ){fOutputPtr = tr;}
79   UInt_t GetOutputSize() { return fOutputSize; }
80   UInt_t GetOutputNTracks() { return fOutputNTracks; }
81
82
83  private:
84
85   AliHLTTPCTrackSegmentData* fOutputPtr;
86   UInt_t fOutputNTracks;
87   UInt_t fOutputSize;
88
89   struct CAHit{
90     Double_t x, y, z;
91     Double_t errx, erry, errz;
92     Int_t index, counter;
93   };
94   
95   std::vector<CAHit> vec_hits; 
96   Int_t patch_first_hit_ind, patch_last_hit_ind; // indices of the first and the last hits in the current patch
97
98   struct CATrack{
99     Int_t patch, nhits, ndf, good, used, next;
100     //parameters
101     Double_t x, y, z, ty, tz;
102     //cov matrix
103     Double_t cov_y, cov_ty, cov_yty, cov_z, cov_tz, cov_ztz, chi2;
104     //indices of hits
105     std::vector<Int_t> vec_ihits;
106   };
107
108   std::vector<CATrack> vec_patch_tracks; 
109   Int_t patch_first_track_ind, patch_last_track_ind; // indices of the first and the last tracks in the current patch
110   std::vector<CATrack> vec_slice_tracks; 
111
112   static bool compareCATracks(const CATrack &a, const CATrack &b){
113     if (a.patch != b.patch)
114       return (a.patch < b.patch);
115     else
116       return (a.nhits > b.nhits);
117   }
118
119   static bool compareCAHitsX(const Int_t &i, const Int_t &j){
120     return (i < j);
121   }
122
123   struct AliHLTTPCConfMapContainer 
124   {
125     void *first; // first track
126     void *last;  // last track
127   };
128
129   Bool_t fBench; //run-time measurements
130   Int_t fNTracks; //number of tracks build.
131
132   AliHLTTPCVertex *fVertex; //!
133   Bool_t fParamSet[2];  //!
134   Bool_t fVertexFinder; //Include vertexfinding or not 
135                         //(latter case vertex=(0,0,0))
136
137   AliHLTTPCConfMapPoint *fHit;  //!
138   AliHLTTPCTrackArray *fTrack;  //!
139   Double_t fMaxDca;      //cut value for momentum fit
140   
141   AliHLTTPCConfMapContainer *fVolume;  //!  Segment volume
142   AliHLTTPCConfMapContainer *fRow;     //!  Row volume
143
144    //Number of cells (segments)
145   Int_t  fNumRowSegment;          // Total number of padrows
146   Int_t  fNumPhiSegment;          // number of phi segments 
147   Int_t  fNumEtaSegment;          // number of eta segments
148   Int_t  fNumRowSegmentPlusOne;   // row+1
149   Int_t  fNumPhiSegmentPlusOne;   // phi+1
150   Int_t  fNumEtaSegmentPlusOne;   // eta+1
151   Int_t  fNumPhiEtaSegmentPlusOne;// phieta+1
152   Int_t  fBounds;                 // bounds
153   Int_t  fPhiHitsOutOfRange;      // phi hits out of range
154   Int_t  fEtaHitsOutOfRange;      // eta hits out of range
155
156   //tracking range:
157   Float_t fPhiMin; //MinPhi angle to consider
158   Float_t fPhiMax; //MaxPhi angle to consider
159   Float_t fEtaMin; //MinEta to consider
160   Float_t fEtaMax; //MaxEta to consider
161   Int_t fRowMin;   //Minimum row to consider
162   Int_t fRowMax;   //Maximum row to consider
163
164   Bool_t fVertexConstraint;       //vertex constraint (true or false)
165   Int_t fTrackletLength[2];       //minimal length of tracks 
166   Int_t fRowScopeTracklet[2];     //number of row segments to look for the next point of a tracklet
167   Int_t fRowScopeTrack[2];        //number of row segments to look for the next point of a track
168   Int_t fMinPoints[2];            //minimum number of points on one track
169   
170   // Cuts
171   Double_t fMaxAngleTracklet[2];  //limit of angle between to pieces of a tracklet
172   Int_t fMaxDist[2];              //maximum distance between two hits 
173   Double_t fHitChi2Cut[2];        //Maximum hit chi2
174   Double_t fGoodHitChi2[2];       //Chi2 to stop looking for next hit
175   Double_t fTrackChi2Cut[2];      //Maximum track chi2
176   Double_t fGoodDist;             //In segment building, distance consider good enough
177   Double_t fMaxPhi;               //Maximum phi
178   Double_t fMaxEta;               //Maximum eta
179
180   // Tracking informtion
181   Int_t fMainVertexTracks; //number of tracks coming from the main vertex
182   Int_t fClustersUnused;   //number of unused clusters
183
184   ClassDef(AliHLTTPCCATracker,1) //Base class for conformal mapping tracking
185 };
186
187 #endif