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