#include <BasicVector3D.h>
Inheritance diagram for BasicVector3D:
Public Types | |
enum | { X = 0, Y = 1, Z = 2, NUM_COORDINATES = 3, SIZE = NUM_COORDINATES } |
Safe indexing of the coordinates when using with matrices, arrays, etc. More... | |
Public Member Functions | |
~BasicVector3D () | |
Destructor. | |
BasicVector3D (const BasicVector3D &v) | |
Copy constructor. | |
BasicVector3D (double x, double y, double z) | |
Constructor from three doubles. | |
operator Hep3Vector () const | |
Conversion (cast) to Hep3Vector. | |
BasicVector3D & | operator= (const BasicVector3D &v) |
Assignment. | |
BasicVector3D & | operator+= (const BasicVector3D &v) |
Adds another 3-vector. | |
BasicVector3D & | operator-= (const BasicVector3D &v) |
Subtracts another 3-vector. | |
BasicVector3D & | operator *= (double a) |
Multiplies by number. | |
BasicVector3D & | operator/= (double a) |
Divides by number. | |
double | operator() (int i) const |
Gets component by index. | |
double | operator[] (int i) const |
Gets component by index. | |
double & | operator() (int i) |
Sets component by index. | |
double & | operator[] (int i) |
Sets component by index. | |
double | x () const |
Returns x-component in cartesian coordinate system. | |
double | y () const |
Returns y-component in cartesian coordinate system. | |
double | z () const |
Returns z-component in cartesian coordinate system. | |
void | setX (double a) |
Set x-component in cartesian coordinate system. | |
void | setY (double a) |
Set y-component in cartesian coordinate system. | |
void | setZ (double a) |
Set z-component in cartesian coordinate system. | |
void | set (double x, double y, double z) |
Sets components in cartesian coordinate system. | |
double | phi () const |
Returns phi-component in spherical (polar) coordinate system. | |
double | theta () const |
Returns theta-component in spherical (polar) coordinate system. | |
double | cosTheta () const |
Returns cosine of theta-component in spherical (polar) coordinate system. | |
double | mag2 () const |
Returns magnitude squared of the 3-vector. | |
double | mag () const |
Returns magnitude of the 3-vector. | |
double | r () const |
Returns r-component in spherical (polar) coordinate system. | |
double | getR () const |
Returns r-component in spherical (polar) coordinate system. | |
double | getTheta () const |
Returns theta-component in spherical (polar) coordinate system. | |
double | getPhi () const |
Returns phi-component in spherical (polar) coordinate system. | |
void | setPhi (double a) |
Sets phi-component in spherical (polar) coordinate system. | |
void | setTheta (double a) |
Sets theta-component in spherical (polar) coordinate system. | |
void | setMag (double a) |
Sets magnitude. | |
void | setR (double a) |
Sets r-component in spherical (polar) coordinate system. | |
double | perp2 () const |
Gets transverse component squared (rho in cylindrical coordinate system). | |
double | perp () const |
Gets transverse component (rho in cylindrical coordinate system). | |
double | eta () const |
Gets pseudo-rapidity. | |
double | getEta () const |
Gets pseudo-rapidity. | |
void | setPerp (double a) |
Sets transverse component keeping phi and z constant. | |
void | setEta (double a) |
Sets pseudo-rapidity, keeping magnitude and phi fixed. | |
double | perp2 (const BasicVector3D &v) const |
Returns transverse component w.r.t. given axis squared. | |
double | perp (const BasicVector3D &v) const |
Returns transverse component w.r.t. given axis. | |
BasicVector3D | unit () const |
Returns unit 3-vector. | |
BasicVector3D | orthogonal () const |
Returns orthogonal 3-vector. | |
double | dot (const BasicVector3D &v) const |
Returns scalar product with another 3-vector. | |
double | angle (const BasicVector3D &v) const |
Returns angle w.r.t. another 3-vector. | |
double | pseudoRapidity () const |
Returns pseudo-rapidity, i.e. -ln(tan(theta/2)). | |
BasicVector3D & | rotateX (double a) |
Rotates the 3-vector around x-axis. | |
BasicVector3D & | rotateY (double a) |
Rotates the 3-vector around y-axis. | |
BasicVector3D & | rotateZ (double a) |
Rotates the 3-vector around z-axis. | |
BasicVector3D & | rotate (double a, const BasicVector3D &v) |
Rotates around the axis specified by another 3-vector. | |
Related Functions | |
(Note that these are not member functions.) | |
std::::ostream & | operator<< (std::::ostream &os, const BasicVector3D &v) |
Output to the stream. | |
std::::istream & | operator>> (std::::istream &is, BasicVector3D &v) |
Input from the stream. | |
BasicVector3D | operator+ (const BasicVector3D &v) |
Unary plus. | |
BasicVector3D | operator+ (const BasicVector3D &a, const BasicVector3D &b) |
Addition of two 3-vectors. | |
BasicVector3D | operator- (const BasicVector3D &v) |
Unary minus. | |
BasicVector3D | operator- (const BasicVector3D &a, const BasicVector3D &b) |
Subtraction of two 3-vectors. | |
BasicVector3D | operator * (const BasicVector3D &v, double a) |
Multiplication 3-vector by scalar. | |
double | operator * (const BasicVector3D &a, const BasicVector3D &b) |
Scalar product of two 3-vectors. | |
BasicVector3D | operator * (double a, const BasicVector3D &v) |
Multiplication scalar by 3-vector. | |
BasicVector3D | operator/ (const BasicVector3D &v, double a) |
Division 3-vector by scalar. | |
bool | operator== (const BasicVector3D &a, const BasicVector3D &b) |
Comparison of two 3-vectors for equality. | |
bool | operator!= (const BasicVector3D &a, const BasicVector3D &b) |
Comparison of two 3-vectors for inequality. |
It only defines common functionality for those classes and should not be used as separate class. For this reason the default constructor is protected.
|
Safe indexing of the coordinates when using with matrices, arrays, etc.
|
|
Conversion (cast) to Hep3Vector. This operator is needed only for backward compatibility and in principle should not exit. |