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 space-time 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:
- Describing a generic displacement vector in 3 dimensions.
- Describing a generic position vector (point) in 3 dimensions.
- Describing a generic LorentzVector in the 4D space-time, using the specified coordinate system for the spatial vector part.
- Describing a generic displacement vector in 2 dimensions.
- Describing a generic position vector (point) in 2 dimensions.
- Class with the (3D) rotation, represented by a 3x3 orthogonal matrix.
- Describing a rotation, represented with a direction axis (3D Vector), and an angle of rotation around that axis.
- Describing a rotation as three angles (Euler angles).
- Rotation class with the (3D) rotation represented by a unit quaternion (u, i, j, k).
- Rotation class representing a 3D rotation about the X axis by the angle of rotation.
- Rotation class representing a 3D rotation about the Y axis by the angle of rotation.
- Rotation class representing a 3D rotation about the Z axis by the angle of rotation.
- Lorentz transformation class with the (4D) transformation represented by a 4x4 orthosymplectic matrix.
- Lorentz boost class with the (4D) transformation represented internally by a 4x4 orthosymplectic matrix.
- Representing a Lorentz Boost along the X axis, by beta.
- Class representing a Lorentz Boost along the Y axis, by beta.
- BoostZ Class representing a Lorentz Boost along the Z axis, by beta.
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 (
ROOT::Math::Polar2D: A polar 2D coordinate system based on
phiis restricted to the range (-PI,PI).
3D coordinate systems
ROOT::Math::Cartesian3D: 3D cartesian coordinate system (
ROOT::Math::Polar3D: 3D polar coordinate system (
ROOT::Math::Cylindrical3D: Cylindrical coordinate system based on
ROOT::Math::CylindricalEta3D6: Cylindrical coordinate system based on
eta(pseudorapidity) instead of
4D coordinate systems
ROOT::Math::PxPyPzE4D: 4D cartesian coordinate system (
tcoordinates) or momentum-energy vectors stored as (
ROOT::Math::PxPyPzM4D: 4D coordinate system or momentum-energy vectors stored as (
ROOT::Math::PtEtaPhiE4D: 4D cylindrical coordinate system using
T). The metric used is (-,-,-,+).
ROOT::Math::PtEtaPhiM4D: 4D cylindrical coordinate system using
M(mass). The metric used is (-,-,-,+).