24 #include "AliHLTTPCCAParam.h"
25 #include "AliHLTTPCCAMath.h"
31 : fISlice( 0 ), fNRows( 0 ), fNInnerRows(0), fAlpha( 0.174533 ), fDAlpha( 0.349066 ),
32 fCosAlpha( 0 ), fSinAlpha( 0 ), fAngleMin( 0 ), fAngleMax( 0 ), fRMin( 83.65 ), fRMax( 133.3 ),
33 fZMin( 0.0529937 ), fZMax( 249.778 ), fErrX( 0 ), fErrY( 0 ), fErrZ( 0.228808 ), fPadPitch( 0.4 ), fBz( -5. ),
34 fHitPickUpFactor( 1. ),
35 fMaxTrackMatchDRow( 4 ), fTrackConnectionFactor( 3.5 ), fTrackChiCut( 3.5 ), fTrackChi2Cut( 10 )
36 ,fRowX(0), fRecoType(0)
83 fParamS0Par[0][0][0] = 0.0004f;
84 fParamS0Par[0][0][1] = 0.001720216f;
85 fParamS0Par[0][0][2] = 0.0236289f;
86 fParamS0Par[0][0][3] = 0.001096839f;
87 fParamS0Par[0][0][4] = 0.007570851f;
88 fParamS0Par[0][0][5] = 0.01857614f;
89 fParamS0Par[0][0][6] = 0.0f;
90 fParamS0Par[0][1][0] = 0.001534805f;
91 fParamS0Par[0][1][1] = 0.001422267f;
92 fParamS0Par[0][1][2] = 0.07089186f;
93 fParamS0Par[0][1][3] = 0.002919157f;
94 fParamS0Par[0][1][4] = 0.006362385f;
95 fParamS0Par[0][1][5] = 0.06090711f;
96 fParamS0Par[0][1][6] = 0.0f;
97 fParamS0Par[0][2][0] = 0.0f;
98 fParamS0Par[0][2][1] = 0.0f;
99 fParamS0Par[0][2][2] = 0.0f;
100 fParamS0Par[0][2][3] = 0.0f;
101 fParamS0Par[0][2][4] = 0.0f;
102 fParamS0Par[0][2][5] = 0.0f;
103 fParamS0Par[0][2][6] = 0.0f;
104 fParamS0Par[1][0][0] = 0.0f;
105 fParamS0Par[1][0][1] = 0.0f;
106 fParamS0Par[1][0][2] = 0.0f;
107 fParamS0Par[1][0][3] = 0.0f;
108 fParamS0Par[1][0][4] = 0.0f;
109 fParamS0Par[1][0][5] = 0.0f;
110 fParamS0Par[1][0][6] = 0.0f;
111 fParamS0Par[1][1][0] = 0.0f;
112 fParamS0Par[1][1][1] = 0.0f;
113 fParamS0Par[1][1][2] = 0.0f;
114 fParamS0Par[1][1][3] = 0.0f;
115 fParamS0Par[1][1][4] = 0.0f;
116 fParamS0Par[1][1][5] = 0.0f;
117 fParamS0Par[1][1][6] = 0.0f;
118 fParamS0Par[1][2][0] = 0.0f;
119 fParamS0Par[1][2][1] = 0.0f;
120 fParamS0Par[1][2][2] = 0.0f;
121 fParamS0Par[1][2][3] = 0.0f;
122 fParamS0Par[1][2][4] = 0.0f;
123 fParamS0Par[1][2][5] = 0.0f;
124 fParamS0Par[1][2][6] = 0.0f;
126 const double kCLight = 0.000299792458;
128 fPolinomialFieldBz[0] = kCLight * 4.99643;
129 fPolinomialFieldBz[1] = kCLight * -2.27193e-06;
130 fPolinomialFieldBz[2] = kCLight * 0.000116475;
131 fPolinomialFieldBz[3] = kCLight * -1.49956e-06;
132 fPolinomialFieldBz[4] = kCLight * -1.01721e-07;
133 fPolinomialFieldBz[5] = kCLight * 4.85701e-07;
138 void AliHLTTPCCAParam::Initialize(
int iSlice,
139 int nRows,
float rowX[],
140 float alpha,
float dAlpha,
141 float rMin,
float rMax,
142 float zMin,
float zMax,
143 float padPitch,
float zSigma,
155 fPadPitch = padPitch;
160 fRowX.resize(fNRows);
161 for (
int irow = 0; irow < nRows; irow++ ) {
162 fRowX[irow] = rowX[irow];
168 void AliHLTTPCCAParam::Update()
171 fCosAlpha = CAMath::Cos( fAlpha );
172 fSinAlpha = CAMath::Sin( fAlpha );
173 fAngleMin = fAlpha - fDAlpha / 2.f;
174 fAngleMax = fAlpha + fDAlpha / 2.f;
175 fErrX = fPadPitch / CAMath::Sqrt( 12.f );
176 fTrackChi2Cut = fTrackChiCut * fTrackChiCut;
179 void AliHLTTPCCAParam::Slice2Global(
float x,
float y,
float z,
180 float *X,
float *Y,
float *Z )
const
183 *X = x * fCosAlpha - y * fSinAlpha;
184 *Y = y * fCosAlpha + x * fSinAlpha;
188 void AliHLTTPCCAParam::Global2Slice(
float X,
float Y,
float Z,
189 float *x,
float *y,
float *z )
const
192 *x = X * fCosAlpha + Y * fSinAlpha;
193 *y = Y * fCosAlpha - X * fSinAlpha;
197 float AliHLTTPCCAParam::GetClusterError2(
int yz,
int type,
float z,
float angle )
const
200 const float angle2 = angle * angle;
201 const float *c = fParamS0Par[yz][type];
202 const float v = c[0] + z * ( c[1] + c[3] * z ) + angle2 * ( c[2] + angle2 * c[4] + c[5] * z );
204 return CAMath::Abs( v );
224 enum {kYErr=0,kZErr=1,kWidTrk=2,kThkDet=3,kYDiff=4,kZDiff=5};
226 const int type = errorType( iRow );
227 z = (200. - CAMath::Abs(z)) * 0.01;
230 float sin2Phi = t.GetSinPhi()*t.GetSinPhi();
231 float cos2Phi = (1.f - sin2Phi);
232 if (cos2Phi<0.0001) cos2Phi=0.0001;
233 float tg2Phi = sin2Phi/cos2Phi;
235 float tg2Lambda = t.DzDs()*t.DzDs();
237 const float *c = fParamS0Par[0][type];
240 Err2Y = c[0] + c[1]*z/cos2Phi + c[2]*tg2Phi;
241 Err2Z = c[3] + c[4]*z*(1.f+tg2Lambda) + c[5]*tg2Lambda;
245 float cos2lambda = 1/(tg2Lambda+1);
246 float sin2lambda = tg2Lambda*cos2lambda;
247 z = (210. - CAMath::Abs(z)) * 0.01;
249 Err2Y = (c[kThkDet]*sin2Phi + c[kWidTrk])
250 / (cos2Phi) + c[kYErr] + c[kYDiff]*z;
251 Err2Z = (c[kThkDet]*(sin2lambda) + c[kWidTrk]*((sin2Phi)*(sin2lambda)+cos2Phi))
252 / (cos2Phi*cos2lambda) + c[kZErr] + c[kZDiff]*z;
258 if(Err2Y<1e-6) Err2Y = 1e-6;
259 if(Err2Z<1e-6) Err2Z = 1e-6;
261 if(Err2Y>1.f) Err2Y = 1.f;
262 if(Err2Z>1.f) Err2Z = 1.f;
271 out << p.fISlice << std::endl;
272 out << p.fNRows << std::endl;
273 out << p.fAlpha << std::endl;
274 out << p.fDAlpha << std::endl;
275 out << p.fCosAlpha << std::endl;
276 out << p.fSinAlpha << std::endl;
277 out << p.fAngleMin << std::endl;
278 out << p.fAngleMax << std::endl;
279 out << p.fRMin << std::endl;
280 out << p.fRMax << std::endl;
281 out << p.fZMin << std::endl;
282 out << p.fZMax << std::endl;
283 out << p.fErrX << std::endl;
284 out << p.fErrY << std::endl;
285 out << p.fErrZ << std::endl;
286 out << p.fPadPitch << std::endl;
287 out << p.fBz << std::endl;
288 out << p.fHitPickUpFactor << std::endl;
289 out << p.fMaxTrackMatchDRow << std::endl;
290 out << p.fTrackConnectionFactor << std::endl;
291 out << p.fTrackChiCut << std::endl;
292 out << p.fTrackChi2Cut << std::endl;
293 for (
int iRow = 0; iRow < p.fNRows; iRow++ ) {
294 out << p.fRowX[iRow] << std::endl;
297 for (
int i = 0; i < 2; i++ )
298 for (
int j = 0; j < 3; j++ )
299 for (
int k = 0; k < 7; k++ )
300 out << p.fParamS0Par[i][j][k] << std::endl;
312 p.SetNInnerRows( 13 );
328 in >> p.fHitPickUpFactor;
329 in >> p.fMaxTrackMatchDRow;
330 in >> p.fTrackConnectionFactor;
331 in >> p.fTrackChiCut;
332 in >> p.fTrackChi2Cut;
333 p.fRowX.resize(p.fNRows);
334 for (
int iRow = 0; iRow < p.fNRows; iRow++ ) {
338 for (
int i = 0; i < 2; i++ )
339 for (
int j = 0; j < 3; j++ )
340 for (
int k = 0; k < 7; k++ )
341 in >> p.fParamS0Par[i][j][k];
346 #include "BinaryStoreHelper.h"
348 void AliHLTTPCCAParam::StoreToFile( FILE *f )
const
350 BinaryStoreWrite( *
this, f );
353 void AliHLTTPCCAParam::RestoreFromFile( FILE *f )
355 BinaryStoreRead( *
this, f );
void GetClusterErrors2(int iRow, const AliHLTTPCCATrackParam &t, float &Err2Y, float &Err2Z) const
mvz start 20.01.2010