9#include <analysis/utility/ReferenceFrame.h>
19 m_momentum(particle->get4Vector()),
20 m_displacement(particle->getVertex()),
21 m_boost(-m_momentum.BoostToCM()),
22 m_lab2restframe(-m_boost)
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();
56 double lorentzrotationvalues[16];
58 TMatrixD lorentzrot(4, 4, lorentzrotationvalues);
60 TMatrixFSym tmp_matrix(matrix);
62 return tmp_matrix.Similarity(lorentzrot);
67 double lorentzrotationvalues[16];
69 TMatrixD lorentzrot(4, 3);
71 for (
int i = 0; i < 4; ++i)
72 for (
int j = 0; j < 3; ++j)
73 lorentzrot(i, j) = lorentzrotationvalues[4 * i + j];
75 TMatrixFSym tmp_matrix(matrix);
76 auto rotated_error_matrix = tmp_matrix.Similarity(lorentzrot);
78 TMatrixD timeshift(3, 4);
87 return rotated_error_matrix.Similarity(timeshift);
117 ROOT::Math::PxPyPzEVector a =
m_transform.
rotateLabToCms() * ROOT::Math::PxPyPzEVector(vector.X(), vector.Y(), vector.Z(), 0);
130 TMatrixD lorentzrot(4, 4);
134 TMatrixFSym tmp_matrix(matrix);
135 return tmp_matrix.Similarity(lorentzrot);
140 TMatrixD lorentzrot(4, 3);
142 TMatrixD labToCmsFrame(4, 4);
144 for (
int i = 0; i < 4; ++i)
145 for (
int j = 0; j < 3; ++j)
146 lorentzrot(i, j) = labToCmsFrame(i, j);
148 TMatrixFSym tmp_matrix(matrix);
149 auto rotated_error_matrix = tmp_matrix.Similarity(lorentzrot);
151 TMatrixD timeshift(3, 4);
157 timeshift(0, 3) = boost_vector(0);
158 timeshift(1, 3) = boost_vector(1);
159 timeshift(2, 3) = boost_vector(2);
161 return rotated_error_matrix.Similarity(timeshift);
165 const ROOT::Math::XYZVector& newZ) :
183 TMatrixD extendedrot(4, 4);
186 extendedrot(3, 3) = 1;
188 TMatrixFSym tmp_matrix(matrix);
189 return tmp_matrix.Similarity(extendedrot);
194 TMatrixD rotmatrix(3, 3);
197 TMatrixFSym tmp_matrix(matrix);
198 return tmp_matrix.Similarity(rotmatrix);
202 const ROOT::Math::XYZVector& newZ) :
203 rotationframe(newX, newY, newZ)
DataType Z() const
access variable Z (= .at(2) without boundary check)
DataType X() const
access variable X (= .at(0) without boundary check)
DataType Y() const
access variable Y (= .at(1) without boundary check)
virtual TMatrixFSym getVertexErrorMatrix(const TMatrixFSym &matrix) const override
Get Vertex error matrix in cms frame.
virtual TMatrixFSym getMomentumErrorMatrix(const TMatrixFSym &matrix) const override
Get Momentum error matrix in cms frame.
virtual ROOT::Math::XYZVector getVertex(const ROOT::Math::XYZVector &vector) const override
Get vertex 3-vector in cms frame.
PCmsLabTransform m_transform
Lab to CMS Transform.
virtual ROOT::Math::PxPyPzEVector getMomentum(const ROOT::Math::PxPyPzEVector &vector) const override
Get Lorentz vector in cms frame.
virtual TMatrixFSym getVertexErrorMatrix(const TMatrixFSym &matrix) const override
Get Vertex error matrix in rotation frame.
virtual TMatrixFSym getMomentumErrorMatrix(const TMatrixFSym &matrix) const override
Get Momentum error matrix in rotation frame.
virtual ROOT::Math::XYZVector getVertex(const ROOT::Math::XYZVector &vector) const override
Get vertex 3-vector in rotation frame.
CMSRotationFrame(const ROOT::Math::XYZVector &newX, const ROOT::Math::XYZVector &newY, const ROOT::Math::XYZVector &newZ)
Create new rotation frame.
RotationFrame rotationframe
Rotationframe.
CMSFrame cmsframe
CMSFrame.
virtual ROOT::Math::PxPyPzEVector getMomentum(const ROOT::Math::PxPyPzEVector &vector) const override
Get Lorentz vector in rotation frame.
virtual TMatrixFSym getVertexErrorMatrix(const TMatrixFSym &matrix) const override
Get Vertex error matrix in lab frame.
virtual TMatrixFSym getMomentumErrorMatrix(const TMatrixFSym &matrix) const override
Get Momentum error matrix in lab frame.
virtual ROOT::Math::XYZVector getVertex(const ROOT::Math::XYZVector &vector) const override
Get vertex 3-vector in lab frame.
virtual ROOT::Math::PxPyPzEVector getMomentum(const ROOT::Math::PxPyPzEVector &vector) const override
Get Lorentz vector in lab frame.
Class to store reconstructed particles.
Abstract base class of all reference frames.
static std::stack< const ReferenceFrame * > m_reference_frames
Stack of current rest frames.
static const ReferenceFrame & GetCurrent()
Get current rest frame.
virtual TMatrixFSym getVertexErrorMatrix(const TMatrixFSym &matrix) const override
Get Vertex error matrix in rest frame.
virtual TMatrixFSym getMomentumErrorMatrix(const TMatrixFSym &matrix) const override
Get Momentum error matrix in rest frame.
ROOT::Math::XYZVector m_displacement
displacement of RF origin in th lab frame
virtual ROOT::Math::XYZVector getVertex(const ROOT::Math::XYZVector &vector) const override
Get vertex 3-vector in rest frame system.
RestFrame(const Particle *particle)
Create new rest frame.
ROOT::Math::XYZVector m_boost
boost of RF relative to the lab frame
virtual ROOT::Math::PxPyPzEVector getMomentum(const ROOT::Math::PxPyPzEVector &vector) const override
Get Lorentz vector in rest frame System.
ROOT::Math::Boost m_lab2restframe
Lorentz transformation connecting lab and rest frame.
virtual TMatrixFSym getVertexErrorMatrix(const TMatrixFSym &matrix) const override
Get Vertex error matrix in rotation frame.
virtual TMatrixFSym getMomentumErrorMatrix(const TMatrixFSym &matrix) const override
Get Momentum error matrix in rotation frame.
virtual ROOT::Math::XYZVector getVertex(const ROOT::Math::XYZVector &vector) const override
Get vertex 3-vector in rotation frame.
RotationFrame(const ROOT::Math::XYZVector &newX, const ROOT::Math::XYZVector &newY, const ROOT::Math::XYZVector &newZ)
Create new rotation frame.
ROOT::Math::Rotation3D m_rotation
Rotation.
virtual ROOT::Math::PxPyPzEVector getMomentum(const ROOT::Math::PxPyPzEVector &vector) const override
Get Lorentz vector in rotation frame.
Abstract base class for different kinds of events.