Reference

Contents

Index

Interface

Supported coordinate systems

LorentzVectorBase.XYZTType
XYZT <: AbstractCoordinateSystem

Cartesian coordinate system for four-vectors. Using this requires the implementation of the following interface functions:

LorentzVectorBase.x(::CustomFourVector)
LorentzVectorBase.y(::CustomFourVector)
LorentzVectorBase.z(::CustomFourVector)
LorentzVectorBase.t(::CustomFourVector)
source
LorentzVectorBase.PxPyPzEType
PxPyPzE <: AbstractCoordinateSystem

Cartesian coordinate system for four-momenta. Using this requires the implementation of the following interface functions:

LorentzVectorBase.px(::CustomFourMomentum)
LorentzVectorBase.py(::CustomFourMomentum)
LorentzVectorBase.pz(::CustomFourMomentum)
LorentzVectorBase.E(::CustomFourMomentum)
source
LorentzVectorBase.PtEtaPhiMType
PtEtaPhiM <: AbstractCoordinateSystem

Cylindrical coordinate system for four-momenta. Using this requires the implementation of the following interface functions:

pt(::CustomFourMomentum)
eta(::CustomFourMomentum)
phi(::CustomFourMomentum)
mass(::CustomFourMomentum)
source

Supported getter functions

LorentzVectorBase.pxFunction
px(lv)

Return the x-component of a given Lorentz-vector-like lv.

Example

For a four-momentum `(px, py, pz, E)`, this function returns the `px` component.

See Also

source
LorentzVectorBase.pyFunction
py(lv)

Return the y-component of a given Lorentz-vector-like lv.

Example

For a four-momentum (px, py, pz, E), this function returns the py component.

See Also

source
LorentzVectorBase.pzFunction
pz(lv)

Return the z-component of a given Lorentz-vector-like lv.

Example

For a four-momentum (px, py, pz, E), this function returns the pz component.

See Also

source
LorentzVectorBase.EFunction
E(lv)

Return the energy component (E) of a given Lorentz-vector-like lv.

Example

For a four-momentum (px, py, pz, E), this function returns the E component.

See Also

source
LorentzVectorBase.ptFunction
pt(lv)

Return the transverse momentum ($p_T$) of a given Lorentz-vector-like lv, defined as the Euclidean magnitude of the momentum components in the x-y plane.

Example

For a four-momentum (px, py, pz, E), this function returns sqrt(px^2 + py^2).

Notes

  • The transverse components are defined with respect to the z-axis (3-axis), representing the perpendicular momentum to this axis.

See Also

  • pt2: For the squared transverse momentum.
source
LorentzVectorBase.pt2Function
pt2(lv)

Return the squared transverse momentum ($p_T^2$) of a given Lorentz-vector-like lv. The transverse momentum is defined with respect to the z-axis (3-axis) and is the sum of the squares of the x- and y-components.

Example

For a four-momentum (px, py, pz, E), this function returns px^2 + py^2.

Notes

  • The transverse components are the momentum projections in the x-y plane, perpendicular to the z-axis.

See Also

  • pt: For the transverse momentum.
source
LorentzVectorBase.etaFunction
eta(lv)

Return the pseudorapidity ($\eta$) of a given Lorentz-vector-like lv. The pseudorapidity is a commonly used quantity in high-energy physics, particularly in collider experiments, and is defined as:

\[ \eta = -\log(\tan(\theta/ 2))\]

where $\theta$ is the polar angle of the Lorentz-vector-like relative to the z-axis.

Example

For a four-momentum (px, py, pz, E), this function log(tan(theta/2)) where theta is given by the polar_angle.

Warning

If the transverse momentum (pt) is zero (i.e., the particle is aligned with the beam axis), a warning is raised, and a large pseudorapidity value (±10e10) is returned as a convention. This occurs because the pseudorapidity is ill-defined when pt = 0.

Notes

  • Pseudorapidity is approximately equal to the rapidity $y$ in the ultra-relativistic limit (when the particle's mass is negligible compared to its energy).

See Also

  • rapidity: For the rapidity of the Lorentz-vector-like.
source
LorentzVectorBase.phiFunction
phi(lv)

Return the azimuthal angle ($\phi$) of the Lorentz-vector-like lv.

The azimuthal angle is the angle between the x-axis and the projection of the Lorentz-vector-like on the x-y plane.

Example

If ``(x, y, z, t)`` is a four-vector, this is equivalent to ``atan(y / x)``.
Note

The azimuthal angle is defined with respect to the z-axis.

See Also

source
LorentzVectorBase.spatial_magnitudeFunction
spatial_magnitude(lv)

Return the spatial magnitude of the Lorentz-vector-like lv, i.e., the magnitude of its spatial components.

Example

If the Lorentz-vector-like is a four-vector (x, y, z, t), this function returns sqrt(x^2 + y^2 + z^2).

Warning

This function differs from the TLorentzVector::P() function in the ROOT library.

source
LorentzVectorBase.spatial_magnitude2Function
spatial_magnitude2(lv)

Return the square of the spatial magnitude of the Lorentz-vector-like lv, i.e., the sum of the squares of its spatial components.

Example

If the Lorentz-vector-like is four-vector (x, y, z, t), this function returns x^2 + y^2 + z^2.

Warning

This function differs from the TLorentzVector::P2() function in the ROOT library.

source
LorentzVectorBase.massFunction
mass(lv)

Return the invariant mass of the Lorentz-vector-like lv, computed as the square root of the Minkowski inner product of the four-vector components with itself.

Example

For a four-momentum (px, py, pz, E), this function returns sqrt(E^2 - (px^2 + py^2 + pz^2)).

Notes

  • If the squared invariant mass m^2 is negative, this function returns -sqrt(-m^2) to ensure a real result. This can happen in certain unphysical cases where the energy component is smaller than the spatial momentum magnitude.

See Also

  • mass2: For the squared invariant mass calculation.
source
LorentzVectorBase.mass2Function
mass2(lv)

Return the squared invariant mass of the Lorentz-vector-like lv, computed as the Minkowski inner product of the four-vector components with itself.

Example

For a four-momentum (px, py, pz, E), this function returns E^2 - (px^2 + py^2 + pz^2).

See Also

  • mass: For the invariant mass, i.e., the square root of this value.
source
LorentzVectorBase.boost_betaFunction
boost_beta(lv)

Return the magnitude of the velocity ($\beta$) of a particle as a fraction of the speed of light of the Lorentz-vector-like lv.

Example

For a four-momentum (px, py, pz, E), this function returns sqrt(px^2 + py^2 + pz^2) / E.

Throws

  • ArgumentError if the time (energy) component is zero while the spatial components are non-zero, as this results in an undefined velocity.

Notes

  • If both the time (energy) and spatial components are zero, the function returns zero ($\beta = 0$), as this represents a stationary object with no motion.

See Also

  • boost_gamma: For the relativistic gamma factor, which depends on $\beta$.
source
LorentzVectorBase.boost_gammaFunction
boost_gamma(lv)

Return the relativistic gamma factor ($\gamma$) for the Lorentz-vector-like lv.

Example

For a four-momentum (px, py, pz, E) with velocity $\beta$, this function returns $1 / sqrt(1 - \beta^2)$.

See Also

  • boost_beta: For the velocity $\beta$, which is used to compute $\gamma$.
source
LorentzVectorBase.mt2Function
mt2(lv)

Return the squared transverse mass ($m_T^2$) of a given Lorentz-vector-like lv, which is the difference between the squared time- (energy-) and the squared z-component.

Example

For a four-momentum (px, py, pz, E), this function returns E^2 - pz^2.

Notes

  • The transverse components are defined with respect to the z-axis (3-axis), indicating a projection in the x-y plane.

See Also

  • mt: For the transverse mass.
source
LorentzVectorBase.mtFunction
mt(lv)

Return the transverse mass ($m_T$) of a given Lorentz-vector-like lv, calculated as the square root of the squared transverse mass. The transverse mass is often used in high-energy physics to describe the effective mass of a system when only the transverse components are considered.

Example

For a four-momentum (px, py, pz, E), this function returns sqrt(E^2 - pz^2).

Notes

  • If the squared transverse mass (mT^2) is negative, the function returns -sqrt(-mT^2) to

handle the imaginary mass situation that can occur in some relativistic systems.

  • The transverse components are defined with respect to the z-axis (3-axis), indicating momentum in the x-y plane.

Throws

  • May include a warning if the transverse mass is negative, depending on user settings.

See Also

  • mt2: For the squared transverse mass.
source
LorentzVectorBase.rapidityFunction
rapidity(lv)

Return the rapidity for a given Lorentz-vector-like lv.

The rapidity $y$ is defined as:

\[y = \frac{1}{2}\log((E + p_z) / (E - p_z))\]

where E is the energy (time- or 0-component of the Lorentz-vector-like), and pz is the component along the z-axis.

Example

For a four-vector (px, py, pz, E), this function calculates the rapidity as:

y = 0.5 * log((E + pz) / (E - pz))

Notes

  • Rapidity is preferred over pseudorapidity when mass effects are significant, as it takes into account the energy and longitudinal momentum of the particle. In contrast, pseudorapidity depends only on the particle's direction and ignores mass.
  • The transverse components of the momentum are defined with respect to the 3-axis (beam axis).
  • Rapidity is Lorentz-invariant under boosts along the z-axis, making it useful for comparisons between different reference frames in collider experiments.
Warning

If the particle's energy E is equal to its longitudinal momentum pz, resulting in a denominator of zero in the logarithm, the function will raise an error as rapidity is ill-defined in this case.

See Also

source
LorentzVectorBase.polar_angleFunction
polar_angle(lv)

Return the polar angle ($\theta$) of the Lorentz-vector-like lv.

Example

If the Lorentz-vector-like is a four-vector $(x, y, z, t)$, this is equivalent to $\arccos(z / \sqrt{x^2 + y^2 + z^2})$.

Note

If the Lorentz-vector-like is zero, the function returns zero for the angle.

See Also

source
LorentzVectorBase.cos_thetaFunction
cos_theta(lv)

Return the cosine of the polar angle ($\theta$) of the Lorentz-vector-like lv.

Depending on the coordinate system, this might be an equivalent but faster version of cos(polar_angle(lv)).

Example

If $(x, y, z, t)$ is a four-vector, this is equivalent to $z / \sqrt{x^2 + y^2 + z^2}$.

See Also

source
LorentzVectorBase.cos_phiFunction
cos_phi(lv)

Return the cosine of the azimuthal angle ($\phi$) of the Lorentz-vector-like lv.

Depending on the coordinate system, this might be an equivalent but faster version of cos(phi(lv)).

Example

If $(x, y, z, t)$ is a four-momentum, this is equivalent to $x / \sqrt{x^2 + y^2}$.

See Also

source
LorentzVectorBase.sin_phiFunction
sin_phi(lv)

Return the sine of the azimuthal angle ($\phi$) of the Lorentz-vector-like lv.

Depending on the coordinate system, this might be an equivalent but faster version of sin(phi(lv)).

Example

If $(x, y, z, t)$ is a four-momentum, this is equivalent to $y / \sqrt{x^2 + y^2}$.

See Also

source
LorentzVectorBase.plus_componentFunction
plus_component(lv)

Return the plus component ($p^+$) of the Lorentz-vector-like lv in light-cone coordinates.

This component is defined as (t + z) / 2, where t is the time (or energy) component and z is the third spatial component of the Lorentz-vector-like.

Example

If (x, y, z, t) is a four-vector, this is equivalent to (t + z) / 2.

Warning

This definition differs from the light-cone coordinate definitions commonly used in general relativity.

source
LorentzVectorBase.minus_componentFunction
minus_component(lv)

Return the minus component ($p^-$) of the Lorentz-vector-like lv in light-cone coordinates.

This component is defined as (t - z) / 2, where t is the time (or energy) component and z is the third spatial component of the Lorentz-vector-like.

Example

If (x, y, z, t) is a four-vector, this is equivalent to (t - z) / 2.

Warning

This definition differs from the light-cone coordinate definitions commonly used in general relativity.

source