Belle II Software  release-08-00-10
HelixUtils Class Reference

utility for helix<->x,p conversions More...

#include <HelixUtils.h>

Public Types

enum  VertexCoor {
  iX = 0 ,
  iY ,
  iZ ,
  iPx ,
  iPy ,
  iPz
}
 Parameters of the vertex

 
enum  HelixCoor {
  iD0 = 0 ,
  iPhi0 ,
  iOmega ,
  iZ0 ,
  iTanLambda ,
  iArcLength2D
}
 Parameters of the helix.
 

Static Public Member Functions

static void helixFromVertexNumerical (const Eigen::Matrix< double, 3, 1 > &position, const Eigen::Matrix< double, 3, 1 > &momentum, int charge, double Bz, Belle2::Helix &helix, double &flt, Eigen::Matrix< double, 5, 6 > &jacobian)
 get helix from a vertex
 
static void getJacobianToCartesianFrameworkHelix (Eigen::Matrix< double, 5, 6 > &jacobian, const double x, const double y, const double z, const double px, const double py, const double pz, const double bfield, const double charge)
 get the jacobian dh={helix pars}/dx={x,y,z,px,py,pz} for the implementation of the framework helix. More...
 
static void getHelixAndJacobianFromVertexNumerical (const Eigen::Matrix< double, 1, 6 > &positionAndMom, int charge, double Bz, Belle2::Helix &helix, Eigen::Matrix< double, 5, 6 > &jacobian)
 get helix and jacobian from a vertex
 
static void getJacobianFromVertexNumerical (const Eigen::Matrix< double, 1, 6 > &positionAndMom, int charge, double Bz, const Belle2::Helix &helix, Eigen::Matrix< double, 5, 6 > &jacobian, double delta=1e-5)
 get jacobian from a vertex
 
static void helixFromVertex (const Eigen::Matrix< double, 1, 6 > &positionAndMomentum, int charge, double Bz, Belle2::Helix &helix, double &L, Eigen::Matrix< double, 5, 6 > &jacobian)
 vertex --> helix
 
static void vertexFromHelix (const Belle2::Helix &helix, double L, double Bz, ROOT::Math::XYZVector &position, ROOT::Math::XYZVector &momentum, int &charge)
 helix --> vertex
 
static std::string helixParName (int i)
 map of the helix parameters by list index
 
static std::string vertexParName (int i)
 map of the vertex parameters by list index
 
static void printVertexPar (const Belle2::B2Vector3D &position, const Belle2::B2Vector3D &momentum, int charge)
 Print the vertex parameters.
 
static double helixPoca (const Belle2::Helix &helix1, const Belle2::Helix &helix2, double &flt1, double &flt2, Belle2::B2Vector3D &vertex, bool parallel=false)
 POCA between two tracks.
 
static double helixPoca (const Belle2::Helix &helix, const Belle2::B2Vector3D &point, double &flt)
 POCA between a track and a point.
 
static double phidomain (const double phi)
 the domain of phi
 

Detailed Description

utility for helix<->x,p conversions

Definition at line 20 of file HelixUtils.h.

Member Function Documentation

◆ getJacobianToCartesianFrameworkHelix()

void getJacobianToCartesianFrameworkHelix ( Eigen::Matrix< double, 5, 6 > &  jacobian,
const double  x,
const double  y,
const double  z,
const double  px,
const double  py,
const double  pz,
const double  bfield,
const double  charge 
)
static

get the jacobian dh={helix pars}/dx={x,y,z,px,py,pz} for the implementation of the framework helix.

WARNING only valid right after initialisation!

Definition at line 407 of file HelixUtils.cc.

418  {
419  const double alpha = 1.0 / (bfield * Belle2::Const::speedOfLight) * 1E4;
420  const double aq = charge / alpha;
421 
422  const double pt = std::hypot(px, py);
423  const double pt2 = pt * pt;
424  const double pt3 = pt2 * pt;
425  const double aq2 = aq * aq;
426 
427  const double x2 = x * x;
428  const double y2 = y * y;
429  const double r = x2 + y2;
430 
431  const double px2 = px * px;
432  const double py2 = py * py;
433 
434  const double px0 = px - aq * y;
435  const double py0 = py + aq * x;
436 
437  const double pt02 = px0 * px0 + py0 * py0;
438  const double pt0 = std::sqrt(pt02);
439  double sqrt13 = pt0 / pt;
440 
441  // D d0 / Dx_i
442  jacobian(0, 0) = py0 / pt0;
443  jacobian(0, 1) = -px0 / pt0;
444  jacobian(0, 2) = 0;
445  jacobian(0, 3) = (-(y * (aq2 * r + 2 * aq * py * x + 2 * py2 * (1 + sqrt13))) - px * (2 * py * x * (1 + sqrt13) + aq * (y2 *
446  (-1 + sqrt13) + x2 * (1 + sqrt13)))) /
447  (pt2 * pt0 * (1 + sqrt13) * (1 + sqrt13));
448 
449  jacobian(0, 4) = (2 * px2 * x * (1 + sqrt13) + 2 * px * y * (py - aq * x + py * sqrt13) + aq * (aq * r * x - py * (x2 *
450  (-1 + sqrt13) + y2 * (1 + sqrt13)))) /
451  (pt2 * pt0 * (1 + sqrt13) * (1 + sqrt13));
452  jacobian(0, 5) = 0;
453 
454  // D phi0 / Dx_i0;
455  jacobian(1, 0) = aq * px0 / pt02;
456  jacobian(1, 1) = aq * py0 / pt02;
457  jacobian(1, 2) = 0;
458  jacobian(1, 3) = -py0 / pt02;
459  jacobian(1, 4) = px0 / pt02;
460  jacobian(1, 5) = 0;
461 
462  // D omega / Dx_i
463  jacobian(2, 0) = 0;
464  jacobian(2, 1) = 0;
465  jacobian(2, 2) = 0;
466  jacobian(2, 3) = - aq * px / pt3;
467  jacobian(2, 4) = - aq * py / pt3;
468  jacobian(2, 5) = 0;
469 
470  // D z0 / Dx_i
471  jacobian(3, 0) = -pz * px0 / pt02;
472  jacobian(3, 1) = -pz * py0 / pt02;
473  jacobian(3, 2) = 1;
474  jacobian(3, 3) = (pz * (px2 * x - py * (aq * r + py * x) + 2 * px * py * y)) / (pt2 * pt02);
475  jacobian(3, 4) = (pz * (px * (aq * r + 2 * py * x) - px2 * y + py2 * y)) / (pt2 * pt02);
476  jacobian(3, 5) = std::atan2(-(aq * (px * x + py * y)), (px2 + py * py0 - aq * px * y)) / aq; //pt on num. and denom cancels.
477 
478  // D tan lambda / Dx_i
479  jacobian(4, 0) = 0;
480  jacobian(4, 1) = 0;
481  jacobian(4, 2) = 0;
482  jacobian(4, 3) = -pz * px / pt3;
483  jacobian(4, 4) = -pz * py / pt3;
484  jacobian(4, 5) = 1. / pt;
485  }
static const double speedOfLight
[cm/ns]
Definition: Const.h:686
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
double charge(int pdgCode)
Returns electric charge of a particle with given pdg code.
Definition: EvtPDLUtil.cc:44

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