PandaRoot
PndCATrackParam.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // $Id: PndCATrackParam.h,v 1.5 2011/05/20 16:28:05 fisyak Exp $
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 PNDCATRACKPARAM_H
11 #define PNDCATRACKPARAM_H
12 #include <string.h>
13 #include "PndCADef.h"
14 #include "PndCAMath.h"
15 #include "PndCATrackParamVector.h"
16 #include "PndCAHits.h"
17 
19 
28  // friend std::istream &operator>>( std::istream &, PndCATrackParam & );
29  // friend std::ostream &operator<<( std::ostream &, const PndCATrackParam & );
30  public:
32  PndCATrackParam(const TrackParamVector &v, int i) : fX(v.X()[i]), fSignCosPhi(v.SignCosPhi()[i]), fChi2(v.Chi2()[i]), fNDF(v.NDF()[i]), fAlpha(v.Angle()[i]), fISec(v.ISec()[i])
33  {
34  for (int j = 0; j < 5; ++j)
35  fP[j] = v.Par()[j][i];
36  for (int j = 0; j < 15; ++j)
37  fC[j] = v.Cov()[j][i];
38  }
39 
41  float fBethe;
42  float fE;
43  float fTheta2;
44  float fEP2;
45  float fSigmadE2;
46  float fK22;
47  float fK33;
48  float fK43;
49  float fK44;
50  };
51 
52  float X() const { return fX; }
53  float Y() const { return fP[0]; }
54  float Z() const { return fP[1]; }
55  float SinPhi() const { return fP[2]; }
56  float DzDs() const { return fP[3]; }
57  float QPt() const { return fP[4]; }
58  float QMomentum() const { return fP[4]; }
59 
64  float SignCosPhi() const { return fSignCosPhi; }
65  float Chi2() const { return fChi2; }
66  int NDF() const { return fNDF; }
67 
68  float Err2Y() const { return fC[0]; }
69  float Err2Z() const { return fC[2]; }
70  float Err2SinPhi() const { return fC[5]; }
71  float Err2DzDs() const { return fC[9]; }
72  float Err2QPt() const { return fC[14]; }
73 
74  float Angle() const { return fAlpha; }
75  int ISec() const { return fISec; }
76 
77  float GetX() const { return fX; }
78  float GetY() const { return fP[0]; }
79  float GetZ() const { return fP[1]; }
80  float GetSinPhi() const { return fP[2]; }
81  float GetDzDs() const { return fP[3]; }
82  float GetQPt() const { return fP[4]; }
83  float GetSignCosPhi() const { return fSignCosPhi; }
84  float GetChi2() const { return fChi2; }
85  int GetNDF() const { return fNDF; }
86 
87  float GetKappa(float Bz) const { return fP[4] * Bz; }
88  float GetCosPhiPositive() const { return CAMath::Sqrt(1 - SinPhi() * SinPhi()); }
89  float GetCosPhi() const { return fSignCosPhi * CAMath::Sqrt(1 - SinPhi() * SinPhi()); }
90 
91  float GetErr2Y() const { return fC[0]; }
92  float GetErr2Z() const { return fC[2]; }
93  float GetErr2SinPhi() const { return fC[5]; }
94  float GetErr2DzDs() const { return fC[9]; }
95  float GetErr2QPt() const { return fC[14]; }
96 
97  float Err2X1() const { return fC[0]; }
98  float Err2X2() const { return fC[2]; }
99  float Err2QMomentum() const { return fC[14]; }
100 
101  const float *Par() const { return fP; }
102  const float *Cov() const { return fC; }
103 
104  const float *GetPar() const { return fP; }
105  const float *GetCov() const { return fC; }
106 
107  void SetPar(int i, float v) { fP[i] = v; }
108  void SetCov(int i, float v) { fC[i] = v; }
109 
110  void SetX(float v) { fX = v; }
111  void SetY(float v) { fP[0] = v; }
112  void SetZ(float v) { fP[1] = v; }
113  void SetSinPhi(float v) { fP[2] = v; }
114  void SetDzDs(float v) { fP[3] = v; }
115  void SetQPt(float v) { fP[4] = v; }
116  void SetSignCosPhi(float v) { fSignCosPhi = v; }
117  void SetChi2(float v) { fChi2 = v; }
118  void SetNDF(int v) { fNDF = v; }
119 
120  void SetAngle(float v) { fAlpha = v; }
121  void SetISec(int v) { fISec = v; }
122 
123  void SetErr2QPt(float v) { fC[14] = v; }
124 
125  void InitDirection(float r0, float r1, float r2) // initialize direction parameters according to a given tangent vector
126  {
127  const float r = sqrt(r0 * r0 + r1 * r1);
128  SetSinPhi(r1 / r);
129  SetSignCosPhi(sign(r0));
130  SetDzDs(r2 / r);
131  }
132 
133  float GetDist2(const PndCATrackParam &t) const;
134  float GetDistXZ2(const PndCATrackParam &t) const;
135 
136  float GetS(float x, float y, float Bz) const;
137 
138  void GetDCAPoint(float x, float y, float z, float &px, float &py, float &pz, float Bz) const;
139 
140  bool TransportToX(float x, float Bz, float maxSinPhi = .999);
141  bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi = .999);
142 
143  bool TransportToX(float x, PndCATrackLinearisation &t0, float Bz, float maxSinPhi = .999, float *DL = nullptr);
144 
145  bool TransportToX(float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi = .999);
146 
147  bool TransportToXWithMaterial(float x, PndCATrackLinearisation &t0, PndCATrackFitParam &par, float Bz, float maxSinPhi = .999);
148 
149  bool TransportToXWithMaterial(float x, PndCATrackFitParam &par, float Bz, float maxSinPhi = .999);
150 
151  static float ApproximateBetheBloch(float beta2);
152  static float BetheBlochGeant(float bg, float kp0 = 2.33, float kp1 = 0.20, float kp2 = 3.00, float kp3 = 173e-9, float kp4 = 0.49848);
153  static float BetheBlochSolid(float bg);
154  static float BetheBlochGas(float bg);
155 
156  void CalculateFitParameters(PndCATrackFitParam &par, float mass = 0.13957);
157  bool CorrectForMeanMaterial(float xOverX0, float xTimesRho, const PndCATrackFitParam &par);
158 
159  bool Rotate(float alpha, float maxSinPhi = .999);
160  bool Rotate(float alpha, PndCATrackLinearisation &t0, float maxSinPhi = .999);
161 
162  void RotateXY(float alpha, float &x, float &y, float &sin) const;
163  bool Filter(float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi = .999);
164 
165  void Print() const;
166 
168  {
169  fC[0] = 10.f;
170  fC[1] = 0.f;
171  fC[2] = 10.f;
172  fC[3] = 0.f;
173  fC[4] = 0.f;
174  fC[5] = 1.f;
175  fC[6] = 0.f;
176  fC[7] = 0.f;
177  fC[8] = 0.f;
178  fC[9] = 1.f;
179  fC[10] = 0.f;
180  fC[11] = 0.f;
181  fC[12] = 0.f;
182  fC[13] = 0.f;
183  fC[14] = 10.f;
184  }
185 
186  PndCATrackParam GetGlobalParam(float alpha) const; // alpha - angle of the current slice
187 
188  void Reset()
189  {
190  fX = 0;
191  fSignCosPhi = 0;
192  for (int i = 0; i < 5; i++)
193  fP[i] = 0;
194  for (int i = 0; i < 15; i++)
195  fC[i] = 0;
196  fChi2 = 0;
197  fNDF = 0;
198  fISec = 0;
199  }
200 
201  bool Transport(const PndCAHit &hit, float Bz);
202  bool Filter(const PndCAHit &hit);
203 
204  bool IsValid() const { return fChi2 != -1; }
205  void SetAsInvalid() { fChi2 = -1; }
206 
207  private:
208  float fX; // x position
209  float fSignCosPhi; // sign of cosPhi // phi = arctg (Dy/Dx)
210  float fP[5]; // 'active' track parameters: Y, Z, SinPhi, Dz/Ds (ds = sqrt( dx^2 + dy^2 )), q/Pt
211  float fC[15]; // the covariance matrix for Y,Z,SinPhi,..
212  float fChi2; // the chi^2 value
213  int fNDF; // the Number of Degrees of Freedom
214 
215  float fAlpha; // coor system
216  int fISec;
217 };
218 
219 inline void PndCATrackParam::RotateXY(float alpha, float &x, float &y, float &sin) const
220 {
221  //* Rotate the coordinate system in XY on the angle alpha
222 
223  const float cA = CAMath::Cos(alpha);
224  const float sA = CAMath::Sin(alpha);
225 
226  x = (X() * cA + Y() * sA);
227  y = (-X() * sA + Y() * cA);
228  sin = -GetCosPhi() * sA + SinPhi() * cA;
229 }
230 
231 inline bool PndCATrackParam::Filter(float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi)
232 {
233  assert(maxSinPhi > 0.f);
234  //* Add the y,z measurement with the Kalman filter
235 
236  const float c00 = fC[0];
237  const float c10 = fC[1];
238  const float c11 = fC[2];
239  const float c20 = fC[3];
240  const float c21 = fC[4];
241  // float c22 = fC[5];
242  const float c30 = fC[6];
243  const float c31 = fC[7];
244  // float c32 = fC[8];
245  // float c33 = fC[9];
246  const float c40 = fC[10];
247  const float c41 = fC[11];
248  // float c42 = fC[12];
249  // float c43 = fC[13];
250  // float c44 = fC[14];
251 
252  float d = 1.f / (err2Y * err2Z + err2Y * c11 + err2Z * c00 + c00 * c11 - c10 * c10 - 2 * errYZ * c10 - errYZ * errYZ);
253  err2Y += c00;
254  err2Z += c11;
255  errYZ += c10;
256 
257  const float z0 = y - fP[0], z1 = z - fP[1];
258 
259  if (ISUNLIKELY(err2Y < 1.e-8f) || ISUNLIKELY(err2Z < 1.e-8f))
260  return 0;
261 
262  const float mS0 = err2Z * d;
263  const float mS1 = -errYZ * d;
264  const float mS2 = err2Y * d;
265 
266  // K = CHtS
267 
268  const float k00 = c00 * mS0 + c10 * mS1, k01 = c00 * mS1 + c10 * mS2, k10 = c10 * mS0 + c11 * mS1, k11 = c10 * mS1 + c11 * mS2, k20 = c20 * mS0 + c21 * mS1,
269  k21 = c20 * mS1 + c21 * mS2, k30 = c30 * mS0 + c31 * mS1, k31 = c30 * mS1 + c31 * mS2, k40 = c40 * mS0 + c41 * mS1, k41 = c40 * mS1 + c41 * mS2;
270 
271  const float sinPhi = fP[2] + k20 * z0 + k21 * z1;
272 
273  if (ISUNLIKELY(CAMath::Abs(sinPhi) >= maxSinPhi))
274  return 0;
275 
276  fNDF += 2;
277  fChi2 += mS0 * z0 * z0 + mS2 * z1 * z1 + 2 * z0 * z1 * mS1;
278 
279  fP[0] += k00 * z0 + k01 * z1;
280  fP[1] += k10 * z0 + k11 * z1;
281  fP[2] = sinPhi;
282  fP[3] += k30 * z0 + k31 * z1;
283  fP[4] += k40 * z0 + k41 * z1;
284 
285  fC[0] -= (k00 * c00 + k01 * c10); // c00
286 
287  fC[1] -= (k10 * c00 + k11 * c10); // c10
288  fC[2] -= (k10 * c10 + k11 * c11); // c11
289 
290  fC[3] -= (k20 * c00 + k21 * c10); // c20
291  fC[4] -= (k20 * c10 + k21 * c11); // c21
292  fC[5] -= (k20 * c20 + k21 * c21); // c22
293 
294  fC[6] -= (k30 * c00 + k31 * c10); // c30
295  fC[7] -= (k30 * c10 + k31 * c11); // c31
296  fC[8] -= (k30 * c20 + k31 * c21); // c32
297  fC[9] -= (k30 * c30 + k31 * c31); // c33
298 
299  fC[10] -= (k40 * c00 + k41 * c10); // c40
300  fC[11] -= (k40 * c10 + k41 * c11); // c41
301  fC[12] -= (k40 * c20 + k41 * c21); // c42
302  fC[13] -= (k40 * c30 + k41 * c31); // c43
303  fC[14] -= (k40 * c40 + k41 * c41); // c44
304 
305  return 1;
306 }
307 
308 inline float PndCATrackParam::ApproximateBetheBloch(float beta2)
309 {
310  //------------------------------------------------------------------
311  // This is an approximation of the Bethe-Bloch formula with
312  // the density effect taken into account at beta*gamma > 3.5
313  // (the approximation is reasonable only for solid materials)
314  //------------------------------------------------------------------
315  if (beta2 >= 1)
316  return 0;
317  else {
318  const float beta2_beta21i = beta2 / (1 - beta2);
319  if (beta2_beta21i > 12.25) // 3.5^2 = 12.25
320  return 0.153e-3 / beta2 * (9.94223 + 0.5 * log(beta2_beta21i) - beta2); // log( 3.5*5940 ) = 9.94223
321  else
322  return 0.153e-3 / beta2 * (8.6895 + log(beta2_beta21i) - beta2); // log( 5940 ) = 8.6895
323  }
324 }
325 
327 {
328  const float p2 = (1. + fP[3] * fP[3]);
329  const float k2 = fP[4] * fP[4];
330  const float mass2 = mass * mass;
331 
332  const float beta2 = p2 / (p2 + mass2 * k2);
333 
334  const float pp2 = (k2 > 1.e-8) ? p2 / k2 : 10000; // impuls 2
335 
336  // par.fBethe = BetheBlochGas( pp2/mass2);
337  par.fBethe = ApproximateBetheBloch(pp2 / mass2);
338  par.fE = CAMath::Sqrt(pp2 + mass2);
339  par.fTheta2 = 198.81e-6 / (beta2 * pp2); // 14.1^2 * 1e-6
340  par.fEP2 = par.fE / pp2; // have tried reduce number of "/", but it was slower. (may be bacause of additional of constants = memory)
341 
342  // Approximate energy loss fluctuation (M.Ivanov)
343 
344  const float knst = 0.07; // To be tuned.
345  par.fSigmadE2 = knst * par.fEP2 * fP[4];
346  par.fSigmadE2 = par.fSigmadE2 * par.fSigmadE2;
347 
348  par.fK22 = p2;
349  par.fK33 = par.fK22 * par.fK22;
350  par.fK43 = fP[3] * fP[4] * par.fK22;
351  par.fK44 = (p2 - 1.f) * k2;
352 }
353 
354 #include "PndCAMath.h"
355 #include "PndCATrackLinearisation.h"
356 
357 inline bool PndCATrackParam::TransportToX(float x, PndCATrackLinearisation &t0, float Bz, float maxSinPhi, float *DL)
358 {
359  //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz
360  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
361  //* linearisation of trajectory t0 is also transported to X=x,
362  //* returns 1 if OK
363  //*
364 
365  const float ex = t0.CosPhi();
366  const float ey = t0.SinPhi();
367  const float k = t0.QPt() * Bz;
368  const float dx = x - X();
369 
370  const float ey1 = k * dx + ey;
371 
372  // check for intersection with X=x
373 
374  if (CAMath::Abs(ey1) > maxSinPhi)
375  return 0;
376 
377  float ex1 = CAMath::Sqrt(1.f - ey1 * ey1);
378  if (ex < 0)
379  ex1 = -ex1;
380 
381  const float dx2 = dx * dx;
382  const float ss = ey + ey1;
383  const float cc = ex + ex1;
384 
385  if ((CAMath::Abs(cc) < 1.e-4 || CAMath::Abs(ex) < 1.e-4 || CAMath::Abs(ex1) < 1.e-4))
386  return 0;
387 
388  const float cci = 1.f / cc;
389  const float exi = 1.f / ex;
390  const float ex1i = 1.f / ex1;
391 
392  const float tg = ss * cci; // tan((phi1+phi)/2)
393 
394  const float dy = dx * tg;
395  float dl = dx * CAMath::Sqrt(1.f + tg * tg);
396 
397  if (cc < 0)
398  dl = -dl;
399  float dSin = dl * k * 0.5;
400  if (dSin > 1.f)
401  dSin = 1.f;
402  if (dSin < -1.f)
403  dSin = -1.f;
404  const float dS = (CAMath::Abs(k) > 1.e-4) ? (2 * CAMath::ASin(dSin) / k) : dl;
405  const float dz = dS * t0.DzDs();
406 
407  if (DL)
408  *DL = -dS * CAMath::Sqrt(1.f + t0.DzDs() * t0.DzDs());
409 
410  const float d[3] = {fP[2] - t0.SinPhi(), fP[3] - t0.DzDs(), fP[4] - t0.QPt()};
411 
412  // float H0[5] = { 1,0, h2, 0, h4 };
413  // float H1[5] = { 0, 1, 0, dS, 0 };
414  // float H2[5] = { 0, 0, 1, 0, dxBz };
415  // float H3[5] = { 0, 0, 0, 1, 0 };
416  // float H4[5] = { 0, 0, 0, 0, 1 };
417 
418  const float h2 = dx * (1.f + ey * ey1 + ex * ex1) * exi * ex1i * cci;
419  const float h4 = dx2 * (cc + ss * ey1 * ex1i) * cci * cci * Bz;
420  const float dxBz = dx * Bz;
421 
422  t0.SetCosPhi(ex1);
423  t0.SetSinPhi(ey1);
424 
425  fX = X() + dx;
426  fP[0] = Y() + dy + h2 * d[0] + h4 * d[2];
427  fP[1] = Z() + dz + dS * d[1];
428  fP[2] = t0.SinPhi() + d[0] + dxBz * d[2];
429  if (CAMath::Abs(fP[2]) > maxSinPhi)
430  fP[2] = t0.SinPhi();
431 
432 #if 1
433  const float c00 = fC[0];
434  const float c10 = fC[1];
435  const float c11 = fC[2];
436  const float c20 = fC[3];
437  const float c21 = fC[4];
438  const float c22 = fC[5];
439  const float c30 = fC[6];
440  const float c31 = fC[7];
441  const float c32 = fC[8];
442  const float c33 = fC[9];
443  const float c40 = fC[10];
444  const float c41 = fC[11];
445  const float c42 = fC[12];
446  const float c43 = fC[13];
447  const float c44 = fC[14];
448 
449  fC[0] = (c00 + h2 * h2 * c22 + h4 * h4 * c44 + 2.f * (h2 * c20 + h4 * c40 + h2 * h4 * c42));
450 
451  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * (c30 + h2 * c32 + h4 * c43);
452  fC[2] = c11 + 2.f * dS * c31 + dS * dS * c33;
453 
454  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * (c40 + h2 * c42 + h4 * c44);
455  fC[4] = c21 + dS * c32 + dxBz * (c41 + dS * c43);
456  fC[5] = c22 + 2.f * dxBz * c42 + dxBz * dxBz * c44;
457 
458  fC[6] = c30 + h2 * c32 + h4 * c43;
459  fC[7] = c31 + dS * c33;
460  fC[8] = c32 + dxBz * c43;
461  fC[9] = c33;
462 
463  fC[10] = c40 + h2 * c42 + h4 * c44;
464  fC[11] = c41 + dS * c43;
465  fC[12] = c42 + dxBz * c44;
466  fC[13] = c43;
467  fC[14] = c44;
468 #else
469  fC[0] = (fC[0] + h2 * h2 * fC[5] + h4 * h4 * fC[14] + 2 * (h2 * fC[3] + h4 * fC[10] + h2 * h4 * fC[12]));
470 
471  fC[1] = fC[1] + h2 * fC[4] + h4 * fC[11] + dS * (fC[6] + h2 * fC[8] + h4 * fC[13]);
472  fC[2] = fC[2] + 2 * dS * fC[7] + dS * dS * fC[9];
473 
474  fC[3] = fC[3] + h2 * fC[5] + h4 * fC[12] + dxBz * (fC[10] + h2 * fC[12] + h4 * fC[14]);
475  fC[4] = fC[4] + dS * fC[8] + dxBz * (fC[11] + dS * fC[13]);
476  fC[5] = fC[5] + 2 * dxBz * fC[12] + dxBz * dxBz * fC[14];
477 
478  fC[6] = fC[6] + h2 * fC[8] + h4 * fC[13];
479  fC[7] = fC[7] + dS * fC[9];
480  fC[8] = fC[8] + dxBz * fC[13];
481  fC[9] = fC[9];
482 
483  fC[10] = fC[10] + h2 * fC[12] + h4 * fC[14];
484  fC[11] = fC[11] + dS * fC[13];
485  fC[12] = fC[12] + dxBz * fC[14];
486  fC[13] = fC[13];
487  fC[14] = fC[14];
488 #endif
489 
490  // std::cout << fC[0] << " "<<fC1[0]<<" "<<fC[2] << " "<<fC1[2]<<" "<<fC[5] << " "<<fC1[5]<<" "<<fC[9] << " "<<fC1[9]<<" "<<fC[14] << "
491  // "<<fC1[14]<<std::endl;
492  return 1;
493 }
494 
495 inline bool PndCATrackParam::CorrectForMeanMaterial(float xOverX0, float xTimesRho, const PndCATrackFitParam &par)
496 {
497  //------------------------------------------------------------------
498  // This function corrects the track parameters for the crossed material.
499  // "xOverX0" - X/X0, the thickness in units of the radiation length.
500  // "xTimesRho" - is the product length*density (g/cm^2).
501  //------------------------------------------------------------------
502  // float &fC22 = fC[5];
503  // float &fC33 = fC[9];
504  // float &fC40 = fC[10];
505  // float &fC41 = fC[11];
506  // float &fC42 = fC[12];
507  // float &fC43 = fC[13];
508  // float &fC44 = fC[14];
509 
510  // Energy losses************************
511 
512  const float dE = par.fBethe * xTimesRho;
513  if (CAMath::Abs(dE) > 0.3 * par.fE)
514  return 0; // 30% energy loss is too much!
515  const float corr = (1. - par.fEP2 * dE);
516  if (corr < 0.3 || corr > 1.3)
517  return 0;
518 
519  fP[4] *= corr;
520  fC[10] *= corr;
521  fC[11] *= corr;
522  fC[12] *= corr;
523  fC[13] *= corr;
524  fC[14] *= corr * corr;
525  fC[14] += par.fSigmadE2 * CAMath::Abs(dE);
526  // std::cout << "dE "<<dE<<" corr "<<corr<<" fBethe " <<par.fBethe<<" XxRo "<<xTimesRho<<std::endl;
527 
528  // Multiple scattering******************
529 
530  const float theta2 = par.fTheta2 * CAMath::Abs(xOverX0);
531  fC[5] += theta2 * par.fK22 * (1. - fP[2] * fP[2]);
532  fC[9] += theta2 * par.fK33;
533  fC[13] += theta2 * par.fK43;
534  fC[14] += theta2 * par.fK44;
535 
536  return 1;
537 }
538 
539 inline bool PndCATrackParam::TransportToXWithMaterial(float x, PndCATrackLinearisation &t0, PndCATrackFitParam &par, float Bz, float maxSinPhi)
540 {
541  //* Transport the track parameters to X=x taking into account material budget
542 
543  const float kRho = 1.54e-3; // 1.025e-3 ;//0.9e-3;
544  // const float kRadLen = 29.532;//28.94;
545  // const float kRhoOverRadLen = kRho / kRadLen;
546  const float kRhoOverRadLen = 7.68e-5;
547  float dl;
548 
549  if (!TransportToX(x, t0, Bz, maxSinPhi, &dl))
550  return 0;
551 
552  UNUSED_PARAM3(kRho, kRhoOverRadLen, par); // TODO
553  // CorrectForMeanMaterial( dl*kRhoOverRadLen, dl*kRho, par );
554  return 1;
555 }
556 
557 inline bool PndCATrackParam::TransportToXWithMaterial(float x, PndCATrackFitParam &par, float Bz, float maxSinPhi)
558 {
559  //* Transport the track parameters to X=x taking into account material budget
560 
561  PndCATrackLinearisation t0(*this);
562  return TransportToXWithMaterial(x, t0, par, Bz, maxSinPhi);
563 }
564 
565 inline bool PndCATrackParam::Transport(const PndCAHit &hit, float Bz)
566 {
567  // TODO material. See Vector part
568  PndCATrackFitParam fitPar;
569  CalculateFitParameters(fitPar);
570  PndCATrackLinearisation tR(*this);
571  const bool rotated = Rotate(-fAlpha + hit.Angle(), tR, .999f);
572  PndCATrackLinearisation tE(*this);
573  const bool transported = TransportToXWithMaterial(hit.X0(), tE, fitPar, Bz, 0.999f);
574  return rotated & transported;
575 }
576 
577 inline bool PndCATrackParam::Filter(const PndCAHit &hit)
578 {
579  return Filter(hit.X1(), hit.X2(), hit.Err2X1(), hit.ErrX12(), hit.Err2X2(), 0.999f);
580 }
581 
583 
584 // std::istream &operator>>( std::istream &in, PndCATrackParam &ot );
585 // std::ostream &operator<<( std::ostream &out, const PndCATrackParam &ot );
586 
587 #endif
static T ASin(const T &x)
float DzDs() const
bool CorrectForMeanMaterial(float xOverX0, float xTimesRho, const PndCATrackFitParam &par)
float GetErr2QPt() const
float GetDist2(const PndCATrackParam &t) const
void SetZ(float v)
float GetY() const
bool Filter(float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi=.999)
float GetS(float x, float y, float Bz) const
const float * GetCov() const
const float * Cov() const
void SetCov(int i, float v)
bool Transport(const PndCAHit &hit, float Bz)
bool Rotate(float alpha, float maxSinPhi=.999)
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:28
static float BetheBlochGeant(float bg, float kp0=2.33, float kp1=0.20, float kp2=3.00, float kp3=173e-9, float kp4=0.49848)
float Chi2() const
static T Sqrt(const T &x)
Definition: PndCAMath.h:45
bool IsValid() const
float Angle() const
Definition: PndCAHits.h:52
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:118
static T Sin(const T &x)
Definition: PndCAMath.h:71
PndCATrackParam TrackParam
void SetSignCosPhi(float v)
float GetQPt() const
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:117
void SetX(float v)
float Err2QPt() const
void GetDCAPoint(float x, float y, float z, float &px, float &py, float &pz, float Bz) const
float Err2X1() const
Definition: PndCAHits.h:39
const float * Par() const
static T Cos(const T &x)
Definition: PndCAMath.h:76
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)
float SinPhi() const
__m128 v
Definition: P4_F32vec4.h:3
const float * GetPar() const
float Z() const
unsigned int i
Definition: P4_F32vec4.h:21
float Err2DzDs() const
static T Abs(const T &x)
Definition: PndCAMath.h:56
float Y() const
void InitDirection(float r0, float r1, float r2)
void SetSinPhi(float v)
void SetDzDs(float v)
float GetErr2SinPhi() const
float Err2Y() const
static float BetheBlochSolid(float bg)
float GetX() const
void SetISec(int v)
int NDF() const
void SetPar(int i, float v)
float GetSignCosPhi() const
float GetDistXZ2(const PndCATrackParam &t) const
float GetErr2Y() const
void SetQPt(float v)
float X() const
int ISec() const
float Err2X2() const
Definition: PndCAHits.h:41
float Err2QMomentum() const
float Err2X1() const
float GetDzDs() const
float SignCosPhi() const
float Angle() const
float GetChi2() const
float GetKappa(float Bz) const
bool TransportToX(float x, float Bz, float maxSinPhi=.999)
float X1() const
Definition: PndCAHits.h:36
float GetErr2Z() const
float f
Definition: P4_F32vec4.h:20
void Print() const
#define ISUNLIKELY(x)
Definition: PndCADef.h:157
static float BetheBlochGas(float bg)
PndCATrackParam GetGlobalParam(float alpha) const
int sign(T val)
Definition: PndCADef.h:49
float QPt() const
double alpha
Definition: f_Init.h:7
float GetCosPhi() const
static float ApproximateBetheBloch(float beta2)
float GetErr2DzDs() const
void SetErr2QPt(float v)
float X2() const
Definition: PndCAHits.h:37
float Err2X2() const
const float_v & Cov(int i) const
float Err2SinPhi() const
int GetNDF() const
float ErrX12() const
Definition: PndCAHits.h:40
float GetSinPhi() const
void SetAngle(float v)
float QMomentum() const
void SetY(float v)
void CalculateFitParameters(PndCATrackFitParam &par, float mass=0.13957)
float GetCosPhiPositive() const
float GetZ() const
PndCATrackParam(const TrackParamVector &v, int i)
double pz[39]
Definition: pipisigmas.h:13
float Err2Z() const
void SetChi2(float v)
float X0() const
Definition: PndCAHits.h:35
const float_v & Par(int i) const
void RotateXY(float alpha, float &x, float &y, float &sin) const
void SetNDF(int v)