ThePEG 2.3.0
|
A 3-component vector. More...
#include <ThreeVector.h>
Public Member Functions | |
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) |
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 > | |
auto | dot (const ThreeVector< U > &a) const -> decltype(this->x() *a.x()) |
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. | |
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. | |
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]\). | |
template<typename U > | |
ThreeVector< Value > & | rotate (double angle, const ThreeVector< U > &axis) |
Apply a rotation. | |
ThreeVector< Value > & | rotateUz (const Axis &axis) |
Rotate the reference frame to a new z-axis. | |
ThreeVector< Value > & | rotateUzBack (const Axis &axis) |
Rotate from a reference frame to the z-axis. | |
template<typename U > | |
auto | cross (const ThreeVector< U > &a) const -> ThreeVector< decltype(this->y() *a.z())> |
Vector cross-product. | |
Comparison operators. | |
bool | operator== (const ThreeVector< Value > &a) const |
bool | operator!= (const ThreeVector< Value > &a) const |
bool | almostEqual (const ThreeVector< Value > &a, double threshold=1e-04) const |
bool | almostUnequal (const ThreeVector< Value > &a, double threshold=1e-04) const |
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) |
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. | |
Private Types | |
using | Value2 = decltype(sqr(std::declval< Value >())) |
Value squared. | |
Private Attributes | |
Vector components | |
Value | theX |
Value | theY |
Value | theZ |
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 34 of file ThreeVector.h.
|
private |
Value squared.
Definition at line 38 of file ThreeVector.h.
|
inline |
Definition at line 43 of file ThreeVector.h.
|
inline |
Definition at line 46 of file ThreeVector.h.
|
inline |
Definition at line 50 of file ThreeVector.h.
|
inline |
Definition at line 268 of file ThreeVector.h.
|
inline |
Definition at line 271 of file ThreeVector.h.
|
inline |
Angle between two vectors.
Definition at line 321 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::cosTheta().
Referenced by ThePEG::ThreeVector< Value >::rotate().
|
inline |
Cosine of the azimuthal angle between two vectors.
Definition at line 310 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::dot(), ThePEG::ThreeVector< Value >::mag(), and ThePEG::ZERO.
Referenced by ThePEG::ThreeVector< Value >::angle().
|
inline |
Vector cross-product.
Definition at line 251 of file ThreeVector.h.
|
inline |
Azimuthal angle difference, brought into the range \((-\pi,\pi]\).
Definition at line 161 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::phi(), ThePEG::Constants::pi, and ThePEG::Constants::twopi.
|
inline |
Dot product.
Definition at line 84 of file ThreeVector.h.
Referenced by ThePEG::ThreeVector< Value >::cosTheta(), and ThePEG::ThreeVector< Value >::perp2().
|
inline |
Magnitude \(\sqrt{x^2+y^2+z^2}\).
Definition at line 74 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::mag2().
Referenced by ThePEG::ThreeVector< Value >::cosTheta(), ThePEG::LorentzVector< Value >::rotate(), ThePEG::ThreeVector< Value >::rotate(), and ThePEG::ThreeVector< Value >::setTheta().
|
inline |
Squared magnitude \(x^2+y^2+z^2\).
Definition at line 71 of file ThreeVector.h.
References ThePEG::sqr().
Referenced by ThePEG::UtilityBase::getTransformToMomentum(), ThePEG::ThreeVector< Value >::mag(), ThePEG::ThreeVector< Value >::perp2(), ThePEG::LorentzVector< Value >::rapidity(), ThePEG::UtilityBase::transformToMomentum(), and ThePEG::ThreeVector< Value >::unit().
|
inline |
Definition at line 265 of file ThreeVector.h.
|
inline |
Definition at line 293 of file ThreeVector.h.
|
inline |
Definition at line 279 of file ThreeVector.h.
|
inline |
Definition at line 286 of file ThreeVector.h.
|
inline |
Definition at line 300 of file ThreeVector.h.
|
inline |
Definition at line 262 of file ThreeVector.h.
|
inline |
|
inline |
Transverse component \(\sqrt{x^2+y^2}\).
Definition at line 80 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::perp2().
Referenced by ThePEG::ThreeVector< Value >::setPhi(), and ThePEG::ThreeVector< Value >::theta().
|
inline |
Transverse component with respect to the given axis.
Definition at line 104 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::perp2().
|
inline |
Squared transverse component \(x^2+y^2\).
Definition at line 77 of file ThreeVector.h.
References ThePEG::sqr().
Referenced by ThePEG::ThreeVector< Value >::perp().
|
inline |
Squared transverse component with respect to the given axis.
Definition at line 92 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::dot(), ThePEG::ThreeVector< Value >::mag2(), ThePEG::sqr(), and ThePEG::ZERO.
|
inline |
Azimuthal angle.
Definition at line 117 of file ThreeVector.h.
Referenced by ThePEG::ThreeVector< Value >::deltaPhi(), and ThePEG::ThreeVector< Value >::setTheta().
|
inline |
Apply a rotation.
angle | Rotation angle in radians. |
axis | Rotation axis. |
Definition at line 177 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::angle(), ThePEG::ThreeVector< Value >::mag(), and ThePEG::ZERO.
|
inline |
Rotate the reference frame to a new z-axis.
Definition at line 206 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::unit().
|
inline |
Rotate from a reference frame to the z-axis.
Definition at line 229 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::unit().
|
inline |
Set the azimuthal angle.
Definition at line 131 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::perp().
|
inline |
Set the polar angle.
Definition at line 122 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::mag(), and ThePEG::ThreeVector< Value >::phi().
|
inline |
Definition at line 64 of file ThreeVector.h.
|
inline |
Definition at line 65 of file ThreeVector.h.
|
inline |
Definition at line 66 of file ThreeVector.h.
|
inline |
Polar angle.
Definition at line 111 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::perp(), and ThePEG::ZERO.
|
inline |
Parallel vector with unit length.
Definition at line 139 of file ThreeVector.h.
References ThePEG::ThreeVector< Value >::mag2(), and ThePEG::ZERO.
Referenced by ThePEG::LorentzVector< Value >::rotateUz(), ThePEG::ThreeVector< Value >::rotateUz(), and ThePEG::ThreeVector< Value >::rotateUzBack().
|
inline |
Definition at line 57 of file ThreeVector.h.
|
inline |
Definition at line 58 of file ThreeVector.h.
|
inline |
Definition at line 59 of file ThreeVector.h.
|
private |
Definition at line 328 of file ThreeVector.h.
|
private |
Definition at line 329 of file ThreeVector.h.
|
private |
Definition at line 330 of file ThreeVector.h.