Belle II Software development
MCParticleInfo Class Reference

This struct is used by the TrackingPerformanceEvaluation Module to save information of reconstructed tracks. More...

#include <MCParticleInfo.h>

Public Member Functions

 MCParticleInfo (const MCParticle &the_mcParticle, const ROOT::Math::XYZVector &the_magField)
 Constructor.
 
double getPx ()
 Getter for x component of momentum.
 
double getPy ()
 Getter for y component of momentum.
 
double getPz ()
 Getter for z component of momentum.
 
double getPt ()
 Getter for transverse momentum.
 
double getP ()
 Getter for magnitut of momentum.
 
double getEnergy ()
 Getter for energy.
 
double getX ()
 Getter for x component of vertex.
 
double getY ()
 Getter for y component of vertex.
 
double getZ ()
 Getter for z component of vertex.
 
double getPtheta ()
 Getter for theta of momentum vector.
 
double getPphi ()
 Getter for phi of momentum vector.
 
double getCharge ()
 Getter for electric charge of particle.
 
double getD0 ()
 Getter for D0.
 
double getZ0 ()
 Getter for Z0.
 
double getPhi ()
 Getter for Phi.
 
double getOmega ()
 Getter for Omega.
 
double getCotTheta ()
 Getter for Theta.
 
double getLambda ()
 Getter for Lambda.
 
double getChi ()
 Getter for Chi.
 

Private Attributes

const MCParticlem_mcParticle
 Reference to MC particle.
 
double m_myBz
 Member variable for z component of B field.
 
double m_charge
 Member variable for particle's electric charge.
 

Detailed Description

This struct is used by the TrackingPerformanceEvaluation Module to save information of reconstructed tracks.

Definition at line 22 of file MCParticleInfo.h.

Constructor & Destructor Documentation

◆ MCParticleInfo()

MCParticleInfo ( const MCParticle the_mcParticle,
const ROOT::Math::XYZVector &  the_magField 
)

Constructor.

Definition at line 14 of file MCParticleInfo.cc.

15 : m_mcParticle(the_mcParticle)
16 , m_myBz(the_magField.R())
17 , m_charge(the_mcParticle.getCharge())
18{
19 // set units to: cm, GeV/c
20 m_myBz *= 0.299792 / 100;
21} ;
double m_myBz
Member variable for z component of B field.
const MCParticle & m_mcParticle
Reference to MC particle.
double m_charge
Member variable for particle's electric charge.
float getCharge() const
Return the particle charge defined in TDatabasePDG.
Definition: MCParticle.cc:36

Member Function Documentation

◆ getCharge()

double getCharge ( )
inline

Getter for electric charge of particle.

Definition at line 55 of file MCParticleInfo.h.

55{ return m_mcParticle.getCharge(); };

◆ getChi()

double getChi ( )

Getter for Chi.

Definition at line 50 of file MCParticleInfo.cc.

51{
52 double px = this->getPx();
53 double py = this->getPy();
54 double pt = this->getPt();
55 double x = this->getX();
56 double y = this->getY();
57
58 double sinChi = -m_charge * (px * x + py * y);
59 double cosChi = -m_charge * (px * y - py * x - (pt * pt) / m_charge / m_myBz);
60
61 return atan2(sinChi, cosChi);
62
63};
double getPx()
Getter for x component of momentum.
double getPt()
Getter for transverse momentum.
double getY()
Getter for y component of vertex.
double getX()
Getter for x component of vertex.
double getPy()
Getter for y component of momentum.

◆ getCotTheta()

double getCotTheta ( )

Getter for Theta.

Definition at line 79 of file MCParticleInfo.cc.

80{
81 double tanDip = this->getPz() / this->getPt();
82
83 return tanDip;
84};
double getPz()
Getter for z component of momentum.

◆ getD0()

double getD0 ( )

Getter for D0.

Definition at line 24 of file MCParticleInfo.cc.

25{
26
27 double pt = this->getPt();
28 double px = this->getPx();
29 double py = this->getPy();
30 double x = this->getX();
31 double y = this->getY();
32 double R = 1 / this->getOmega(); //cm
33
34 double alpha = R / pt; //cm/GeV
35 double Cx = x + alpha * py; //cm
36 double Cy = y - alpha * px; //cm
37 double d0 = sqrt(Cx * Cx + Cy * Cy) - R * m_charge; //cm
38 d0 = d0 * m_charge;
39
40 return d0;
41};
double R
typedef autogenerated by FFTW
double getOmega()
Getter for Omega.
double sqrt(double a)
sqrt for double
Definition: beamHelpers.h:28

◆ getEnergy()

double getEnergy ( )
inline

Getter for energy.

Definition at line 40 of file MCParticleInfo.h.

40{ return m_mcParticle.getEnergy(); };
float getEnergy() const
Return particle energy in GeV.
Definition: MCParticle.h:147

◆ getLambda()

double getLambda ( )

Getter for Lambda.

Definition at line 87 of file MCParticleInfo.cc.

88{
89 double lambda = atan2(this->getPz(), this->getPt());
90 return lambda;
91};

◆ getOmega()

double getOmega ( )

Getter for Omega.

Definition at line 66 of file MCParticleInfo.cc.

67{
68 double R = this->getPt() / m_myBz / m_charge; // cm
69 return 1 / R;
70};

◆ getP()

double getP ( )
inline

Getter for magnitut of momentum.

Definition at line 38 of file MCParticleInfo.h.

38{ return m_mcParticle.getMomentum().R(); };
ROOT::Math::XYZVector getMomentum() const
Return momentum.
Definition: MCParticle.h:198

◆ getPhi()

double getPhi ( )

Getter for Phi.

Definition at line 44 of file MCParticleInfo.cc.

45{
46 return atan2(this->getPy(), this->getPx()) - this->getChi();
47};
double getChi()
Getter for Chi.

◆ getPphi()

double getPphi ( )
inline

Getter for phi of momentum vector.

Definition at line 52 of file MCParticleInfo.h.

52{ return m_mcParticle.getMomentum().Phi(); };

◆ getPt()

double getPt ( )
inline

Getter for transverse momentum.

Definition at line 36 of file MCParticleInfo.h.

36{ return m_mcParticle.getMomentum().Rho(); };

◆ getPtheta()

double getPtheta ( )
inline

Getter for theta of momentum vector.

Definition at line 50 of file MCParticleInfo.h.

50{ return m_mcParticle.getMomentum().Theta(); };

◆ getPx()

double getPx ( )
inline

Getter for x component of momentum.

Definition at line 30 of file MCParticleInfo.h.

30{ return m_mcParticle.getMomentum().x(); };

◆ getPy()

double getPy ( )
inline

Getter for y component of momentum.

Definition at line 32 of file MCParticleInfo.h.

32{ return m_mcParticle.getMomentum().y(); };

◆ getPz()

double getPz ( )
inline

Getter for z component of momentum.

Definition at line 34 of file MCParticleInfo.h.

34{ return m_mcParticle.getMomentum().z(); };

◆ getX()

double getX ( )
inline

Getter for x component of vertex.

Definition at line 43 of file MCParticleInfo.h.

43{ return m_mcParticle.getVertex().X(); };
ROOT::Math::XYZVector getVertex() const
Return production vertex position, shorthand for getProductionVertex().
Definition: MCParticle.h:183

◆ getY()

double getY ( )
inline

Getter for y component of vertex.

Definition at line 45 of file MCParticleInfo.h.

45{ return m_mcParticle.getVertex().Y(); };

◆ getZ()

double getZ ( )
inline

Getter for z component of vertex.

Definition at line 47 of file MCParticleInfo.h.

47{ return m_mcParticle.getVertex().Z(); };

◆ getZ0()

double getZ0 ( )

Getter for Z0.

Definition at line 73 of file MCParticleInfo.cc.

74{
75 return this->getZ() + this->getPz() / m_charge / m_myBz * this->getChi();
76};
double getZ()
Getter for z component of vertex.

Member Data Documentation

◆ m_charge

double m_charge
private

Member variable for particle's electric charge.

Definition at line 80 of file MCParticleInfo.h.

◆ m_mcParticle

const MCParticle& m_mcParticle
private

Reference to MC particle.

Definition at line 76 of file MCParticleInfo.h.

◆ m_myBz

double m_myBz
private

Member variable for z component of B field.

Definition at line 78 of file MCParticleInfo.h.


The documentation for this class was generated from the following files: