StRoot  1
HepMC::FourVector Class Reference

FourVector is a simple representation of a physics 4 vector. More...

`#include <SimpleVector.h>`

## Public Member Functions

FourVector (double xin, double yin, double zin, double tin=0)
constructor requiring at least x, y, and z

FourVector (double tin)
constructor requiring only t

template<class T >
FourVector (const T &v, typename detail::disable_if< detail::is_arithmetic< T >::value, void >::type *=0)

FourVector (const FourVector &v)
copy constructor

void swap (FourVector &other)
swap

double px () const
return px

double py () const
return py

double pz () const
return pz

double e () const
return E

double x () const
return x

double y () const
return y

double z () const
return z

double t () const
return t

double m2 () const
Invariant mass squared.

double m () const
Invariant mass. If m2() is negative then -sqrt(-m2()) is returned.

double perp2 () const
Transverse component of the spatial vector squared.

double perp () const
Transverse component of the spatial vector (R in cylindrical system).

double theta () const
The polar angle.

double phi () const
The azimuth angle.

double rho () const
spatial vector component magnitude

FourVectoroperator= (const FourVector &)
make a copy

bool operator== (const FourVector &) const
equality

bool operator!= (const FourVector &) const
inequality

double pseudoRapidity () const
Returns the pseudo-rapidity, i.e. -ln(tan(theta/2))

double eta () const
Pseudorapidity (of the space part)

void set (double x, double y, double z, double t)
set x, y, z, and t

void setX (double xin)
set x

void setY (double yin)
set y

void setZ (double zin)
set z

void setT (double tin)
set t

void setPx (double xin)
set px

void setPy (double yin)
set py

void setPz (double zin)
set pz

void setE (double tin)
set E

## Detailed Description

FourVector is a simple representation of a physics 4 vector.

For compatibility with existing code, the basic expected geometrical access methods are povided. Also, there is a templated constructor that will take another vector (HepLorentzVector, GenVector, ...) which must have the following methods: x(), y(), z(), t().

Definition at line 42 of file SimpleVector.h.

## Constructor & Destructor Documentation

template<class T >
 HepMC::FourVector::FourVector ( const T & v, typename detail::disable_if< detail::is_arithmetic< T >::value, void >::type * = `0` )
inline

templated constructor this is used ONLY if T is not arithmetic

Definition at line 60 of file SimpleVector.h.

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