/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Private Attributes
HepMC::FourVector Class Reference

FourVector is a simple representation of a physics 4 vector. 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.
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.
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

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

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.

  : 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.

  : m_x(0), m_y(0), m_z(0), m_t(t) {}
HepMC::FourVector::FourVector ( ) [inline]

Definition at line 54 of file SimpleVector.h.

  : 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.

  : 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.

  : 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.

                                                 {
    std::swap( m_x, other.m_x );
    std::swap( m_y, other.m_y );
    std::swap( m_z, other.m_z );
    std::swap( m_t, other.m_t );
}
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.

                                   {
  return m_t*m_t - (m_x*m_x + m_y*m_y + m_z*m_z);
}
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.

                                  {
  double mm = m2();
  return mm < 0.0 ? -std::sqrt(-mm) : std::sqrt(mm);
}
double HepMC::FourVector::perp2 ( ) const [inline]

Transverse component of the spatial vector squared.

Definition at line 55 of file SimpleVector.icc.

{ 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.

{ return std::sqrt(perp2()); }
double HepMC::FourVector::mag ( ) const [inline]

Magnitude of the spatial vector.

Definition at line 51 of file SimpleVector.icc.

                                     { 
return std::sqrt( m_x*m_x + m_y*m_y + m_z*m_z );
}
double HepMC::FourVector::theta ( ) const [inline]

The polar angle.

Definition at line 59 of file SimpleVector.icc.

                                         {
  return m_x == 0.0 && m_y == 0.0 && m_z == 0.0 ? 0.0 : std::atan2(perp(),m_z);
}
double HepMC::FourVector::phi ( ) const [inline]

The azimuth angle.

Definition at line 63 of file SimpleVector.icc.

                                    {
  return m_x == 0.0 && m_y == 0.0 ? 0.0 : std::atan2(m_y,m_x);
}
double HepMC::FourVector::rho ( ) const [inline]

spatial vector component magnitude

Definition at line 67 of file SimpleVector.icc.

                                     { 
return std::sqrt( m_x*m_x + m_y*m_y + m_z*m_z );
}
FourVector & HepMC::FourVector::operator= ( const FourVector v) [inline]

make a copy

Definition at line 27 of file SimpleVector.icc.

                                                              {
  m_x = v.x();
  m_y = v.y();
  m_z = v.z();
  m_t = v.t();
  return *this;
}
bool HepMC::FourVector::operator== ( const FourVector v) const [inline]

equality

Definition at line 71 of file SimpleVector.icc.

                                                               {
  return (v.x()==x() && v.y()==y() && v.z()==z() && v.t()==t()) ? true : false;
}
bool HepMC::FourVector::operator!= ( const FourVector v) const [inline]

inequality

Definition at line 75 of file SimpleVector.icc.

                                                               {
  return (v.x()!=x() || v.y()!=y() || v.z()!=z() || v.t()!=t()) ? true : false;
}
double HepMC::FourVector::pseudoRapidity ( ) const [inline]

Returns the pseudo-rapidity, i.e.

-ln(tan(theta/2))

Definition at line 79 of file SimpleVector.icc.

                                               {
  double m = mag();
  if ( m==  0   ) return  0.0;   
  if ( m==  z() ) return  1.0E72;
  if ( m== -z() ) return -1.0E72;
  return 0.5*log( (m+z())/(m-z()) );
}
double HepMC::FourVector::eta ( ) const [inline]

Pseudorapidity (of the space part)

Definition at line 87 of file SimpleVector.icc.

{ 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.

                                                                   {
  m_x = x;
  m_y = y;
  m_z = z;
  m_t = t;
}
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 Fri May 16 2014 09:49:37 for HepMC by doxygen 1.7.4