cepgen is hosted by Hepforge, IPPP Durham
CepGen 1.2.5
Central exclusive processes event generator
Loading...
Searching...
No Matches

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

#include <CepGen/Physics/Momentum.h>

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

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 &) const
 Vector product of the 3-momentum with another 3-momentum.
 
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
 Unary inverse operator.
 
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.
 
Momentum operator* (double c) const
 Multiply all components of a 4-momentum by a scalar.
 
Momentumoperator*= (double c)
 Multiply all 4-momentum coordinates by a scalar.
 
 operator Vector () const
 Cast the 4-momentum object into a 4-dimensional vector.
 
MomentumbetaGammaBoost (double gamma, double betagamma)
 Forward \(\beta-\gamma\) boost.
 
MomentumlorentzBoost (const Momentum &p)
 Forward Lorentz boost.
 
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)
 
double px () const
 Momentum along the \(x\)-axis (in GeV)
 
MomentumsetPy (double py)
 Set the momentum along the \(y\)-axis (in GeV)
 
double py () const
 Momentum along the \(y\)-axis (in GeV)
 
MomentumsetPz (double pz)
 Set the longitudinal momentum (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\))
 
Momentum transverse () const
 Transverse coordinates of a momentum.
 
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
 Tranverse energy component (in GeV)
 
double energyT2 () const
 Squared tranverse 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.
 
double mass () const
 Mass (in GeV) as computed from its energy and momentum.
 
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.
 
double deltaEta (const Momentum &) const
 Pseudorapidity distance between two momenta.
 
double deltaPhi (const Momentum &) const
 Azimutal 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 the transverse components by an angle phi (and reflect the y coordinate)
 
MomentumrotateThetaPhi (double theta, double phi)
 Rotate the particle's momentum by a polar/azimuthal angle.
 
MomentummirrorX ()
 Apply a \( x\rightarrow -x\) transformation.
 
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.
 

Friends

Momentum operator* (double, const Momentum &)
 Left-multiply all 4-momentum coordinates by a scalar.
 
std::ostream & operator<< (std::ostream &, const Momentum &)
 Human-readable format for a particle's momentum.
 

Detailed Description

4-momentum for a particle

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 33 of file Momentum.h.

Constructor & Destructor Documentation

◆ Momentum() [1/3]

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

Definition at line 45 of file Momentum.cpp.

◆ Momentum() [2/3]

Momentum ( double *  p)
explicit

Definition at line 49 of file Momentum.cpp.

◆ Momentum() [3/3]

Momentum ( const Vector vec)
explicit

Definition at line 54 of file Momentum.cpp.

Member Function Documentation

◆ beta()

double beta ( ) const

Definition at line 265 of file Momentum.cpp.

◆ betaGammaBoost()

Momentum & betaGammaBoost ( double  gamma,
double  betagamma 
)

Definition at line 297 of file Momentum.cpp.

◆ computeEnergyFromMass()

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

Definition at line 186 of file Momentum.cpp.

◆ computePzFromMass()

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

Definition at line 188 of file Momentum.cpp.

◆ crossProduct()

double crossProduct ( const Momentum mom) const

Definition at line 152 of file Momentum.cpp.

◆ deltaEta()

double deltaEta ( const Momentum oth) const

Definition at line 251 of file Momentum.cpp.

◆ deltaPhi()

double deltaPhi ( const Momentum oth) const

Definition at line 253 of file Momentum.cpp.

◆ deltaPt()

double deltaPt ( const Momentum oth) const

Definition at line 257 of file Momentum.cpp.

◆ deltaR()

double deltaR ( const Momentum oth) const

Definition at line 259 of file Momentum.cpp.

◆ energy()

double energy ( ) const

Definition at line 136 of file Momentum.h.

◆ energy2()

double energy2 ( ) const

Definition at line 138 of file Momentum.h.

◆ energyT()

double energyT ( ) const

Definition at line 218 of file Momentum.cpp.

◆ energyT2()

double energyT2 ( ) const

Definition at line 213 of file Momentum.cpp.

◆ eta()

double eta ( ) const

Definition at line 240 of file Momentum.cpp.

◆ fourProduct()

double fourProduct ( const Momentum mom) const

Definition at line 145 of file Momentum.cpp.

◆ fromPtEtaPhiE()

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

Definition at line 69 of file Momentum.cpp.

◆ fromPtEtaPhiM()

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

Definition at line 73 of file Momentum.cpp.

◆ fromPThetaPhiE()

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

Definition at line 77 of file Momentum.cpp.

◆ fromPtYPhiM()

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

Definition at line 93 of file Momentum.cpp.

◆ fromPxPyPzE()

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

Definition at line 82 of file Momentum.cpp.

◆ fromPxPyPzM()

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

Definition at line 84 of file Momentum.cpp.

◆ fromPxPyYM()

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

Definition at line 88 of file Momentum.cpp.

◆ gamma()

double gamma ( ) const

Definition at line 295 of file Momentum.cpp.

◆ gamma2()

double gamma2 ( ) const

Definition at line 280 of file Momentum.cpp.

◆ lorentzBoost()

Momentum & lorentzBoost ( const Momentum p)

Definition at line 304 of file Momentum.cpp.

◆ mass()

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

Definition at line 222 of file Momentum.cpp.

◆ mass2()

double mass2 ( ) const

Definition at line 220 of file Momentum.cpp.

◆ massT()

double massT ( ) const

Definition at line 226 of file Momentum.cpp.

◆ massT2()

double massT2 ( ) const

Definition at line 224 of file Momentum.cpp.

◆ mirrorX()

Momentum & mirrorX ( )

Definition at line 196 of file Momentum.h.

◆ mirrorY()

Momentum & mirrorY ( )

Definition at line 201 of file Momentum.h.

◆ mirrorZ()

Momentum & mirrorZ ( )

Definition at line 206 of file Momentum.h.

◆ operator Vector()

operator Vector ( ) const

Definition at line 211 of file Momentum.cpp.

◆ operator!=()

bool operator!= ( const Momentum oth) const

Definition at line 43 of file Momentum.h.

◆ operator%()

Momentum operator% ( const Momentum mom) const

Definition at line 122 of file Momentum.cpp.

◆ operator*() [1/2]

double operator* ( const Momentum mom) const

Definition at line 120 of file Momentum.cpp.

◆ operator*() [2/2]

Momentum operator* ( double  c) const

Definition at line 127 of file Momentum.cpp.

◆ operator*=() [1/2]

double operator*= ( const Momentum )

◆ operator*=() [2/2]

Momentum & operator*= ( double  c)

Definition at line 129 of file Momentum.cpp.

◆ operator+()

Momentum operator+ ( const Momentum mom) const

Definition at line 100 of file Momentum.cpp.

◆ operator+=()

Momentum & operator+= ( const Momentum mom)

Definition at line 104 of file Momentum.cpp.

◆ operator-() [1/2]

Momentum operator- ( ) const

Definition at line 109 of file Momentum.cpp.

◆ operator-() [2/2]

Momentum operator- ( const Momentum mom) const

Definition at line 111 of file Momentum.cpp.

◆ operator-=()

Momentum & operator-= ( const Momentum mom)

Definition at line 115 of file Momentum.cpp.

◆ operator==()

bool operator== ( const Momentum oth) const

Definition at line 63 of file Momentum.cpp.

◆ p()

double p ( ) const

Definition at line 130 of file Momentum.h.

◆ p2()

double p2 ( ) const

Definition at line 132 of file Momentum.h.

◆ phi()

double phi ( ) const

Definition at line 230 of file Momentum.cpp.

◆ pt()

double pt ( ) const

Definition at line 232 of file Momentum.cpp.

◆ pt2()

double pt2 ( ) const

Definition at line 234 of file Momentum.cpp.

◆ pVector()

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

Definition at line 204 of file Momentum.cpp.

◆ px()

double px ( ) const

Definition at line 112 of file Momentum.h.

◆ py()

double py ( ) const

Definition at line 116 of file Momentum.h.

◆ pz()

double pz ( ) const

Definition at line 120 of file Momentum.h.

◆ rapidity()

double rapidity ( ) const

Definition at line 246 of file Momentum.cpp.

◆ rotatePhi()

Momentum & rotatePhi ( double  phi,
double  sign 
)

Definition at line 324 of file Momentum.cpp.

◆ rotateThetaPhi()

Momentum & rotateThetaPhi ( double  theta,
double  phi 
)

Definition at line 330 of file Momentum.cpp.

◆ setEnergy()

Momentum & setEnergy ( double  e)

Definition at line 171 of file Momentum.cpp.

◆ setMass()

Momentum & setMass ( double  m)

Definition at line 176 of file Momentum.cpp.

◆ setMass2()

Momentum & setMass2 ( double  m2)

Definition at line 178 of file Momentum.cpp.

◆ setP() [1/2]

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

Definition at line 182 of file Momentum.cpp.

◆ setP() [2/2]

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

Definition at line 180 of file Momentum.cpp.

◆ setPx()

Momentum & setPx ( double  px)

Definition at line 156 of file Momentum.cpp.

◆ setPy()

Momentum & setPy ( double  py)

Definition at line 161 of file Momentum.cpp.

◆ setPz()

Momentum & setPz ( double  pz)

Definition at line 166 of file Momentum.cpp.

◆ theta()

double theta ( ) const

Definition at line 228 of file Momentum.cpp.

◆ threeProduct()

double threeProduct ( const Momentum mom) const

Definition at line 138 of file Momentum.cpp.

◆ transverse()

Momentum transverse ( ) const

Definition at line 236 of file Momentum.cpp.

◆ truncate()

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

Definition at line 197 of file Momentum.cpp.

Friends And Related Symbol Documentation

◆ operator*

Momentum operator* ( double  c,
const Momentum mom 
)
friend

Definition at line 134 of file Momentum.cpp.

◆ operator<<

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

Definition at line 353 of file Momentum.cpp.