]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCAParam.h
Update master to aliroot
[u/mrichter/AliRoot.git] / HLT / TPCLib / tracking-ca / AliHLTTPCCAParam.h
1 //-*- Mode: C++ -*-
2 // @(#) $Id$
3 // ************************************************************************
4 // This file is property of and copyright by the ALICE HLT Project        *
5 // ALICE Experiment at CERN, All rights reserved.                         *
6 // See cxx source for full Copyright notice                               *
7 //                                                                        *
8 //*************************************************************************
9
10 #ifndef ALIHLTTPCCAPARAM_H
11 #define ALIHLTTPCCAPARAM_H
12
13 #include "AliHLTTPCCADef.h"
14 #include "AliHLTTPCCAMath.h"
15 #include "AliHLTTPCCATrackParam.h"
16
17 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
18 #include <iostream>
19 #endif
20
21 /**
22  * @class ALIHLTTPCCAParam
23  * parameters of the AliHLTTPCCATracker, including geometry information
24  * and some reconstructon constants.
25  *
26  * The class is under construction.
27  *
28  */
29 MEM_CLASS_PRE() class AliHLTTPCCAParam
30 {
31   public:
32         AliHLTTPCCAParam();
33     ~AliHLTTPCCAParam() {}
34
35 #if !defined(HLTCA_GPUCODE)
36     void Initialize( int iSlice, int nRows, float rowX[],
37                             float alpha, float dAlpha,
38                             float rMin, float rMax, float zMin, float zMax,
39                             float padPitch, float zSigma, float bz );
40     void Update();
41 #endif //!HLTCA_GPUCODE
42
43         GPUd() void Slice2Global( float x, float y,  float z,
44                               float *X, float *Y,  float *Z ) const;
45
46     GPUd() void Global2Slice( float x, float y,  float z,
47                               float *X, float *Y,  float *Z ) const;
48
49
50     GPUhd() int ISlice() const { return fISlice;}
51     GPUhd() int NRows() const { return fNRows;}
52
53     GPUhd() float RowX( int iRow ) const { return fRowX[iRow]; }
54
55     GPUd() float Alpha() const { return fAlpha;}
56     GPUd() float Alpha( int iSlice ) const { return 0.174533 + DAlpha()*iSlice;}
57     GPUd() float DAlpha() const { return fDAlpha;}
58     GPUd() float CosAlpha() const { return fCosAlpha;}
59     GPUd() float SinAlpha() const { return fSinAlpha;}
60     GPUd() float AngleMin() const { return fAngleMin;}
61     GPUd() float AngleMax() const { return fAngleMax;}
62     GPUd() float RMin() const { return fRMin;}
63     GPUd() float RMax() const { return fRMax;}
64     GPUd() float ZMin() const { return fZMin;}
65     GPUd() float ZMax() const { return fZMax;}
66     GPUd() float ErrZ() const { return fErrZ;}
67     GPUd() float ErrX() const { return fErrX;}
68     GPUd() float ErrY() const { return fErrY;}
69     GPUd() float BzkG() const { return fBzkG;}
70     GPUd() float ConstBz() const { return fConstBz;}
71
72     GPUd() float NeighboursSearchArea() const { return fNeighboursSearchArea; }
73     GPUd() float TrackConnectionFactor() const { return fTrackConnectionFactor; }
74     GPUd() float TrackChiCut()  const { return fTrackChiCut; }
75     GPUd() float TrackChi2Cut() const { return fTrackChi2Cut; }
76     GPUd() int   MaxTrackMatchDRow() const { return fMaxTrackMatchDRow; }
77     GPUd() float HitPickUpFactor() const { return fHitPickUpFactor; }
78   GPUd() float ClusterError2CorrectionY() const { return fClusterError2CorrectionY; }
79   GPUd() float ClusterError2CorrectionZ() const { return fClusterError2CorrectionZ; }
80   GPUd() int MinNTrackClusters() const { return fMinNTrackClusters; }
81   GPUd() float MaxTrackQPt() const { return fMaxTrackQPt; }
82
83
84
85     GPUhd() void SetISlice( int v ) {  fISlice = v;}
86     GPUhd() void SetNRows( int v ) {  fNRows = v;}
87     GPUhd() void SetRowX( int iRow, float v ) {  fRowX[iRow] = v; }
88     GPUd() void SetAlpha( float v ) {  fAlpha = v;}
89     GPUd() void SetDAlpha( float v ) {  fDAlpha = v;}
90     GPUd() void SetCosAlpha( float v ) {  fCosAlpha = v;}
91     GPUd() void SetSinAlpha( float v ) {  fSinAlpha = v;}
92     GPUd() void SetAngleMin( float v ) {  fAngleMin = v;}
93     GPUd() void SetAngleMax( float v ) {  fAngleMax = v;}
94     GPUd() void SetRMin( float v ) {  fRMin = v;}
95     GPUd() void SetRMax( float v ) {  fRMax = v;}
96     GPUd() void SetZMin( float v ) {  fZMin = v;}
97     GPUd() void SetZMax( float v ) {  fZMax = v;}
98     GPUd() void SetErrZ( float v ) {  fErrZ = v;}
99     GPUd() void SetErrX( float v ) {  fErrX = v;}
100     GPUd() void SetErrY( float v ) {  fErrY = v;}
101     GPUd() void SetBzkG( float v ) {  fBzkG = v;}
102
103   GPUd() void SetNeighboursSearchArea( float v ) { fNeighboursSearchArea = v;}
104     GPUd() void SetTrackConnectionFactor( float v ) { fTrackConnectionFactor = v;}
105     GPUd() void SetTrackChiCut( float v ) {  fTrackChiCut = v; }
106   GPUd() void SetTrackChi2Cut( float v ) {  fTrackChi2Cut = v; }
107     GPUd() void SetMaxTrackMatchDRow( int v ) {  fMaxTrackMatchDRow = v; }
108     GPUd() void SetHitPickUpFactor( float v ) {  fHitPickUpFactor = v; }
109     GPUd() void SetClusterError2CorrectionY( float v ) { fClusterError2CorrectionY = v; }
110     GPUd() void SetClusterError2CorrectionZ( float v ) { fClusterError2CorrectionZ = v; }
111
112   GPUd() void SetMinNTrackClusters( int v ){ fMinNTrackClusters = v; }
113   GPUd() void SetMinTrackPt( float v ){ fMaxTrackQPt = CAMath::Abs(v)>0.02 ?1./CAMath::Abs(v) :1./0.02; }
114
115     GPUd() float GetClusterError2( int yz, int type, float z, float angle ) const;
116     GPUd() void GetClusterErrors2( int row, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const;
117     GPUd() void GetClusterErrors2v1( int rowType, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const;
118
119 #if !defined(__OPENCL__) || defined(HLTCA_HOSTCODE)
120     void WriteSettings( std::ostream &out ) const;
121     void ReadSettings( std::istream &in );
122 #endif
123
124     GPUd() void SetParamS0Par( int i, int j, int k, float val ) {
125       fParamS0Par[i][j][k] = val;
126     }
127   
128     GPUd() const MakeType(float*) GetParamS0Par(int i, int j) const { return fParamS0Par[i][j]; }
129  
130     GPUd() float GetBzkG() const { return fBzkG;}
131     GPUd() float GetConstBz() const { return fConstBz;}
132     GPUd() float GetBz( float x, float y, float z ) const;
133         MEM_CLASS_PRE2() GPUd() float GetBz( const MEM_LG2(AliHLTTPCCATrackParam) &t ) const {return GetBz( t.X(), t.Y(), t.Z() );}
134
135   protected:
136     int fISlice; // slice number
137     int fNRows; // number of rows
138
139     float fAlpha, fDAlpha; // slice angle and angular size
140     float fCosAlpha, fSinAlpha;// sign and cosine of the slice angle
141     float fAngleMin, fAngleMax; // minimal and maximal angle
142     float fRMin, fRMax;// slice R range
143     float fZMin, fZMax;// slice Z range
144     float fErrX, fErrY, fErrZ;// default cluster errors
145     float fPadPitch; // pad pitch
146     float fBzkG;       // constant magnetic field value in kG
147     float fConstBz;       // constant magnetic field value in kG*clight
148
149     float fHitPickUpFactor;// multiplier for the chi2 window for hit pick up procedure
150
151     int   fMaxTrackMatchDRow;// maximal jump in TPC row for connecting track segments
152
153   float fNeighboursSearchArea; // area in cm for the search of neighbours
154
155     float fTrackConnectionFactor; // allowed distance in Chi^2/3.5 for neighbouring tracks
156     float fTrackChiCut; // cut for track Sqrt(Chi2/NDF);
157     float fTrackChi2Cut;// cut for track Chi^2/NDF
158   float fClusterError2CorrectionY; // correction for the squared cluster error during tracking
159   float fClusterError2CorrectionZ; // correction for the squared cluster error during tracking
160     int fMinNTrackClusters; //* required min number of clusters on the track
161     float fMaxTrackQPt;    //* required max Q/Pt (==min Pt) of tracks
162
163     float fRowX[200];// X-coordinate of rows
164     float fParamS0Par[2][3][7];    // cluster error parameterization coeficients
165     float fPolinomialFieldBz[6];   // field coefficients
166
167 };
168
169
170
171 MEM_CLASS_PRE() GPUd() inline float MEM_LG(AliHLTTPCCAParam)::GetBz( float x, float y, float z ) const
172 {
173   float r2 = x * x + y * y;
174   float r  = CAMath::Sqrt( r2 );
175   const float *c = fPolinomialFieldBz;
176   return ( c[0] + c[1]*z  + c[2]*r  + c[3]*z*z + c[4]*z*r + c[5]*r2 );
177 }
178
179 #endif //ALIHLTTPCCAPARAM_H