]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/src/AliL3ConfMapper.h
Minor changes at new Top Makefile.
[u/mrichter/AliRoot.git] / HLT / src / AliL3ConfMapper.h
1 #ifndef ALIL3_ConfMapper
2 #define ALIL3_ConfMapper
3
4 #include "AliL3RootTypes.h"
5
6 #include "AliL3SpacePointData.h"
7
8 class AliL3ConfMapPoint;
9 class AliL3ConfMapTrack;
10 class AliL3Vertex;
11 class AliL3TrackArray;
12
13 struct AliL3ConfMapContainer 
14 {
15   void *first;
16   void *last;
17 };
18
19 //
20 //Conformal mapping base class
21
22 class AliL3ConfMapper {
23
24  private:
25
26   Bool_t fBench; //run-time measurements)
27
28   Int_t nTracks; //number of tracks build.
29
30   //  AliTPCParam *fParam;   
31   AliL3Vertex *fVertex; //!
32   Bool_t fParamSet;
33   Bool_t fVertexFinder;  //Include vertexfinding or not (latter case vertex=(0,0,0))
34
35   AliL3ConfMapPoint *fHit;  //!
36   AliL3TrackArray *fTrack;  //!
37   Double_t fMaxDca;      //cut value for momentum fit
38   
39   AliL3ConfMapContainer *fVolume;  //!  Segment volume
40   AliL3ConfMapContainer *fRow;     //!  Row volume
41
42    //Number of cells (segments)
43   Int_t  fNumRowSegment;          // Total number of padrows
44   Int_t  fNumPhiSegment;          // number of phi segments 
45   Int_t  fNumEtaSegment;          // number of eta segments
46   Int_t  fNumRowSegmentPlusOne;
47   Int_t  fNumPhiSegmentPlusOne;
48   Int_t  fNumEtaSegmentPlusOne;
49   Int_t  fNumPhiEtaSegmentPlusOne;
50   Int_t  fBounds;         
51   Int_t  fPhiHitsOutOfRange;
52   Int_t  fEtaHitsOutOfRange;
53
54   //tracking range:
55   Float_t fPhiMin; //MinPhi angle to consider
56   Float_t fPhiMax; //MaxPhi angle to consider
57   Float_t fEtaMin; //MinEta to consider
58   Float_t fEtaMax; //MaxEta to consider
59   Int_t fRowMin;   //Minimum row to consider
60   Int_t fRowMax;   //Maximum row to consider
61
62   Bool_t fVertexConstraint;       //vertex constraint (true or false)
63   Int_t fTrackletLength[2];       //minimal length of tracks 
64   Int_t fRowScopeTracklet[2];     //number of row segments to look for the next point of a tracklet
65   Int_t fRowScopeTrack[2];        //number of row segments to look for the next point of a track
66   Int_t fMinPoints[2];            //minimum number of points on one track
67   
68   // Cuts
69   Double_t fMaxAngleTracklet[2];  //limit of angle between to pieces of a tracklet
70   Int_t fMaxDist[2];                 //maximum distance between two hits 
71   Double_t fHitChi2Cut[2];           //Maximum hit chi2
72   Double_t fGoodHitChi2[2];          //Chi2 to stop looking for next hit
73   Double_t fTrackChi2Cut[2];         //Maximum track chi2
74   Double_t fGoodDist;             //In segment building, distance consider good enough
75   Double_t fMaxPhi;
76   Double_t fMaxEta;
77
78   // Tracking informtion
79   Int_t fMainVertexTracks; //number of tracks coming from the main vertex
80   Int_t fClustersUnused;   //number of unused clusters
81
82   static Double_t todeg;
83   static Double_t pi;
84   static Double_t twopi;
85
86   //setter:
87   void SetMinPoints(Int_t f,Bool_t vertex_constraint) {fMinPoints[(Int_t)vertex_constraint] = f; }  
88   void SetVertexConstraint(Bool_t f) {fVertexConstraint =f;}
89   
90   void SetHitChi2Cut(Double_t f,Bool_t vert) {fHitChi2Cut[(Int_t)vert]=f;}
91   void SetGoodHitChi2(Double_t f,Bool_t vert) {fGoodHitChi2[(Int_t)vert]=f;}
92   void SetTrackChi2Cut(Double_t f,Bool_t vert) {fTrackChi2Cut[(Int_t)vert]=f;}
93   void SetMaxDist(Int_t f,Bool_t vert) {fMaxDist[(Int_t)vert]=f;}
94   void SetTrackletLength(Int_t f,Bool_t vert) {fTrackletLength[(Int_t)vert]=f;}
95   void SetRowScopeTrack(Int_t f, Bool_t vertex_constraint)         { fRowScopeTrack[(Int_t)vertex_constraint] = f; }     // sets one row scope for tracks
96   void SetRowScopeTracklet(Int_t f, Bool_t vertex_constraint)      { fRowScopeTracklet[(Int_t)vertex_constraint] = f; }  // sets one row scope for tracklets
97   void SetMaxAngleTracklet(Double_t f, Bool_t vertex_constraint)   { fMaxAngleTracklet[(Int_t)vertex_constraint] = f; }  // sets one angle cut
98
99   void SetPointers();
100   Double_t CpuTime();
101
102  public:
103
104   AliL3ConfMapper();
105   //  AliL3ConfMapper(AliTPCParam *param,AliL3Vertex *vertex,Bool_t bench=(Bool_t)false);
106   virtual ~AliL3ConfMapper();
107   
108   void InitVolumes();
109   void InitSector(Int_t sector,Int_t *rowrange=0,Float_t *etarange=0);
110   void SetVertex(AliL3Vertex *vertex){fVertex = vertex;}
111   void MainVertexTracking_a();
112   void MainVertexTracking_b();
113   void MainVertexTracking();
114   void NonVertexTracking();
115   void MainVertexSettings(Int_t trackletlength, Int_t tracklength, 
116                           Int_t rowscopetracklet, Int_t rowscopetrack,Double_t maxphi=0.1,Double_t maxeta=0.1);
117   void NonVertexSettings(Int_t trackletlength, Int_t tracklength, 
118                          Int_t rowscopetracklet, Int_t rowscopetrack);
119   Bool_t ReadHits(UInt_t count, AliL3SpacePointData* hits );
120   void ClusterLoop();
121   void CreateTrack(AliL3ConfMapPoint *hit);
122   AliL3ConfMapPoint *GetNextNeighbor(AliL3ConfMapPoint *start_hit,AliL3ConfMapTrack *track=NULL);
123   Int_t EvaluateHit(AliL3ConfMapPoint *start_hit,AliL3ConfMapPoint *hit,AliL3ConfMapTrack *track);
124
125   Double_t CalcDistance(const AliL3ConfMapPoint *hit1,const AliL3ConfMapPoint *hit2) const;
126   Double_t TrackletAngle(const AliL3ConfMapTrack *track,Int_t n=3) const;
127   Bool_t VerifyRange(const AliL3ConfMapPoint *hit1,const AliL3ConfMapPoint *hit2) const;
128   Int_t FillTracks();
129   
130   //getters
131   Int_t GetNumberOfTracks() {return nTracks;}
132   AliL3TrackArray *GetTracks() {return fTrack;}
133   Double_t GetMaxDca()  const {return fMaxDca;}
134   AliL3Vertex* GetVertex() const
135           {
136           return fVertex;
137           }
138
139   //setters
140   void SetTrackCuts(Double_t hitChi2Cut, Double_t goodHitChi2, Double_t trackChi2Cut, Int_t maxdist,Bool_t vertexconstraint); 
141   void SetTrackletCuts(Double_t maxangle,Double_t goodDist,Bool_t vertex_constraint);   //Set cut of tracklet for the given vertex_constraint
142   void SetNSegments(Int_t f,Int_t g) {fNumPhiSegment=f,fNumEtaSegment=g;} //Set number of subvolumes (#segments in (phi,eta)
143   void SetParamDone(Bool_t f) {fParamSet = (Bool_t)f;}
144   void SetMaxDca(Double_t f) {fMaxDca = f;}
145
146   ClassDef(AliL3ConfMapper,1) //Base class for conformal mapping tracking
147 };
148
149 #endif