ThePEG::ThreeVector< Value > Class Template Reference

A 3-component vector. More...

#include <ThreeVector.h>

List of all members.

Public Member Functions

Value2 mag2 () const
 Squared magnitude $x^2+y^2+z^2$.
Value mag () const
 Magnitude $\sqrt{x^2+y^2+z^2}$.
Value2 perp2 () const
 Squared transverse component $x^2+y^2$.
Value perp () const
 Transverse component $\sqrt{x^2+y^2}$.
template<typename U>
BinaryOpTraits< Value, U >::MulT dot (const ThreeVector< U > &a) const
 Dot product.
template<typename U>
Value2 perp2 (const ThreeVector< U > &p) const
 Squared transverse component with respect to the given axis.
template<typename U>
Value perp (const ThreeVector< U > &p) const
 Transverse component with respect to the given axis.
ThreeVector< double > unit () const
 Parallel vector with unit length.
ThreeVector< Value > orthogonal () const
 Orthogonal vector.
template<typename U>
double deltaPhi (const ThreeVector< U > &v2) const
 Azimuthal angle difference, brought into the range $(-\pi,\pi]$.
ThreeVector< Value > & rotate (double angle, const ThreeVector< double > &axis)
 Apply a rotation.
ThreeVector< Value > & rotateUz (const Axis &axis)
 Rotate the reference frame to a new z-axis.
template<typename U>
ThreeVector< typename
BinaryOpTraits< Value, U >
::MulT > 
cross (const ThreeVector< U > &a) const
 Vector cross-product.
template<typename U>
double cosTheta (const ThreeVector< U > &q) const
 Cosine of the azimuthal angle between two vectors.
template<typename U>
double angle (const ThreeVector< U > &v) const
 Angle between two vectors.
Constructors.
 ThreeVector ()
 ThreeVector (Value x, Value y, Value z)
template<typename ValueB>
 ThreeVector (const ThreeVector< ValueB > &v)
Component access methods.
Value x () const
Value y () const
Value z () const
Component set methods.
void setX (Value x)
void setY (Value y)
void setZ (Value z)
Spherical coordinates.
double theta () const
 Polar angle.
double phi () const
 Azimuthal angle.
void setTheta (double th)
 Set the polar angle.
void setPhi (double ph)
 Set the azimuthal angle.
Mathematical assignment operators.
ThreeVector< Value > & operator+= (const ThreeVector< Value > &a)
ThreeVector< Value > & operator-= (const ThreeVector< Value > &a)
ThreeVector< Value > & operator*= (double a)
ThreeVector< Value > & operator/= (double a)

Private Types

typedef BinaryOpTraits< Value,
Value >::MulT 
Value2
 Value squared.
typedef BinaryOpTraits< Value2,
Value2 >::MulT 
Value4
 Value to the 4th power.

Private Attributes

Vector components
Value theX
Value theY
Value theZ


Detailed Description

template<typename Value>
class ThePEG::ThreeVector< Value >

A 3-component vector.

It can be created with any unit type as template parameter. All basic mathematical operations are supported, as well as a subset of the CLHEP Vector3 functionality.

Definition at line 33 of file ThreeVector.h.


Member Function Documentation

template<typename Value>
ThreeVector<Value>& ThePEG::ThreeVector< Value >::rotate ( double  angle,
const ThreeVector< double > &  axis 
) [inline]

Apply a rotation.

Parameters:
angle Rotation angle in radians.
axis Rotation axis.

Definition at line 182 of file ThreeVector.h.

References ThePEG::ThreeVector< Value >::mag(), ThePEG::ThreeVector< Value >::x(), ThePEG::ThreeVector< Value >::y(), and ThePEG::ThreeVector< Value >::z().


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

Generated on Thu Apr 29 12:43:26 2010 for ThePEG by  doxygen 1.5.5