Vector classes (2D, 3D and 4D / Lorentz vector) and their transformations.
These classes represent vectors and their operations and transformations, such as rotations and Lorentz transformations, in two, three and four dimensions. The 4D space-time is used for physics vectors representing relativistic particles in Minkowski-space. These vectors are different from Linear Algebra vectors or std::vector
which describe generic N-dimensional vectors.
Hint: the most commonly used Lorentz vector class is ROOT::Math::PtEtaPhiMVector, a typedef to ROOT::Math::LorentzVector < ROOT::Math::PtEtaPhiM4D < double > >.
Mathematically, vectors and points are two distinct concepts. They have different transformations: vectors can only be rotated, while points can be rotated or translated. You can add two vectors but not two points, and the difference between two points is a vector. We then distinguish for the 2 and 3 dimensional case, between points and vectors, modeling them with different classes:
ROOT::Math::LorentzVector models 4D space-time vectors. There is no class for a 4D point.
The vector classes are based on a generic type of coordinate system, expressed as a template parameter of the class. Various classes exist to describe the various coordinates systems:
The angle theta is defined between [0, \(\pi\)] and phi between [- \(\pi\), \(\pi\)]. The angles are expressed in radians. The eta component is known as pseudo-rapidity.
Users can define the Vectors according to the coordinate type which is most efficient for their use. Transformations between the various coordinate systems are available through copy constructors or the assignment operator =
. The coordinate system classes are templated on the scalar type for maximum flexibility, and to minimize memory usage for some use cases.
The 2D and 3D point and vector classes can be associated to a tag defining the coordinate system. This can be used to distinguish between vectors of different coordinate systems like global or local vectors. The coordinate system tag is a template parameter of the ROOT::Math::DisplacementVector3D (and ROOT::Math::DisplacementVector2D) and ROOT::Math::PositionVector3D (and ROOT::Math::PositionVector2D) classes. A default tag, ROOT::Math::DefaultCoordinateSystemTag, exists for users who don't need this functionality.
To avoid exposing templated parameters to the users, typedefs are defined for all types of vectors based an double
s and float
s. The table below lists the double
versions; the float
counterpart ends on an extra F
, such as ROOT::Math::XYPointF instead of ROOT::Math::XYPoint.
Type definitions for points in two dimensions, based on ROOT::Math::PositionVector2D, are defined by Math/Point2D.h
:
Type definitions for vectors in two dimensions, based on ROOT::Math::DisplacementVector2D, are defined by Math/Vector2D.h
:
Type definitions for points in three dimensions, based on ROOT::Math::PositionVector3D, are defined by Math/Point3D.h
:
Type definitions for vectors in three dimensions, based on ROOT::Math::DisplacementVector3D, are defined by Math/Vector3D.h
:
Type definitions for Lorentz vectors in four dimensions, based on ROOT::Math::LorentzVector, are defined by Math/Vector4D.h
:
The metric used for any such LorentzVector is (-,-,-,+).
Check the functions below, as well as in ROOT::Math::VectorUtil for non-member functions such as DeltaR, Angle, boost.
A vector can be constructed from its coordinate representation:
In addition, the vector classes can be constructed from any object that implements the accessors x(), y() and z(). This can be a vector using a different coordinate system, or even an object from a different package as long as it implements the required signatures. One such vector type is CLHEP's Hep3Vector
:
The following operations are possible between vector classes, even of different coordinate system types:
Note that the multiplication between two vectors using the operator *
is not supported because it is ambiguous.
ROOT::Math::PxPyPzM4D
** or **ROOT::Math::PtEtaPhiM4D
**) the unary operator -
(negation) doesn't perform a 4-vector negation. Instead, it negates only the spatial components, which might result in unintuive behaviours (for instance, for PxPyPzM4D coordinate system, \(\textbf{v}+ \left(-\textbf{v}\right) \neq \textbf{v} -\textbf{v}\)).The vector classes support methods for:
The transformations are modeled using simple (non-template) classes, using double
as the scalar type to avoid too large numerical errors. The transformations are grouped in Rotations (in 3 dimensions), Lorentz transformations. Each group has several members which may model physically equivalent transformations but with different internal representations. Transformation classes can operate on all type of vectors using the operator()
or the operator *
and the transformations can also be combined via the operator *
. In more detail the transformations available are:
For compatibility with CLHEP, the vector classes can be constructed easily from a CLHEP Hep3Vector
or HepLorentzVector
, by using a template constructor, which requires only that the classes implement the accessors x()
, y()
and z()
(and t()
for HepLorentzVector
). The vector classes also provide member function with the same naming convention as CLHEP for the most used functions like x()
, y()
and z()
.
A more detailed description of all the GenVector classes is available in this document.
Namespaces | |
namespace | ROOT::Math::VectorUtil |
Global Helper functions for generic Vector classes. | |
Classes | |
class | ROOT::Math::AxisAngle |
AxisAngle class describing rotation represented with direction axis (3D Vector) and an angle of rotation around that axis. More... | |
class | ROOT::Math::Boost |
Lorentz boost class with the (4D) transformation represented internally by a 4x4 orthosymplectic matrix. More... | |
class | ROOT::Math::BoostX |
Class representing a Lorentz Boost along the X axis, by beta. More... | |
class | ROOT::Math::BoostY |
Class representing a Lorentz Boost along the Y axis, by beta. More... | |
class | ROOT::Math::BoostZ |
Class representing a Lorentz Boost along the Z axis, by beta. More... | |
class | ROOT::Math::Cartesian2D< T > |
Class describing a 2D cartesian coordinate system (x, y coordinates) More... | |
class | ROOT::Math::Cartesian3D< T > |
Class describing a 3D cartesian coordinate system (x, y, z coordinates) More... | |
class | ROOT::Math::Cylindrical3D< T > |
Class describing a cylindrical coordinate system based on rho, z and phi. More... | |
class | ROOT::Math::CylindricalEta3D< T > |
Class describing a cylindrical coordinate system based on eta (pseudorapidity) instead of z. More... | |
class | ROOT::Math::DefaultCoordinateSystemTag |
DefaultCoordinateSystemTag Default tag for identifying any coordinate system. More... | |
class | ROOT::Math::DisplacementVector2D< CoordSystem, Tag > |
Class describing a generic displacement vector in 2 dimensions. More... | |
class | ROOT::Math::DisplacementVector3D< CoordSystem, Tag > |
Class describing a generic displacement vector in 3 dimensions. More... | |
class | ROOT::Math::EulerAngles |
EulerAngles class describing rotation as three angles (Euler Angles). More... | |
class | ROOT::Math::GlobalCoordinateSystemTag |
Tag for identifying vectors based on a global coordinate system. More... | |
class | ROOT::Math::LocalCoordinateSystemTag |
Tag for identifying vectors based on a local coordinate system. More... | |
class | ROOT::Math::LorentzRotation |
Lorentz transformation class with the (4D) transformation represented by a 4x4 orthosymplectic matrix. More... | |
class | ROOT::Math::LorentzVector< CoordSystem > |
Class describing a generic LorentzVector in the 4D space-time, using the specified coordinate system for the spatial vector part. More... | |
class | ROOT::Math::Impl::Plane3D< T > |
Class describing a geometrical plane in 3 dimensions. More... | |
class | ROOT::Math::Polar2D< T > |
Class describing a polar 2D coordinate system based on r and phi Phi is restricted to be in the range [-PI,PI) More... | |
class | ROOT::Math::Polar3D< T > |
Class describing a polar coordinate system based on r, theta and phi Phi is restricted to be in the range [-PI,PI) More... | |
class | ROOT::Math::PositionVector2D< CoordSystem, Tag > |
Class describing a generic position vector (point) in 2 dimensions. More... | |
class | ROOT::Math::PositionVector3D< CoordSystem, Tag > |
Class describing a generic position vector (point) in 3 dimensions. More... | |
class | ROOT::Math::PtEtaPhiE4D< ScalarType > |
Class describing a 4D cylindrical coordinate system using Pt , Phi, Eta and E (or rho, phi, eta , T) The metric used is (-,-,-,+). More... | |
class | ROOT::Math::PtEtaPhiM4D< ScalarType > |
Class describing a 4D cylindrical coordinate system using Pt , Phi, Eta and M (mass) The metric used is (-,-,-,+). More... | |
class | ROOT::Math::PxPyPzE4D< ScalarType > |
Class describing a 4D cartesian coordinate system (x, y, z, t coordinates) or momentum-energy vectors stored as (Px, Py, Pz, E). More... | |
class | ROOT::Math::PxPyPzM4D< ScalarType > |
Class describing a 4D coordinate system or momentum-energy vectors stored as (Px, Py, Pz, M). More... | |
class | ROOT::Math::Quaternion |
Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k). More... | |
class | ROOT::Math::Rotation3D |
Rotation class with the (3D) rotation represented by a 3x3 orthogonal matrix. More... | |
class | ROOT::Math::RotationX |
Rotation class representing a 3D rotation about the X axis by the angle of rotation. More... | |
class | ROOT::Math::RotationY |
Rotation class representing a 3D rotation about the Y axis by the angle of rotation. More... | |
class | ROOT::Math::RotationZ |
Rotation class representing a 3D rotation about the Z axis by the angle of rotation. More... | |
class | ROOT::Math::RotationZYX |
Rotation class with the (3D) rotation represented by angles describing first a rotation of an angle phi (yaw) about the Z axis, followed by a rotation of an angle theta (pitch) about the Y axis, followed by a third rotation of an angle psi (roll) about the X axis. More... | |
class | ROOT::Math::Impl::Transform3D< T > |
Basic 3D Transformation class describing a rotation and then a translation The internal data are a 3D rotation data (represented as a 3x3 matrix) and a 3D vector data. More... | |
class | ROOT::Math::Impl::Translation3D< T > |
Class describing a 3 dimensional translation. More... | |
Functions | |
template<class CoordSystem > | |
LorentzVector< CoordSystem >::Scalar | ROOT::Math::Acoplanarity (LorentzVector< CoordSystem > const &pp, LorentzVector< CoordSystem > const &pm) |
pair (p+ p-) acoplanarity alpha = 1 - |phi+ - phi-|/pi . | |
template<class Vector1 , class Vector2 > | |
double | ROOT::Math::VectorUtil::Angle (const Vector1 &v1, const Vector2 &v2) |
Find Angle between two vectors. | |
template<class CoordSystem > | |
LorentzVector< CoordSystem >::Scalar | ROOT::Math::AsymmetryScalar (LorentzVector< CoordSystem > const &pp, LorentzVector< CoordSystem > const &pm) |
pair (p+ p-) scalar asymmetry As = ||Pt+| - |Pt-|/||Pt+| + |Pt-|| . | |
template<class CoordSystem > | |
LorentzVector< CoordSystem >::Scalar | ROOT::Math::AsymmetryVectorial (LorentzVector< CoordSystem > const &pp, LorentzVector< CoordSystem > const &pm) |
pair (p+ p-) vectorial asymmetry Av = |Pt+ - Pt-|/|Pt+ + Pt-| . | |
template<class LVector , class BoostVector > | |
LVector | ROOT::Math::VectorUtil::boost (const LVector &v, const BoostVector &b) |
Boost a generic Lorentz Vector class using a generic 3D Vector class describing the boost The only requirement on the vector is that implements the X(), Y(), Z(), T() and SetXYZT methods. | |
template<class LVector , class T > | |
LVector | ROOT::Math::VectorUtil::boostX (const LVector &v, T beta) |
Boost a generic Lorentz Vector class along the X direction with a factor beta The only requirement on the vector is that implements the X(), Y(), Z(), T() and SetXYZT methods. | |
template<class LVector > | |
LVector | ROOT::Math::VectorUtil::boostY (const LVector &v, double beta) |
Boost a generic Lorentz Vector class along the Y direction with a factor beta The only requirement on the vector is that implements the X(), Y(), Z(), T() methods and be constructed from x,y,z,t values The beta of the boost must be <= 1 or a nul Lorentz Vector will be returned. | |
template<class LVector > | |
LVector | ROOT::Math::VectorUtil::boostZ (const LVector &v, double beta) |
Boost a generic Lorentz Vector class along the Z direction with a factor beta The only requirement on the vector is that implements the X(), Y(), Z(), T() methods and be constructed from x,y,z,t values The beta of the boost must be <= 1 or a nul Lorentz Vector will be returned. | |
template<class Vector1 , class Vector2 > | |
double | ROOT::Math::VectorUtil::CosTheta (const Vector1 &v1, const Vector2 &v2) |
Find CosTheta Angle between two generic 3D vectors pre-requisite: vectors implement the X(), Y() and Z() | |
template<class Vector1 , class Vector2 > | |
Vector1::Scalar | ROOT::Math::VectorUtil::DeltaPhi (const Vector1 &v1, const Vector2 &v2) |
Find aximutal Angle difference between two generic vectors ( v2.Phi() - v1.Phi() ) The only requirements on the Vector classes is that they implement the Phi() method. | |
template<class Vector1 , class Vector2 > | |
Vector1::Scalar | ROOT::Math::VectorUtil::DeltaR (const Vector1 &v1, const Vector2 &v2) |
Find difference in pseudorapidity (Eta) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Eta() method. | |
template<class Vector1 , class Vector2 > | |
Vector1::Scalar | ROOT::Math::VectorUtil::DeltaR2 (const Vector1 &v1, const Vector2 &v2) |
Find square of the difference in pseudorapidity (Eta) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Eta() method. | |
template<class Vector1 , class Vector2 > | |
Vector1::Scalar | ROOT::Math::VectorUtil::DeltaR2RapidityPhi (const Vector1 &v1, const Vector2 &v2) |
Find square of the difference in true rapidity (y) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Rapidity() method. | |
template<class Vector1 , class Vector2 > | |
Vector1::Scalar | ROOT::Math::VectorUtil::DeltaRapidityPhi (const Vector1 &v1, const Vector2 &v2) |
Find difference in Rapidity (y) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Rapidity() method. | |
template<class Vector1 , class Vector2 > | |
Vector1::Scalar | ROOT::Math::VectorUtil::InvariantMass (const Vector1 &v1, const Vector2 &v2) |
return the invariant mass of two LorentzVector The only requirement on the LorentzVector is that they need to implement the X() , Y(), Z() and E() methods. | |
template<class Vector1 , class Vector2 > | |
Vector1::Scalar | ROOT::Math::VectorUtil::InvariantMass2 (const Vector1 &v1, const Vector2 &v2) |
Returns the square of what InvariantMass(const Vector1&, const Vector2&) would return. | |
template<class Matrix , class CoordSystem , class U > | |
DisplacementVector3D< CoordSystem, U > | ROOT::Math::VectorUtil::Mult (const Matrix &m, const DisplacementVector3D< CoordSystem, U > &v) |
Multiplications of a generic matrices with a DisplacementVector3D of any coordinate system. | |
template<class CoordSystem , class Matrix > | |
LorentzVector< CoordSystem > | ROOT::Math::VectorUtil::Mult (const Matrix &m, const LorentzVector< CoordSystem > &v) |
Multiplications of a generic matrices with a LorentzVector described in any coordinate system. | |
template<class Matrix , class CoordSystem , class U > | |
PositionVector3D< CoordSystem, U > | ROOT::Math::VectorUtil::Mult (const Matrix &m, const PositionVector3D< CoordSystem, U > &p) |
Multiplications of a generic matrices with a generic PositionVector Assume that the matrix implements the operator( i,j) and that it has at least 3 columns and 3 rows. | |
template<class Vector1 , class Vector2 > | |
double | ROOT::Math::VectorUtil::Perp (const Vector1 &v, const Vector2 &u) |
Find the magnitude of the vector component of v perpendicular to the given direction of u. | |
template<class Vector1 , class Vector2 > | |
double | ROOT::Math::VectorUtil::Perp2 (const Vector1 &v, const Vector2 &u) |
Find the magnitude square of the vector component of v perpendicular to the given direction of u. | |
template<class Vector1 , class Vector2 > | |
Vector1 | ROOT::Math::VectorUtil::PerpVector (const Vector1 &v, const Vector2 &u) |
Find the vector component of v perpendicular to the given direction of u. | |
double | ROOT::Math::VectorUtil::Phi_0_2pi (double phi) |
Return a phi angle in the interval (0,2*PI]. | |
double | ROOT::Math::VectorUtil::Phi_mpi_pi (double phi) |
Returns phi angle in the interval (-PI,PI]. | |
template<class Vector1 , class Vector2 > | |
Vector1 | ROOT::Math::VectorUtil::ProjVector (const Vector1 &v, const Vector2 &u) |
Find the projection of v along the given direction u. | |
template<class Vector , class RotationMatrix > | |
Vector | ROOT::Math::VectorUtil::Rotate (const Vector &v, const RotationMatrix &rot) |
rotation on a generic vector using a generic rotation class. | |
template<class Vector > | |
Vector | ROOT::Math::VectorUtil::Rotate (const Vector &v, double alpha, const Vector &axis) |
rotation along a custom axis for a generic vector by an Angle alpha (in rad) returning a new vector. | |
template<class Vector > | |
Vector | ROOT::Math::VectorUtil::RotateX (const Vector &v, double alpha) |
rotation along X axis for a generic vector by an Angle alpha returning a new vector. | |
template<class Vector > | |
Vector | ROOT::Math::VectorUtil::RotateY (const Vector &v, double alpha) |
rotation along Y axis for a generic vector by an Angle alpha returning a new vector. | |
template<class Vector > | |
Vector | ROOT::Math::VectorUtil::RotateZ (const Vector &v, double alpha) |
rotation along Z axis for a generic vector by an Angle alpha returning a new vector. | |
LorentzVector< CoordSystem >::Scalar ROOT::Math::Acoplanarity | ( | LorentzVector< CoordSystem > const & | pp, |
LorentzVector< CoordSystem > const & | pm ) |
pair (p+ p-) acoplanarity alpha = 1 - |phi+ - phi-|/pi
.
pp | p+, LorentzVector based on any coordinate system |
pm | p-, LorentzVector based on any coordinate system |
Definition at line 746 of file LorentzVector.h.
Find Angle between two vectors.
Use the CosTheta() function
v1 | Vector v1 |
v2 | Vector v2 |
\[ \theta = \cos ^{-1} \frac { \vec{v1} \cdot \vec{v2} }{ | \vec{v1} | | \vec{v2} | } \]
Definition at line 170 of file VectorUtil.h.
LorentzVector< CoordSystem >::Scalar ROOT::Math::AsymmetryScalar | ( | LorentzVector< CoordSystem > const & | pp, |
LorentzVector< CoordSystem > const & | pm ) |
pair (p+ p-) scalar asymmetry As = ||Pt+| - |Pt-|/||Pt+| + |Pt-||
.
Measures the relative difference in transverse momentum of the pair, e.g. two photons, and would be ideally zero for two back-to-back photons.
pp | p+, LorentzVector based on any coordinate system |
pm | p-, LorentzVector based on any coordinate system |
Definition at line 795 of file LorentzVector.h.
LorentzVector< CoordSystem >::Scalar ROOT::Math::AsymmetryVectorial | ( | LorentzVector< CoordSystem > const & | pp, |
LorentzVector< CoordSystem > const & | pm ) |
pair (p+ p-) vectorial asymmetry Av = |Pt+ - Pt-|/|Pt+ + Pt-|
.
In an experimental setting, it reflects a convolution of the experimental resolutions of particle energy and azimuthal angle measurement.
pp | p+, LorentzVector based on any coordinate system |
pm | p-, LorentzVector based on any coordinate system |
Definition at line 774 of file LorentzVector.h.
Boost a generic Lorentz Vector class using a generic 3D Vector class describing the boost The only requirement on the vector is that implements the X(), Y(), Z(), T() and SetXYZT methods.
The requirement on the boost vector is that needs to implement the X(), Y() , Z() retorning the vector elements describing the boost The beta of the boost must be <= 1 or a nul Lorentz Vector will be returned
Definition at line 408 of file VectorUtil.h.
Boost a generic Lorentz Vector class along the X direction with a factor beta The only requirement on the vector is that implements the X(), Y(), Z(), T() and SetXYZT methods.
The beta of the boost must be <= 1 or a nul Lorentz Vector will be returned
Definition at line 438 of file VectorUtil.h.
Boost a generic Lorentz Vector class along the Y direction with a factor beta The only requirement on the vector is that implements the X(), Y(), Z(), T() methods and be constructed from x,y,z,t values The beta of the boost must be <= 1 or a nul Lorentz Vector will be returned.
Definition at line 460 of file VectorUtil.h.
Boost a generic Lorentz Vector class along the Z direction with a factor beta The only requirement on the vector is that implements the X(), Y(), Z(), T() methods and be constructed from x,y,z,t values The beta of the boost must be <= 1 or a nul Lorentz Vector will be returned.
Definition at line 481 of file VectorUtil.h.
Find CosTheta Angle between two generic 3D vectors pre-requisite: vectors implement the X(), Y() and Z()
v1 | Vector v1 |
v2 | Vector v2 |
\[ \cos \theta = \frac { \vec{v1} \cdot \vec{v2} }{ | \vec{v1} | | \vec{v2} | } \]
Definition at line 143 of file VectorUtil.h.
Find aximutal Angle difference between two generic vectors ( v2.Phi() - v1.Phi() ) The only requirements on the Vector classes is that they implement the Phi() method.
v1 | Vector of any type implementing the Phi() operator |
v2 | Vector of any type implementing the Phi() operator |
\[ \Delta \phi = \phi_2 - \phi_1 \]
Definition at line 62 of file VectorUtil.h.
Find difference in pseudorapidity (Eta) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Eta() method.
v1 | Vector 1 |
v2 | Vector 2 |
\[ \Delta R = \sqrt{ ( \Delta \phi )^2 + ( \Delta \eta )^2 } \]
Definition at line 113 of file VectorUtil.h.
Find square of the difference in pseudorapidity (Eta) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Eta() method.
v1 | Vector 1 |
v2 | Vector 2 |
\[ \Delta R2 = ( \Delta \phi )^2 + ( \Delta \eta )^2 \]
Definition at line 83 of file VectorUtil.h.
|
inline |
Find square of the difference in true rapidity (y) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Rapidity() method.
v1 | Vector 1 |
v2 | Vector 2 |
\[ \Delta R2 = ( \Delta \phi )^2 + ( \Delta \y )^2 \]
Definition at line 98 of file VectorUtil.h.
|
inline |
Find difference in Rapidity (y) and Phi between two generic vectors The only requirements on the Vector classes is that they implement the Phi() and Rapidity() method.
v1 | Vector 1 |
v2 | Vector 2 |
\[ \Delta R = \sqrt{ ( \Delta \phi )^2 + ( \Delta y )^2 } \]
,Definition at line 127 of file VectorUtil.h.
|
inline |
return the invariant mass of two LorentzVector The only requirement on the LorentzVector is that they need to implement the X() , Y(), Z() and E() methods.
v1 | LorenzVector 1 |
v2 | LorenzVector 2 |
\[ M_{12} = \sqrt{ (\vec{v1} + \vec{v2} ) \cdot (\vec{v1} + \vec{v2} ) } \]
Definition at line 249 of file VectorUtil.h.
|
inline |
Returns the square of what InvariantMass(const Vector1&, const Vector2&) would return.
This is mostly useful for speed optimisations, because the expensive sqrt operation is skipped.
Definition at line 266 of file VectorUtil.h.
|
inline |
Multiplications of a generic matrices with a DisplacementVector3D of any coordinate system.
Assume that the matrix implements the operator( i,j) and that it has at least 3 columns and 3 rows. There is no check on the matrix size !!
Definition at line 505 of file VectorUtil.h.
|
inline |
Multiplications of a generic matrices with a LorentzVector described in any coordinate system.
Assume that the matrix implements the operator( i,j) and that it has at least 4 columns and 4 rows. There is no check on the matrix size !!
Definition at line 537 of file VectorUtil.h.
|
inline |
Multiplications of a generic matrices with a generic PositionVector Assume that the matrix implements the operator( i,j) and that it has at least 3 columns and 3 rows.
There is no check on the matrix size !!
Definition at line 520 of file VectorUtil.h.
Find the magnitude of the vector component of v perpendicular to the given direction of u.
v | Vector v for which the perpendicular component is to be found |
u | Vector specifying the direction |
\[ perp = | \vec{v} - \frac{ \vec{v} \cdot \vec{u} }{|\vec{u}|}\vec{u} | \]
Precondition is that Vector1 implements Dot function and Vector2 implements X(),Y() and Z()Definition at line 229 of file VectorUtil.h.
Find the magnitude square of the vector component of v perpendicular to the given direction of u.
v | Vector v for which the perpendicular component is to be found |
u | Vector specifying the direction |
\[ perp = | \vec{v} - \frac{ \vec{v} \cdot \vec{u} }{|\vec{u}|}\vec{u} |^2 \]
Precondition is that Vector1 implements Dot function and Vector2 implements X(),Y() and Z()Definition at line 213 of file VectorUtil.h.
Find the vector component of v perpendicular to the given direction of u.
v | Vector v for which the perpendicular component is to be found |
u | Vector specifying the direction |
\[ \vec{perp} = \vec{v} - \frac{ \vec{v} \cdot \vec{u} }{|\vec{u}|}\vec{u} \]
Precondition is that Vector1 implements Dot function and Vector2 implements X(),Y() and Z()Definition at line 200 of file VectorUtil.h.
Return a phi angle in the interval (0,2*PI].
Definition at line 23 of file VectorUtil.cxx.
Returns phi angle in the interval (-PI,PI].
Definition at line 38 of file VectorUtil.cxx.
Find the projection of v along the given direction u.
v | Vector v for which the propjection is to be found |
u | Vector specifying the direction |
\[ \vec{proj} = \frac{ \vec{v} \cdot \vec{u} }{|\vec{u}|}\vec{u} \]
Precondition is that Vector1 implements Dot function and Vector2 implements X(),Y() and Z()Definition at line 184 of file VectorUtil.h.
Vector ROOT::Math::VectorUtil::Rotate | ( | const Vector & | v, |
const RotationMatrix & | rot ) |
rotation on a generic vector using a generic rotation class.
The only requirement on the vector is that implements the X(), Y(), Z() and SetXYZ methods. The requirement on the rotation matrix is that need to implement the (i,j) operator returning the matrix element with R(0,0) = xx element
Definition at line 387 of file VectorUtil.h.
Vector ROOT::Math::VectorUtil::Rotate | ( | const Vector & | v, |
double | alpha, | ||
const Vector & | axis ) |
rotation along a custom axis for a generic vector by an Angle alpha (in rad) returning a new vector.
The only pre requisite on the Vector is that it has to implement the X(), Y() and Z() and SetXYZ methods.
Definition at line 351 of file VectorUtil.h.
rotation along X axis for a generic vector by an Angle alpha returning a new vector.
The only pre requisite on the Vector is that it has to implement the X(), Y() and Z() and SetXYZ methods.
Definition at line 288 of file VectorUtil.h.
rotation along Y axis for a generic vector by an Angle alpha returning a new vector.
The only pre requisite on the Vector is that it has to implement the X(), Y() and Z() and SetXYZ methods.
Definition at line 309 of file VectorUtil.h.
rotation along Z axis for a generic vector by an Angle alpha returning a new vector.
The only pre requisite on the Vector is that it has to implement the X(), Y() and Z() and SetXYZ methods.
Definition at line 330 of file VectorUtil.h.