Belle II Software  release-05-02-19
MCParticleInfo.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Giulia Casarosa *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <mdst/dataobjects/MCParticle.h>
12 #include <tracking/dataobjects/MCParticleInfo.h>
13 
14 using namespace std;
15 using namespace Belle2;
16 
17 MCParticleInfo::MCParticleInfo(const MCParticle& the_mcParticle, const TVector3& the_magField)
18  : m_mcParticle(the_mcParticle)
19  , m_myBz(the_magField.Mag())
20  , m_charge(the_mcParticle.getCharge())
21 {
22  // set units to: cm, GeV/c
23  m_myBz *= 0.299792 / 100;
24 } ;
25 
26 double
28 {
29 
30  double pt = this->getPt();
31  double px = this->getPx();
32  double py = this->getPy();
33  double x = this->getX();
34  double y = this->getY();
35  double R = 1 / this->getOmega(); //cm
36 
37  double alpha = R / pt; //cm/GeV
38  double Cx = x + alpha * py; //cm
39  double Cy = y - alpha * px; //cm
40  double d0 = sqrt(Cx * Cx + Cy * Cy) - R * m_charge; //cm
41  d0 = d0 * m_charge;
42 
43  return d0;
44 };
45 
46 double
48 {
49  return atan2(this->getPy(), this->getPx()) - this->getChi();
50 };
51 
52 double
54 {
55  double px = this->getPx();
56  double py = this->getPy();
57  double pt = this->getPt();
58  double x = this->getX();
59  double y = this->getY();
60 
61  double sinChi = -m_charge * (px * x + py * y);
62  double cosChi = -m_charge * (px * y - py * x - (pt * pt) / m_charge / m_myBz);
63 
64  return atan2(sinChi, cosChi);
65 
66 };
67 
68 double
70 {
71  double R = this->getPt() / m_myBz / m_charge; // cm
72  return 1 / R;
73 };
74 
75 double
77 {
78  return this->getZ() + this->getPz() / m_charge / m_myBz * this->getChi();
79 };
80 
81 double
83 {
84  double tanDip = this->getPz() / this->getPt();
85 
86  return tanDip;
87 };
88 
89 double
91 {
92  double lambda = atan2(this->getPz(), this->getPt());
93  return lambda;
94 };
95 
Belle2::MCParticleInfo::getZ
double getZ()
Getter for z component of vertex.
Definition: MCParticleInfo.h:59
Belle2::MCParticleInfo::getPy
double getPy()
Getter for y component of momentum.
Definition: MCParticleInfo.h:44
Belle2::MCParticleInfo::getY
double getY()
Getter for y component of vertex.
Definition: MCParticleInfo.h:57
Belle2::MCParticleInfo::getZ0
double getZ0()
Getter for Z0.
Definition: MCParticleInfo.cc:76
Belle2::MCParticleInfo::getPhi
double getPhi()
Getter for Phi.
Definition: MCParticleInfo.cc:47
Belle2::MCParticleInfo::getPt
double getPt()
Getter for transverse momentum.
Definition: MCParticleInfo.h:48
Belle2::MCParticleInfo::m_myBz
double m_myBz
Member variable for z component of B field.
Definition: MCParticleInfo.h:90
Belle2::MCParticleInfo::m_charge
double m_charge
Member variable for particle's electric charge.
Definition: MCParticleInfo.h:92
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::MCParticleInfo::getOmega
double getOmega()
Getter for Omega.
Definition: MCParticleInfo.cc:69
Belle2::MCParticleInfo::getX
double getX()
Getter for x component of vertex.
Definition: MCParticleInfo.h:55
Belle2::MCParticleInfo::getPx
double getPx()
Getter for x component of momentum.
Definition: MCParticleInfo.h:42
Belle2::MCParticle
A Class to store the Monte Carlo particle information.
Definition: MCParticle.h:43
Belle2::MCParticleInfo::getPz
double getPz()
Getter for z component of momentum.
Definition: MCParticleInfo.h:46
Belle2::MCParticleInfo::getD0
double getD0()
Getter for D0.
Definition: MCParticleInfo.cc:27
Belle2::MCParticleInfo::getChi
double getChi()
Getter for Chi.
Definition: MCParticleInfo.cc:53
Belle2::MCParticleInfo::getLambda
double getLambda()
Getter for Lambda.
Definition: MCParticleInfo.cc:90
Belle2::MCParticleInfo::getCotTheta
double getCotTheta()
Getter for Theta.
Definition: MCParticleInfo.cc:82