Belle II Software development
CMSFrame Class Reference

CMS frame. More...

#include <ReferenceFrame.h>

Inheritance diagram for CMSFrame:
ReferenceFrame

Public Member Functions

virtual ROOT::Math::XYZVector getVertex (const ROOT::Math::XYZVector &vector) const override
 Get vertex 3-vector in cms frame.
 
virtual ROOT::Math::PxPyPzEVector getMomentum (const ROOT::Math::PxPyPzEVector &vector) const override
 Get Lorentz vector in cms frame.
 
virtual TMatrixFSym getMomentumErrorMatrix (const TMatrixFSym &matrix) const override
 Get Momentum error matrix in cms frame.
 
virtual TMatrixFSym getVertexErrorMatrix (const TMatrixFSym &matrix) const override
 Get Vertex error matrix in cms 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

PCmsLabTransform m_transform
 Lab to CMS Transform.
 

Static Private Attributes

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

Detailed Description

CMS frame.

Definition at line 215 of file ReferenceFrame.h.

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]

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

Get Lorentz vector in cms frame.

Parameters
vectorLorentz vector from particle
Returns
Lorentz vector in cms frame

Implements ReferenceFrame.

Definition at line 121 of file ReferenceFrame.cc.

122{
123 // 1. Boost momentum into cms frame
124 return m_transform.rotateLabToCms() * vector;
125}
PCmsLabTransform m_transform
Lab to CMS Transform.

◆ getMomentum() [2/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 }

◆ getMomentumErrorMatrix() [1/2]

TMatrixFSym getMomentumErrorMatrix ( const TMatrixFSym & matrix) const
overridevirtual

Get Momentum error matrix in cms frame.

Parameters
matrixCovariance matrix from particle
Returns
Covariance matrix in cms frame

Implements ReferenceFrame.

Definition at line 127 of file ReferenceFrame.cc.

128{
129 TMatrixD lorentzrot(4, 4);
130
131 m_transform.rotateLabToCms().GetRotationMatrix(lorentzrot);
132
133 TMatrixFSym tmp_matrix(matrix);
134 return tmp_matrix.Similarity(lorentzrot);
135}

◆ getMomentumErrorMatrix() [2/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 }

◆ getVertex() [1/2]

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

Get vertex 3-vector in cms frame.

Parameters
vector3-vector from particle
Returns
3-vector in cms frame

Implements ReferenceFrame.

Definition at line 110 of file ReferenceFrame.cc.

111{
112 // Transform Vertex from lab into cms frame:
113 // TODO 0: Subtract fitted IP similar to RestFrame
114 // 1. Use Lorentz Transformation to Boost Vertex vector into cms frame
115 // 2. Subtract movement of vertex end due to the time difference between
116 // the former simultaneous measured vertex points (see derivation of Lorentz contraction)
117 ROOT::Math::PxPyPzEVector a = m_transform.rotateLabToCms() * ROOT::Math::PxPyPzEVector(vector.X(), vector.Y(), vector.Z(), 0);
118 return a.Vect() - m_transform.getBoostVector() * a.T();
119}

◆ getVertex() [2/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 }

◆ getVertexErrorMatrix() [1/2]

TMatrixFSym getVertexErrorMatrix ( const TMatrixFSym & matrix) const
overridevirtual

Get Vertex error matrix in cms frame.

Parameters
matrixCovariance matrix from particle
Returns
Covariance matrix in cms frame

Implements ReferenceFrame.

Definition at line 137 of file ReferenceFrame.cc.

138{
139 TMatrixD lorentzrot(4, 3);
140
141 TMatrixD labToCmsFrame(4, 4);
142 m_transform.rotateLabToCms().GetRotationMatrix(labToCmsFrame);
143 for (int i = 0; i < 4; ++i)
144 for (int j = 0; j < 3; ++j)
145 lorentzrot(i, j) = labToCmsFrame(i, j);
146
147 TMatrixFSym tmp_matrix(matrix);
148 auto rotated_error_matrix = tmp_matrix.Similarity(lorentzrot);
149
150 TMatrixD timeshift(3, 4);
151 timeshift.Zero();
152 auto boost_vector = m_transform.getBoostVector();
153 timeshift(0, 0) = 1;
154 timeshift(1, 1) = 1;
155 timeshift(2, 2) = 1;
156 timeshift(0, 3) = boost_vector.X();
157 timeshift(1, 3) = boost_vector.Y();
158 timeshift(2, 3) = boost_vector.Z();
159
160 return rotated_error_matrix.Similarity(timeshift);
161}

◆ getVertexErrorMatrix() [2/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 }

◆ 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_reference_frames

std::stack< const ReferenceFrame * > m_reference_frames
staticprivateinherited

Stack of current rest frames.

Definition at line 123 of file ReferenceFrame.h.

◆ m_transform

PCmsLabTransform m_transform
private

Lab to CMS Transform.

Definition at line 247 of file ReferenceFrame.h.


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