Belle II Software development
hitXP.cc
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#include <tracking/dataobjects/hitXP.h>
9#include <framework/gearbox/Const.h>
10
11using namespace Belle2;
12
13double hitXP::omega(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p, double charge) const
14{
15 ROOT::Math::XYZVector x(0.01 * xx.X(), 0.01 * xx.Y(), 0.01 * xx.Z());
16 double Bz = 1.5;
17 double Bze = Bz * charge * Const::speedOfLight / 100.;
18 double aux = Bze / sqrt(p.X() * p.X() + p.Y() * p.Y());
19 aux = aux / 100;
20 return aux;
21}
22
23
24double hitXP::tanLambda(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p) const
25{
26 ROOT::Math::XYZVector x(0.01 * xx.X(), 0.01 * xx.Y(), 0.01 * xx.Z());
27 double aux = p.Z() / sqrt(p.X() * p.X() + p.Y() * p.Y());
28 return aux;
29}
30
31
32double hitXP::d0(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p, double charge) const
33{
34 ROOT::Math::XYZVector x(0.01 * xx.X(), 0.01 * xx.Y(), 0.01 * xx.Z());
35 double Bz = 1.5;
36 double Bze = Bz * charge * Const::speedOfLight / 100.;
37 double aux = sqrt((p.Y() / (Bze) + x.X()) * (p.Y() / (Bze) + x.X()) + (x.Y() - p.X() / (Bze)) * (x.Y() - p.X() / (Bze))) - sqrt((
38 p.X() * p.X() + p.Y() * p.Y()) / (Bze * Bze));
39 if (Bze < 0) {
40 aux = -aux;
41 }
42 aux = 100 * aux;
43 return aux;
44}
45
46double hitXP::phi0(const ROOT::Math::XYZVector& xx, ROOT::Math::XYZVector p, double charge) const
47{
48 ROOT::Math::XYZVector x(0.01 * xx.X(), 0.01 * xx.Y(), 0.01 * xx.Z());
49 double Bz = 1.5;
50 double Bze = Bz * charge * Const::speedOfLight / 100.;
51 double aux;
52 double chi;
53 if (Bze > 0) {
54 chi = atan2((-p.X() * x.X() - p.Y() * x.Y()), ((p.X() * p.X() + p.Y() * p.Y()) / (Bze) + p.Y() * x.X() - p.X() * x.Y()));
55 } else {
56 chi = atan2(-(-p.X() * x.X() - p.Y() * x.Y()), -((p.X() * p.X() + p.Y() * p.Y()) / (Bze) + p.Y() * x.X() - p.X() * x.Y()));
57 }
58 aux = atan2(p.Y(), p.X()) - chi;
59 return aux;
60}
61
62double hitXP::z0(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p, double charge) const
63{
64 ROOT::Math::XYZVector x(0.01 * xx.X(), 0.01 * xx.Y(), 0.01 * xx.Z());
65 double Bz = 1.5;
66 double Bze = Bz * charge * Const::speedOfLight / 100.;
67 double aux;
68 double chi;
69 if (Bze > 0) {
70 chi = atan2((-p.X() * x.X() - p.Y() * x.Y()), ((p.X() * p.X() + p.Y() * p.Y()) / (Bze) + p.Y() * x.X() - p.X() * x.Y()));
71 } else {
72 chi = atan2(-(-p.X() * x.X() - p.Y() * x.Y()), -((p.X() * p.X() + p.Y() * p.Y()) / (Bze) + p.Y() * x.X() - p.X() * x.Y()));
73 }
74 aux = p.Z() * chi / (Bze) + x.Z();
75 aux = 100 * aux;
76 return aux;
77}
static const double speedOfLight
[cm/ns]
Definition: Const.h:695
double phi0(const ROOT::Math::XYZVector &xx, ROOT::Math::XYZVector p, double charge) const
evaluates the parameter phi0 (angle between pT and x) of a helicoidal track starting from position an...
Definition: hitXP.cc:46
double z0(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p, double charge) const
evaluates the parameter z0 (distance transverse plane-POCA) of a helicoidal track starting from posit...
Definition: hitXP.cc:62
double tanLambda(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p) const
evaluates the parameter tanLambda (pz/pt) of a helicoidal track starting from position and momentum o...
Definition: hitXP.cc:24
double d0(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p, double charge) const
evaluates the parameter d0 (impact parameter) of a helicoidal track starting from position and moment...
Definition: hitXP.cc:32
double omega(ROOT::Math::XYZVector xx, ROOT::Math::XYZVector p, double charge) const
evaluates the parameter omega (1/curvature radius) of a helicoidal track starting from position and m...
Definition: hitXP.cc:13
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28
Abstract base class for different kinds of events.