Belle II Software development
CDCBFieldUtil.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackingUtilities/numerics/ERotation.h>
11#include <tracking/trackingUtilities/numerics/ESign.h>
12
13#include <Math/Vector3D.h>
14#include <Math/Vector2D.h>
15
16namespace Belle2 {
21 namespace TrackingUtilities {
22
25 public:
27 static bool isOff();
28
30 static ESign getBFieldZSign();
31
33 static double getBFieldZ();
34
36 static double getBFieldZ(const ROOT::Math::XYVector& pos2D);
37
39 static double getBFieldZ(const ROOT::Math::XYZVector& pos3D);
40
42 static double getAlphaFromBField(double bField);
43
45 static double getAlphaZ(const ROOT::Math::XYVector& pos2D);
46
48 static double getAlphaZ(const ROOT::Math::XYZVector& pos3D);
49
62 static ESign ccwInfoToChargeSign(ERotation ccwInfo);
63
65 static ERotation chargeSignToERotation(ESign chargeSign);
66
68 static ERotation chargeToERotation(double charge);
69
71 static double absMom2DToBendRadius(double absMom2D,
72 double bZ);
73
75 static double absMom2DToBendRadius(double absMom2D,
76 const ROOT::Math::XYVector& pos2D);
77
79 static double absMom2DToBendRadius(double absMom2D,
80 const ROOT::Math::XYZVector& pos3D);
81
83 static double absMom2DToCurvature(double absMom2D,
84 double charge,
85 double bZ);
86
88 static double absMom2DToCurvature(double absMom2D,
89 double charge,
90 const ROOT::Math::XYVector& pos2D);
91
93 static double absMom2DToCurvature(double absMom2D,
94 double charge,
95 const ROOT::Math::XYZVector& pos3D);
96
98 static double curvatureToAbsMom2D(double curvature,
99 double bZ);
100
102 static double curvatureToAbsMom2D(double curvature,
103 const ROOT::Math::XYVector& pos2D);
104
106 static double curvatureToAbsMom2D(double curvature,
107 const ROOT::Math::XYZVector& pos3D);
108 };
109 }
111}
Helper functions to interact with the magnetic field.
static double curvatureToAbsMom2D(double curvature, double bZ)
Conversion helper for two dimensional curvature to momenta.
static double getAlphaZ(const ROOT::Math::XYVector &pos2D)
Getter for the signed alpha of the magnetic field in z direction.
static bool isOff()
Indicator if the magnetic field is off in the current geometry.
static ESign getBFieldZSign()
Getter for the sign of the magnetic field in z direction.
static ESign ccwInfoToChargeSign(ERotation ccwInfo)
Conversion helper from clockwise or counterclockwise travel to the charge sign.
static double getBFieldZ()
Getter for the signed magnetic field strength in z direction at the origin ( in Tesla )
static ERotation chargeSignToERotation(ESign chargeSign)
Conversion helper from the charge sign to clockwise or counterclockwise travel.
static ERotation chargeToERotation(double charge)
Conversion help for charges to clockwise or counterclockwise travel.
static double absMom2DToCurvature(double absMom2D, double charge, double bZ)
Conversion helper for momenta to two dimensional curvature.
static double getAlphaFromBField(double bField)
Translator from magnetic field strength in Tesla to the alpha value.
static double absMom2DToBendRadius(double absMom2D, double bZ)
Conversion helper for momenta to two dimensional (absolute) bend radius.
Abstract base class for different kinds of events.