Belle II Software prerelease-10-00-00a
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 <Eigen/Core>
15namespace TreeFitter {
16
19 class HelixUtils {
20
21 public:
22
24 enum VertexCoor {iX = 0, iY, iZ, iPx, iPy, iPz} ;
25
27 enum HelixCoor {iD0 = 0, iPhi0, iOmega, iZ0, iTanLambda, iArcLength2D} ;
28
30 static void helixFromVertexNumerical(const Eigen::Matrix<double, 3, 1>& position,
31 const Eigen::Matrix<double, 3, 1>& momentum,
32 int charge, double Bz,
33 Belle2::Helix& helix,
34 double& flt,
35 Eigen::Matrix<double, 5, 6>& jacobian);
36
40 static void getJacobianToCartesianFrameworkHelix(Eigen::Matrix<double, 5, 6>& jacobian,
41 const double x,
42 const double y,
43 const double z,
44 const double px,
45 const double py,
46 const double pz,
47 const double bfield,
48 const double charge
49 );
50
52 static void getHelixAndJacobianFromVertexNumerical(const Eigen::Matrix<double, 1, 6>& positionAndMom,
53 int charge, double Bz,
54 Belle2::Helix& helix,
55 Eigen::Matrix<double, 5, 6>& jacobian);
56
58 static void getJacobianFromVertexNumerical(const Eigen::Matrix<double, 1, 6>& positionAndMom,
59 int charge, double Bz,
60 const Belle2::Helix& helix,
61 Eigen::Matrix<double, 5, 6>& jacobian,
62 double delta = 1e-5
63 );
64
66 static void helixFromVertex(const Eigen::Matrix<double, 1, 6>& positionAndMomentum,
67 int charge, double Bz,
68 Belle2::Helix& helix,
69 double& L,
70 Eigen::Matrix<double, 5, 6>& jacobian);
71
72
74 static void vertexFromHelix(const Belle2::Helix& helix,
75 double L, double Bz,
76 ROOT::Math::XYZVector& position,
77 ROOT::Math::XYZVector& momentum, int& charge);
78
80 static std::string helixParName(int i) ;
81
83 static std::string vertexParName(int i) ;
84
86 static void printVertexPar(const ROOT::Math::XYZVector& position, const ROOT::Math::XYZVector& momentum, int charge) ;
87
89 static double helixPoca(const Belle2::Helix& helix1,
90 const Belle2::Helix& helix2,
91 double& flt1, double& flt2,
92 ROOT::Math::XYZVector& vertex, bool parallel = false) ;
93
95 static double helixPoca(const Belle2::Helix& helix, const ROOT::Math::XYZVector& point,
96 double& flt) ;
97
99 static double phidomain(const double phi) ;
100
101 } ;
102
103}
Helix parameter class.
Definition Helix.h:48
utility for helix<->x,p conversions
Definition HelixUtils.h:19
static std::string vertexParName(int i)
map of the vertex parameters by list index
static void printVertexPar(const ROOT::Math::XYZVector &position, const ROOT::Math::XYZVector &momentum, int charge)
Print the vertex parameters.
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
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 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 double helixPoca(const Belle2::Helix &helix1, const Belle2::Helix &helix2, double &flt1, double &flt2, ROOT::Math::XYZVector &vertex, bool parallel=false)
POCA between two tracks.
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
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.
HelixCoor
Parameters of the helix.
Definition HelixUtils.h:27
VertexCoor
Parameters of the vertex.
Definition HelixUtils.h:24