thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
ThePEG::LorentzVector< Value > Class Template Reference

A 4-component Lorentz vector. More...

#include <LorentzVector.h>

Inheritance diagram for ThePEG::LorentzVector< Value >:

Public Member Functions

Constructors.
 LorentzVector ()
 
 LorentzVector (Value x, Value y, Value z, Value t)
 
 LorentzVector (const ThreeVector< Value > &v, Value t)
 
template<typename U >
 LorentzVector (const LorentzVector< U > &v)
 
template<typename ValueB >
LorentzVector< Value > & operator= (const LorentzVector< ValueB > &b)
 Assignment operator.
 
Component access methods.
Value x () const
 
Value y () const
 
Value z () const
 
Value t () const
 
Value e () const
 
Component set methods.
void setX (Value x)
 
void setY (Value y)
 
void setZ (Value z)
 
void setT (Value t)
 
void setE (Value e)
 
ThreeVector< Value > vect () const
 Access to the 3-component part.
 
 operator ThreeVector< Value > () const
 Cast to the 3-component part.
 
void setVect (const ThreeVector< Value > &p)
 Set the 3-component part.
 
LorentzVector< Value > conjugate () const
 The complex conjugate vector.
 
Value2 m2 () const
 Squared magnitude \(x^\mu\,x_\mu=t^2 - \vec{x}^2\).
 
Value2 m2 (const LorentzVector< Value > &a) const
 Squared magnitude with another vector.
 
Value m () const
 Magnitude (signed) \(\pm\sqrt{|t^2 - \vec{x}^2|}\).
 
Value2 mt2 () const
 Transverse mass squared \(t^2-z^2\).
 
Value mt () const
 Transverse mass (signed) \(\pm\sqrt{|t^2 - z^2|}\).
 
Value2 perp2 () const
 Squared transverse component of the spatial vector \(x^2+y^2\).
 
Value perp () const
 Transverse component of the spatial vector \(\pm\sqrt{x^2 + y^2}\).
 
template<typename U >
Value2 perp2 (const ThreeVector< U > &p) const
 Squared transverse component of the spatial vector with respect to the given axis.
 
template<typename U >
Value perp (const ThreeVector< U > &p) const
 Transverse component of the spatial vector with respect to the given axis.
 
Value2 et2 () const
 Transverse energy squared.
 
Value et () const
 Transverse energy (signed).
 
Value2 et2 (const ThreeVector< double > &v) const
 Transverse energy squared with respect to the given axis.
 
Value et (const ThreeVector< double > &v) const
 Transverse energy with respect to the given axis (signed).
 
Spherical coordinates for the spatial part.
Value2 rho2 () const
 Radius squared.
 
Value rho () const
 Radius.
 
void setRho (Value newRho)
 Set new radius.
 
double theta () const
 Polar angle.
 
double cosTheta () const
 Cosine of the polar angle.
 
double phi () const
 Azimuthal angle.
 
double eta () const
 Pseudorapidity of spatial part.
 
double angle (const LorentzVector< Value > &w) const
 Spatial angle with another vector.
 
double rapidity () const
 Rapidity \(\frac{1}{2}\ln\frac{t+z}{t-z} \).
 
double rapidity (const Axis &ref) const
 Rapidity with respect to another vector.
 
Boost boostVector () const
 Boost from reference frame into this vector's rest frame: \(\frac{\vec{x}}{t}\).
 
Boost findBoostToCM () const
 Boost from reference frame into this vector's rest frame: \(-\frac{\vec{x}}{t}\).
 
Value plus () const
 Returns the positive light-cone component \(t + z\).
 
Value minus () const
 Returns the negative light-cone component \(t - z\).
 
bool isNear (const LorentzVector< Value > &w, double epsilon) const
 Are two vectors nearby, using Euclidean measure \(t^2 + |\vec{x}|^2\)?
 
LorentzVector< Value > & transform (const SpinOneLorentzRotation &m)
 Rotate the vector. Resets \(x^\mu\rightarrow\mathsf{M}^\mu_\nu x^\nu\).
 
LorentzVector< Value > & operator*= (const SpinOneLorentzRotation &m)
 Rotate the vector. Resets \(x^\mu\rightarrow\mathsf{M}^\mu_\nu x^\nu\).
 
template<typename U >
auto dot (const LorentzVector< U > &a) const -> decltype(this->t() *a.t())
 Dot product with metric \((+,-,-,-)\).
 
LorentzVector< Value > & boost (double bx, double by, double bz, double gamma=-1.)
 Apply boost.
 
LorentzVector< Value > & boost (Boost b, double gamma=-1.)
 Apply boost.
 
LorentzVector< Value > & rotateX (double phi)
 Apply rotation around the x-axis.
 
LorentzVector< Value > & rotateY (double phi)
 Apply rotation around the y-axis.
 
LorentzVector< Value > & rotateZ (double phi)
 Apply rotation around the z-axis.
 
LorentzVector< Value > & rotateUz (const Axis &axis)
 Rotate the reference frame to a new z-axis.
 
template<typename U >
LorentzVector< Value > & rotate (double angle, const ThreeVector< U > &axis)
 Apply a rotation.
 
Mathematical assignment operators.
LorentzVector< Complex > & operator+= (const LorentzVector< complex< QtyDouble > > &a)
 
template<typename ValueB >
LorentzVector< Value > & operator+= (const LorentzVector< ValueB > &a)
 
LorentzVector< Complex > & operator-= (const LorentzVector< complex< QtyDouble > > &a)
 
template<typename ValueB >
LorentzVector< Value > & operator-= (const LorentzVector< ValueB > &a)
 
LorentzVector< Value > & operator*= (double a)
 
LorentzVector< Value > & operator/= (double a)
 

Private Types

using Value2 = decltype(sqr(std::declval< Value >()))
 Value squared.
 

Private Attributes

Vector components
Value theX
 
Value theY
 
Value theZ
 
Value theT
 

Detailed Description

template<typename Value>
class ThePEG::LorentzVector< Value >

A 4-component Lorentz vector.

It can be created with any unit type as template parameter. All basic mathematical operations are supported, as well as a subset of the CLHEP LorentzVector functionality.

Definition at line 43 of file LorentzVector.h.

Member Typedef Documentation

◆ Value2

template<typename Value >
using ThePEG::LorentzVector< Value >::Value2 = decltype(sqr(std::declval<Value>()))
private

Value squared.

Definition at line 47 of file LorentzVector.h.

Constructor & Destructor Documentation

◆ LorentzVector() [1/4]

template<typename Value >
ThePEG::LorentzVector< Value >::LorentzVector ( )
inline

Definition at line 52 of file LorentzVector.h.

◆ LorentzVector() [2/4]

template<typename Value >
ThePEG::LorentzVector< Value >::LorentzVector ( Value  x,
Value  y,
Value  z,
Value  t 
)
inline

Definition at line 55 of file LorentzVector.h.

◆ LorentzVector() [3/4]

template<typename Value >
ThePEG::LorentzVector< Value >::LorentzVector ( const ThreeVector< Value > &  v,
Value  t 
)
inline

Definition at line 58 of file LorentzVector.h.

◆ LorentzVector() [4/4]

template<typename Value >
template<typename U >
ThePEG::LorentzVector< Value >::LorentzVector ( const LorentzVector< U > &  v)
inline

Definition at line 62 of file LorentzVector.h.

Member Function Documentation

◆ angle()

template<typename Value >
double ThePEG::LorentzVector< Value >::angle ( const LorentzVector< Value > &  w) const
inline

Spatial angle with another vector.

Definition at line 253 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::vect().

Referenced by ThePEG::LorentzVector< Value >::rotate().

◆ boost() [1/2]

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::boost ( Boost  b,
double  gamma = -1. 
)
inline

Apply boost.


Parameters
bThree-vector giving the boost.
gammaOptional gamma parameter for higher numerical accuracy. The user has to ensure consistency. If not given, it will be calculated as \(\gamma=1/\sqrt{1-\beta^2}\).

Definition at line 381 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::boost().

◆ boost() [2/2]

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::boost ( double  bx,
double  by,
double  bz,
double  gamma = -1. 
)
inline

Apply boost.


Parameters
bxComponent x of the boost.
byComponent y of the boost.
bzComponent z of the boost.
gammaOptional gamma parameter for higher numerical accuracy. The user has to ensure consistency. If not given, it will be calculated as \(\gamma=1/\sqrt{1-\beta^2}\).

Definition at line 354 of file LorentzVector.h.

Referenced by ThePEG::LorentzVector< Value >::boost().

◆ boostVector()

template<typename Value >
Boost ThePEG::LorentzVector< Value >::boostVector ( ) const
inline

Boost from reference frame into this vector's rest frame: \(\frac{\vec{x}}{t}\).

Definition at line 283 of file LorentzVector.h.

References ERROR_IF, ThePEG::LorentzVector< Value >::m2(), ThePEG::LorentzVector< Value >::rho2(), and ThePEG::LorentzVector< Value >::vect().

Referenced by ThePEG::dirBoostVector(), and ThePEG::LorentzVector< Value >::findBoostToCM().

◆ conjugate()

template<typename Value >
LorentzVector< Value > ThePEG::LorentzVector< Value >::conjugate ( ) const
inline

The complex conjugate vector.

Definition at line 113 of file LorentzVector.h.

◆ cosTheta()

template<typename Value >
double ThePEG::LorentzVector< Value >::cosTheta ( ) const
inline

Cosine of the polar angle.

Definition at line 230 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::rho().

Referenced by ThePEG::dirCosTheta().

◆ dot()

template<typename Value >
template<typename U >
auto ThePEG::LorentzVector< Value >::dot ( const LorentzVector< U > &  a) const -> decltype(this->t() * a.t())
inline

Dot product with metric \((+,-,-,-)\).

Definition at line 334 of file LorentzVector.h.

Referenced by ThePEG::LorentzVector< Value >::isNear().

◆ e()

template<typename Value >
Value ThePEG::LorentzVector< Value >::e ( ) const
inline

Definition at line 83 of file LorentzVector.h.

◆ et() [1/2]

template<typename Value >
Value ThePEG::LorentzVector< Value >::et ( ) const
inline

Transverse energy (signed).

Definition at line 181 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::et2().

◆ et() [2/2]

template<typename Value >
Value ThePEG::LorentzVector< Value >::et ( const ThreeVector< double > &  v) const
inline

Transverse energy with respect to the given axis (signed).

Definition at line 196 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::et2().

◆ et2() [1/2]

template<typename Value >
Value2 ThePEG::LorentzVector< Value >::et2 ( ) const
inline

Transverse energy squared.

Definition at line 174 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::vect().

Referenced by ThePEG::LorentzVector< Value >::et().

◆ et2() [2/2]

template<typename Value >
Value2 ThePEG::LorentzVector< Value >::et2 ( const ThreeVector< double > &  v) const
inline

Transverse energy squared with respect to the given axis.

Definition at line 188 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::vect().

◆ eta()

template<typename Value >
double ThePEG::LorentzVector< Value >::eta ( ) const
inline

◆ findBoostToCM()

template<typename Value >
Boost ThePEG::LorentzVector< Value >::findBoostToCM ( ) const
inline

Boost from reference frame into this vector's rest frame: \(-\frac{\vec{x}}{t}\).

Definition at line 299 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::boostVector().

◆ isNear()

template<typename Value >
bool ThePEG::LorentzVector< Value >::isNear ( const LorentzVector< Value > &  w,
double  epsilon 
) const
inline

Are two vectors nearby, using Euclidean measure \(t^2 + |\vec{x}|^2\)?

Definition at line 310 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::dot(), ThePEG::sqr(), and ThePEG::LorentzVector< Value >::vect().

Referenced by ThePEG::SpinInfo::isNear().

◆ m()

template<typename Value >
Value ThePEG::LorentzVector< Value >::m ( ) const
inline

◆ m2() [1/2]

template<typename Value >
Value2 ThePEG::LorentzVector< Value >::m2 ( ) const
inline

◆ m2() [2/2]

template<typename Value >
Value2 ThePEG::LorentzVector< Value >::m2 ( const LorentzVector< Value > &  a) const
inline

Squared magnitude with another vector.

Definition at line 125 of file LorentzVector.h.

References ThePEG::sqr().

◆ minus()

template<typename Value >
Value ThePEG::LorentzVector< Value >::minus ( ) const
inline

Returns the negative light-cone component \(t - z\).

Definition at line 307 of file LorentzVector.h.

Referenced by ThePEG::Lorentz5Vector< Value >::dirMinus(), ThePEG::dirMinus(), ThePEG::Lorentz5Vector< Value >::dirPlus(), ThePEG::dirPlus(), and ThePEG::Particle::Pminus().

◆ mt()

template<typename Value >
Value ThePEG::LorentzVector< Value >::mt ( ) const
inline

Transverse mass (signed) \(\pm\sqrt{|t^2 - z^2|}\).

Definition at line 141 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::mt2().

◆ mt2()

template<typename Value >
Value2 ThePEG::LorentzVector< Value >::mt2 ( ) const
inline

Transverse mass squared \(t^2-z^2\).

Definition at line 138 of file LorentzVector.h.

Referenced by ThePEG::LorentzVector< Value >::mt().

◆ operator ThreeVector< Value >()

template<typename Value >
ThePEG::LorentzVector< Value >::operator ThreeVector< Value > ( ) const
inline

Cast to the 3-component part.

Definition at line 102 of file LorentzVector.h.

◆ operator*=() [1/2]

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::operator*= ( const SpinOneLorentzRotation m)
inline

Rotate the vector. Resets \(x^\mu\rightarrow\mathsf{M}^\mu_\nu x^\nu\).

Definition at line 327 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::m(), and ThePEG::LorentzVector< Value >::transform().

◆ operator*=() [2/2]

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::operator*= ( double  a)
inline

Definition at line 521 of file LorentzVector.h.

◆ operator+=() [1/2]

template<typename Value >
LorentzVector< Complex > & ThePEG::LorentzVector< Value >::operator+= ( const LorentzVector< complex< QtyDouble > > &  a)
inline

Definition at line 487 of file LorentzVector.h.

◆ operator+=() [2/2]

template<typename Value >
template<typename ValueB >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::operator+= ( const LorentzVector< ValueB > &  a)
inline

Definition at line 496 of file LorentzVector.h.

◆ operator-=() [1/2]

template<typename Value >
LorentzVector< Complex > & ThePEG::LorentzVector< Value >::operator-= ( const LorentzVector< complex< QtyDouble > > &  a)
inline

Definition at line 504 of file LorentzVector.h.

◆ operator-=() [2/2]

template<typename Value >
template<typename ValueB >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::operator-= ( const LorentzVector< ValueB > &  a)
inline

Definition at line 513 of file LorentzVector.h.

◆ operator/=()

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::operator/= ( double  a)
inline

Definition at line 529 of file LorentzVector.h.

◆ operator=()

template<typename Value >
template<typename ValueB >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::operator= ( const LorentzVector< ValueB > &  b)
inline

Assignment operator.

Definition at line 68 of file LorentzVector.h.

Referenced by ThePEG::Lorentz5Vector< Value >::operator=().

◆ perp() [1/2]

template<typename Value >
Value ThePEG::LorentzVector< Value >::perp ( ) const
inline

Transverse component of the spatial vector \(\pm\sqrt{x^2 + y^2}\).

Definition at line 151 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::perp2().

Referenced by ThePEG::LorentzVector< Value >::eta(), and ThePEG::LorentzVector< Value >::theta().

◆ perp() [2/2]

template<typename Value >
template<typename U >
Value ThePEG::LorentzVector< Value >::perp ( const ThreeVector< U > &  p) const
inline

Transverse component of the spatial vector with respect to the given axis.

Definition at line 168 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::vect().

◆ perp2() [1/2]

template<typename Value >
Value2 ThePEG::LorentzVector< Value >::perp2 ( ) const
inline

Squared transverse component of the spatial vector \(x^2+y^2\).

Definition at line 148 of file LorentzVector.h.

References ThePEG::sqr().

Referenced by ThePEG::LorentzVector< Value >::perp(), ThePEG::Particle::perpmass2(), and ThePEG::LorentzVector< Value >::rapidity().

◆ perp2() [2/2]

template<typename Value >
template<typename U >
Value2 ThePEG::LorentzVector< Value >::perp2 ( const ThreeVector< U > &  p) const
inline

Squared transverse component of the spatial vector with respect to the given axis.

Definition at line 158 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::vect().

◆ phi()

template<typename Value >
double ThePEG::LorentzVector< Value >::phi ( ) const
inline

◆ plus()

template<typename Value >
Value ThePEG::LorentzVector< Value >::plus ( ) const
inline

Returns the positive light-cone component \(t + z\).

Definition at line 305 of file LorentzVector.h.

Referenced by ThePEG::Lorentz5Vector< Value >::dirMinus(), ThePEG::dirMinus(), ThePEG::Lorentz5Vector< Value >::dirPlus(), ThePEG::dirPlus(), and ThePEG::Particle::Pplus().

◆ rapidity() [1/2]

template<typename Value >
double ThePEG::LorentzVector< Value >::rapidity ( ) const
inline

Rapidity \(\frac{1}{2}\ln\frac{t+z}{t-z} \).

Definition at line 259 of file LorentzVector.h.

References ThePEG::Constants::epsilon, ERROR_IF, ThePEG::LorentzVector< Value >::m2(), ThePEG::LorentzVector< Value >::perp2(), ThePEG::sqr(), and ThePEG::ZERO.

◆ rapidity() [2/2]

template<typename Value >
double ThePEG::LorentzVector< Value >::rapidity ( const Axis ref) const
inline

◆ rho()

◆ rho2()

template<typename Value >
Value2 ThePEG::LorentzVector< Value >::rho2 ( ) const
inline

Radius squared.

Definition at line 205 of file LorentzVector.h.

References ThePEG::sqr().

Referenced by ThePEG::LorentzVector< Value >::boostVector(), and ThePEG::LorentzVector< Value >::rho().

◆ rotate()

template<typename Value >
template<typename U >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::rotate ( double  angle,
const ThreeVector< U > &  axis 
)
inline

Apply a rotation.

Parameters
angleRotation angle in radians.
axisRotation axis.

Definition at line 456 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::angle(), and ThePEG::ThreeVector< Value >::mag().

◆ rotateUz()

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::rotateUz ( const Axis axis)
inline

Rotate the reference frame to a new z-axis.

Definition at line 430 of file LorentzVector.h.

References ThePEG::ThreeVector< Value >::unit().

◆ rotateX()

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::rotateX ( double  phi)
inline

Apply rotation around the x-axis.

Parameters
phiAngle in radians.

Definition at line 390 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::phi().

◆ rotateY()

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::rotateY ( double  phi)
inline

Apply rotation around the y-axis.

Parameters
phiAngle in radians.

Definition at line 404 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::phi().

◆ rotateZ()

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::rotateZ ( double  phi)
inline

Apply rotation around the z-axis.

Parameters
phiAngle in radians.

Definition at line 418 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::phi().

◆ setE()

template<typename Value >
void ThePEG::LorentzVector< Value >::setE ( Value  e)
inline

Definition at line 92 of file LorentzVector.h.

◆ setRho()

template<typename Value >
void ThePEG::LorentzVector< Value >::setRho ( Value  newRho)
inline

Set new radius.

Definition at line 211 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::rho().

Referenced by ThePEG::Lorentz5Vector< Value >::rescaleRho().

◆ setT()

template<typename Value >
void ThePEG::LorentzVector< Value >::setT ( Value  t)
inline

Definition at line 91 of file LorentzVector.h.

◆ setVect()

template<typename Value >
void ThePEG::LorentzVector< Value >::setVect ( const ThreeVector< Value > &  p)
inline

Set the 3-component part.

Definition at line 105 of file LorentzVector.h.

Referenced by ThePEG::Particle::set3Momentum(), and ThePEG::Particle::setLifeLength().

◆ setX()

template<typename Value >
void ThePEG::LorentzVector< Value >::setX ( Value  x)
inline

Definition at line 88 of file LorentzVector.h.

◆ setY()

template<typename Value >
void ThePEG::LorentzVector< Value >::setY ( Value  y)
inline

Definition at line 89 of file LorentzVector.h.

◆ setZ()

template<typename Value >
void ThePEG::LorentzVector< Value >::setZ ( Value  z)
inline

Definition at line 90 of file LorentzVector.h.

◆ t()

template<typename Value >
Value ThePEG::LorentzVector< Value >::t ( ) const
inline

Definition at line 82 of file LorentzVector.h.

◆ theta()

template<typename Value >
double ThePEG::LorentzVector< Value >::theta ( ) const
inline

Polar angle.

Definition at line 223 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::perp().

Referenced by ThePEG::dirTheta().

◆ transform()

template<typename Value >
LorentzVector< Value > & ThePEG::LorentzVector< Value >::transform ( const SpinOneLorentzRotation m)
inline

Rotate the vector. Resets \(x^\mu\rightarrow\mathsf{M}^\mu_\nu x^\nu\).

Definition at line 321 of file LorentzVector.h.

References ThePEG::LorentzVector< Value >::m().

Referenced by ThePEG::LorentzVector< Value >::operator*=(), ThePEG::Helicity::VectorWaveFunction::transform(), and ThePEG::Lorentz5Vector< Value >::transform().

◆ vect()

◆ x()

template<typename Value >
Value ThePEG::LorentzVector< Value >::x ( ) const
inline

Definition at line 79 of file LorentzVector.h.

◆ y()

template<typename Value >
Value ThePEG::LorentzVector< Value >::y ( ) const
inline

Definition at line 80 of file LorentzVector.h.

◆ z()

template<typename Value >
Value ThePEG::LorentzVector< Value >::z ( ) const
inline

Definition at line 81 of file LorentzVector.h.

Member Data Documentation

◆ theT

template<typename Value >
Value ThePEG::LorentzVector< Value >::theT
private

Definition at line 544 of file LorentzVector.h.

◆ theX

template<typename Value >
Value ThePEG::LorentzVector< Value >::theX
private

Definition at line 541 of file LorentzVector.h.

◆ theY

template<typename Value >
Value ThePEG::LorentzVector< Value >::theY
private

Definition at line 542 of file LorentzVector.h.

◆ theZ

template<typename Value >
Value ThePEG::LorentzVector< Value >::theZ
private

Definition at line 543 of file LorentzVector.h.


The documentation for this class was generated from the following file: