Belle II Software development
HelixUtils.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * External Contributor: Wouter Hulsbergen *
5 * *
6 * See git log for contributors and copyright holders. *
7 * This file is licensed under LGPL-3.0, see LICENSE.md. *
8 **************************************************************************/
9#pragma once
10
11#include <string>
12
13#include <framework/dataobjects/Helix.h>
14#include <framework/geometry/B2Vector3.h>
15#include <Eigen/Core>
16namespace TreeFitter {
17
20 class HelixUtils {
21
22 public:
23
25 enum VertexCoor {iX = 0, iY, iZ, iPx, iPy, iPz} ;
26
28 enum HelixCoor {iD0 = 0, iPhi0, iOmega, iZ0, iTanLambda, iArcLength2D} ;
29
31 static void helixFromVertexNumerical(const Eigen::Matrix<double, 3, 1>& position,
32 const Eigen::Matrix<double, 3, 1>& momentum,
33 int charge, double Bz,
34 Belle2::Helix& helix,
35 double& flt,
36 Eigen::Matrix<double, 5, 6>& jacobian);
37
41 static void getJacobianToCartesianFrameworkHelix(Eigen::Matrix<double, 5, 6>& jacobian,
42 const double x,
43 const double y,
44 const double z,
45 const double px,
46 const double py,
47 const double pz,
48 const double bfield,
49 const double charge
50 );
51
53 static void getHelixAndJacobianFromVertexNumerical(const Eigen::Matrix<double, 1, 6>& positionAndMom,
54 int charge, double Bz,
55 Belle2::Helix& helix,
56 Eigen::Matrix<double, 5, 6>& jacobian);
57
59 static void getJacobianFromVertexNumerical(const Eigen::Matrix<double, 1, 6>& positionAndMom,
60 int charge, double Bz,
61 const Belle2::Helix& helix,
62 Eigen::Matrix<double, 5, 6>& jacobian,
63 double delta = 1e-5
64 );
65
67 static void helixFromVertex(const Eigen::Matrix<double, 1, 6>& positionAndMomentum,
68 int charge, double Bz,
69 Belle2::Helix& helix,
70 double& L,
71 Eigen::Matrix<double, 5, 6>& jacobian);
72
73
75 static void vertexFromHelix(const Belle2::Helix& helix,
76 double L, double Bz,
77 ROOT::Math::XYZVector& position,
78 ROOT::Math::XYZVector& momentum, int& charge);
79
81 static std::string helixParName(int i) ;
82
84 static std::string vertexParName(int i) ;
85
87 static void printVertexPar(const Belle2::B2Vector3D& position, const Belle2::B2Vector3D& momentum, int charge) ;
88
90 static double helixPoca(const Belle2::Helix& helix1,
91 const Belle2::Helix& helix2,
92 double& flt1, double& flt2,
93 Belle2::B2Vector3D& vertex, bool parallel = false) ;
94
96 static double helixPoca(const Belle2::Helix& helix, const Belle2::B2Vector3D& point,
97 double& flt) ;
98
100 static double phidomain(const double phi) ;
101
102 } ;
103
104}
Helix parameter class.
Definition: Helix.h:48
utility for helix<->x,p conversions
Definition: HelixUtils.h:20
static std::string vertexParName(int i)
map of the vertex parameters by list index
Definition: HelixUtils.cc:106
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
Definition: HelixUtils.cc:33
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
Definition: HelixUtils.cc:130
static void vertexFromHelix(const Belle2::Helix &helix, double L, double Bz, ROOT::Math::XYZVector &position, ROOT::Math::XYZVector &momentum, int &charge)
helix --> vertex
Definition: HelixUtils.cc:23
static void printVertexPar(const Belle2::B2Vector3D &position, const Belle2::B2Vector3D &momentum, int charge)
Print the vertex parameters.
Definition: HelixUtils.cc:120
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.
Definition: HelixUtils.cc:214
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
Definition: HelixUtils.cc:169
static std::string helixParName(int i)
map of the helix parameters by list index
Definition: HelixUtils.cc:92
static double phidomain(const double phi)
the domain of phi
Definition: HelixUtils.cc:205
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.
Definition: HelixUtils.cc:407
HelixCoor
Parameters of the helix.
Definition: HelixUtils.h:28
VertexCoor
Parameters of the vertex
Definition: HelixUtils.h:25