PandaRoot
PndCATrackParam Class Reference

#include <PndCATrackParam.h>

Classes

struct  PndCATrackFitParam
 

Public Member Functions

 PndCATrackParam ()
 
 PndCATrackParam (const TrackParamVector &v, int i)
 
float X () const
 
float Y () const
 
float Z () const
 
float SinPhi () const
 
float DzDs () const
 
float QPt () const
 
float QMomentum () const
 
float SignCosPhi () const
 
float Chi2 () const
 
int NDF () const
 
float Err2Y () const
 
float Err2Z () const
 
float Err2SinPhi () const
 
float Err2DzDs () const
 
float Err2QPt () const
 
float Angle () const
 
int ISec () const
 
float GetX () const
 
float GetY () const
 
float GetZ () const
 
float GetSinPhi () const
 
float GetDzDs () const
 
float GetQPt () const
 
float GetSignCosPhi () const
 
float GetChi2 () const
 
int GetNDF () const
 
float GetKappa (float Bz) const
 
float GetCosPhiPositive () const
 
float GetCosPhi () const
 
float GetErr2Y () const
 
float GetErr2Z () const
 
float GetErr2SinPhi () const
 
float GetErr2DzDs () const
 
float GetErr2QPt () const
 
float Err2X1 () const
 
float Err2X2 () const
 
float Err2QMomentum () const
 
const float * Par () const
 
const float * Cov () const
 
const float * GetPar () const
 
const float * GetCov () const
 
void SetPar (int i, float v)
 
void SetCov (int i, float v)
 
void SetX (float v)
 
void SetY (float v)
 
void SetZ (float v)
 
void SetSinPhi (float v)
 
void SetDzDs (float v)
 
void SetQPt (float v)
 
void SetSignCosPhi (float v)
 
void SetChi2 (float v)
 
void SetNDF (int v)
 
void SetAngle (float v)
 
void SetISec (int v)
 
void SetErr2QPt (float v)
 
void InitDirection (float r0, float r1, float r2)
 
float GetDist2 (const PndCATrackParam &t) const
 
float GetDistXZ2 (const PndCATrackParam &t) const
 
float GetS (float x, float y, float Bz) const
 
void GetDCAPoint (float x, float y, float z, float &px, float &py, float &pz, float Bz) const
 
bool TransportToX (float x, float Bz, float maxSinPhi=.999)
 
bool TransportToXWithMaterial (float x, float Bz, float maxSinPhi=.999)
 
bool TransportToX (float x, PndCATrackLinearisation &t0, float Bz, float maxSinPhi=.999, float *DL=nullptr)
 
bool TransportToX (float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi=.999)
 
bool TransportToXWithMaterial (float x, PndCATrackLinearisation &t0, PndCATrackFitParam &par, float Bz, float maxSinPhi=.999)
 
bool TransportToXWithMaterial (float x, PndCATrackFitParam &par, float Bz, float maxSinPhi=.999)
 
void CalculateFitParameters (PndCATrackFitParam &par, float mass=0.13957)
 
bool CorrectForMeanMaterial (float xOverX0, float xTimesRho, const PndCATrackFitParam &par)
 
bool Rotate (float alpha, float maxSinPhi=.999)
 
bool Rotate (float alpha, PndCATrackLinearisation &t0, float maxSinPhi=.999)
 
void RotateXY (float alpha, float &x, float &y, float &sin) const
 
bool Filter (float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi=.999)
 
void Print () const
 
void ResetCovMatrix ()
 
PndCATrackParam GetGlobalParam (float alpha) const
 
void Reset ()
 
bool Transport (const PndCAHit &hit, float Bz)
 
bool Filter (const PndCAHit &hit)
 
bool IsValid () const
 
void SetAsInvalid ()
 

Static Public Member Functions

static float ApproximateBetheBloch (float beta2)
 
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)
 
static float BetheBlochSolid (float bg)
 
static float BetheBlochGas (float bg)
 

Detailed Description

PndCATrackParam class describes the track parametrisation which is used by the PndCATracker slice tracker.

Definition at line 27 of file PndCATrackParam.h.

Constructor & Destructor Documentation

◆ PndCATrackParam() [1/2]

PndCATrackParam::PndCATrackParam ( )
inline

Definition at line 31 of file PndCATrackParam.h.

References Reset().

31 { Reset(); }

◆ PndCATrackParam() [2/2]

PndCATrackParam::PndCATrackParam ( const TrackParamVector v,
int  i 
)
inline

Definition at line 32 of file PndCATrackParam.h.

References PndCATrackParamVector::Cov(), i, and PndCATrackParamVector::Par().

32  : 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  }
unsigned int i
Definition: P4_F32vec4.h:21
const float_v & Cov(int i) const
const float_v & Par(int i) const

Member Function Documentation

◆ Angle()

float PndCATrackParam::Angle ( ) const
inline

Definition at line 74 of file PndCATrackParam.h.

74 { return fAlpha; }

◆ ApproximateBetheBloch()

float PndCATrackParam::ApproximateBetheBloch ( float  beta2)
inlinestatic

Definition at line 308 of file PndCATrackParam.h.

References log().

Referenced by CalculateFitParameters(), and InitDirection().

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 }
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:117

◆ BetheBlochGas()

static float PndCATrackParam::BetheBlochGas ( float  bg)
static

Referenced by InitDirection().

◆ BetheBlochGeant()

static float PndCATrackParam::BetheBlochGeant ( float  bg,
float  kp0 = 2.33,
float  kp1 = 0.20,
float  kp2 = 3.00,
float  kp3 = 173e-9,
float  kp4 = 0.49848 
)
static

Referenced by InitDirection().

◆ BetheBlochSolid()

static float PndCATrackParam::BetheBlochSolid ( float  bg)
static

Referenced by InitDirection().

◆ CalculateFitParameters()

void PndCATrackParam::CalculateFitParameters ( PndCATrackFitParam par,
float  mass = 0.13957 
)
inline

Definition at line 326 of file PndCATrackParam.h.

References ApproximateBetheBloch(), PndCATrackParam::PndCATrackFitParam::fBethe, PndCATrackParam::PndCATrackFitParam::fE, PndCATrackParam::PndCATrackFitParam::fEP2, PndCATrackParam::PndCATrackFitParam::fK22, PndCATrackParam::PndCATrackFitParam::fK33, PndCATrackParam::PndCATrackFitParam::fK43, PndCATrackParam::PndCATrackFitParam::fK44, PndCATrackParam::PndCATrackFitParam::fSigmadE2, PndCATrackParam::PndCATrackFitParam::fTheta2, and CAMath::Sqrt().

Referenced by InitDirection(), and Transport().

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 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:45
static float ApproximateBetheBloch(float beta2)

◆ Chi2()

float PndCATrackParam::Chi2 ( ) const
inline

Definition at line 65 of file PndCATrackParam.h.

Referenced by PndCATrack::Fit().

65 { return fChi2; }

◆ CorrectForMeanMaterial()

bool PndCATrackParam::CorrectForMeanMaterial ( float  xOverX0,
float  xTimesRho,
const PndCATrackFitParam par 
)
inline

Definition at line 495 of file PndCATrackParam.h.

References CAMath::Abs(), PndCATrackParam::PndCATrackFitParam::fBethe, PndCATrackParam::PndCATrackFitParam::fE, PndCATrackParam::PndCATrackFitParam::fEP2, PndCATrackParam::PndCATrackFitParam::fK22, PndCATrackParam::PndCATrackFitParam::fK33, PndCATrackParam::PndCATrackFitParam::fK43, PndCATrackParam::PndCATrackFitParam::fK44, PndCATrackParam::PndCATrackFitParam::fSigmadE2, and PndCATrackParam::PndCATrackFitParam::fTheta2.

Referenced by InitDirection().

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 }
static T Abs(const T &x)
Definition: PndCAMath.h:56

◆ Cov()

const float* PndCATrackParam::Cov ( ) const
inline

Definition at line 102 of file PndCATrackParam.h.

102 { return fC; }

◆ DzDs()

float PndCATrackParam::DzDs ( ) const
inline

Definition at line 56 of file PndCATrackParam.h.

56 { return fP[3]; }

◆ Err2DzDs()

float PndCATrackParam::Err2DzDs ( ) const
inline

Definition at line 71 of file PndCATrackParam.h.

71 { return fC[9]; }

◆ Err2QMomentum()

float PndCATrackParam::Err2QMomentum ( ) const
inline

Definition at line 99 of file PndCATrackParam.h.

Referenced by PndCANPlet::QMomentumErr(), and PndCANPlet::QMomentumErr2().

99 { return fC[14]; }

◆ Err2QPt()

float PndCATrackParam::Err2QPt ( ) const
inline

Definition at line 72 of file PndCATrackParam.h.

72 { return fC[14]; }

◆ Err2SinPhi()

float PndCATrackParam::Err2SinPhi ( ) const
inline

Definition at line 70 of file PndCATrackParam.h.

70 { return fC[5]; }

◆ Err2X1()

float PndCATrackParam::Err2X1 ( ) const
inline

Definition at line 97 of file PndCATrackParam.h.

97 { return fC[0]; }

◆ Err2X2()

float PndCATrackParam::Err2X2 ( ) const
inline

Definition at line 98 of file PndCATrackParam.h.

98 { return fC[2]; }

◆ Err2Y()

float PndCATrackParam::Err2Y ( ) const
inline

Definition at line 68 of file PndCATrackParam.h.

68 { return fC[0]; }

◆ Err2Z()

float PndCATrackParam::Err2Z ( ) const
inline

Definition at line 69 of file PndCATrackParam.h.

69 { return fC[2]; }

◆ Filter() [1/2]

bool PndCATrackParam::Filter ( float  y,
float  z,
float  err2Y,
float  errYZ,
float  err2Z,
float  maxSinPhi = .999 
)
inline

Definition at line 231 of file PndCATrackParam.h.

References CAMath::Abs(), f, and ISUNLIKELY.

Referenced by Filter(), InitDirection(), and Reset().

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 }
static T Abs(const T &x)
Definition: PndCAMath.h:56
float f
Definition: P4_F32vec4.h:20
#define ISUNLIKELY(x)
Definition: PndCADef.h:157

◆ Filter() [2/2]

bool PndCATrackParam::Filter ( const PndCAHit hit)
inline

Definition at line 577 of file PndCATrackParam.h.

References PndCAHit::Err2X1(), PndCAHit::Err2X2(), PndCAHit::ErrX12(), Filter(), PndCAHit::X1(), and PndCAHit::X2().

578 {
579  return Filter(hit.X1(), hit.X2(), hit.Err2X1(), hit.ErrX12(), hit.Err2X2(), 0.999f);
580 }
bool Filter(float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi=.999)
float Err2X1() const
Definition: PndCAHits.h:39
float Err2X2() const
Definition: PndCAHits.h:41
float X1() const
Definition: PndCAHits.h:36
float X2() const
Definition: PndCAHits.h:37
float ErrX12() const
Definition: PndCAHits.h:40

◆ GetChi2()

float PndCATrackParam::GetChi2 ( ) const
inline

Definition at line 84 of file PndCATrackParam.h.

84 { return fChi2; }

◆ GetCosPhi()

float PndCATrackParam::GetCosPhi ( ) const
inline

Definition at line 89 of file PndCATrackParam.h.

References SinPhi(), and CAMath::Sqrt().

Referenced by RotateXY().

89 { return fSignCosPhi * CAMath::Sqrt(1 - SinPhi() * SinPhi()); }
static T Sqrt(const T &x)
Definition: PndCAMath.h:45
float SinPhi() const

◆ GetCosPhiPositive()

float PndCATrackParam::GetCosPhiPositive ( ) const
inline

Definition at line 88 of file PndCATrackParam.h.

References SinPhi(), and CAMath::Sqrt().

88 { return CAMath::Sqrt(1 - SinPhi() * SinPhi()); }
static T Sqrt(const T &x)
Definition: PndCAMath.h:45
float SinPhi() const

◆ GetCov()

const float* PndCATrackParam::GetCov ( ) const
inline

Definition at line 105 of file PndCATrackParam.h.

105 { return fC; }

◆ GetDCAPoint()

void PndCATrackParam::GetDCAPoint ( float  x,
float  y,
float  z,
float &  px,
float &  py,
float &  pz,
float  Bz 
) const

Referenced by InitDirection().

◆ GetDist2()

float PndCATrackParam::GetDist2 ( const PndCATrackParam t) const

Referenced by InitDirection().

◆ GetDistXZ2()

float PndCATrackParam::GetDistXZ2 ( const PndCATrackParam t) const

Referenced by InitDirection().

◆ GetDzDs()

float PndCATrackParam::GetDzDs ( ) const
inline

Definition at line 81 of file PndCATrackParam.h.

81 { return fP[3]; }

◆ GetErr2DzDs()

float PndCATrackParam::GetErr2DzDs ( ) const
inline

Definition at line 94 of file PndCATrackParam.h.

94 { return fC[9]; }

◆ GetErr2QPt()

float PndCATrackParam::GetErr2QPt ( ) const
inline

Definition at line 95 of file PndCATrackParam.h.

95 { return fC[14]; }

◆ GetErr2SinPhi()

float PndCATrackParam::GetErr2SinPhi ( ) const
inline

Definition at line 93 of file PndCATrackParam.h.

93 { return fC[5]; }

◆ GetErr2Y()

float PndCATrackParam::GetErr2Y ( ) const
inline

Definition at line 91 of file PndCATrackParam.h.

91 { return fC[0]; }

◆ GetErr2Z()

float PndCATrackParam::GetErr2Z ( ) const
inline

Definition at line 92 of file PndCATrackParam.h.

92 { return fC[2]; }

◆ GetGlobalParam()

PndCATrackParam PndCATrackParam::GetGlobalParam ( float  alpha) const

Referenced by ResetCovMatrix().

◆ GetKappa()

float PndCATrackParam::GetKappa ( float  Bz) const
inline

Definition at line 87 of file PndCATrackParam.h.

87 { return fP[4] * Bz; }

◆ GetNDF()

int PndCATrackParam::GetNDF ( ) const
inline

Definition at line 85 of file PndCATrackParam.h.

85 { return fNDF; }

◆ GetPar()

const float* PndCATrackParam::GetPar ( ) const
inline

Definition at line 104 of file PndCATrackParam.h.

104 { return fP; }

◆ GetQPt()

float PndCATrackParam::GetQPt ( ) const
inline

Definition at line 82 of file PndCATrackParam.h.

82 { return fP[4]; }

◆ GetS()

float PndCATrackParam::GetS ( float  x,
float  y,
float  Bz 
) const

Referenced by InitDirection().

◆ GetSignCosPhi()

float PndCATrackParam::GetSignCosPhi ( ) const
inline

Definition at line 83 of file PndCATrackParam.h.

83 { return fSignCosPhi; }

◆ GetSinPhi()

float PndCATrackParam::GetSinPhi ( ) const
inline

Definition at line 80 of file PndCATrackParam.h.

80 { return fP[2]; }

◆ GetX()

float PndCATrackParam::GetX ( ) const
inline

Definition at line 77 of file PndCATrackParam.h.

77 { return fX; }

◆ GetY()

float PndCATrackParam::GetY ( ) const
inline

Definition at line 78 of file PndCATrackParam.h.

78 { return fP[0]; }

◆ GetZ()

float PndCATrackParam::GetZ ( ) const
inline

Definition at line 79 of file PndCATrackParam.h.

79 { return fP[1]; }

◆ InitDirection()

void PndCATrackParam::InitDirection ( float  r0,
float  r1,
float  r2 
)
inline

Definition at line 125 of file PndCATrackParam.h.

References alpha, ApproximateBetheBloch(), BetheBlochGas(), BetheBlochGeant(), BetheBlochSolid(), CalculateFitParameters(), CorrectForMeanMaterial(), Filter(), GetDCAPoint(), GetDist2(), GetDistXZ2(), GetS(), Print(), pz, Rotate(), RotateXY(), SetDzDs(), SetSignCosPhi(), SetSinPhi(), sign(), sin(), sqrt(), TransportToX(), and TransportToXWithMaterial().

126  {
127  const float r = sqrt(r0 * r0 + r1 * r1);
128  SetSinPhi(r1 / r);
129  SetSignCosPhi(sign(r0));
130  SetDzDs(r2 / r);
131  }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:28
void SetSignCosPhi(float v)
void SetSinPhi(float v)
void SetDzDs(float v)
int sign(T val)
Definition: PndCADef.h:49

◆ ISec()

int PndCATrackParam::ISec ( ) const
inline

Definition at line 75 of file PndCATrackParam.h.

75 { return fISec; }

◆ IsValid()

bool PndCATrackParam::IsValid ( ) const
inline

Definition at line 204 of file PndCATrackParam.h.

204 { return fChi2 != -1; }

◆ NDF()

int PndCATrackParam::NDF ( ) const
inline

Definition at line 66 of file PndCATrackParam.h.

Referenced by PndCATrack::Fit().

66 { return fNDF; }

◆ Par()

const float* PndCATrackParam::Par ( ) const
inline

Definition at line 101 of file PndCATrackParam.h.

101 { return fP; }

◆ Print()

void PndCATrackParam::Print ( ) const

Referenced by InitDirection().

◆ QMomentum()

float PndCATrackParam::QMomentum ( ) const
inline

Definition at line 58 of file PndCATrackParam.h.

Referenced by PndCANPlet::QMomentum().

58 { return fP[4]; }

◆ QPt()

float PndCATrackParam::QPt ( ) const
inline

Definition at line 57 of file PndCATrackParam.h.

57 { return fP[4]; }

◆ Reset()

void PndCATrackParam::Reset ( )
inline

Definition at line 188 of file PndCATrackParam.h.

References Filter(), i, and Transport().

Referenced by PndCATrackParam().

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  }
unsigned int i
Definition: P4_F32vec4.h:21

◆ ResetCovMatrix()

void PndCATrackParam::ResetCovMatrix ( )
inline

Definition at line 167 of file PndCATrackParam.h.

References GetGlobalParam().

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  }

◆ Rotate() [1/2]

bool PndCATrackParam::Rotate ( float  alpha,
float  maxSinPhi = .999 
)

Referenced by InitDirection(), and Transport().

◆ Rotate() [2/2]

bool PndCATrackParam::Rotate ( float  alpha,
PndCATrackLinearisation t0,
float  maxSinPhi = .999 
)

◆ RotateXY()

void PndCATrackParam::RotateXY ( float  alpha,
float &  x,
float &  y,
float &  sin 
) const
inline

Definition at line 219 of file PndCATrackParam.h.

References CAMath::Cos(), GetCosPhi(), CAMath::Sin(), SinPhi(), X(), and Y().

Referenced by InitDirection().

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 }
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:118
static T Sin(const T &x)
Definition: PndCAMath.h:71
static T Cos(const T &x)
Definition: PndCAMath.h:76
float SinPhi() const
float Y() const
float X() const
double alpha
Definition: f_Init.h:7
float GetCosPhi() const

◆ SetAngle()

void PndCATrackParam::SetAngle ( float  v)
inline

Definition at line 120 of file PndCATrackParam.h.

References v.

120 { fAlpha = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetAsInvalid()

void PndCATrackParam::SetAsInvalid ( )
inline

Definition at line 205 of file PndCATrackParam.h.

205 { fChi2 = -1; }

◆ SetChi2()

void PndCATrackParam::SetChi2 ( float  v)
inline

Definition at line 117 of file PndCATrackParam.h.

References v.

117 { fChi2 = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetCov()

void PndCATrackParam::SetCov ( int  i,
float  v 
)
inline

Definition at line 108 of file PndCATrackParam.h.

References i, and v.

108 { fC[i] = v; }
__m128 v
Definition: P4_F32vec4.h:3
unsigned int i
Definition: P4_F32vec4.h:21

◆ SetDzDs()

void PndCATrackParam::SetDzDs ( float  v)
inline

Definition at line 114 of file PndCATrackParam.h.

References v.

Referenced by InitDirection().

114 { fP[3] = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetErr2QPt()

void PndCATrackParam::SetErr2QPt ( float  v)
inline

Definition at line 123 of file PndCATrackParam.h.

References v.

123 { fC[14] = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetISec()

void PndCATrackParam::SetISec ( int  v)
inline

Definition at line 121 of file PndCATrackParam.h.

References v.

121 { fISec = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetNDF()

void PndCATrackParam::SetNDF ( int  v)
inline

Definition at line 118 of file PndCATrackParam.h.

References v.

118 { fNDF = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetPar()

void PndCATrackParam::SetPar ( int  i,
float  v 
)
inline

Definition at line 107 of file PndCATrackParam.h.

References i, and v.

107 { fP[i] = v; }
__m128 v
Definition: P4_F32vec4.h:3
unsigned int i
Definition: P4_F32vec4.h:21

◆ SetQPt()

void PndCATrackParam::SetQPt ( float  v)
inline

Definition at line 115 of file PndCATrackParam.h.

References v.

115 { fP[4] = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetSignCosPhi()

void PndCATrackParam::SetSignCosPhi ( float  v)
inline

Definition at line 116 of file PndCATrackParam.h.

References v.

Referenced by InitDirection().

116 { fSignCosPhi = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetSinPhi()

void PndCATrackParam::SetSinPhi ( float  v)
inline

Definition at line 113 of file PndCATrackParam.h.

References v.

Referenced by InitDirection().

113 { fP[2] = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetX()

void PndCATrackParam::SetX ( float  v)
inline

Definition at line 110 of file PndCATrackParam.h.

References v.

110 { fX = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetY()

void PndCATrackParam::SetY ( float  v)
inline

Definition at line 111 of file PndCATrackParam.h.

References v.

111 { fP[0] = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SetZ()

void PndCATrackParam::SetZ ( float  v)
inline

Definition at line 112 of file PndCATrackParam.h.

References v.

112 { fP[1] = v; }
__m128 v
Definition: P4_F32vec4.h:3

◆ SignCosPhi()

float PndCATrackParam::SignCosPhi ( ) const
inline

The sign of cos phi is always positive in the slice tracker. Only after coordinate transformation can the sign change to negative.

Definition at line 64 of file PndCATrackParam.h.

64 { return fSignCosPhi; }

◆ SinPhi()

float PndCATrackParam::SinPhi ( ) const
inline

Definition at line 55 of file PndCATrackParam.h.

Referenced by GetCosPhi(), GetCosPhiPositive(), and RotateXY().

55 { return fP[2]; }

◆ Transport()

bool PndCATrackParam::Transport ( const PndCAHit hit,
float  Bz 
)
inline

Definition at line 565 of file PndCATrackParam.h.

References PndCAHit::Angle(), CalculateFitParameters(), Rotate(), TransportToXWithMaterial(), and PndCAHit::X0().

Referenced by Reset().

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 }
bool Rotate(float alpha, float maxSinPhi=.999)
float Angle() const
Definition: PndCAHits.h:52
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)
void CalculateFitParameters(PndCATrackFitParam &par, float mass=0.13957)
float X0() const
Definition: PndCAHits.h:35

◆ TransportToX() [1/3]

bool PndCATrackParam::TransportToX ( float  x,
float  Bz,
float  maxSinPhi = .999 
)

◆ TransportToX() [2/3]

bool PndCATrackParam::TransportToX ( float  x,
PndCATrackLinearisation t0,
float  Bz,
float  maxSinPhi = .999,
float *  DL = nullptr 
)
inline

Definition at line 357 of file PndCATrackParam.h.

References CAMath::Abs(), CAMath::ASin(), PndCATrackLinearisation::CosPhi(), PndCATrackLinearisation::DzDs(), f, PndCATrackLinearisation::QPt(), PndCATrackLinearisation::SetCosPhi(), PndCATrackLinearisation::SetSinPhi(), PndCATrackLinearisation::SinPhi(), CAMath::Sqrt(), X(), Y(), and Z().

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 }
static T ASin(const T &x)
static T Sqrt(const T &x)
Definition: PndCAMath.h:45
float Z() const
static T Abs(const T &x)
Definition: PndCAMath.h:56
float Y() const
float X() const
float f
Definition: P4_F32vec4.h:20

◆ TransportToX() [3/3]

bool PndCATrackParam::TransportToX ( float  x,
float  sinPhi0,
float  cosPhi0,
float  Bz,
float  maxSinPhi = .999 
)

◆ TransportToXWithMaterial() [1/3]

bool PndCATrackParam::TransportToXWithMaterial ( float  x,
float  Bz,
float  maxSinPhi = .999 
)

◆ TransportToXWithMaterial() [2/3]

bool PndCATrackParam::TransportToXWithMaterial ( float  x,
PndCATrackLinearisation t0,
PndCATrackFitParam par,
float  Bz,
float  maxSinPhi = .999 
)
inline

Definition at line 539 of file PndCATrackParam.h.

References TransportToX().

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 }
bool TransportToX(float x, float Bz, float maxSinPhi=.999)

◆ TransportToXWithMaterial() [3/3]

bool PndCATrackParam::TransportToXWithMaterial ( float  x,
PndCATrackFitParam par,
float  Bz,
float  maxSinPhi = .999 
)
inline

Definition at line 557 of file PndCATrackParam.h.

References TransportToXWithMaterial().

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 }
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)

◆ X()

float PndCATrackParam::X ( ) const
inline

Definition at line 52 of file PndCATrackParam.h.

Referenced by RotateXY(), and TransportToX().

52 { return fX; }

◆ Y()

float PndCATrackParam::Y ( ) const
inline

Definition at line 53 of file PndCATrackParam.h.

Referenced by RotateXY(), and TransportToX().

53 { return fP[0]; }

◆ Z()

float PndCATrackParam::Z ( ) const
inline

Definition at line 54 of file PndCATrackParam.h.

Referenced by TransportToX().

54 { return fP[1]; }

The documentation for this class was generated from the following file: