10 #ifndef ALIHLTTPCCAPARAM_H
11 #define ALIHLTTPCCAPARAM_H
13 #include "AliHLTTPCCADef.h"
14 #include "AliHLTTPCCAMath.h"
15 #include "AliHLTTPCCATrackParam.h"
16 #include "AliHLTTPCCAParameters.h"
23 template<
typename T>
struct char_traits;
24 template<
typename _CharT,
typename _Traits>
class basic_istream;
25 typedef basic_istream<char, char_traits<char> > istream;
26 template<
typename _CharT,
typename _Traits>
class basic_ostream;
27 typedef basic_ostream<char, char_traits<char> > ostream;
46 void Initialize(
int iSlice,
int nRows,
float rowX[],
47 float alpha,
float dAlpha,
48 float rMin,
float rMax,
float zMin,
float zMax,
49 float padPitch,
float zSigma,
float bz );
52 void Slice2Global(
float x,
float y,
float z,
53 float *X,
float *Y,
float *Z )
const;
55 void Global2Slice(
float x,
float y,
float z,
56 float *X,
float *Y,
float *Z )
const;
59 int ISlice()
const {
return fISlice;}
60 int NRows()
const {
return fNRows; }
61 int NRows8()
const {
return fNRows + sfloat_v::Size - (fNRows-1)%sfloat_v::Size - 1;}
63 int NInnerRows()
const {
return fNInnerRows; }
65 const float *RowX()
const {
return &(fRowX[0]); }
66 float RowX(
int iRow )
const {
return fRowX[iRow]; }
68 float Alpha()
const {
return fAlpha;}
69 float Alpha(
int iSlice )
const {
return 0.0 + DAlpha()*iSlice;}
70 float DAlpha()
const {
return fDAlpha;}
71 float CosAlpha()
const {
return fCosAlpha;}
72 float SinAlpha()
const {
return fSinAlpha;}
73 float AngleMin()
const {
return fAngleMin;}
74 float AngleMax()
const {
return fAngleMax;}
75 float RMin()
const {
return fRMin;}
76 float RMax()
const {
return fRMax;}
77 float ZMin()
const {
return fZMin;}
78 float ZMax()
const {
return fZMax;}
79 float ErrZ()
const {
return fErrZ;}
80 float ErrX()
const {
return fErrX;}
81 float ErrY()
const {
return fErrY;}
82 float Bz()
const {
return fBz;}
83 float cBz()
const {
return fBz*0.000299792458;}
85 float TrackConnectionFactor()
const {
return fTrackConnectionFactor; }
86 float TrackChiCut()
const {
return fTrackChiCut; }
87 float TrackChi2Cut()
const {
return fTrackChi2Cut; }
88 int MaxTrackMatchDRow()
const {
return fMaxTrackMatchDRow; }
89 float HitPickUpFactor()
const {
return fHitPickUpFactor; }
93 void SetISlice(
int v ) { fISlice = v;}
94 void SetNRows(
int v ) { fNRows = v; fRowX.resize(fNRows);}
95 void SetNInnerRows(
int v ) { fNInnerRows = v;}
96 void SetRowX(
int iRow,
float v ) { fRowX[iRow] = v; }
97 void SetAlpha(
float v ) { fAlpha = v;}
98 void SetDAlpha(
float v ) { fDAlpha = v;}
99 void SetCosAlpha(
float v ) { fCosAlpha = v;}
100 void SetSinAlpha(
float v ) { fSinAlpha = v;}
101 void SetAngleMin(
float v ) { fAngleMin = v;}
102 void SetAngleMax(
float v ) { fAngleMax = v;}
103 void SetRMin(
float v ) { fRMin = v;}
104 void SetRMax(
float v ) { fRMax = v;}
105 void SetZMin(
float v ) { fZMin = v;}
106 void SetZMax(
float v ) { fZMax = v;}
107 void SetErrZ(
float v ) { fErrZ = v;}
108 void SetErrX(
float v ) { fErrX = v;}
109 void SetErrY(
float v ) { fErrY = v;}
110 void SetBz(
float v ) { fBz = v;}
111 void SetTrackConnectionFactor(
float v ) { fTrackConnectionFactor = v;}
112 void SetTrackChiCut(
float v ) { fTrackChiCut = v; }
113 void SetTrackChi2Cut(
float v ) { fTrackChi2Cut = v; }
114 void SetMaxTrackMatchDRow(
int v ) { fMaxTrackMatchDRow = v; }
115 void SetHitPickUpFactor(
float v ) { fHitPickUpFactor = v; }
116 void SetRecoType(
int reco) { fRecoType = reco; }
125 void GetClusterErrors2( ushort_v rowIndexes,
const sfloat_v &X,
const sfloat_v &Y, sfloat_v &Z, sfloat_v &Err2Y, sfloat_v &Err2Z )
const;
131 void SetParamS0Par(
int i,
int j,
int k,
float val ) {
132 fParamS0Par[i][j][k] = val;
135 float GetBz()
const {
return fBz;}
136 float GetBz(
float x,
float y,
float z )
const;
137 sfloat_v GetBz( sfloat_v x, sfloat_v y, sfloat_v z )
const;
141 void StoreToFile( FILE *f )
const;
142 void RestoreFromFile( FILE *f );
145 float GetClusterError2(
int yz,
int type,
float z,
float angle )
const;
146 sfloat_v GetClusterError2(
int yz,
int type, sfloat_v z, sfloat_v angle )
const;
152 float fAlpha, fDAlpha;
153 float fCosAlpha, fSinAlpha;
154 float fAngleMin, fAngleMax;
157 float fErrX, fErrY, fErrZ;
161 float fHitPickUpFactor;
163 int fMaxTrackMatchDRow;
164 float fTrackConnectionFactor;
170 float fParamS0Par[2][3][7];
171 float fPolinomialFieldBz[6];
191 inline int errorType(
int row )
const {
193 type = ( row < fNInnerRows ? 0 : 1 );
196 inline ushort_v errorType( short_v row )
const {
198 type.setZero( row < fNInnerRows );
209 inline float AliHLTTPCCAParam::GetBz(
float x,
float y,
float z )
const
211 float r2 = x * x + y * y;
212 float r = CAMath::Sqrt( r2 );
213 const float *c = fPolinomialFieldBz;
214 return ( c[0] + c[1]*z + c[2]*r + c[3]*z*z + c[4]*z*r + c[5]*r2 );
217 inline sfloat_v AliHLTTPCCAParam::GetBz( sfloat_v x, sfloat_v y, sfloat_v z )
const
219 sfloat_v r2 = x * x + y * y;
220 sfloat_v r = CAMath::Sqrt( r2 );
221 const float *c = fPolinomialFieldBz;
222 return ( c[0] + c[1]*z + c[2]*r + c[3]*z*z + c[4]*z*r + c[5]*r2 );
227 return GetBz( t.X(), t.Y(), t.Z() );
232 return GetBz( t.X(), t.Y(), t.Z() );
332 const sfloat_v one = sfloat_v(Vc::One);
333 const sfloat_v zero = sfloat_v(Vc::Zero);
335 const int type = errorType( iRow );
336 z = (200.f - CAMath::Abs(z)) * 0.01f;
339 sfloat_v sin2Phi = t.GetSinPhi()*t.GetSinPhi();
340 sfloat_v cos2Phi = (one - sin2Phi);
341 cos2Phi(cos2Phi < 0.0001f) = 0.0001f;
342 sfloat_v tg2Phi = sin2Phi/cos2Phi;
344 sfloat_v tg2Lambda = t.DzDs()*t.DzDs();
346 const float *c = fParamS0Par[0][type];
347 sfloat_v v = c[0] + c[1]*z/cos2Phi + c[2]*tg2Phi;
348 sfloat_v w = c[3] + c[4]*z*(one + tg2Lambda) + c[5]*tg2Lambda;
352 const sfloat_v errmin=1e-6f;
353 v(v<errmin) = errmin;
354 w(w<errmin) = errmin;
356 *Err2Y = CAMath::Abs( v );
357 *Err2Z = CAMath::Abs( w );
362 const sfloat_v one = sfloat_v(Vc::One);
363 const sfloat_v zero = sfloat_v(Vc::Zero);
365 z = (200.f - CAMath::Abs(z)) * 0.01f;
368 const ushort_v type = errorType( static_cast<short_v>( rowIndexes ) );
370 sfloat_v sin2Phi = t.GetSinPhi()*t.GetSinPhi();
371 sfloat_v cos2Phi = (one - sin2Phi);
372 cos2Phi(cos2Phi < 0.0001f) = 0.0001f;
373 sfloat_v tg2Phi = sin2Phi/cos2Phi;
375 sfloat_v tg2Lambda = t.DzDs()*t.DzDs();
377 const float *c = &fParamS0Par[0][0][0];
378 const sfloat_v errmin=1e-6f;
379 sfloat_v v( c, type );
380 v += z * sfloat_v( c + 1, type )/cos2Phi + sfloat_v( c + 2, type ) *tg2Phi;
382 v(v<errmin) = errmin;
383 *Err2Y = CAMath::Abs( v );
385 v.gather( c+3, type );
386 v += z * sfloat_v( c + 4, type )*(one + tg2Lambda) + sfloat_v( c + 5, type )*tg2Lambda;
388 v(v<errmin) = errmin;
389 *Err2Z = CAMath::Abs( v );
void GetClusterErrors2(int iRow, const AliHLTTPCCATrackParam &t, float &Err2Y, float &Err2Z) const
mvz start 20.01.2010
friend std::ostream & operator<<(std::ostream &, const AliHLTTPCCAParam &)
mvz end 20.01.2010