Lorentz Vector
Interface registry
QEDbase.register_LorentzVectorLike — Function
register_LorentzVectorLike(T)
Function to register a custom type as a LorentzVectorLike.
Ensure the passed custom type has implemented at least the function getT, getX, getY, getZ and enables getter functions of the lorentz vector library for the given type. If additionally the functions setT!, setX!, setY!, setZ! are implemened for the passed custom type, also the setter functions of the Lorentz vector interface are enabled.
Built-in Lorentz vector types
QEDbase.AbstractLorentzVector — Type
abstract type AbstractLorentzVector{T} <: StaticArraysCore.FieldVector{4, T}Abstract type to model generic Lorentz vectors, i.e. elements of a minkowski-like space, where the component space is arbitray.
sourceQEDbase.AbstractFourMomentum — Type
AbstractFourMomentum{T_ELEM} where {T_ELEM<:Real}Abstract base type for four-momentas, representing one energy and three spacial components.
Also see: QEDcore.SFourMomentum
Accessor functions
QEDbase.minkowski_dot — Function
minkowski_dot(v1,v2)Return the Minkowski dot product of two LorentzVectorLike.
If (t1,x1,y1,z1) and (t2,x2,y2,z2) are two LorentzVectorLike, this is equivalent to
t1*t2 - (x1*x2 + y1*y2 + z1*z2)QEDbase.mdot — Function
Function alias for minkowski_dot.
QEDbase.getT — Function
QEDbase.getX — Function
QEDbase.getY — Function
QEDbase.getZ — Function
QEDbase.getMagnitude2 — Function
getMagnitude2(lv)Return the square of the magnitude of a given LorentzVectorLike, i.e. the sum of the squared spatial components.
This function differs from a similar function for the TLorentzVector used in the famous ROOT library.
QEDbase.getMag2 — Function
Functiom alias for getMagnitude2.
QEDbase.getMagnitude — Function
getMagnitude(lv)Return the magnitude of a given LorentzVectorLike, i.e. the euklidian norm spatial components.
This function differs from a similar function for the TLorentzVector used in the famous ROOT library.
QEDbase.getMag — Function
Functiom alias for getMagnitude.
QEDbase.getInvariantMass2 — Function
getInvariantMass2(lv)Return the squared invariant mass of a given LorentzVectorLike, i.e. the minkowski dot with itself.
QEDbase.getMass2 — Function
Function alias for getInvariantMass2
QEDbase.getInvariantMass — Function
getInvariantMass(lv)Return the the invariant mass of a given LorentzVectorLike, i.e. the square root of the minkowski dot with itself.
QEDbase.getMass — Function
Function alias for getInvariantMass.
QEDbase.getE — Function
QEDbase.getEnergy — Function
QEDbase.getPx — Function
QEDbase.getPy — Function
QEDbase.getPz — Function
QEDbase.getBeta — Function
getBeta(lv)Return magnitude of the beta vector for a given LorentzVectorLike, i.e. the magnitude of the LorentzVectorLike divided by its 0-component.
QEDbase.getGamma — Function
getGamma(lv)Return the relativistic gamma factor for a given LorentzVectorLike, i.e. the inverse square root of one minus the beta vector squared.
If (E,px,py,pz) is a LorentzVectorLike with beta vector β, this is equivalent to 1/sqrt(1- β^2).
QEDbase.getTransverseMomentum2 — Function
getTransverseMomentum2(lv)Return the squared transverse momentum for a given LorentzVectorLike, i.e. the sum of its squared 1- and 2-component.
QEDbase.getPt2 — Function
Function alias for getTransverseMomentum2.
QEDbase.getPerp2 — Function
Function alias for getTransverseMomentum2.
QEDbase.getTransverseMomentum — Function
getTransverseMomentum(lv)Return the transverse momentum for a given LorentzVectorLike, i.e. the magnitude of its transverse components.
QEDbase.getPt — Function
Function alias for getTransverseMomentum.
QEDbase.getPerp — Function
Function alias for getTransverseMomentum.
QEDbase.getTransverseMass2 — Function
getTransverseMass2(lv)Return the squared transverse mass for a given LorentzVectorLike, i.e. the difference of its squared 0- and 3-component.
QEDbase.getMt2 — Function
Function alias for getTransverseMass2
QEDbase.getTransverseMass — Function
getTransverseMass(lv)Return the transverse momentum for a given LorentzVectorLike, i.e. the square root of its squared transverse mass.
QEDbase.getMt — Function
Function alias for getTransverseMass
QEDbase.getRapidity — Function
QEDbase.getRho2 — Function
Function alias for getMagnitude2
QEDbase.getRho — Function
Function alias for getMagnitude
QEDbase.getTheta — Function
getTheta(lv)Return the theta angle for a given LorentzVectorLike, i.e. the polar angle of its spatial components in spherical coordinates.
If (E,px,py,pz) is a LorentzVectorLike with magnitude rho, this is equivalent to arccos(pz/rho), which is also equivalent to arctan(sqrt(px^2+py^2)/pz).
The spherical coordinates are defined w.r.t. to the 3-axis.
QEDbase.getCosTheta — Function
QEDbase.getPhi — Function
getPhi(lv)Return the phi angle for a given LorentzVectorLike, i.e. the azimuthal angle of its spatial components in spherical coordinates.
The spherical coordinates are defined w.r.t. to the 3-axis.
QEDbase.getCosPhi — Function
QEDbase.getSinPhi — Function
QEDbase.getPlus — Function
getPlus(lv)Return the plus component for a given LorentzVectorLike in light-cone coordinates.
The light-cone coordinates are defined w.r.t. to the 3-axis.
The definition p^+ := (E + p_z)/2 differs from the usual definition of light-cone coordinates in general relativity.
QEDbase.getMinus — Function
getMinus(lv)Return the minus component for a given LorentzVectorLike in light-cone coordinates.
The light-cone coordinates are defined w.r.t. to the 3-axis.
The definition p^- := (E - p_z)/2 differs from the usual definition of light-cone coordinates in general relativity.
Setter functions
QEDbase.setE! — Function
QEDbase.setEnergy! — Function
QEDbase.setPx! — Function
QEDbase.setPy! — Function
QEDbase.setPz! — Function
QEDbase.setTheta! — Function
QEDbase.setCosTheta! — Function
setCosTheta!(lv,value)Sets the cosine of the theta angle of a LorentzVectorLike to a given value.
The value set with setCosTheta! is then returned by getCosTheta. Since the cosine of the theta angle is computed on the call of getCosTheta, the setter setCosTheta! changes several components of the given LorentzVectorLike.
QEDbase.setRho! — Function
QEDbase.setPhi! — Function
QEDbase.setPlus! — Function
QEDbase.setMinus! — Function
QEDbase.setTransverseMomentum! — Function
setTransverseMomentum!(lv,value)Sets the transverse momentum of a LorentzVectorLike to a given value.
The value set with setTransverseMomentum! is then returned by getTransverseMomentum. Since the transverse momentum is computed on the call of getTransverseMomentum, the setter setTransverseMomentum! changes several components of the given LorentzVectorLike.
QEDbase.setPerp! — Function
Function alias for setTransverseMomentum!.
QEDbase.setPt! — Function
Function alias for setTransverseMomentum!.
QEDbase.setTransverseMass! — Function
setTransverseMass!(lv,value)Sets the transverse mass of a LorentzVectorLike to a given value.
The value set with setTransverseMass! is then returned by getTransverseMass. Since the transverse mass is computed on the call of getTransverseMass, the setter setTransverseMass! changes several components of the given LorentzVectorLike.
QEDbase.setMt! — Function
Function alias for setTransverseMass!.
QEDbase.setRapidity! — Function
setRapidity!(lv,value)Sets the rapidity of a LorentzVectorLike to a given value.
The value set with setRapidity! is then returned by getRapidity. Since the rapidity is computed on the call of setRapidity, the setter setRapidity! changes several components of the given LorentzVectorLike.
Utilities
QEDbase.isonshell — Function
isonshell(mom, mass)
On-shell check of a given four-momentum mom w.r.t. a given mass mass.
For AbstractFourMomentum, the element type defaults to Float64, limiting the precision of comparisons between elements. The current implementation has been tested within the boundaries for energy scales E with 1e-9 <= E <= 1e5. In those bounds, the mass error, which is correctly detected as off-shell, is 1e-4 times the mean value of the components, but has at most the value 0.01, e.g. at the high energy end. The energy scales correspond to 0.5 meV for the lower bound and 50 GeV for the upper bound.
QEDbase.assert_onshell — Function
QEDbase.AbstractCoordinateTransformation — Type
AbstractCoordinateTransformationAbstract base type for coordinate transformations supposed to be acting on four-momenta. Every subtype of trafo::AbstractCoordinateTransformation should implement the following interface functions:
QEDbase._transform(trafo,p): transformspBase.inv(trafo): returns the inverted transform
Example
Implementing the interface by defining the interface functions:
julia> using QEDbase
julia> struct TestTrafo{T} <: AbstractCoordinateTransformation
a::T
end
julia> QEDbase._transform(trafo::TestTrafo,p) = trafo.a*p
julia> Base.inv(trafo::TestTrafo) = TestTrafo(inv(trafo.a))
The TestTrafo can then be used to transform four-momenta:
julia> trafo = TestTrafo(2.0)
TestTrafo{Float64}(2.0)
julia> p = SFourMomentum(4,3,2,1)
4-element SFourMomentum{Float64} with indices SOneTo(4):
4.0
3.0
2.0
1.0
julia> trafo(p) # multiply every component with 2.0
4-element SFourMomentum{Float64} with indices SOneTo(4):
8.0
6.0
4.0
2.0
julia> inv(trafo)(p) # divide every component by 2.0
4-element SFourMomentum{Float64} with indices SOneTo(4):
2.0
1.5
1.0
0.5source