]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/tracking-ca/AliHLTTPCCAParam.h
f6564614eaa469cdc4c943a98d0a64cca1ba05a4
[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 #include <iostream>
18
19
20 /**
21  * @class ALIHLTTPCCAParam
22  * parameters of the AliHLTTPCCATracker, including geometry information
23  * and some reconstructon constants.
24  *
25  * The class is under construction.
26  *
27  */
28 class AliHLTTPCCAParam
29 {
30   public:
31
32 #if !defined(HLTCA_GPUCODE)
33     GPUd() AliHLTTPCCAParam();
34 #endif
35
36     ~AliHLTTPCCAParam() {;}
37
38     GPUd() void Initialize( int iSlice, int nRows, float rowX[],
39                             float alpha, float dAlpha,
40                             float rMin, float rMax, float zMin, float zMax,
41                             float padPitch, float zSigma, float bz );
42     GPUd() void Update();
43
44     GPUd() void Slice2Global( float x, float y,  float z,
45                               float *X, float *Y,  float *Z ) const;
46
47     GPUd() void Global2Slice( float x, float y,  float z,
48                               float *X, float *Y,  float *Z ) const;
49
50
51     GPUhd() int ISlice() const { return fISlice;}
52     GPUhd() int NRows() const { return fNRows;}
53
54     GPUhd() float RowX( int iRow ) const { return fRowX[iRow]; }
55
56     GPUd() float Alpha() const { return fAlpha;}
57     GPUd() float Alpha( int iSlice ) const { return 0.174533 + DAlpha()*iSlice;}
58     GPUd() float DAlpha() const { return fDAlpha;}
59     GPUd() float CosAlpha() const { return fCosAlpha;}
60     GPUd() float SinAlpha() const { return fSinAlpha;}
61     GPUd() float AngleMin() const { return fAngleMin;}
62     GPUd() float AngleMax() const { return fAngleMax;}
63     GPUd() float RMin() const { return fRMin;}
64     GPUd() float RMax() const { return fRMax;}
65     GPUd() float ZMin() const { return fZMin;}
66     GPUd() float ZMax() const { return fZMax;}
67     GPUd() float ErrZ() const { return fErrZ;}
68     GPUd() float ErrX() const { return fErrX;}
69     GPUd() float ErrY() const { return fErrY;}
70     GPUd() float Bz() const { return fBz;}
71
72     GPUd() float TrackConnectionFactor() const { return fTrackConnectionFactor; }
73     GPUd() float TrackChiCut()  const { return fTrackChiCut; }
74     GPUd() float TrackChi2Cut() const { return fTrackChi2Cut; }
75     GPUd() int   MaxTrackMatchDRow() const { return fMaxTrackMatchDRow; }
76     GPUd() float HitPickUpFactor() const { return fHitPickUpFactor; }
77
78
79
80     GPUhd() void SetISlice( int v ) {  fISlice = v;}
81     GPUhd() void SetNRows( int v ) {  fNRows = v;}
82     GPUhd() void SetRowX( int iRow, float v ) {  fRowX[iRow] = v; }
83     GPUd() void SetAlpha( float v ) {  fAlpha = v;}
84     GPUd() void SetDAlpha( float v ) {  fDAlpha = v;}
85     GPUd() void SetCosAlpha( float v ) {  fCosAlpha = v;}
86     GPUd() void SetSinAlpha( float v ) {  fSinAlpha = v;}
87     GPUd() void SetAngleMin( float v ) {  fAngleMin = v;}
88     GPUd() void SetAngleMax( float v ) {  fAngleMax = v;}
89     GPUd() void SetRMin( float v ) {  fRMin = v;}
90     GPUd() void SetRMax( float v ) {  fRMax = v;}
91     GPUd() void SetZMin( float v ) {  fZMin = v;}
92     GPUd() void SetZMax( float v ) {  fZMax = v;}
93     GPUd() void SetErrZ( float v ) {  fErrZ = v;}
94     GPUd() void SetErrX( float v ) {  fErrX = v;}
95     GPUd() void SetErrY( float v ) {  fErrY = v;}
96     GPUd() void SetBz( float v ) {  fBz = v;}
97     GPUd() void SetTrackConnectionFactor( float v ) { fTrackConnectionFactor = v;}
98     GPUd() void SetTrackChiCut( float v ) {  fTrackChiCut = v; }
99     GPUd() void SetTrackChi2Cut( float v ) {  fTrackChi2Cut = v; }
100     GPUd() void SetMaxTrackMatchDRow( int v ) {  fMaxTrackMatchDRow = v; }
101     GPUd() void SetHitPickUpFactor( float v ) {  fHitPickUpFactor = v; }
102
103
104     GPUd() float GetClusterError2( int yz, int type, float z, float angle ) const;
105     GPUd() void GetClusterErrors2( int iRow, float z, float sinPhi, float cosPhi, float DzDs, float &Err2Y, float &Err2Z ) const;
106
107     void WriteSettings( std::ostream &out ) const;
108     void ReadSettings( std::istream &in );
109
110     GPUd() void SetParamS0Par( int i, int j, int k, float val ) {
111       fParamS0Par[i][j][k] = val;
112     }
113
114     GPUd() float GetBz() const { return fBz;}
115     GPUd() float GetBz( float x, float y, float z ) const;
116     GPUd()  float GetBz( const AliHLTTPCCATrackParam &t ) const;
117
118   protected:
119
120     int fISlice; // slice number
121     int fNRows; // number of rows
122
123     float fAlpha, fDAlpha; // slice angle and angular size
124     float fCosAlpha, fSinAlpha;// sign and cosine of the slice angle
125     float fAngleMin, fAngleMax; // minimal and maximal angle
126     float fRMin, fRMax;// slice R range
127     float fZMin, fZMax;// slice Z range
128     float fErrX, fErrY, fErrZ;// default cluster errors
129     float fPadPitch; // pad pitch
130     float fBz;       // magnetic field value (only constant field can be used)
131
132     float fHitPickUpFactor;// multiplier for the chi2 window for hit pick up procedure
133
134     int   fMaxTrackMatchDRow;// maximal jump in TPC row for connecting track segments
135     float fTrackConnectionFactor; // allowed distance in Chi^2/3.5 for neighbouring tracks
136     float fTrackChiCut; // cut for track Sqrt(Chi2/NDF);
137     float fTrackChi2Cut;// cut for track Chi^2/NDF
138
139     float fRowX[200];// X-coordinate of rows
140     float fParamS0Par[2][3][7];    // cluster error parameterization coeficients
141     float fPolinomialFieldBz[6];   // field coefficients
142
143 };
144
145
146
147 GPUd() inline float AliHLTTPCCAParam::GetBz( float x, float y, float z ) const
148 {
149   float r2 = x * x + y * y;
150   float r  = CAMath::Sqrt( r2 );
151   const float *c = fPolinomialFieldBz;
152   return ( c[0] + c[1]*z  + c[2]*r  + c[3]*z*z + c[4]*z*r + c[5]*r2 );
153 }
154
155 GPUd() inline float AliHLTTPCCAParam::GetBz( const AliHLTTPCCATrackParam &t ) const
156 {
157   return GetBz( t.X(), t.Y(), t.Z() );
158 }
159
160 #endif