Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Hammer::FourMomentum Class Reference

4-momentum class More...

#include <FourMomentum.hh>

+ Inheritance diagram for Hammer::FourMomentum:
+ Collaboration diagram for Hammer::FourMomentum:

Public Member Functions

 FourMomentum ()
 default constructor More...
 
 FourMomentum (const std::array< double, 4 > &other)
 constructor from an array of numbers More...
 
 FourMomentum (const double E, const double px, const double py, const double pz)
 constructor from specific components More...
 
FourMomentumsetE (double E)
 set the 4-momentum energy More...
 
FourMomentumsetPx (double px)
 set the 4-momentum momentum x component More...
 
FourMomentumsetPy (double py)
 set the 4-momentum momentum y component More...
 
FourMomentumsetPz (double pz)
 set the 4-momentum momentum z component More...
 
double E () const
 returns the energy More...
 
double px () const
 returns the momentum x component More...
 
double py () const
 returns the momentum y component More...
 
double pz () const
 returns the momentum z component More...
 
double mass () const
 returns the invariant mass if the invariant mass squared is negative returns \( - \sqrt{|m^2|} \) More...
 
double mass2 () const
 returns the squared invariant mass More...
 
double p () const
 returns the absolute value of the 3-momentum More...
 
double p2 () const
 returns the squared 3-momentum More...
 
double pt () const
 returns the transverse momentum More...
 
double rapidity () const
 returns the rapidity (along the z-axis) More...
 
double phi () const
 returns the azimuthal angle More...
 
double eta () const
 returns the pseudorapidity (along the z-axis) More...
 
double theta () const
 returns the polar angle (along the z-axis) More...
 
std::array< double, 3 > pVec () const
 returns the spatial 3-vector as an array More...
 
double dot (const FourMomentum &v) const
 contracts the 4-momentum with another More...
 
FourMomentumoperator*= (double a)
 multiplies the components by a constant More...
 
FourMomentumoperator/= (double a)
 divides the components by a constant More...
 
FourMomentumoperator+= (const FourMomentum &v)
 adds the another 4-momentum to itself More...
 
FourMomentumoperator-= (const FourMomentum &v)
 subtract the 4-momentum by another More...
 
FourMomentum operator- () const
 construct a copy of itself with all the signs of the components flipped More...
 
FourMomentum PFlip () const
 construct a copy of itself with all the signs of the spatial components flipped More...
 
double gamma () const
 returns the \( \gamma = 1/\sqrt{1-\beta^2} \) for the Lorentz transformation to the rest frame More...
 
double beta () const
 returns the value of the boost to the rest frame More...
 
std::array< double, 3 > boostVector () const
 returns the boost 3-vector More...
 
FourMomentumboostToRestFrameOf (const FourMomentum &v)
 returns a boosted 4-vector More...
 
FourMomentumboostFromRestFrameOf (const FourMomentum &v)
 
FourMomentumboostToRestFrameOf (const std::array< double, 3 > &v)
 

Static Public Member Functions

static FourMomentum fromPM (double px, double py, double pz, double mass)
 builder method based on 3-momentum and invariant mass More...
 
static FourMomentum fromPtEtaPhiM (double pt, double eta, double phi, double mass)
 builder method based on collider-friendly variables More...
 
static FourMomentum fromEtaPhiME (double eta, double phi, double mass, double E)
 builder method based on collider-friendly variables More...
 

Private Member Functions

void boostBy (const std::array< double, 3 > &v)
 

Private Attributes

std::array< double, 4 > _vec
 the contents of the 4-momentum in the notation \( (E, p_x, p_y, p_z) \). More...
 

Detailed Description

4-momentum class

Defines a 4-momentum and its basic properties and operations

Definition at line 30 of file FourMomentum.hh.

Constructor & Destructor Documentation

Hammer::FourMomentum::FourMomentum ( )

default constructor

Definition at line 24 of file FourMomentum.cc.

Hammer::FourMomentum::FourMomentum ( const std::array< double, 4 > &  other)

constructor from an array of numbers

Parameters
[in]otherthe array, defined as \( \left(E, p_x, p_y, p_z \right) \)
Hammer::FourMomentum::FourMomentum ( const double  E,
const double  px,
const double  py,
const double  pz 
)

constructor from specific components

Parameters
[in]Ethe energy
[in]pxthe x momentum component
[in]pythe y momentum component
[in]pzthe z momentum component

Member Function Documentation

double Hammer::FourMomentum::beta ( ) const

returns the value of the boost to the rest frame

Returns
the value. Throws if zero energy.
void Hammer::FourMomentum::boostBy ( const std::array< double, 3 > &  v)
private
Parameters
[in]v
Returns
FourMomentum& Hammer::FourMomentum::boostFromRestFrameOf ( const FourMomentum v)
Parameters
[in]v
Returns
FourMomentum& Hammer::FourMomentum::boostToRestFrameOf ( const FourMomentum v)

returns a boosted 4-vector

Parameters
[in]v
Returns
the boosted 4-vector.
FourMomentum& Hammer::FourMomentum::boostToRestFrameOf ( const std::array< double, 3 > &  v)
Parameters
[in]v
Returns
std::array<double, 3> Hammer::FourMomentum::boostVector ( ) const

returns the boost 3-vector

Returns
the vector. Throws if zero energy.
double Hammer::FourMomentum::dot ( const FourMomentum v) const

contracts the 4-momentum with another

Parameters
[in]vthe other 4-momentum
Returns
the dot product
double Hammer::FourMomentum::E ( ) const

returns the energy

double Hammer::FourMomentum::eta ( ) const

returns the pseudorapidity (along the z-axis)

static FourMomentum Hammer::FourMomentum::fromEtaPhiME ( double  eta,
double  phi,
double  mass,
double  E 
)
static

builder method based on collider-friendly variables

Parameters
[in]etathe pseudorapidity
[in]phithe azimuthal angle
[in]massthe invariant mass
[in]Ethe energy
Returns
the built 4-momentum
static FourMomentum Hammer::FourMomentum::fromPM ( double  px,
double  py,
double  pz,
double  mass 
)
static

builder method based on 3-momentum and invariant mass

Parameters
[in]pxthe x momentum component
[in]pythe y momentum component
[in]pzthe z momentum component
[in]massthe invariant mass
Returns
the built 4-momentum
static FourMomentum Hammer::FourMomentum::fromPtEtaPhiM ( double  pt,
double  eta,
double  phi,
double  mass 
)
static

builder method based on collider-friendly variables

Parameters
[in]ptthe transverse momentum
[in]etathe pseudorapidity
[in]phithe azimuthal angle
[in]massthe invariant mass
Returns
the built 4-momentum
double Hammer::FourMomentum::gamma ( ) const

returns the \( \gamma = 1/\sqrt{1-\beta^2} \) for the Lorentz transformation to the rest frame

Returns
the value. Throws for massless particles.
double Hammer::FourMomentum::mass ( ) const

returns the invariant mass if the invariant mass squared is negative returns \( - \sqrt{|m^2|} \)

double Hammer::FourMomentum::mass2 ( ) const

returns the squared invariant mass

FourMomentum& Hammer::FourMomentum::operator*= ( double  a)

multiplies the components by a constant

Parameters
[in]athe real constant
Returns
a reference to itself
FourMomentum& Hammer::FourMomentum::operator+= ( const FourMomentum v)

adds the another 4-momentum to itself

Parameters
[in]vthe other 4-momentum
Returns
a reference to itself
FourMomentum Hammer::FourMomentum::operator- ( ) const

construct a copy of itself with all the signs of the components flipped

Returns
a new 4-vector with the components flipped
FourMomentum& Hammer::FourMomentum::operator-= ( const FourMomentum v)

subtract the 4-momentum by another

Parameters
[in]vthe other 4-momentum
Returns
a reference to itself
FourMomentum& Hammer::FourMomentum::operator/= ( double  a)

divides the components by a constant

Parameters
[in]athe real constant
Returns
a reference to itself. Throws if division-by-zero.
double Hammer::FourMomentum::p ( ) const

returns the absolute value of the 3-momentum

double Hammer::FourMomentum::p2 ( ) const

returns the squared 3-momentum

FourMomentum Hammer::FourMomentum::PFlip ( ) const

construct a copy of itself with all the signs of the spatial components flipped

Returns
a new 4-vector with the spatial components flipped
double Hammer::FourMomentum::phi ( ) const

returns the azimuthal angle

double Hammer::FourMomentum::pt ( ) const

returns the transverse momentum

std::array<double, 3> Hammer::FourMomentum::pVec ( ) const

returns the spatial 3-vector as an array

double Hammer::FourMomentum::px ( ) const

returns the momentum x component

double Hammer::FourMomentum::py ( ) const

returns the momentum y component

double Hammer::FourMomentum::pz ( ) const

returns the momentum z component

double Hammer::FourMomentum::rapidity ( ) const

returns the rapidity (along the z-axis)

FourMomentum& Hammer::FourMomentum::setE ( double  E)

set the 4-momentum energy

Parameters
[in]Ethe new energy
Returns
a reference to itself
FourMomentum& Hammer::FourMomentum::setPx ( double  px)

set the 4-momentum momentum x component

Parameters
[in]pxthe new momentum x component
Returns
a reference to itself
FourMomentum& Hammer::FourMomentum::setPy ( double  py)

set the 4-momentum momentum y component

Parameters
[in]pythe new momentum y component
Returns
a reference to itself
FourMomentum& Hammer::FourMomentum::setPz ( double  pz)

set the 4-momentum momentum z component

Parameters
[in]pzthe new momentum z component
Returns
a reference to itself
double Hammer::FourMomentum::theta ( ) const

returns the polar angle (along the z-axis)

Member Data Documentation

std::array<double, 4> Hammer::FourMomentum::_vec
private

the contents of the 4-momentum in the notation \( (E, p_x, p_y, p_z) \).

Definition at line 222 of file FourMomentum.hh.


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