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 39 of file PndCATrackParam.h.

Constructor & Destructor Documentation

◆ PndCATrackParam() [1/2]

PndCATrackParam::PndCATrackParam ( )
inline

Definition at line 43 of file PndCATrackParam.h.

References Reset().

43 { Reset(); }

◆ PndCATrackParam() [2/2]

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

Definition at line 44 of file PndCATrackParam.h.

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

44  : fX(v.X()[i]), fSignCosPhi(v.SignCosPhi()[i]), fChi2(v.Chi2()[i]), fNDF(v.NDF()[i]), fAlpha(v.Angle()[i]), fISec(v.ISec()[i])
45  {
46  for (int j = 0; j < 5; ++j)
47  fP[j] = v.Par()[j][i];
48  for (int j = 0; j < 15; ++j)
49  fC[j] = v.Cov()[j][i];
50  }
unsigned int i
Definition: P4_F32vec4.h:33
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 86 of file PndCATrackParam.h.

86 { return fAlpha; }

◆ ApproximateBetheBloch()

float PndCATrackParam::ApproximateBetheBloch ( float  beta2)
inlinestatic

Definition at line 320 of file PndCATrackParam.h.

References log().

Referenced by CalculateFitParameters(), and InitDirection().

321 {
322  //------------------------------------------------------------------
323  // This is an approximation of the Bethe-Bloch formula with
324  // the density effect taken into account at beta*gamma > 3.5
325  // (the approximation is reasonable only for solid materials)
326  //------------------------------------------------------------------
327  if (beta2 >= 1)
328  return 0;
329  else {
330  const float beta2_beta21i = beta2 / (1 - beta2);
331  if (beta2_beta21i > 12.25) // 3.5^2 = 12.25
332  return 0.153e-3 / beta2 * (9.94223 + 0.5 * log(beta2_beta21i) - beta2); // log( 3.5*5940 ) = 9.94223
333  else
334  return 0.153e-3 / beta2 * (8.6895 + log(beta2_beta21i) - beta2); // log( 5940 ) = 8.6895
335  }
336 }
friend F32vec4 log(const F32vec4 &a)
Definition: P4_F32vec4.h:129

◆ 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 338 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().

339 {
340  const float p2 = (1. + fP[3] * fP[3]);
341  const float k2 = fP[4] * fP[4];
342  const float mass2 = mass * mass;
343 
344  const float beta2 = p2 / (p2 + mass2 * k2);
345 
346  const float pp2 = (k2 > 1.e-8) ? p2 / k2 : 10000; // impuls 2
347 
348  // par.fBethe = BetheBlochGas( pp2/mass2);
349  par.fBethe = ApproximateBetheBloch(pp2 / mass2);
350  par.fE = CAMath::Sqrt(pp2 + mass2);
351  par.fTheta2 = 198.81e-6 / (beta2 * pp2); // 14.1^2 * 1e-6
352  par.fEP2 = par.fE / pp2; // have tried reduce number of "/", but it was slower. (may be bacause of additional of constants = memory)
353 
354  // Approximate energy loss fluctuation (M.Ivanov)
355 
356  const float knst = 0.07; // To be tuned.
357  par.fSigmadE2 = knst * par.fEP2 * fP[4];
358  par.fSigmadE2 = par.fSigmadE2 * par.fSigmadE2;
359 
360  par.fK22 = p2;
361  par.fK33 = par.fK22 * par.fK22;
362  par.fK43 = fP[3] * fP[4] * par.fK22;
363  par.fK44 = (p2 - 1.f) * k2;
364 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:57
static float ApproximateBetheBloch(float beta2)

◆ Chi2()

float PndCATrackParam::Chi2 ( ) const
inline

Definition at line 77 of file PndCATrackParam.h.

Referenced by PndCATrack::Fit().

77 { return fChi2; }

◆ CorrectForMeanMaterial()

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

Definition at line 507 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().

508 {
509  //------------------------------------------------------------------
510  // This function corrects the track parameters for the crossed material.
511  // "xOverX0" - X/X0, the thickness in units of the radiation length.
512  // "xTimesRho" - is the product length*density (g/cm^2).
513  //------------------------------------------------------------------
514  // float &fC22 = fC[5];
515  // float &fC33 = fC[9];
516  // float &fC40 = fC[10];
517  // float &fC41 = fC[11];
518  // float &fC42 = fC[12];
519  // float &fC43 = fC[13];
520  // float &fC44 = fC[14];
521 
522  // Energy losses************************
523 
524  const float dE = par.fBethe * xTimesRho;
525  if (CAMath::Abs(dE) > 0.3 * par.fE)
526  return 0; // 30% energy loss is too much!
527  const float corr = (1. - par.fEP2 * dE);
528  if (corr < 0.3 || corr > 1.3)
529  return 0;
530 
531  fP[4] *= corr;
532  fC[10] *= corr;
533  fC[11] *= corr;
534  fC[12] *= corr;
535  fC[13] *= corr;
536  fC[14] *= corr * corr;
537  fC[14] += par.fSigmadE2 * CAMath::Abs(dE);
538  // std::cout << "dE "<<dE<<" corr "<<corr<<" fBethe " <<par.fBethe<<" XxRo "<<xTimesRho<<std::endl;
539 
540  // Multiple scattering******************
541 
542  const float theta2 = par.fTheta2 * CAMath::Abs(xOverX0);
543  fC[5] += theta2 * par.fK22 * (1. - fP[2] * fP[2]);
544  fC[9] += theta2 * par.fK33;
545  fC[13] += theta2 * par.fK43;
546  fC[14] += theta2 * par.fK44;
547 
548  return 1;
549 }
static T Abs(const T &x)
Definition: PndCAMath.h:68

◆ Cov()

const float* PndCATrackParam::Cov ( ) const
inline

Definition at line 114 of file PndCATrackParam.h.

114 { return fC; }

◆ DzDs()

float PndCATrackParam::DzDs ( ) const
inline

Definition at line 68 of file PndCATrackParam.h.

68 { return fP[3]; }

◆ Err2DzDs()

float PndCATrackParam::Err2DzDs ( ) const
inline

Definition at line 83 of file PndCATrackParam.h.

83 { return fC[9]; }

◆ Err2QMomentum()

float PndCATrackParam::Err2QMomentum ( ) const
inline

Definition at line 111 of file PndCATrackParam.h.

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

111 { return fC[14]; }

◆ Err2QPt()

float PndCATrackParam::Err2QPt ( ) const
inline

Definition at line 84 of file PndCATrackParam.h.

84 { return fC[14]; }

◆ Err2SinPhi()

float PndCATrackParam::Err2SinPhi ( ) const
inline

Definition at line 82 of file PndCATrackParam.h.

82 { return fC[5]; }

◆ Err2X1()

float PndCATrackParam::Err2X1 ( ) const
inline

Definition at line 109 of file PndCATrackParam.h.

109 { return fC[0]; }

◆ Err2X2()

float PndCATrackParam::Err2X2 ( ) const
inline

Definition at line 110 of file PndCATrackParam.h.

110 { return fC[2]; }

◆ Err2Y()

float PndCATrackParam::Err2Y ( ) const
inline

Definition at line 80 of file PndCATrackParam.h.

80 { return fC[0]; }

◆ Err2Z()

float PndCATrackParam::Err2Z ( ) const
inline

Definition at line 81 of file PndCATrackParam.h.

81 { 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 243 of file PndCATrackParam.h.

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

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

244 {
245  assert(maxSinPhi > 0.f);
246  //* Add the y,z measurement with the Kalman filter
247 
248  const float c00 = fC[0];
249  const float c10 = fC[1];
250  const float c11 = fC[2];
251  const float c20 = fC[3];
252  const float c21 = fC[4];
253  // float c22 = fC[5];
254  const float c30 = fC[6];
255  const float c31 = fC[7];
256  // float c32 = fC[8];
257  // float c33 = fC[9];
258  const float c40 = fC[10];
259  const float c41 = fC[11];
260  // float c42 = fC[12];
261  // float c43 = fC[13];
262  // float c44 = fC[14];
263 
264  float d = 1.f / (err2Y * err2Z + err2Y * c11 + err2Z * c00 + c00 * c11 - c10 * c10 - 2 * errYZ * c10 - errYZ * errYZ);
265  err2Y += c00;
266  err2Z += c11;
267  errYZ += c10;
268 
269  const float z0 = y - fP[0], z1 = z - fP[1];
270 
271  if (ISUNLIKELY(err2Y < 1.e-8f) || ISUNLIKELY(err2Z < 1.e-8f))
272  return 0;
273 
274  const float mS0 = err2Z * d;
275  const float mS1 = -errYZ * d;
276  const float mS2 = err2Y * d;
277 
278  // K = CHtS
279 
280  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,
281  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;
282 
283  const float sinPhi = fP[2] + k20 * z0 + k21 * z1;
284 
285  if (ISUNLIKELY(CAMath::Abs(sinPhi) >= maxSinPhi))
286  return 0;
287 
288  fNDF += 2;
289  fChi2 += mS0 * z0 * z0 + mS2 * z1 * z1 + 2 * z0 * z1 * mS1;
290 
291  fP[0] += k00 * z0 + k01 * z1;
292  fP[1] += k10 * z0 + k11 * z1;
293  fP[2] = sinPhi;
294  fP[3] += k30 * z0 + k31 * z1;
295  fP[4] += k40 * z0 + k41 * z1;
296 
297  fC[0] -= (k00 * c00 + k01 * c10); // c00
298 
299  fC[1] -= (k10 * c00 + k11 * c10); // c10
300  fC[2] -= (k10 * c10 + k11 * c11); // c11
301 
302  fC[3] -= (k20 * c00 + k21 * c10); // c20
303  fC[4] -= (k20 * c10 + k21 * c11); // c21
304  fC[5] -= (k20 * c20 + k21 * c21); // c22
305 
306  fC[6] -= (k30 * c00 + k31 * c10); // c30
307  fC[7] -= (k30 * c10 + k31 * c11); // c31
308  fC[8] -= (k30 * c20 + k31 * c21); // c32
309  fC[9] -= (k30 * c30 + k31 * c31); // c33
310 
311  fC[10] -= (k40 * c00 + k41 * c10); // c40
312  fC[11] -= (k40 * c10 + k41 * c11); // c41
313  fC[12] -= (k40 * c20 + k41 * c21); // c42
314  fC[13] -= (k40 * c30 + k41 * c31); // c43
315  fC[14] -= (k40 * c40 + k41 * c41); // c44
316 
317  return 1;
318 }
static T Abs(const T &x)
Definition: PndCAMath.h:68
float f
Definition: P4_F32vec4.h:32
#define ISUNLIKELY(x)
Definition: PndCADef.h:169

◆ Filter() [2/2]

bool PndCATrackParam::Filter ( const PndCAHit hit)
inline

Definition at line 589 of file PndCATrackParam.h.

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

590 {
591  return Filter(hit.X1(), hit.X2(), hit.Err2X1(), hit.ErrX12(), hit.Err2X2(), 0.999f);
592 }
bool Filter(float y, float z, float err2Y, float errYZ, float err2Z, float maxSinPhi=.999)
float Err2X1() const
Definition: PndCAHits.h:51
float Err2X2() const
Definition: PndCAHits.h:53
float X1() const
Definition: PndCAHits.h:48
float X2() const
Definition: PndCAHits.h:49
float ErrX12() const
Definition: PndCAHits.h:52

◆ GetChi2()

float PndCATrackParam::GetChi2 ( ) const
inline

Definition at line 96 of file PndCATrackParam.h.

96 { return fChi2; }

◆ GetCosPhi()

float PndCATrackParam::GetCosPhi ( ) const
inline

Definition at line 101 of file PndCATrackParam.h.

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

Referenced by RotateXY().

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

◆ GetCosPhiPositive()

float PndCATrackParam::GetCosPhiPositive ( ) const
inline

Definition at line 100 of file PndCATrackParam.h.

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

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

◆ GetCov()

const float* PndCATrackParam::GetCov ( ) const
inline

Definition at line 117 of file PndCATrackParam.h.

117 { 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 93 of file PndCATrackParam.h.

93 { return fP[3]; }

◆ GetErr2DzDs()

float PndCATrackParam::GetErr2DzDs ( ) const
inline

Definition at line 106 of file PndCATrackParam.h.

106 { return fC[9]; }

◆ GetErr2QPt()

float PndCATrackParam::GetErr2QPt ( ) const
inline

Definition at line 107 of file PndCATrackParam.h.

107 { return fC[14]; }

◆ GetErr2SinPhi()

float PndCATrackParam::GetErr2SinPhi ( ) const
inline

Definition at line 105 of file PndCATrackParam.h.

105 { return fC[5]; }

◆ GetErr2Y()

float PndCATrackParam::GetErr2Y ( ) const
inline

Definition at line 103 of file PndCATrackParam.h.

103 { return fC[0]; }

◆ GetErr2Z()

float PndCATrackParam::GetErr2Z ( ) const
inline

Definition at line 104 of file PndCATrackParam.h.

104 { return fC[2]; }

◆ GetGlobalParam()

PndCATrackParam PndCATrackParam::GetGlobalParam ( float  alpha) const

Referenced by ResetCovMatrix().

◆ GetKappa()

float PndCATrackParam::GetKappa ( float  Bz) const
inline

Definition at line 99 of file PndCATrackParam.h.

99 { return fP[4] * Bz; }

◆ GetNDF()

int PndCATrackParam::GetNDF ( ) const
inline

Definition at line 97 of file PndCATrackParam.h.

97 { return fNDF; }

◆ GetPar()

const float* PndCATrackParam::GetPar ( ) const
inline

Definition at line 116 of file PndCATrackParam.h.

116 { return fP; }

◆ GetQPt()

float PndCATrackParam::GetQPt ( ) const
inline

Definition at line 94 of file PndCATrackParam.h.

94 { 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 95 of file PndCATrackParam.h.

95 { return fSignCosPhi; }

◆ GetSinPhi()

float PndCATrackParam::GetSinPhi ( ) const
inline

Definition at line 92 of file PndCATrackParam.h.

92 { return fP[2]; }

◆ GetX()

float PndCATrackParam::GetX ( ) const
inline

Definition at line 89 of file PndCATrackParam.h.

89 { return fX; }

◆ GetY()

float PndCATrackParam::GetY ( ) const
inline

Definition at line 90 of file PndCATrackParam.h.

90 { return fP[0]; }

◆ GetZ()

float PndCATrackParam::GetZ ( ) const
inline

Definition at line 91 of file PndCATrackParam.h.

91 { return fP[1]; }

◆ InitDirection()

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

Definition at line 137 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().

138  {
139  const float r = sqrt(r0 * r0 + r1 * r1);
140  SetSinPhi(r1 / r);
141  SetSignCosPhi(sign(r0));
142  SetDzDs(r2 / r);
143  }
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:40
void SetSignCosPhi(float v)
void SetSinPhi(float v)
void SetDzDs(float v)
int sign(T val)
Definition: PndCADef.h:61

◆ ISec()

int PndCATrackParam::ISec ( ) const
inline

Definition at line 87 of file PndCATrackParam.h.

87 { return fISec; }

◆ IsValid()

bool PndCATrackParam::IsValid ( ) const
inline

Definition at line 216 of file PndCATrackParam.h.

216 { return fChi2 != -1; }

◆ NDF()

int PndCATrackParam::NDF ( ) const
inline

Definition at line 78 of file PndCATrackParam.h.

Referenced by PndCATrack::Fit().

78 { return fNDF; }

◆ Par()

const float* PndCATrackParam::Par ( ) const
inline

Definition at line 113 of file PndCATrackParam.h.

113 { return fP; }

◆ Print()

void PndCATrackParam::Print ( ) const

Referenced by InitDirection().

◆ QMomentum()

float PndCATrackParam::QMomentum ( ) const
inline

Definition at line 70 of file PndCATrackParam.h.

Referenced by PndCANPlet::QMomentum().

70 { return fP[4]; }

◆ QPt()

float PndCATrackParam::QPt ( ) const
inline

Definition at line 69 of file PndCATrackParam.h.

69 { return fP[4]; }

◆ Reset()

void PndCATrackParam::Reset ( )
inline

Definition at line 200 of file PndCATrackParam.h.

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

Referenced by PndCATrackParam().

201  {
202  fX = 0;
203  fSignCosPhi = 0;
204  for (int i = 0; i < 5; i++)
205  fP[i] = 0;
206  for (int i = 0; i < 15; i++)
207  fC[i] = 0;
208  fChi2 = 0;
209  fNDF = 0;
210  fISec = 0;
211  }
unsigned int i
Definition: P4_F32vec4.h:33

◆ ResetCovMatrix()

void PndCATrackParam::ResetCovMatrix ( )
inline

Definition at line 179 of file PndCATrackParam.h.

References GetGlobalParam().

180  {
181  fC[0] = 10.f;
182  fC[1] = 0.f;
183  fC[2] = 10.f;
184  fC[3] = 0.f;
185  fC[4] = 0.f;
186  fC[5] = 1.f;
187  fC[6] = 0.f;
188  fC[7] = 0.f;
189  fC[8] = 0.f;
190  fC[9] = 1.f;
191  fC[10] = 0.f;
192  fC[11] = 0.f;
193  fC[12] = 0.f;
194  fC[13] = 0.f;
195  fC[14] = 10.f;
196  }

◆ 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 231 of file PndCATrackParam.h.

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

Referenced by InitDirection().

232 {
233  //* Rotate the coordinate system in XY on the angle alpha
234 
235  const float cA = CAMath::Cos(alpha);
236  const float sA = CAMath::Sin(alpha);
237 
238  x = (X() * cA + Y() * sA);
239  y = (-X() * sA + Y() * cA);
240  sin = -GetCosPhi() * sA + SinPhi() * cA;
241 }
friend F32vec4 sin(const F32vec4 &a)
Definition: P4_F32vec4.h:130
static T Sin(const T &x)
Definition: PndCAMath.h:83
static T Cos(const T &x)
Definition: PndCAMath.h:88
float SinPhi() const
float Y() const
float X() const
double alpha
Definition: f_Init.h:31
float GetCosPhi() const

◆ SetAngle()

void PndCATrackParam::SetAngle ( float  v)
inline

Definition at line 132 of file PndCATrackParam.h.

References v.

132 { fAlpha = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetAsInvalid()

void PndCATrackParam::SetAsInvalid ( )
inline

Definition at line 217 of file PndCATrackParam.h.

217 { fChi2 = -1; }

◆ SetChi2()

void PndCATrackParam::SetChi2 ( float  v)
inline

Definition at line 129 of file PndCATrackParam.h.

References v.

129 { fChi2 = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetCov()

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

Definition at line 120 of file PndCATrackParam.h.

References i, and v.

120 { fC[i] = v; }
__m128 v
Definition: P4_F32vec4.h:15
unsigned int i
Definition: P4_F32vec4.h:33

◆ SetDzDs()

void PndCATrackParam::SetDzDs ( float  v)
inline

Definition at line 126 of file PndCATrackParam.h.

References v.

Referenced by InitDirection().

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

◆ SetErr2QPt()

void PndCATrackParam::SetErr2QPt ( float  v)
inline

Definition at line 135 of file PndCATrackParam.h.

References v.

135 { fC[14] = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetISec()

void PndCATrackParam::SetISec ( int  v)
inline

Definition at line 133 of file PndCATrackParam.h.

References v.

133 { fISec = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetNDF()

void PndCATrackParam::SetNDF ( int  v)
inline

Definition at line 130 of file PndCATrackParam.h.

References v.

130 { fNDF = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetPar()

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

Definition at line 119 of file PndCATrackParam.h.

References i, and v.

119 { fP[i] = v; }
__m128 v
Definition: P4_F32vec4.h:15
unsigned int i
Definition: P4_F32vec4.h:33

◆ SetQPt()

void PndCATrackParam::SetQPt ( float  v)
inline

Definition at line 127 of file PndCATrackParam.h.

References v.

127 { fP[4] = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetSignCosPhi()

void PndCATrackParam::SetSignCosPhi ( float  v)
inline

Definition at line 128 of file PndCATrackParam.h.

References v.

Referenced by InitDirection().

128 { fSignCosPhi = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetSinPhi()

void PndCATrackParam::SetSinPhi ( float  v)
inline

Definition at line 125 of file PndCATrackParam.h.

References v.

Referenced by InitDirection().

125 { fP[2] = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetX()

void PndCATrackParam::SetX ( float  v)
inline

Definition at line 122 of file PndCATrackParam.h.

References v.

122 { fX = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetY()

void PndCATrackParam::SetY ( float  v)
inline

Definition at line 123 of file PndCATrackParam.h.

References v.

123 { fP[0] = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ SetZ()

void PndCATrackParam::SetZ ( float  v)
inline

Definition at line 124 of file PndCATrackParam.h.

References v.

124 { fP[1] = v; }
__m128 v
Definition: P4_F32vec4.h:15

◆ 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 76 of file PndCATrackParam.h.

76 { return fSignCosPhi; }

◆ SinPhi()

float PndCATrackParam::SinPhi ( ) const
inline

Definition at line 67 of file PndCATrackParam.h.

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

67 { return fP[2]; }

◆ Transport()

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

Definition at line 577 of file PndCATrackParam.h.

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

Referenced by Reset().

578 {
579  // TODO material. See Vector part
580  PndCATrackFitParam fitPar;
581  CalculateFitParameters(fitPar);
582  PndCATrackLinearisation tR(*this);
583  const bool rotated = Rotate(-fAlpha + hit.Angle(), tR, .999f);
584  PndCATrackLinearisation tE(*this);
585  const bool transported = TransportToXWithMaterial(hit.X0(), tE, fitPar, Bz, 0.999f);
586  return rotated & transported;
587 }
bool Rotate(float alpha, float maxSinPhi=.999)
float Angle() const
Definition: PndCAHits.h:64
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)
void CalculateFitParameters(PndCATrackFitParam &par, float mass=0.13957)
float X0() const
Definition: PndCAHits.h:47

◆ 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 369 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().

370 {
371  //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz
372  //* maxSinPhi is the max. allowed value for |t0.SinPhi()|
373  //* linearisation of trajectory t0 is also transported to X=x,
374  //* returns 1 if OK
375  //*
376 
377  const float ex = t0.CosPhi();
378  const float ey = t0.SinPhi();
379  const float k = t0.QPt() * Bz;
380  const float dx = x - X();
381 
382  const float ey1 = k * dx + ey;
383 
384  // check for intersection with X=x
385 
386  if (CAMath::Abs(ey1) > maxSinPhi)
387  return 0;
388 
389  float ex1 = CAMath::Sqrt(1.f - ey1 * ey1);
390  if (ex < 0)
391  ex1 = -ex1;
392 
393  const float dx2 = dx * dx;
394  const float ss = ey + ey1;
395  const float cc = ex + ex1;
396 
397  if ((CAMath::Abs(cc) < 1.e-4 || CAMath::Abs(ex) < 1.e-4 || CAMath::Abs(ex1) < 1.e-4))
398  return 0;
399 
400  const float cci = 1.f / cc;
401  const float exi = 1.f / ex;
402  const float ex1i = 1.f / ex1;
403 
404  const float tg = ss * cci; // tan((phi1+phi)/2)
405 
406  const float dy = dx * tg;
407  float dl = dx * CAMath::Sqrt(1.f + tg * tg);
408 
409  if (cc < 0)
410  dl = -dl;
411  float dSin = dl * k * 0.5;
412  if (dSin > 1.f)
413  dSin = 1.f;
414  if (dSin < -1.f)
415  dSin = -1.f;
416  const float dS = (CAMath::Abs(k) > 1.e-4) ? (2 * CAMath::ASin(dSin) / k) : dl;
417  const float dz = dS * t0.DzDs();
418 
419  if (DL)
420  *DL = -dS * CAMath::Sqrt(1.f + t0.DzDs() * t0.DzDs());
421 
422  const float d[3] = {fP[2] - t0.SinPhi(), fP[3] - t0.DzDs(), fP[4] - t0.QPt()};
423 
424  // float H0[5] = { 1,0, h2, 0, h4 };
425  // float H1[5] = { 0, 1, 0, dS, 0 };
426  // float H2[5] = { 0, 0, 1, 0, dxBz };
427  // float H3[5] = { 0, 0, 0, 1, 0 };
428  // float H4[5] = { 0, 0, 0, 0, 1 };
429 
430  const float h2 = dx * (1.f + ey * ey1 + ex * ex1) * exi * ex1i * cci;
431  const float h4 = dx2 * (cc + ss * ey1 * ex1i) * cci * cci * Bz;
432  const float dxBz = dx * Bz;
433 
434  t0.SetCosPhi(ex1);
435  t0.SetSinPhi(ey1);
436 
437  fX = X() + dx;
438  fP[0] = Y() + dy + h2 * d[0] + h4 * d[2];
439  fP[1] = Z() + dz + dS * d[1];
440  fP[2] = t0.SinPhi() + d[0] + dxBz * d[2];
441  if (CAMath::Abs(fP[2]) > maxSinPhi)
442  fP[2] = t0.SinPhi();
443 
444 #if 1
445  const float c00 = fC[0];
446  const float c10 = fC[1];
447  const float c11 = fC[2];
448  const float c20 = fC[3];
449  const float c21 = fC[4];
450  const float c22 = fC[5];
451  const float c30 = fC[6];
452  const float c31 = fC[7];
453  const float c32 = fC[8];
454  const float c33 = fC[9];
455  const float c40 = fC[10];
456  const float c41 = fC[11];
457  const float c42 = fC[12];
458  const float c43 = fC[13];
459  const float c44 = fC[14];
460 
461  fC[0] = (c00 + h2 * h2 * c22 + h4 * h4 * c44 + 2.f * (h2 * c20 + h4 * c40 + h2 * h4 * c42));
462 
463  fC[1] = c10 + h2 * c21 + h4 * c41 + dS * (c30 + h2 * c32 + h4 * c43);
464  fC[2] = c11 + 2.f * dS * c31 + dS * dS * c33;
465 
466  fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * (c40 + h2 * c42 + h4 * c44);
467  fC[4] = c21 + dS * c32 + dxBz * (c41 + dS * c43);
468  fC[5] = c22 + 2.f * dxBz * c42 + dxBz * dxBz * c44;
469 
470  fC[6] = c30 + h2 * c32 + h4 * c43;
471  fC[7] = c31 + dS * c33;
472  fC[8] = c32 + dxBz * c43;
473  fC[9] = c33;
474 
475  fC[10] = c40 + h2 * c42 + h4 * c44;
476  fC[11] = c41 + dS * c43;
477  fC[12] = c42 + dxBz * c44;
478  fC[13] = c43;
479  fC[14] = c44;
480 #else
481  fC[0] = (fC[0] + h2 * h2 * fC[5] + h4 * h4 * fC[14] + 2 * (h2 * fC[3] + h4 * fC[10] + h2 * h4 * fC[12]));
482 
483  fC[1] = fC[1] + h2 * fC[4] + h4 * fC[11] + dS * (fC[6] + h2 * fC[8] + h4 * fC[13]);
484  fC[2] = fC[2] + 2 * dS * fC[7] + dS * dS * fC[9];
485 
486  fC[3] = fC[3] + h2 * fC[5] + h4 * fC[12] + dxBz * (fC[10] + h2 * fC[12] + h4 * fC[14]);
487  fC[4] = fC[4] + dS * fC[8] + dxBz * (fC[11] + dS * fC[13]);
488  fC[5] = fC[5] + 2 * dxBz * fC[12] + dxBz * dxBz * fC[14];
489 
490  fC[6] = fC[6] + h2 * fC[8] + h4 * fC[13];
491  fC[7] = fC[7] + dS * fC[9];
492  fC[8] = fC[8] + dxBz * fC[13];
493  fC[9] = fC[9];
494 
495  fC[10] = fC[10] + h2 * fC[12] + h4 * fC[14];
496  fC[11] = fC[11] + dS * fC[13];
497  fC[12] = fC[12] + dxBz * fC[14];
498  fC[13] = fC[13];
499  fC[14] = fC[14];
500 #endif
501 
502  // std::cout << fC[0] << " "<<fC1[0]<<" "<<fC[2] << " "<<fC1[2]<<" "<<fC[5] << " "<<fC1[5]<<" "<<fC[9] << " "<<fC1[9]<<" "<<fC[14] << "
503  // "<<fC1[14]<<std::endl;
504  return 1;
505 }
static T ASin(const T &x)
static T Sqrt(const T &x)
Definition: PndCAMath.h:57
float Z() const
static T Abs(const T &x)
Definition: PndCAMath.h:68
float Y() const
float X() const
float f
Definition: P4_F32vec4.h:32

◆ 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 551 of file PndCATrackParam.h.

References TransportToX().

552 {
553  //* Transport the track parameters to X=x taking into account material budget
554 
555  const float kRho = 1.54e-3; // 1.025e-3 ;//0.9e-3;
556  // const float kRadLen = 29.532;//28.94;
557  // const float kRhoOverRadLen = kRho / kRadLen;
558  const float kRhoOverRadLen = 7.68e-5;
559  float dl;
560 
561  if (!TransportToX(x, t0, Bz, maxSinPhi, &dl))
562  return 0;
563 
564  UNUSED_PARAM3(kRho, kRhoOverRadLen, par); // TODO
565  // CorrectForMeanMaterial( dl*kRhoOverRadLen, dl*kRho, par );
566  return 1;
567 }
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 569 of file PndCATrackParam.h.

References TransportToXWithMaterial().

570 {
571  //* Transport the track parameters to X=x taking into account material budget
572 
573  PndCATrackLinearisation t0(*this);
574  return TransportToXWithMaterial(x, t0, par, Bz, maxSinPhi);
575 }
bool TransportToXWithMaterial(float x, float Bz, float maxSinPhi=.999)

◆ X()

float PndCATrackParam::X ( ) const
inline

Definition at line 64 of file PndCATrackParam.h.

Referenced by RotateXY(), and TransportToX().

64 { return fX; }

◆ Y()

float PndCATrackParam::Y ( ) const
inline

Definition at line 65 of file PndCATrackParam.h.

Referenced by RotateXY(), and TransportToX().

65 { return fP[0]; }

◆ Z()

float PndCATrackParam::Z ( ) const
inline

Definition at line 66 of file PndCATrackParam.h.

Referenced by TransportToX().

66 { return fP[1]; }

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