diff --git a/README.md b/README.md index bbdc9f8..4330c01 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ you can also use `fromPtEtaPhiE(pt, eta, phi, energy) --> LorentzVectorCyl`. and these functions for both of them: ```julia -px, py, pz, energy, pt, rap, eta, phi, mass +px, py, pz, energy, pt, rapidity, eta, phi, mass ``` as well as these utility functions: diff --git a/src/cartesian.jl b/src/cartesian.jl index aeee4b8..da45b26 100644 --- a/src/cartesian.jl +++ b/src/cartesian.jl @@ -1,5 +1,6 @@ Base.zero(lv::T) where T<:LorentzVector = T(0,0,0,0) mass2(lv::LorentzVector) = dot(lv, lv) +"""mass value - returns a negative number for spacelike 4-vectors""" mass(lv::LorentzVector) = mass2(lv) < 0.0 ? sqrt(-mass2(lv)) : sqrt(mass2(lv)) pt2(lv::LorentzVector) = muladd(lv.x, lv.x, lv.y^2) pt(lv::LorentzVector) = sqrt(pt2(lv)) @@ -30,7 +31,7 @@ end const η = eta """Rapidity""" -function rap(lv::LorentzVector) +function rapidity(lv::LorentzVector) pt_squared = pt2(lv) abspz = abs(pz(lv)) if (energy(lv) == abspz) && (pt_squared == 0.0) diff --git a/src/cylindrical.jl b/src/cylindrical.jl index b1a2147..b1ead7c 100644 --- a/src/cylindrical.jl +++ b/src/cylindrical.jl @@ -77,7 +77,7 @@ function fast_mass(v1::LorentzVectorCyl, v2::LorentzVectorCyl) end "Rapidity" -function rap(lv::LorentzVectorCyl) +function rapidity(lv::LorentzVectorCyl) num = sqrt(lv.mass^2 + lv.pt^2 * cosh(lv.eta)^2) + lv.pt * sinh(lv.eta) den = sqrt(lv.mass^2 + lv.pt^2) return log(num/den)