Belle II Software  release-05-01-25
HelixUtils.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributor: Wouter Hulsbergen, Jo-Frederik Krohn, Francesco Tenchini *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <string>
13 
14 #include <framework/dataobjects/Helix.h>
15 #include <Eigen/Core>
16 namespace 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(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  TVector3& position,
78  TVector3& 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 TVector3& position, const TVector3& momentum, int charge) ;
88 
90  static double helixPoca(const Belle2::Helix& helix1,
91  const Belle2::Helix& helix2,
92  double& flt1, double& flt2,
93  TVector3& vertex, bool parallel = false) ;
94 
96  static double helixPoca(const Belle2::Helix& helix, const TVector3& point,
97  double& flt) ;
98 
100  static double phidomain(const double phi) ;
101 
102  } ;
103 
104 }
TreeFitter::HelixUtils::getJacobianToCartesianFrameworkHelix
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:390
TreeFitter::HelixUtils::vertexFromHelix
static void vertexFromHelix(const Belle2::Helix &helix, double L, double Bz, TVector3 &position, TVector3 &momentum, int &charge)
helix --> vertex
Definition: HelixUtils.cc:31
TreeFitter::HelixUtils::HelixCoor
HelixCoor
Parameters of the helix.
Definition: HelixUtils.h:44
TreeFitter::HelixUtils::printVertexPar
static void printVertexPar(const TVector3 &position, const TVector3 &momentum, int charge)
Print the vertex parameters.
Definition: HelixUtils.cc:133
TreeFitter::HelixUtils::phidomain
static double phidomain(const double phi)
the domain of phi
Definition: HelixUtils.cc:229
TreeFitter::HelixUtils::VertexCoor
VertexCoor
Parameters of the vertex
Definition: HelixUtils.h:41
TreeFitter::HelixUtils::helixPoca
static double helixPoca(const Belle2::Helix &helix1, const Belle2::Helix &helix2, double &flt1, double &flt2, TVector3 &vertex, bool parallel=false)
POCA between two tracks.
Definition: HelixUtils.cc:238
Belle2::CDC::Helix
Helix parameter class.
Definition: Helix.h:51
TreeFitter::HelixUtils::getHelixAndJacobianFromVertexNumerical
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:143
TreeFitter::HelixUtils::helixFromVertex
static void helixFromVertex(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:41
TreeFitter::HelixUtils::helixFromVertexNumerical
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
TreeFitter::HelixUtils::getJacobianFromVertexNumerical
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:190
TreeFitter::HelixUtils::vertexParName
static std::string vertexParName(int i)
map of the vertex parameters by list index
Definition: HelixUtils.cc:119
TreeFitter::HelixUtils::helixParName
static std::string helixParName(int i)
map of the helix paramteres by list index
Definition: HelixUtils.cc:105