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]

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 cms frame.

Parameters
vectorLorentz vector from particle
Returns
Lorentz vector in cms frame

Implements ReferenceFrame.

Definition at line 122 of file ReferenceFrame.cc.

123{
124 // 1. Boost momentum into cms frame
125 return m_transform.rotateLabToCms() * vector;
126}
PCmsLabTransform m_transform
Lab to CMS Transform.
const ROOT::Math::LorentzRotation rotateLabToCms() const
Returns Lorentz transformation from Lab to CMS.

◆ 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 cms frame.

Parameters
matrixCovariance matrix from particle
Returns
Covariance matrix in cms frame

Implements ReferenceFrame.

Definition at line 128 of file ReferenceFrame.cc.

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

◆ 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 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() - ROOT::Math::XYZVector(m_transform.getBoostVector().X(), m_transform.getBoostVector().Y(),
119 m_transform.getBoostVector().Z()) * a.T();
120}
DataType Z() const
access variable Z (= .at(2) without boundary check)
Definition: B2Vector3.h:435
DataType X() const
access variable X (= .at(0) without boundary check)
Definition: B2Vector3.h:431
DataType Y() const
access variable Y (= .at(1) without boundary check)
Definition: B2Vector3.h:433
B2Vector3D getBoostVector() const
Returns boost vector (beta=p/E)

◆ 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 cms frame.

Parameters
matrixCovariance matrix from particle
Returns
Covariance matrix in cms frame

Implements ReferenceFrame.

Definition at line 138 of file ReferenceFrame.cc.

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

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