cepgen is hosted by Hepforge, IPPP Durham
CepGen N/A
Central exclusive processes event generator

Container for a particle's 4-momentum, along with useful methods to ease the development of any matrix element level generator. More...

#include <include/CepGen/Physics/Momentum.h>

+ Inheritance diagram for Momentum:
+ Collaboration diagram for Momentum:

Public Types

enum  coord_t { X = 0 , Y = 1 , Z = 2 , E = 3 }
 

Public Member Functions

 Momentum (double x=0., double y=0., double z=0., double t=-1.)
 Build a 4-momentum using its 3-momentum coordinates and its energy.
 
 Momentum (double *p)
 Build a 4-momentum using its 3-momentum coordinates and its energy.
 
 Momentum (const Vector &)
 Build a 4-momentum using its 3-momentum coordinates and its energy.
 
bool operator== (const Momentum &) const
 Equality operator.
 
bool operator!= (const Momentum &oth) const
 Inequality operator.
 
double threeProduct (const Momentum &) const
 Scalar product of the 3-momentum with another 3-momentum.
 
double fourProduct (const Momentum &) const
 Scalar product of the 4-momentum with another 4-momentum.
 
double crossProduct (const Momentum &, coord_t) const
 Vector product of the 3-momentum with another 3-momentum.
 
Momentum operator+ () const
 Unary trivial operator.
 
Momentum operator- () const
 Unary inverse operator.
 
Momentum operator* (double) const
 Multiply all components of a 4-momentum by a scalar.
 
Momentumoperator*= (double)
 Multiply all 4-momentum coordinates by a scalar.
 
Momentum operator/ (double) const
 Divide all components of a 4-momentum by a scalar.
 
Momentumoperator/= (double)
 Divide all 4-momentum coordinates by a scalar.
 
Momentum operator+ (const Momentum &) const
 Compute the 4-vector sum of two 4-momenta.
 
Momentumoperator+= (const Momentum &)
 Add a 4-momentum through a 4-vector sum.
 
Momentum operator- (const Momentum &) const
 Compute the inverse per-coordinate 4-vector.
 
Momentumoperator-= (const Momentum &)
 Subtract a 4-momentum through a 4-vector sum.
 
double operator* (const Momentum &) const
 Scalar product of two 3-momenta.
 
Momentum operator% (const Momentum &) const
 Vector product of two 3-momenta.
 
double operator*= (const Momentum &)
 Scalar product of the 3-momentum with another 3-momentum.
 
 operator Vector () const
 Cast the 4-momentum object into a 4-dimensional vector.
 
MomentumsetP (double px, double py, double pz, double e)
 Set all the components of the 4-momentum (in GeV)
 
MomentumsetP (double px, double py, double pz)
 Set all the components of the 3-momentum (in GeV)
 
MomentumsetPx (double px)
 Set the momentum along the \(x\)-axis (in GeV)
 
MomentumsetPy (double py)
 Set the momentum along the \(y\)-axis (in GeV)
 
MomentumsetPz (double pz)
 Set the longitudinal momentum (in GeV)
 
double px () const
 Momentum along the \(x\)-axis (in GeV)
 
double py () const
 Momentum along the \(y\)-axis (in GeV)
 
double pz () const
 Longitudinal momentum (in GeV)
 
double pt () const
 Transverse momentum (in GeV)
 
double pt2 () const
 Squared transverse momentum (in GeV \(^2\))
 
std::array< double, 5 > pVector () const
 5-vector of double precision floats (in GeV)
 
double p () const
 3-momentum norm (in GeV)
 
double p2 () const
 Squared 3-momentum norm (in GeV \(^2\))
 
MomentumsetEnergy (double)
 Set the energy (in GeV)
 
double energy () const
 Energy (in GeV)
 
double energy2 () const
 Squared energy (in GeV \(^2\))
 
double energyT () const
 Transverse energy component (in GeV)
 
double energyT2 () const
 Squared transverse energy component (in GeV \(^2\))
 
MomentumsetMass2 (double)
 Compute the energy from the mass.
 
double mass2 () const
 Squared mass (in GeV \(^2\)) as computed from its energy and momentum.
 
MomentumsetMass (double)
 Compute the energy from the mass Mass (in GeV) as computed from its energy and momentum.
 
double mass () const
 
double massT2 () const
 Squared transverse mass (in GeV \(^2\))
 
double massT () const
 Transverse mass (in GeV)
 
double theta () const
 Polar angle (angle with respect to the longitudinal direction)
 
double phi () const
 Azimuthal angle (angle in the transverse plane)
 
double eta () const
 Pseudo-rapidity.
 
double rapidity () const
 Rapidity.
 
Momentum transverse (coord_t=Z) const
 Transverse coordinates of a momentum.
 
Momentum longitudinal (coord_t=Z) const
 Longitudinal component of a momentum.
 
MomentumbetaGammaBoost (double gamma, double beta_gamma)
 Forward \(\beta-\gamma\) boost.
 
MomentumlorentzBoost (const Momentum &p)
 Forward Lorentz boost.
 
double deltaEta (const Momentum &) const
 Pseudo-rapidity distance between two momenta.
 
double deltaPhi (const Momentum &) const
 Azimuthal angle opening between two momenta.
 
double deltaPt (const Momentum &) const
 Transverse momentum distance between two momenta.
 
double deltaR (const Momentum &) const
 Angular distance between two momenta.
 
double beta () const
 Beta scalar value.
 
double gamma2 () const
 Squared gamma scalar value.
 
double gamma () const
 Gamma scalar value.
 
MomentumcomputeEnergyFromMass (double on_shell_mass)
 Compute the mass from 4-momentum.
 
MomentumcomputePzFromMass (double on_shell_mass)
 Compute the longitudinal coordinate from energy-mass-transverse momentum constraints.
 
Momentumtruncate (double tolerance=1.e-10)
 Apply a threshold to all values with a given tolerance.
 
MomentumrotatePhi (double phi, double sign)
 Rotate transverse components (+ reflect the y coordinate)
 
MomentumrotateThetaPhi (double theta, double phi)
 Rotate the particle's momentum by a polar/azimuthal angle Apply an \( x\rightarrow -x\) transformation.
 
MomentummirrorX ()
 
MomentummirrorY ()
 Apply a \( y\rightarrow -y\) transformation.
 
MomentummirrorZ ()
 Apply a \( z\rightarrow -z\) transformation.
 

Static Public Member Functions

static Momentum fromPtEtaPhiE (double pt, double eta, double phi, double e=-1.)
 Build a 3-momentum from its three pseudo-cylindrical coordinates.
 
static Momentum fromPtEtaPhiM (double pt, double eta, double phi, double m)
 Build a 3-momentum from its three pseudo-cylindrical coordinates.
 
static Momentum fromPThetaPhiE (double p, double theta, double phi, double e=-1.)
 Build a 4-momentum from its scalar momentum, and its polar and azimuthal angles.
 
static Momentum fromPxPyPzE (double px, double py, double pz, double e)
 Build a 4-momentum from its four momentum and energy coordinates.
 
static Momentum fromPxPyPzM (double px, double py, double pz, double m)
 Build a 4-momentum from its three momentum coordinates and mass.
 
static Momentum fromPxPyYM (double px, double py, double rap, double m)
 Build a 4-momentum from its transverse momentum, rapidity and mass.
 
static Momentum fromPtYPhiM (double pt, double rap, double phi, double m)
 Build a 4-momentum from its transverse momentum, azimuthal angle, rapidity and mass.
 
static Momentum fromPtYPhiE (double pt, double rap, double phi, double e)
 Build a 4-momentum from its transverse momentum, azimuthal angle, rapidity and energy.
 

Friends

Momentum operator* (double, const Momentum &)
 Left-multiply all 4-momentum coordinates by a scalar.
 
std::ostream & operator<< (std::ostream &, const Momentum &)
 Human-readable printout of a momentum.
 

Detailed Description

Date
Dec 2015
Author
Laurent Forthomme laure.nosp@m.nt.f.nosp@m.ortho.nosp@m.mme@.nosp@m.cern..nosp@m.ch

Definition at line 30 of file Momentum.h.

Member Enumeration Documentation

◆ coord_t

enum coord_t
Enumerator

Definition at line 39 of file Momentum.h.

Constructor & Destructor Documentation

◆ Momentum() [1/3]

Momentum ( double x = 0.,
double y = 0.,
double z = 0.,
double t = -1. )
explicit

◆ Momentum() [2/3]

Momentum ( double * p)
explicit

◆ Momentum() [3/3]

Momentum ( const Vector & )
explicit

Member Function Documentation

◆ beta()

double beta ( ) const

◆ betaGammaBoost()

Momentum & betaGammaBoost ( double gamma,
double beta_gamma )

◆ computeEnergyFromMass()

Momentum & computeEnergyFromMass ( double on_shell_mass)
Parameters
[in]on_shell_massSpecify on-shell mass (in GeV) to constrain energy

◆ computePzFromMass()

Momentum & computePzFromMass ( double on_shell_mass)
Parameters
[in]on_shell_massSpecify on-shell mass (in GeV) to constrain longitudinal momentum

◆ crossProduct()

double crossProduct ( const Momentum & ,
coord_t  ) const

◆ deltaEta()

double deltaEta ( const Momentum & ) const

◆ deltaPhi()

double deltaPhi ( const Momentum & ) const

◆ deltaPt()

double deltaPt ( const Momentum & ) const

◆ deltaR()

double deltaR ( const Momentum & ) const

◆ energy()

double energy ( ) const

Definition at line 107 of file Momentum.h.

◆ energy2()

double energy2 ( ) const

Definition at line 108 of file Momentum.h.

◆ energyT()

double energyT ( ) const

◆ energyT2()

double energyT2 ( ) const

◆ eta()

double eta ( ) const

◆ fourProduct()

double fourProduct ( const Momentum & ) const

◆ fromPtEtaPhiE()

static Momentum fromPtEtaPhiE ( double pt,
double eta,
double phi,
double e = -1. )
static

◆ fromPtEtaPhiM()

static Momentum fromPtEtaPhiM ( double pt,
double eta,
double phi,
double m )
static

◆ fromPThetaPhiE()

static Momentum fromPThetaPhiE ( double p,
double theta,
double phi,
double e = -1. )
static

◆ fromPtYPhiE()

static Momentum fromPtYPhiE ( double pt,
double rap,
double phi,
double e )
static

◆ fromPtYPhiM()

static Momentum fromPtYPhiM ( double pt,
double rap,
double phi,
double m )
static

◆ fromPxPyPzE()

static Momentum fromPxPyPzE ( double px,
double py,
double pz,
double e )
static

◆ fromPxPyPzM()

static Momentum fromPxPyPzM ( double px,
double py,
double pz,
double m )
static

◆ fromPxPyYM()

static Momentum fromPxPyYM ( double px,
double py,
double rap,
double m )
static

◆ gamma()

double gamma ( ) const

◆ gamma2()

double gamma2 ( ) const

◆ longitudinal()

Momentum longitudinal ( coord_t = Z) const

◆ lorentzBoost()

Momentum & lorentzBoost ( const Momentum & p)

◆ mass()

double mass ( ) const

◆ mass2()

double mass2 ( ) const

◆ massT()

double massT ( ) const

◆ massT2()

double massT2 ( ) const

◆ mirrorX()

Momentum & mirrorX ( )

Definition at line 151 of file Momentum.h.

◆ mirrorY()

Momentum & mirrorY ( )

Definition at line 156 of file Momentum.h.

◆ mirrorZ()

Momentum & mirrorZ ( )

Definition at line 161 of file Momentum.h.

◆ operator Vector()

operator Vector ( ) const

◆ operator!=()

bool operator!= ( const Momentum & oth) const

Definition at line 41 of file Momentum.h.

◆ operator%()

Momentum operator% ( const Momentum & ) const

◆ operator*() [1/2]

double operator* ( const Momentum & ) const

◆ operator*() [2/2]

Momentum operator* ( double ) const

◆ operator*=() [1/2]

double operator*= ( const Momentum & )

◆ operator*=() [2/2]

Momentum & operator*= ( double )

◆ operator+() [1/2]

Momentum operator+ ( ) const

◆ operator+() [2/2]

Momentum operator+ ( const Momentum & ) const

◆ operator+=()

Momentum & operator+= ( const Momentum & )

◆ operator-() [1/2]

Momentum operator- ( ) const

◆ operator-() [2/2]

Momentum operator- ( const Momentum & ) const

◆ operator-=()

Momentum & operator-= ( const Momentum & )

◆ operator/()

Momentum operator/ ( double ) const

◆ operator/=()

Momentum & operator/= ( double )

◆ operator==()

bool operator== ( const Momentum & ) const

◆ p()

double p ( ) const

Definition at line 104 of file Momentum.h.

◆ p2()

double p2 ( ) const

Definition at line 105 of file Momentum.h.

◆ phi()

double phi ( ) const

◆ pt()

double pt ( ) const

◆ pt2()

double pt2 ( ) const

◆ pVector()

std::array< double, 5 > pVector ( ) const

◆ px()

double px ( ) const

Definition at line 97 of file Momentum.h.

◆ py()

double py ( ) const

Definition at line 98 of file Momentum.h.

◆ pz()

double pz ( ) const

Definition at line 99 of file Momentum.h.

◆ rapidity()

double rapidity ( ) const

◆ rotatePhi()

Momentum & rotatePhi ( double phi,
double sign )

◆ rotateThetaPhi()

Momentum & rotateThetaPhi ( double theta,
double phi )

◆ setEnergy()

Momentum & setEnergy ( double )

◆ setMass()

Momentum & setMass ( double )
Note
Returns \(-\sqrt{|E^2-\mathbf{p}^2|}<0\) if \(\mathbf{p}^2>E^2\)

◆ setMass2()

Momentum & setMass2 ( double )

◆ setP() [1/2]

Momentum & setP ( double px,
double py,
double pz )

◆ setP() [2/2]

Momentum & setP ( double px,
double py,
double pz,
double e )

◆ setPx()

Momentum & setPx ( double px)

◆ setPy()

Momentum & setPy ( double py)

◆ setPz()

Momentum & setPz ( double pz)

◆ theta()

double theta ( ) const

◆ threeProduct()

double threeProduct ( const Momentum & ) const

◆ transverse()

Momentum transverse ( coord_t = Z) const

◆ truncate()

Momentum & truncate ( double tolerance = 1.e-10)

Friends And Related Symbol Documentation

◆ operator*

Momentum operator* ( double ,
const Momentum &  )
friend

◆ operator<<

std::ostream & operator<< ( std::ostream & ,
const Momentum &  )
friend