API reference
FourVectors.Bz — Method
Bz(p::FourVector{T}, γ::T) where {T}Applies an active boost along the z-axis with Lorentz factor γ. A negative γ reverses the boost direction (same |γ|, opposite sign of longitudinal velocity).
FourVectors.Rx — Method
Rx(p::FourVector{T}, α::T) where {T}Applies an active rotation by angle α about the x-axis to p.
FourVectors.Ry — Method
Ry(p::FourVector{T}, θ::T) where {T}Applies an active rotation by angle θ about the y-axis to p.
FourVectors.Rz — Method
Rz(p::FourVector{T}, ϕ::T) where {T}Applies an active rotation by angle ϕ about the z-axis to p.
FourVectors.rotate_to_plane — Method
rotate_to_plane(p, which_z, which_xplus)Rotates a four-momentum p into a reference frame where the z-axis follows which_z and where the spatial direction which_xplus fixes azimuth (φ > 0 half-plane).
Sequence:
- Rotate so
which_zaligns with the lab +z (Ry,Rz). - Rotate about z so
which_xplussits in the x–z plane at non-negative x.
Example
julia> p = FourVector(0.5, 0.5, 0.5; M = 1.0);
julia> which_z = FourVector(0.0, 0.0, 1.0; M = 2.0);
julia> which_xplus = FourVector(1.0, 1.0, 0.0; M = 0.0);
julia> rotate_to_plane(p, which_z, which_xplus)
4-element FourVector{Float64} with indices SOneTo(4):
0.7071067811865475
5.551115123125783e-17
0.5
1.3228756555322954FourVectors.spherical_coordinates — Method
spherical_coordinates(p)Polar direction of spatial part of p as (cosθ = cos_theta(p), ϕ = azimuthal_angle(p)).
FourVectors.transform_to_cmf — Method
transform_to_cmf(p, which_cmf)Transforms p into the center-of-momentum frame of which_cmf: rotate so its spatial direction aligns with +z, then boost along z using the Lorentz factor of which_cmf.
Example
julia> p = FourVector(0.5, 0.5, 0.5; M = 1.0);
julia> transform_to_cmf(p, FourVector(1.0, 0.0, 0.0; E = 2.0))
4-element FourVector{Float64} with indices SOneTo(4):
-0.49999999999999994
0.5
-0.18641234663634787
1.238850097057134