HIPO  4.3.0
High Performance Output data format for experimental physics
fizika::lorentz4 Class Reference

Four-component Lorentz vector for relativistic kinematics. More...

#include <fizika.h>

Public Member Functions

 lorentz4 ()
 Default constructor (uninitialized). More...
 
 lorentz4 (double _px, double _py, double _pz, double _e)
 Construct from px, py, pz, and energy. More...
 
 lorentz4 (vector3 v, double energy)
 Construct from a 3-vector and energy. More...
 
 ~lorentz4 ()
 
double px () const
 
double py () const
 
double pz () const
 
double x () const
 
double y () const
 
double z () const
 
double theta () const
 
double phi () const
 
double m2 () const
 
double p () const
 
double e () const
 
double t () const
 
vector3 vect () const
 
void setX (double _p)
 Set the X momentum component. More...
 
void setY (double _p)
 Set the Y momentum component. More...
 
void setZ (double _p)
 Set the Z momentum component. More...
 
void setT (double _eg)
 Set the energy/time component. More...
 
void setXYZM (double _x, double _y, double _z, double _m)
 Set components from momentum and mass; energy is computed. More...
 
void setXYZE (double _x, double _y, double _z, double _e)
 Set components from momentum and energy directly. More...
 
void setVectM (vector3 &_v, double _mass)
 Set from a 3-vector and mass; energy is computed. More...
 
void rotateX (double angle)
 Rotate the 3-momentum around the X axis. More...
 
void rotateY (double angle)
 Rotate the 3-momentum around the Y axis. More...
 
void rotateZ (double angle)
 Rotate the 3-momentum around the Z axis. More...
 
double m () const
 
vector3 boostVector ()
 
void boost (vector3 vb)
 Apply a Lorentz boost using a boost vector. More...
 
void boost (double bx, double by, double bz)
 Apply a Lorentz boost using beta components. More...
 
void print (const char *_line="LV ")
 Print the Lorentz vector components, magnitude, and mass to stdout. More...
 
lorentz4operator= (const lorentz4 &)
 Copy-assignment operator. More...
 
lorentz4 operator+ (const lorentz4 &) const
 Lorentz vector addition. More...
 
lorentz4 operator- (const lorentz4 &) const
 Lorentz vector subtraction. More...
 
lorentz4operator+= (const lorentz4 &)
 Add another Lorentz vector to this one in place. More...
 
lorentz4operator-= (const lorentz4 &)
 Subtract another Lorentz vector from this one in place. More...
 

Detailed Description

Four-component Lorentz vector for relativistic kinematics.

Stores a 3-momentum vector and an energy component. Supports Lorentz boosts, invariant mass calculation, and standard arithmetic operators.

Definition at line 213 of file fizika.h.

Constructor & Destructor Documentation

◆ lorentz4() [1/3]

fizika::lorentz4::lorentz4 ( )
inline

Default constructor (uninitialized).

Definition at line 222 of file fizika.h.

◆ lorentz4() [2/3]

fizika::lorentz4::lorentz4 ( double  _px,
double  _py,
double  _pz,
double  _e 
)
inline

Construct from px, py, pz, and energy.

Definition at line 224 of file fizika.h.

◆ lorentz4() [3/3]

fizika::lorentz4::lorentz4 ( vector3  v,
double  energy 
)
inline

Construct from a 3-vector and energy.

Definition at line 227 of file fizika.h.

◆ ~lorentz4()

fizika::lorentz4::~lorentz4 ( )
inline

Definition at line 228 of file fizika.h.

Member Function Documentation

◆ boost() [1/2]

void fizika::lorentz4::boost ( double  bx,
double  by,
double  bz 
)
inline

Apply a Lorentz boost using beta components.

Parameters
bxBeta x component
byBeta y component
bzBeta z component

Definition at line 326 of file fizika.h.

◆ boost() [2/2]

void fizika::lorentz4::boost ( vector3  vb)
inline

Apply a Lorentz boost using a boost vector.

Parameters
vbBoost vector (beta_x, beta_y, beta_z)

Definition at line 317 of file fizika.h.

◆ boostVector()

vector3 fizika::lorentz4::boostVector ( )
inline
Returns
The boost vector (beta = p/E).

Definition at line 310 of file fizika.h.

◆ e()

double fizika::lorentz4::e ( ) const
inline
Returns
Energy component.

Definition at line 252 of file fizika.h.

◆ m()

double fizika::lorentz4::m ( ) const
inline
Returns
Invariant mass (negative if m2 < 0).

Definition at line 303 of file fizika.h.

◆ m2()

double fizika::lorentz4::m2 ( ) const
inline
Returns
Invariant mass squared (E^2 - p^2).

Definition at line 248 of file fizika.h.

◆ operator+()

lorentz4 fizika::lorentz4::operator+ ( const lorentz4 q) const
inline

Lorentz vector addition.

Definition at line 366 of file fizika.h.

◆ operator+=()

lorentz4 & fizika::lorentz4::operator+= ( const lorentz4 q)
inline

Add another Lorentz vector to this one in place.

Definition at line 369 of file fizika.h.

◆ operator-()

lorentz4 fizika::lorentz4::operator- ( const lorentz4 q) const
inline

Lorentz vector subtraction.

Definition at line 371 of file fizika.h.

◆ operator-=()

lorentz4 & fizika::lorentz4::operator-= ( const lorentz4 q)
inline

Subtract another Lorentz vector from this one in place.

Definition at line 374 of file fizika.h.

◆ operator=()

lorentz4 & fizika::lorentz4::operator= ( const lorentz4 q)
inline

Copy-assignment operator.

Definition at line 360 of file fizika.h.

◆ p()

double fizika::lorentz4::p ( ) const
inline
Returns
Magnitude of the 3-momentum.

Definition at line 250 of file fizika.h.

◆ phi()

double fizika::lorentz4::phi ( ) const
inline
Returns
Azimuthal angle of the 3-momentum in radians.

Definition at line 245 of file fizika.h.

◆ print()

void fizika::lorentz4::print ( const char *  _line = "LV ")
inline

Print the Lorentz vector components, magnitude, and mass to stdout.

Parameters
_lineLabel prefix for the output line

Definition at line 344 of file fizika.h.

◆ px()

double fizika::lorentz4::px ( ) const
inline
Returns
X component of the 3-momentum.

Definition at line 231 of file fizika.h.

◆ py()

double fizika::lorentz4::py ( ) const
inline
Returns
Y component of the 3-momentum.

Definition at line 233 of file fizika.h.

◆ pz()

double fizika::lorentz4::pz ( ) const
inline
Returns
Z component of the 3-momentum.

Definition at line 235 of file fizika.h.

◆ rotateX()

void fizika::lorentz4::rotateX ( double  angle)
inline

Rotate the 3-momentum around the X axis.

Parameters
angleRotation angle in radians

Definition at line 291 of file fizika.h.

◆ rotateY()

void fizika::lorentz4::rotateY ( double  angle)
inline

Rotate the 3-momentum around the Y axis.

Parameters
angleRotation angle in radians

Definition at line 295 of file fizika.h.

◆ rotateZ()

void fizika::lorentz4::rotateZ ( double  angle)
inline

Rotate the 3-momentum around the Z axis.

Parameters
angleRotation angle in radians

Definition at line 299 of file fizika.h.

◆ setT()

void fizika::lorentz4::setT ( double  _eg)
inline

Set the energy/time component.

Definition at line 266 of file fizika.h.

◆ setVectM()

void fizika::lorentz4::setVectM ( vector3 _v,
double  _mass 
)
inline

Set from a 3-vector and mass; energy is computed.

Definition at line 284 of file fizika.h.

◆ setX()

void fizika::lorentz4::setX ( double  _p)
inline

Set the X momentum component.

Definition at line 260 of file fizika.h.

◆ setXYZE()

void fizika::lorentz4::setXYZE ( double  _x,
double  _y,
double  _z,
double  _e 
)
inline

Set components from momentum and energy directly.

Definition at line 277 of file fizika.h.

◆ setXYZM()

void fizika::lorentz4::setXYZM ( double  _x,
double  _y,
double  _z,
double  _m 
)
inline

Set components from momentum and mass; energy is computed.

Definition at line 269 of file fizika.h.

◆ setY()

void fizika::lorentz4::setY ( double  _p)
inline

Set the Y momentum component.

Definition at line 262 of file fizika.h.

◆ setZ()

void fizika::lorentz4::setZ ( double  _p)
inline

Set the Z momentum component.

Definition at line 264 of file fizika.h.

◆ t()

double fizika::lorentz4::t ( ) const
inline
Returns
Time/energy component (alias for e()).

Definition at line 254 of file fizika.h.

◆ theta()

double fizika::lorentz4::theta ( ) const
inline
Returns
Polar angle of the 3-momentum in radians.

Definition at line 243 of file fizika.h.

◆ vect()

vector3 fizika::lorentz4::vect ( ) const
inline
Returns
Copy of the 3-momentum vector.

Definition at line 256 of file fizika.h.

◆ x()

double fizika::lorentz4::x ( ) const
inline
Returns
X component (alias for px()).

Definition at line 237 of file fizika.h.

◆ y()

double fizika::lorentz4::y ( ) const
inline
Returns
Y component (alias for py()).

Definition at line 239 of file fizika.h.

◆ z()

double fizika::lorentz4::z ( ) const
inline
Returns
Z component (alias for pz()).

Definition at line 241 of file fizika.h.


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