]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCConfMapper.h
- abandon TPCLib backward compatibility check for AliRoot releases < v4-03
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCConfMapper.h
1 // @(#) $Id$
2 // Original: AliHLTConfMapper.h,v 1.11 2004/07/05 09:03:11 loizides 
3
4 #ifndef ALIHLTTPCCONFMAPPER_H
5 #define ALIHLTTPCCONFMAPPER_H
6
7 //
8 //Conformal mapping base class
9 //
10 // Author: Anders Vestbo <mailto:vestbo@fi.uib.no>
11 //*-- Copyright &copy ALICE HLT Group
12
13 #include <vector>
14
15 class AliHLTTPCConfMapPoint;
16 class AliHLTTPCConfMapTrack;
17 class AliHLTTPCVertex;
18 class AliHLTTPCTrackArray;
19 class AliHLTTPCSpacePointData;
20
21
22 class AliHLTTPCConfMapper {
23
24  public:
25
26   AliHLTTPCConfMapper();
27   //  AliHLTTPCConfMapper(AliTPCParam *param,AliHLTTPCVertex *vertex,Bool_t bench=(Bool_t)false);
28   /** destructor */
29   virtual ~AliHLTTPCConfMapper();
30   
31   /**
32    * Init and calculate bounds for the internal arrays.
33    */
34   void InitVolumes();
35
36   /**
37    * Reset internal arrays and free memory.
38    */
39   void Reset();
40
41   void InitSector(Int_t sector,Int_t *rowrange=0,Float_t *etarange=0);
42   void SetVertex(AliHLTTPCVertex *vertex){fVertex = vertex;}
43   void MainVertexTrackingA();
44   void MainVertexTrackingB();
45   void MainVertexTracking();
46   void NonVertexTracking();
47   void MainVertexSettings(Int_t trackletlength, Int_t tracklength, 
48                           Int_t rowscopetracklet, Int_t rowscopetrack,Double_t maxphi=0.1,Double_t maxeta=0.1);
49   void NonVertexSettings(Int_t trackletlength, Int_t tracklength, 
50                          Int_t rowscopetracklet, Int_t rowscopetrack);
51
52   /**
53    * Read an array of space point data.
54    * @param count    array size
55    * @param hits     array
56    * @return kTRUE if success.
57    */
58   Bool_t ReadHits(UInt_t count, AliHLTTPCSpacePointData* hits );
59   void ClusterLoop();
60   void CreateTrack(AliHLTTPCConfMapPoint *hit);
61   AliHLTTPCConfMapPoint *GetNextNeighbor(AliHLTTPCConfMapPoint *start_hit,AliHLTTPCConfMapTrack *track=NULL);
62   Int_t EvaluateHit(AliHLTTPCConfMapPoint *start_hit,AliHLTTPCConfMapPoint *hit,AliHLTTPCConfMapTrack *track);
63
64   Double_t CalcDistance(const AliHLTTPCConfMapPoint *hit1,const AliHLTTPCConfMapPoint *hit2) const;
65   Double_t TrackletAngle(AliHLTTPCConfMapTrack *track,Int_t n=3) const;
66   Bool_t VerifyRange(const AliHLTTPCConfMapPoint *hit1,const AliHLTTPCConfMapPoint *hit2) const;
67   Int_t FillTracks();
68   
69   //getters
70   Int_t GetNumberOfTracks()    const {return fNTracks;}
71   AliHLTTPCTrackArray *GetTracks() const {return fTrack;}
72   Double_t GetMaxDca()         const {return fMaxDca;}
73   AliHLTTPCVertex* GetVertex()     const {return fVertex;}
74   Double_t CpuTime();
75
76   //setters
77   void SetTrackCuts(Double_t hitChi2Cut, Double_t goodHitChi2, Double_t trackChi2Cut, Int_t maxdist,Bool_t vertexconstraint); 
78   void SetTrackletCuts(Double_t maxangle,Double_t goodDist,Bool_t vc);    //Set cut of tracklet for the given vertex_constraint
79   void SetNSegments(Int_t f,Int_t g) {fNumPhiSegment=f,fNumEtaSegment=g;} //Set number of subvolumes (#segments in (phi,eta)
80   void SetMaxDca(Double_t f) {fMaxDca = f;}
81
82   //setter:
83   void SetMinPoints(Int_t f,Bool_t vconstraint) {fMinPoints[(Int_t)vconstraint] = f; }  
84   void SetVertexConstraint(Bool_t f) {fVertexConstraint =f;}
85   
86   void SetHitChi2Cut(Double_t f,Bool_t vert) {fHitChi2Cut[(Int_t)vert]=f;}
87   void SetGoodHitChi2(Double_t f,Bool_t vert) {fGoodHitChi2[(Int_t)vert]=f;}
88   void SetTrackChi2Cut(Double_t f,Bool_t vert) {fTrackChi2Cut[(Int_t)vert]=f;}
89   void SetMaxDist(Int_t f,Bool_t vert) {fMaxDist[(Int_t)vert]=f;}
90   void SetTrackletLength(Int_t f,Bool_t vert) {fTrackletLength[(Int_t)vert]=f;}
91   void SetRowScopeTrack(Int_t f, Bool_t vc){fRowScopeTrack[(Int_t)vc] = f;}
92   void SetRowScopeTracklet(Int_t f, Bool_t vc){fRowScopeTracklet[(Int_t)vc] = f;}
93   void SetMaxAngleTracklet(Double_t f, Bool_t vc){fMaxAngleTracklet[(Int_t)vc] = f;}
94
95   void SetPointers();
96   void SetParamDone(Bool_t vconstraint) {fParamSet[(Int_t)vconstraint] = kTRUE;}
97
98  private:
99   /** copy constructor prohibited */
100   AliHLTTPCConfMapper(const AliHLTTPCConfMapper&);
101   /** assignment operator prohibited */
102   AliHLTTPCConfMapper& operator=(const AliHLTTPCConfMapper&);
103
104   struct AliHLTTPCConfMapContainer 
105   {
106     void *first; // first track
107     void *last;  // last track
108   };
109
110   Bool_t fBench; //run-time measurements
111   Int_t fNTracks; //number of tracks build.
112
113   AliHLTTPCVertex *fVertex; //!
114   Bool_t fParamSet[2];  //!
115   Bool_t fVertexFinder; //Include vertexfinding or not 
116                         //(latter case vertex=(0,0,0))
117
118   /** the list of hits */
119   vector<AliHLTTPCConfMapPoint> fHit;  //!
120   AliHLTTPCTrackArray *fTrack;  //!
121   Double_t fMaxDca;      //cut value for momentum fit
122   
123   AliHLTTPCConfMapContainer *fVolume;  //!  Segment volume
124   AliHLTTPCConfMapContainer *fRow;     //!  Row volume
125
126    //Number of cells (segments)
127   Int_t  fNumRowSegment;          // Total number of padrows
128   Int_t  fNumPhiSegment;          // number of phi segments 
129   Int_t  fNumEtaSegment;          // number of eta segments
130   Int_t  fNumRowSegmentPlusOne;   // row+1
131   Int_t  fNumPhiSegmentPlusOne;   // phi+1
132   Int_t  fNumEtaSegmentPlusOne;   // eta+1
133   Int_t  fNumPhiEtaSegmentPlusOne;// phieta+1
134   Int_t  fBounds;                 // bounds
135   Int_t  fPhiHitsOutOfRange;      // phi hits out of range
136   Int_t  fEtaHitsOutOfRange;      // eta hits out of range
137
138   //tracking range:
139   Float_t fPhiMin; //MinPhi angle to consider
140   Float_t fPhiMax; //MaxPhi angle to consider
141   Float_t fEtaMin; //MinEta to consider
142   Float_t fEtaMax; //MaxEta to consider
143   Int_t fRowMin;   //Minimum row to consider
144   Int_t fRowMax;   //Maximum row to consider
145
146   Bool_t fVertexConstraint;       //vertex constraint (true or false)
147   Int_t fTrackletLength[2];       //minimal length of tracks 
148   Int_t fRowScopeTracklet[2];     //number of row segments to look for the next point of a tracklet
149   Int_t fRowScopeTrack[2];        //number of row segments to look for the next point of a track
150   Int_t fMinPoints[2];            //minimum number of points on one track
151   
152   // Cuts
153   Double_t fMaxAngleTracklet[2];  //limit of angle between to pieces of a tracklet
154   Int_t fMaxDist[2];              //maximum distance between two hits 
155   Double_t fHitChi2Cut[2];        //Maximum hit chi2
156   Double_t fGoodHitChi2[2];       //Chi2 to stop looking for next hit
157   Double_t fTrackChi2Cut[2];      //Maximum track chi2
158   Double_t fGoodDist;             //In segment building, distance consider good enough
159   Double_t fMaxPhi;               //Maximum phi
160   Double_t fMaxEta;               //Maximum eta
161
162   // Tracking informtion
163   Int_t fMainVertexTracks; //number of tracks coming from the main vertex
164   Int_t fClustersUnused;   //number of unused clusters
165
166   ClassDef(AliHLTTPCConfMapper,1) //Base class for conformal mapping tracking
167 };
168
169 #endif