Physics vectors
Generic 2D, 3D and 4D vectors (GenVectors) represent vectors and their operations and transformations, such as rotations and Lorentz transformations. The 2D and 3D space are used to describe the geometry vectors and points, while the 4D spacetime is used for physics vectors representing relativistic particles.
In contrast to the ROOT physics libraries, the GenVector package provides class templates for modeling the vectors.
Every class, function, manipulator, or other symbol defined in the GenVector package, is in the ROOT::Math namespace.
GenVector classes and vector class templates
The vector class templates are provided to represent vectors (in the physics sense) in 2, 3, and Minkowski space 4 dimensions.
Each vector template class uses as its only parameter the coordinate system.
Every vector class publishes a typedef for CoordinateType
, which allows to specify the coordinate system , as well as a typedef for Scalar
(which will match the Scalar
type for the coordinate system).
The vector classes are comparable (operator ==
and operator !=
for the objects or the identical class (including the coordinate system used). Checks for the
equivalence of two vectors in different coordinate systems can be done by converting one to the system of the other.
None of the vector classes have methods to rotate a vector. To rotate a vector, you first have to instantiate the desired rotation object, and then apply it to the vector.
The following GenVector classes and class templates are available:

 DisplacementVector3D
 Describing a generic displacement vector in 3 dimensions.

 PositionVector3D
 Describing a generic position vector (point) in 3 dimensions.

 LorentzVector
 Describing a generic LorentzVector in the 4D spacetime, using the specified coordinate system for the spatial vector part.

 DisplacementVector2D
 Describing a generic displacement vector in 2 dimensions.

 PositionVector2D
 Describing a generic position vector (point) in 2 dimensions.

 Rotation3D
 Class with the (3D) rotation, represented by a 3x3 orthogonal matrix.

 AxisAngle
 Describing a rotation, represented with a direction axis (3D Vector), and an angle of rotation around that axis.

 EulerAngles
 Describing a rotation as three angles (Euler angles).

 Quaternion
 Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).

 RotationX
 Rotation class representing a 3D rotation about the X axis by the angle of rotation.

 RotationY
 Rotation class representing a 3D rotation about the Y axis by the angle of rotation.

 RotationZ
 Rotation class representing a 3D rotation about the Z axis by the angle of rotation.

 LorentzRotation
 Lorentz transformation class with the (4D) transformation represented by a 4x4 orthosymplectic matrix.

 Boost
 Lorentz boost class with the (4D) transformation represented internally by a 4x4 orthosymplectic matrix.

 BoostX
 Representing a Lorentz Boost along the X axis, by beta.

 BoostY
 Class representing a Lorentz Boost along the Y axis, by beta.
 BoostZ Class representing a Lorentz Boost along the Z axis, by beta.
Coordinate systems
The vector classes are based on a generic type of coordinate system, expressed as a template parameter of the class. The following classes exist to describe the various coordinates systems:
2D coordinate system

ROOT::Math::Cartesian2D: 2D cartesian coordinate system (
x
,y
coordinates). 
ROOT::Math::Polar2D: A polar 2D coordinate system based on
r
andphi
.phi
is restricted to the range (PI,PI).
3D coordinate systems

ROOT::Math::Cartesian3D: 3D cartesian coordinate system (
x
,y
,z
coordinates). 
ROOT::Math::Polar3D: 3D polar coordinate system (
r
,theta
,phi
coordinates). 
ROOT::Math::Cylindrical3D: Cylindrical coordinate system based on
rho
,z
andphi
. 
ROOT::Math::CylindricalEta3D6: Cylindrical coordinate system based on
eta
(pseudorapidity) instead ofz
.
4D coordinate systems

ROOT::Math::PxPyPzE4D: 4D cartesian coordinate system (
x
,y
,z
,t
coordinates) or momentumenergy vectors stored as (Px
,Py
,Pz
,E
). 
ROOT::Math::PxPyPzM4D: 4D coordinate system or momentumenergy vectors stored as (
Px
,Py
,Pz
,M
). 
ROOT::Math::PtEtaPhiE4D: 4D cylindrical coordinate system using
Pt
,Phi
,Eta
andE
(orrho
,phi
,eta
,T
). The metric used is (,,,+). 
ROOT::Math::PtEtaPhiM4D: 4D cylindrical coordinate system using
Pt
,Phi
,Eta
andM
(mass). The metric used is (,,,+).