Belle II Software development
MCParticleInfo.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
9#include <tracking/dataobjects/MCParticleInfo.h>
10
11using namespace Belle2;
12
13MCParticleInfo::MCParticleInfo(const MCParticle& the_mcParticle, const ROOT::Math::XYZVector& the_magField)
14 : m_mcParticle(the_mcParticle)
15 , m_myBz(the_magField.R())
16 , m_charge(the_mcParticle.getCharge())
17{
18 // set units to: cm, GeV/c
19 m_myBz *= 0.299792 / 100;
20} ;
21
22double
24{
25
26 double pt = this->getPt();
27 double px = this->getPx();
28 double py = this->getPy();
29 double x = this->getX();
30 double y = this->getY();
31 double R = 1 / this->getOmega(); //cm
32
33 double alpha = R / pt; //cm/GeV
34 double Cx = x + alpha * py; //cm
35 double Cy = y - alpha * px; //cm
36 double d0 = sqrt(Cx * Cx + Cy * Cy) - R * m_charge; //cm
37 d0 = d0 * m_charge;
38
39 return d0;
40};
41
42double
44{
45 return atan2(this->getPy(), this->getPx()) - this->getChi();
46};
47
48double
50{
51 double px = this->getPx();
52 double py = this->getPy();
53 double pt = this->getPt();
54 double x = this->getX();
55 double y = this->getY();
56
57 double sinChi = -m_charge * (px * x + py * y);
58 double cosChi = -m_charge * (px * y - py * x - (pt * pt) / m_charge / m_myBz);
59
60 return atan2(sinChi, cosChi);
61
62};
63
64double
66{
67 double R = this->getPt() / m_myBz / m_charge; // cm
68 return 1 / R;
69};
70
71double
73{
74 return this->getZ() + this->getPz() / m_charge / m_myBz * this->getChi();
75};
76
77double
79{
80 double tanDip = this->getPz() / this->getPt();
81
82 return tanDip;
83};
84
85double
87{
88 double lambda = atan2(this->getPz(), this->getPt());
89 return lambda;
90};
91
double R
typedef autogenerated by FFTW
double getPx()
Getter for x component of momentum.
double m_myBz
Member variable for z component of B field.
double getZ()
Getter for z component of vertex.
double getPt()
Getter for transverse momentum.
double getY()
Getter for y component of vertex.
double getCharge()
Getter for electric charge of particle.
double getLambda()
Getter for Lambda.
double getZ0()
Getter for Z0.
double getX()
Getter for x component of vertex.
double getPy()
Getter for y component of momentum.
double getCotTheta()
Getter for Theta.
MCParticleInfo(const MCParticle &the_mcParticle, const ROOT::Math::XYZVector &the_magField)
Constructor.
double getPhi()
Getter for Phi.
double getPz()
Getter for z component of momentum.
double getOmega()
Getter for Omega.
const MCParticle & m_mcParticle
Reference to MC particle.
double getChi()
Getter for Chi.
double getD0()
Getter for D0.
double m_charge
Member variable for particle's electric charge.
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
double sqrt(double a)
sqrt for double
Definition beamHelpers.h:28
Abstract base class for different kinds of events.