Belle II Software  light-2212-foldex
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 364 of file HelixUtils.cc.

375  {
376  const double alpha = 1.0 / (bfield * Belle2::Const::speedOfLight) * 1E4;
377  const double aq = charge / alpha;
378 
379  const double pt = std::hypot(px, py);
380  const double pt2 = pt * pt;
381  const double pt3 = pt2 * pt;
382  const double aq2 = aq * aq;
383 
384  const double x2 = x * x;
385  const double y2 = y * y;
386  const double r = x2 + y2;
387 
388  const double px2 = px * px;
389  const double py2 = py * py;
390 
391  const double px0 = px - aq * y;
392  const double py0 = py + aq * x;
393 
394  const double pt02 = px0 * px0 + py0 * py0;
395  const double pt0 = std::sqrt(pt02);
396  double sqrt13 = pt0 / pt;
397 
398  // D d0 / Dx_i
399  jacobian(0, 0) = py0 / pt0;
400  jacobian(0, 1) = -px0 / pt0;
401  jacobian(0, 2) = 0;
402  jacobian(0, 3) = (-(y * (aq2 * r + 2 * aq * py * x + 2 * py2 * (1 + sqrt13))) - px * (2 * py * x * (1 + sqrt13) + aq * (y2 *
403  (-1 + sqrt13) + x2 * (1 + sqrt13)))) /
404  (pt2 * pt0 * (1 + sqrt13) * (1 + sqrt13));
405 
406  jacobian(0, 4) = (2 * px2 * x * (1 + sqrt13) + 2 * px * y * (py - aq * x + py * sqrt13) + aq * (aq * r * x - py * (x2 *
407  (-1 + sqrt13) + y2 * (1 + sqrt13)))) /
408  (pt2 * pt0 * (1 + sqrt13) * (1 + sqrt13));
409  jacobian(0, 5) = 0;
410 
411  // D phi0 / Dx_i0;
412  jacobian(1, 0) = aq * px0 / pt02;
413  jacobian(1, 1) = aq * py0 / pt02;
414  jacobian(1, 2) = 0;
415  jacobian(1, 3) = -py0 / pt02;
416  jacobian(1, 4) = px0 / pt02;
417  jacobian(1, 5) = 0;
418 
419  // D omega / Dx_i
420  jacobian(2, 0) = 0;
421  jacobian(2, 1) = 0;
422  jacobian(2, 2) = 0;
423  jacobian(2, 3) = - aq * px / pt3;
424  jacobian(2, 4) = - aq * py / pt3;
425  jacobian(2, 5) = 0;
426 
427  // D z0 / Dx_i
428  jacobian(3, 0) = -pz * px0 / pt02;
429  jacobian(3, 1) = -pz * py0 / pt02;
430  jacobian(3, 2) = 1;
431  jacobian(3, 3) = (pz * (px2 * x - py * (aq * r + py * x) + 2 * px * py * y)) / (pt2 * pt02);
432  jacobian(3, 4) = (pz * (px * (aq * r + 2 * py * x) - px2 * y + py2 * y)) / (pt2 * pt02);
433  jacobian(3, 5) = std::atan2(-(aq * (px * x + py * y)), (px2 + py * py0 - aq * px * y)) / aq; //pt on num. and denom cancels.
434 
435  // D tan lambda / Dx_i
436  jacobian(4, 0) = 0;
437  jacobian(4, 1) = 0;
438  jacobian(4, 2) = 0;
439  jacobian(4, 3) = -pz * px / pt3;
440  jacobian(4, 4) = -pz * py / pt3;
441  jacobian(4, 5) = 1. / pt;
442  }
static const double speedOfLight
[cm/ns]
Definition: Const.h:685
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: