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