Belle II Software light-2406-ragdoll
RestFrame Class Reference

Rest frame of a particle. More...

#include <ReferenceFrame.h>

Inheritance diagram for RestFrame:
Collaboration diagram for RestFrame:

Public Member Functions

 RestFrame (const Particle *particle)
 Create new rest frame.
 
virtual ROOT::Math::XYZVector getVertex (const ROOT::Math::XYZVector &vector) const override
 Get vertex 3-vector in rest frame system.
 
virtual ROOT::Math::PxPyPzEVector getMomentum (const ROOT::Math::PxPyPzEVector &vector) const override
 Get Lorentz vector in rest frame System.
 
virtual TMatrixFSym getMomentumErrorMatrix (const TMatrixFSym &matrix) const override
 Get Momentum error matrix in rest frame.
 
virtual TMatrixFSym getVertexErrorMatrix (const TMatrixFSym &matrix) const override
 Get Vertex error matrix in rest frame.
 
virtual ROOT::Math::XYZVector getVertex (const Particle *particle) const
 Wrapper for particles.
 
virtual ROOT::Math::PxPyPzEVector getMomentum (const Particle *particle) const
 Wrapper for particles.
 
virtual TMatrixFSym getMomentumErrorMatrix (const Particle *particle) const
 Wrapper for particles.
 
virtual TMatrixFSym getVertexErrorMatrix (const Particle *particle) const
 Wrapper for particles.
 

Static Public Member Functions

static const ReferenceFrameGetCurrent ()
 Get current rest frame.
 

Static Private Member Functions

static void Push (const ReferenceFrame *frame)
 Push rest frame of given particle.
 
static void Pop ()
 Pop current rest frame.
 

Private Attributes

ROOT::Math::PxPyPzEVector m_momentum
 momentum of RF in the lab frame
 
ROOT::Math::XYZVector m_displacement
 displacement of RF origin in th lab frame
 
ROOT::Math::XYZVector m_boost
 boost of RF relative to the lab frame
 
ROOT::Math::Boost m_lab2restframe
 Lorentz transformation connecting lab and rest frame.
 

Static Private Attributes

static std::stack< const ReferenceFrame * > m_reference_frames
 Stack of current rest frames.
 

Detailed Description

Rest frame of a particle.

Definition at line 132 of file ReferenceFrame.h.

Constructor & Destructor Documentation

◆ RestFrame()

RestFrame ( const Particle particle)
explicit

Create new rest frame.

Definition at line 18 of file ReferenceFrame.cc.

18 :
19 m_momentum(particle->get4Vector()),
20 m_displacement(particle->getVertex()),
21 m_boost(-m_momentum.BoostToCM()),
23{
24}
ROOT::Math::XYZVector getVertex() const
Returns vertex position (POCA for charged, IP for neutral FS particles)
Definition: Particle.h:631
ROOT::Math::PxPyPzEVector get4Vector() const
Returns Lorentz vector.
Definition: Particle.h:547
ROOT::Math::PxPyPzEVector m_momentum
momentum of RF in the lab frame
ROOT::Math::XYZVector m_displacement
displacement of RF origin in th lab frame
ROOT::Math::XYZVector m_boost
boost of RF relative to the lab frame
ROOT::Math::Boost m_lab2restframe
Lorentz transformation connecting lab and rest frame.

Member Function Documentation

◆ GetCurrent()

const ReferenceFrame & GetCurrent ( )
staticinherited

Get current rest frame.

Returns
RestFrame

Definition at line 26 of file ReferenceFrame.cc.

27{
28 if (m_reference_frames.empty()) {
29 static LabFrame _default;
30 return _default;
31 } else {
32 return *m_reference_frames.top();
33 }
34}
static std::stack< const ReferenceFrame * > m_reference_frames
Stack of current rest frames.

◆ getMomentum() [1/2]

virtual ROOT::Math::PxPyPzEVector getMomentum ( const Particle particle) const
inlinevirtualinherited

Wrapper for particles.

Parameters
particleparticle
Returns
momentum 4-vector in reference frame

Definition at line 60 of file ReferenceFrame.h.

61 {
62 return getMomentum(particle->get4Vector());
63 }
virtual ROOT::Math::PxPyPzEVector getMomentum(const ROOT::Math::PxPyPzEVector &vector) const =0
Get momentum 4-vector in reference frame.

◆ getMomentum() [2/2]

ROOT::Math::PxPyPzEVector getMomentum ( const ROOT::Math::PxPyPzEVector &  vector) const
overridevirtual

Get Lorentz vector in rest frame System.

Parameters
vectorLorentz vector from particle
Returns
Lorentz vector in rest frame System

Implements ReferenceFrame.

Definition at line 48 of file ReferenceFrame.cc.

49{
50 // 1. Boost momentum into rest frame
51 return m_lab2restframe * vector;
52}

◆ getMomentumErrorMatrix() [1/2]

virtual TMatrixFSym getMomentumErrorMatrix ( const Particle particle) const
inlinevirtualinherited

Wrapper for particles.

Parameters
particleparticle
Returns
Covariance matrix in reference frame

Definition at line 77 of file ReferenceFrame.h.

78 {
79 return getMomentumErrorMatrix(particle->getMomentumErrorMatrix());
80 }
virtual TMatrixFSym getMomentumErrorMatrix(const TMatrixFSym &matrix) const =0
Get Momentum error matrix in reference frame.

◆ getMomentumErrorMatrix() [2/2]

TMatrixFSym getMomentumErrorMatrix ( const TMatrixFSym &  matrix) const
overridevirtual

Get Momentum error matrix in rest frame.

Parameters
matrixCovariance matrix from particle
Returns
Covariance matrix in rest frame

Implements ReferenceFrame.

Definition at line 54 of file ReferenceFrame.cc.

55{
56 double lorentzrotationvalues[16];
57 m_lab2restframe.GetLorentzRotation(lorentzrotationvalues);
58 TMatrixD lorentzrot(4, 4, lorentzrotationvalues);
59
60 TMatrixFSym tmp_matrix(matrix);
61
62 return tmp_matrix.Similarity(lorentzrot);
63}

◆ getVertex() [1/2]

virtual ROOT::Math::XYZVector getVertex ( const Particle particle) const
inlinevirtualinherited

Wrapper for particles.

Parameters
particle
Returns
3-vector in reference frame

Definition at line 43 of file ReferenceFrame.h.

44 {
45 return getVertex(particle->getVertex());
46 }
virtual ROOT::Math::XYZVector getVertex(const ROOT::Math::XYZVector &vector) const =0
Get vertex 3-vector in reference frame.

◆ getVertex() [2/2]

ROOT::Math::XYZVector getVertex ( const ROOT::Math::XYZVector &  vector) const
overridevirtual

Get vertex 3-vector in rest frame system.

Parameters
vector3-vector from particle
Returns
3-vector in rest frame System

Implements ReferenceFrame.

Definition at line 36 of file ReferenceFrame.cc.

37{
38 // Transform Vertex from lab into rest frame:
39 // 1. Subtract displacement of rest frame origin in the lab frame
40 // 2. Use Lorentz Transformation to Boost Vertex vector into rest frame
41 // 3. Subtract movement of vertex end due to the time difference between
42 // the former simultaneous measured vertex points (see derivation of Lorentz contraction)
43 ROOT::Math::XYZVector v(vector - m_displacement);
44 ROOT::Math::PxPyPzEVector a = m_lab2restframe * ROOT::Math::PxPyPzEVector(v.X(), v.Y(), v.Z(), 0);
45 return a.Vect() - m_boost * a.T();
46}

◆ getVertexErrorMatrix() [1/2]

virtual TMatrixFSym getVertexErrorMatrix ( const Particle particle) const
inlinevirtualinherited

Wrapper for particles.

Parameters
particle
Returns
Covariance matrix in reference frame

Definition at line 94 of file ReferenceFrame.h.

95 {
96 return getVertexErrorMatrix(particle->getVertexErrorMatrix());
97 }
virtual TMatrixFSym getVertexErrorMatrix(const TMatrixFSym &matrix) const =0
Get Vertex error matrix in reference frame.

◆ getVertexErrorMatrix() [2/2]

TMatrixFSym getVertexErrorMatrix ( const TMatrixFSym &  matrix) const
overridevirtual

Get Vertex error matrix in rest frame.

Parameters
matrixCovariance matrix from particle
Returns
Covariance matrix in rest frame

Implements ReferenceFrame.

Definition at line 65 of file ReferenceFrame.cc.

66{
67 double lorentzrotationvalues[16];
68 m_lab2restframe.GetLorentzRotation(lorentzrotationvalues);
69 TMatrixD lorentzrot(4, 3);
70
71 for (int i = 0; i < 4; ++i)
72 for (int j = 0; j < 3; ++j)
73 lorentzrot(i, j) = lorentzrotationvalues[4 * i + j];
74
75 TMatrixFSym tmp_matrix(matrix);
76 auto rotated_error_matrix = tmp_matrix.Similarity(lorentzrot);
77
78 TMatrixD timeshift(3, 4);
79 timeshift.Zero();
80 timeshift(0, 0) = 1;
81 timeshift(1, 1) = 1;
82 timeshift(2, 2) = 1;
83 timeshift(0, 3) = m_boost.X();
84 timeshift(1, 3) = m_boost.Y();
85 timeshift(2, 3) = m_boost.Z();
86
87 return rotated_error_matrix.Similarity(timeshift);
88}

◆ Pop()

static void Pop ( )
inlinestaticprivateinherited

Pop current rest frame.

Definition at line 118 of file ReferenceFrame.h.

119 {
120 m_reference_frames.pop();
121 }

◆ Push()

static void Push ( const ReferenceFrame frame)
inlinestaticprivateinherited

Push rest frame of given particle.

Parameters
frameUse this reference frame

Definition at line 110 of file ReferenceFrame.h.

111 {
112 m_reference_frames.push(frame);
113 }

Member Data Documentation

◆ m_boost

ROOT::Math::XYZVector m_boost
private

boost of RF relative to the lab frame

Definition at line 171 of file ReferenceFrame.h.

◆ m_displacement

ROOT::Math::XYZVector m_displacement
private

displacement of RF origin in th lab frame

Definition at line 170 of file ReferenceFrame.h.

◆ m_lab2restframe

ROOT::Math::Boost m_lab2restframe
private

Lorentz transformation connecting lab and rest frame.

Definition at line 172 of file ReferenceFrame.h.

◆ m_momentum

ROOT::Math::PxPyPzEVector m_momentum
private

momentum of RF in the lab frame

Definition at line 169 of file ReferenceFrame.h.

◆ m_reference_frames

std::stack< const ReferenceFrame * > m_reference_frames
staticprivateinherited

Stack of current rest frames.

Definition at line 123 of file ReferenceFrame.h.


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