| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

HepMC::FourVector Class Reference

For compatibility with existing code, the basic expected geometrical access methods are povided. More...

#include <SimpleVector.h>

List of all members.


Public Member Functions

 FourVector (double xin, double yin, double zin, double tin=0)
 constructor requiring at least x, y, and z
 FourVector (double t)
 constructor requiring only t
 FourVector ()
template<class T>
 FourVector (const T &v, typename detail::disable_if< detail::is_arithmetic< T >::value, void >::type *=0)
 templated constructor this is used ONLY if T is not arithmetic
 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 mag () const
 Magnitude of the spatial vector.
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 x)
 set x
void setY (double y)
 set y
void setZ (double z)
 set z
void setT (double t)
 set t
void setPx (double x)
 set px
void setPy (double y)
 set py
void setPz (double z)
 set pz
void setE (double t)
 set E

Private Attributes

double m_x
double m_y
double m_z
double m_t

Detailed Description

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

HepMC::FourVector::FourVector ( double  xin,
double  yin,
double  zin,
double  tin = 0 
) [inline]

constructor requiring at least x, y, and z

Definition at line 47 of file SimpleVector.h.

00048   : m_x(xin), m_y(yin), m_z(zin), m_t(tin) {}

HepMC::FourVector::FourVector ( double  t  )  [inline]

constructor requiring only t

Definition at line 51 of file SimpleVector.h.

00052   : m_x(0), m_y(0), m_z(0), m_t(t) {}

HepMC::FourVector::FourVector (  )  [inline]

Definition at line 54 of file SimpleVector.h.

00055   : m_x(0), m_y(0), m_z(0), m_t(0) {}

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.

00062   : m_x(v.x()), m_y(v.y()), m_z(v.z()), m_t(v.t()) {}

HepMC::FourVector::FourVector ( const FourVector v  )  [inline]

copy constructor

Definition at line 65 of file SimpleVector.h.

00066   : m_x(v.x()), m_y(v.y()), m_z(v.z()), m_t(v.t()) {}


Member Function Documentation

void HepMC::FourVector::swap ( FourVector other  )  [inline]

swap

Definition at line 20 of file SimpleVector.icc.

00020                                                  {
00021     std::swap( m_x, other.m_x );
00022     std::swap( m_y, other.m_y );
00023     std::swap( m_z, other.m_z );
00024     std::swap( m_t, other.m_t );
00025 }

double HepMC::FourVector::px (  )  const [inline]

return px

Definition at line 70 of file SimpleVector.h.

double HepMC::FourVector::py (  )  const [inline]

return py

Definition at line 71 of file SimpleVector.h.

double HepMC::FourVector::pz (  )  const [inline]

return pz

Definition at line 72 of file SimpleVector.h.

double HepMC::FourVector::e (  )  const [inline]

return E

Definition at line 73 of file SimpleVector.h.

double HepMC::FourVector::x (  )  const [inline]

return x

Definition at line 75 of file SimpleVector.h.

double HepMC::FourVector::y (  )  const [inline]

return y

Definition at line 76 of file SimpleVector.h.

double HepMC::FourVector::z (  )  const [inline]

return z

Definition at line 77 of file SimpleVector.h.

double HepMC::FourVector::t (  )  const [inline]

return t

Definition at line 78 of file SimpleVector.h.

double HepMC::FourVector::m2 (  )  const [inline]

Invariant mass squared.

Definition at line 42 of file SimpleVector.icc.

00042                                    {
00043   return m_t*m_t - (m_x*m_x + m_y*m_y + m_z*m_z);
00044 }

double HepMC::FourVector::m (  )  const [inline]

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

Definition at line 46 of file SimpleVector.icc.

00046                                   {
00047   double mm = m2();
00048   return mm < 0.0 ? -std::sqrt(-mm) : std::sqrt(mm);
00049 }

double HepMC::FourVector::perp2 (  )  const [inline]

Transverse component of the spatial vector squared.

Definition at line 55 of file SimpleVector.icc.

00055 { return m_x*m_x + m_y*m_y; }

double HepMC::FourVector::perp (  )  const [inline]

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

Definition at line 57 of file SimpleVector.icc.

00057 { return std::sqrt(perp2()); }

double HepMC::FourVector::mag (  )  const [inline]

Magnitude of the spatial vector.

Definition at line 51 of file SimpleVector.icc.

00051                                      { 
00052 return std::sqrt( m_x*m_x + m_y*m_y + m_z*m_z );
00053 }

double HepMC::FourVector::theta (  )  const [inline]

The polar angle.

Definition at line 59 of file SimpleVector.icc.

00059                                          {
00060   return m_x == 0.0 && m_y == 0.0 && m_z == 0.0 ? 0.0 : std::atan2(perp(),m_z);
00061 }

double HepMC::FourVector::phi (  )  const [inline]

The azimuth angle.

Definition at line 63 of file SimpleVector.icc.

00063                                     {
00064   return m_x == 0.0 && m_y == 0.0 ? 0.0 : std::atan2(m_y,m_x);
00065 }

double HepMC::FourVector::rho (  )  const [inline]

spatial vector component magnitude

Definition at line 67 of file SimpleVector.icc.

00067                                      { 
00068 return std::sqrt( m_x*m_x + m_y*m_y + m_z*m_z );
00069 }

FourVector & HepMC::FourVector::operator= ( const FourVector  )  [inline]

make a copy

Definition at line 27 of file SimpleVector.icc.

00027                                                               {
00028   m_x = v.x();
00029   m_y = v.y();
00030   m_z = v.z();
00031   m_t = v.t();
00032   return *this;
00033 }

bool HepMC::FourVector::operator== ( const FourVector  )  const [inline]

equality

Definition at line 71 of file SimpleVector.icc.

00071                                                                {
00072   return (v.x()==x() && v.y()==y() && v.z()==z() && v.t()==t()) ? true : false;
00073 }

bool HepMC::FourVector::operator!= ( const FourVector  )  const [inline]

inequality

Definition at line 75 of file SimpleVector.icc.

00075                                                                {
00076   return (v.x()!=x() || v.y()!=y() || v.z()!=z() || v.t()!=t()) ? true : false;
00077 }

double HepMC::FourVector::pseudoRapidity (  )  const [inline]

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

Definition at line 79 of file SimpleVector.icc.

00079                                                {
00080   double m = mag();
00081   if ( m==  0   ) return  0.0;   
00082   if ( m==  z() ) return  1.0E72;
00083   if ( m== -z() ) return -1.0E72;
00084   return 0.5*log( (m+z())/(m-z()) );
00085 }

double HepMC::FourVector::eta (  )  const [inline]

Pseudorapidity (of the space part).

Definition at line 87 of file SimpleVector.icc.

00087 { return pseudoRapidity();}

void HepMC::FourVector::set ( double  x,
double  y,
double  z,
double  t 
) [inline]

set x, y, z, and t

Definition at line 35 of file SimpleVector.icc.

00035                                                                    {
00036   m_x = x;
00037   m_y = y;
00038   m_z = z;
00039   m_t = t;
00040 }

void HepMC::FourVector::setX ( double  x  )  [inline]

set x

Definition at line 103 of file SimpleVector.h.

void HepMC::FourVector::setY ( double  y  )  [inline]

set y

Definition at line 104 of file SimpleVector.h.

void HepMC::FourVector::setZ ( double  z  )  [inline]

set z

Definition at line 105 of file SimpleVector.h.

void HepMC::FourVector::setT ( double  t  )  [inline]

set t

Definition at line 106 of file SimpleVector.h.

void HepMC::FourVector::setPx ( double  x  )  [inline]

set px

Definition at line 108 of file SimpleVector.h.

void HepMC::FourVector::setPy ( double  y  )  [inline]

set py

Definition at line 109 of file SimpleVector.h.

void HepMC::FourVector::setPz ( double  z  )  [inline]

set pz

Definition at line 110 of file SimpleVector.h.

void HepMC::FourVector::setE ( double  t  )  [inline]

set E

Definition at line 111 of file SimpleVector.h.


Member Data Documentation

double HepMC::FourVector::m_x [private]

Definition at line 115 of file SimpleVector.h.

double HepMC::FourVector::m_y [private]

Definition at line 116 of file SimpleVector.h.

double HepMC::FourVector::m_z [private]

Definition at line 117 of file SimpleVector.h.

double HepMC::FourVector::m_t [private]

Definition at line 118 of file SimpleVector.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:56:45 2011 for HepMC by doxygen 1.4.7