DD4hep
01.18
|
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coordinate systems - internal reperesentation is cartesian. More...
#include <Vector3D.h>
Classes | |
struct | Cartesian |
struct | Cylindrical |
struct | Spherical |
Public Member Functions | |
Vector3D () | |
Default c'tor - zero vector. More... | |
Vector3D (const Vector3D &v) | |
Copy constructor. More... | |
Vector3D (const float *v) | |
Constructor for float array. More... | |
Vector3D (const double *v) | |
Constructor for double array. More... | |
template<class T > | |
Vector3D (double x, double y, double z, T(&)()) | |
Templated c'tor - allows to have overloaded c'tors for different coordinates. More... | |
Vector3D (double x_val, double y_val, double z_val) | |
Default corrdinate system for initialization is cartesian. More... | |
Vector3D & | operator= (const Vector3D &v) |
Copy c'tor for three vectors from other packages - requires T::x(),T::y(), T::z(). More... | |
template<class T > | |
const Vector3D & | fill (const T &v) |
fill vector from arbitrary class that defines operator[] More... | |
const Vector3D & | fill (const double *v) |
fill vector from double array More... | |
const Vector3D & | fill (double x_val, double y_val, double z_val) |
fill from double values More... | |
double | x () const |
Cartesian x coordinate. More... | |
double | y () const |
Cartesian y coordinate. More... | |
double | z () const |
Cartesian cartesian z coordinate. More... | |
double & | x () |
Assign to cartesian x coordinate. More... | |
double & | y () |
Assign to cartesian y coordinate. More... | |
double & | z () |
Assign to cartesian z coordinate. More... | |
double | operator[] (int i) const |
Accessing x,y,z with bracket operator. More... | |
double & | operator[] (int i) |
Accessing x,y,z with bracket operator for assignment. More... | |
double | phi () const |
Azimuthal angle - cylindrical and spherical. More... | |
double | rho () const |
Transversal component - cylindrical 'r'. More... | |
double | trans () const |
Transversal component. More... | |
double | trans2 () const |
Transversal component squared. More... | |
double | r () const |
Spherical r/magnitude. More... | |
double | r2 () const |
Spherical r/magnitude, squared. More... | |
double | theta () const |
Polar angle - spherical. More... | |
double | dot (const Vector3D &v) const |
Scalar product. More... | |
Vector3D | cross (const Vector3D &v) const |
Vector product. More... | |
Vector3D | unit () const |
Parallel unit vector. More... | |
operator const double * () const | |
direct access to data as const double* More... | |
const double * | const_array () const |
direct access to data as const double* More... | |
double * | array () |
direct access to data as double* - allows modification More... | |
bool | isEqual (const Vector3D &b, double epsilon=1e-6) |
Component wise comparison of two vectors - true if all components differ less than epsilon. More... | |
template<class T > | |
T | to () const |
Implicit templated conversion to anything that has a c'tor T(x,y,z) and accessor functions x(),y(),z(). More... | |
template<> | |
Vector3D (double x_val, double y_val, double z_val, Vector3D::Cartesian(&)()) | |
Cartesian c'tor - example: Vector3D v( x, y, c , Vector3D::cartesian ) ;. More... | |
Static Public Member Functions | |
static Cartesian | cartesian () |
static Cylindrical | cylindrical () |
static Spherical | spherical () |
Protected Attributes | |
double | _x |
double | _y |
double | _z |
Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coordinate systems - internal reperesentation is cartesian.
(copy of original version from gear).
Definition at line 32 of file Vector3D.h.
|
inline |
Default c'tor - zero vector.
Definition at line 37 of file Vector3D.h.
|
inline |
Copy constructor.
Definition at line 41 of file Vector3D.h.
|
inline |
Constructor for float array.
Definition at line 44 of file Vector3D.h.
|
inline |
Constructor for double array.
Definition at line 47 of file Vector3D.h.
dd4hep::rec::Vector3D::Vector3D | ( | double | x, |
double | y, | ||
double | z, | ||
T(&)() | |||
) |
Templated c'tor - allows to have overloaded c'tors for different coordinates.
|
inline |
Default corrdinate system for initialization is cartesian.
Definition at line 56 of file Vector3D.h.
|
inline |
Cartesian c'tor - example:
Vector3D v( x, y, c , Vector3D::cartesian ) ;.
Spherical c'tor - example:
Vector3D v( r, phi, theta , Vector3D::spherical ) ;.
Cylindrical c'tor - example:
Vector3D v( rho, phi, z , Vector3D::cylindrical ) ;.
Definition at line 326 of file Vector3D.h.
|
inline |
direct access to data as double* - allows modification
Definition at line 216 of file Vector3D.h.
References _x.
Referenced by dd4hep::rec::Surface::getLines(), dd4hep::rec::CylinderSurface::globalToLocal(), dd4hep::rec::VolSurfaceBase::length_along_u(), dd4hep::rec::VolSurfaceBase::length_along_v(), dd4hep::rec::CylinderSurface::localToGlobal(), dd4hep::rec::CylinderSurface::normal(), dd4hep::rec::CylinderSurface::u(), dd4hep::rec::CylinderSurface::v(), and dd4hep::rec::VolConeImpl::VolConeImpl().
|
inlinestatic |
Definition at line 277 of file Vector3D.h.
|
inline |
direct access to data as const double*
Definition at line 211 of file Vector3D.h.
References _x.
Referenced by dd4hep::rec::Surface::getLines(), dd4hep::rec::VolSurfaceBase::insideBounds(), dd4hep::rec::VolSurfaceBase::length_along_u(), dd4hep::rec::VolSurfaceBase::length_along_v(), and dd4hep::rec::VolConeImpl::VolConeImpl().
Vector product.
Definition at line 191 of file Vector3D.h.
References _x, _y, _z, Vector3D(), x(), y(), and z().
Referenced by dd4hep::rec::VolCylinderImpl::u(), dd4hep::rec::VolConeImpl::u(), dd4hep::rec::VolConeImpl::VolConeImpl(), and dd4hep::rec::VolCylinderImpl::VolCylinderImpl().
|
inlinestatic |
Definition at line 278 of file Vector3D.h.
Referenced by dd4hep::rec::createGearForILD(), dd4hep::rec::VolCylinderImpl::localToGlobal(), dd4hep::rec::VolConeImpl::localToGlobal(), dd4hep::rec::VolCylinderImpl::normal(), and dd4hep::rec::VolCylinderImpl::u().
|
inline |
Scalar product.
Definition at line 185 of file Vector3D.h.
References _x, _y, _z, x(), y(), and z().
Referenced by dd4hep::rec::operator*().
|
inline |
fill vector from arbitrary class that defines operator[]
Definition at line 82 of file Vector3D.h.
Referenced by dd4hep::rec::Surface::getLines(), and dd4hep::rec::Surface::initialize().
|
inline |
|
inline |
|
inline |
Component wise comparison of two vectors - true if all components differ less than epsilon.
Definition at line 222 of file Vector3D.h.
|
inline |
Copy c'tor for three vectors from other packages - requires T::x(),T::y(), T::z().
Definition at line 73 of file Vector3D.h.
|
inline |
Accessing x,y,z with bracket operator.
Definition at line 122 of file Vector3D.h.
|
inline |
Accessing x,y,z with bracket operator for assignment.
Definition at line 131 of file Vector3D.h.
|
inline |
Azimuthal angle - cylindrical and spherical.
Definition at line 142 of file Vector3D.h.
Referenced by dd4hep::rec::VolCylinderImpl::globalToLocal(), dd4hep::rec::VolConeImpl::globalToLocal(), dd4hep::rec::VolCylinderImpl::localToGlobal(), dd4hep::rec::VolConeImpl::localToGlobal(), dd4hep::rec::VolCylinderImpl::normal(), dd4hep::rec::VolConeImpl::normal(), dd4hep::rec::operator<<(), dd4hep::rec::VolCylinderImpl::u(), dd4hep::rec::VolConeImpl::v(), and dd4hep::rec::VolConeImpl::VolConeImpl().
|
inline |
Spherical r/magnitude.
Definition at line 166 of file Vector3D.h.
Referenced by dd4hep::rec::operator<<(), and unit().
|
inline |
|
inline |
Transversal component - cylindrical 'r'.
Definition at line 148 of file Vector3D.h.
References trans().
Referenced by dd4hep::rec::VolCylinderImpl::distance(), dd4hep::rec::VolConeImpl::distance(), dd4hep::rec::VolConeImpl::getLines(), dd4hep::rec::Surface::getLines(), dd4hep::rec::VolCylinderImpl::localToGlobal(), dd4hep::rec::operator<<(), dd4hep::rec::CylinderSurface::radius(), dd4hep::rec::ConeSurface::radius0(), dd4hep::rec::ConeSurface::radius1(), theta(), and dd4hep::rec::VolConeImpl::VolConeImpl().
|
inlinestatic |
Definition at line 279 of file Vector3D.h.
Referenced by dd4hep::rec::VolConeImpl::normal(), dd4hep::rec::VolConeImpl::v(), and dd4hep::rec::VolConeImpl::VolConeImpl().
|
inline |
Polar angle - spherical.
Definition at line 179 of file Vector3D.h.
References _x, _y, _z, and rho().
Referenced by dd4hep::rec::VolConeImpl::distance(), dd4hep::rec::VolConeImpl::getLines(), dd4hep::rec::VolConeImpl::globalToLocal(), dd4hep::rec::VolConeImpl::localToGlobal(), dd4hep::rec::VolConeImpl::normal(), dd4hep::rec::operator<<(), dd4hep::rec::ConeSurface::radius0(), dd4hep::rec::ConeSurface::radius1(), dd4hep::rec::VolConeImpl::v(), dd4hep::rec::VolConeImpl::VolConeImpl(), dd4hep::rec::ConeSurface::z0(), and dd4hep::rec::ConeSurface::z1().
|
inline |
Implicit templated conversion to anything that has a c'tor T(x,y,z) and accessor functions x(),y(),z().
For safety the result is checked which causes a small performance penalty.
Definition at line 261 of file Vector3D.h.
|
inline |
|
inline |
|
inline |
Parallel unit vector.
Definition at line 199 of file Vector3D.h.
References _x, _y, _z, r(), and Vector3D().
Referenced by dd4hep::rec::VolCylinderImpl::VolCylinderImpl().
|
inline |
Cartesian x coordinate.
Definition at line 103 of file Vector3D.h.
References _x.
Referenced by cross(), dot(), dd4hep::rec::Surface::getLines(), isEqual(), dd4hep::rec::operator*(), dd4hep::rec::operator+(), dd4hep::rec::operator-(), dd4hep::rec::operator==(), dd4hep::rec::VolConeImpl::VolConeImpl(), and dd4hep::rec::VolCylinderImpl::VolCylinderImpl().
|
inline |
|
inline |
Cartesian y coordinate.
Definition at line 106 of file Vector3D.h.
References _y.
Referenced by cross(), dot(), dd4hep::rec::Surface::getLines(), isEqual(), dd4hep::rec::operator*(), dd4hep::rec::operator+(), dd4hep::rec::operator-(), dd4hep::rec::operator==(), dd4hep::rec::VolConeImpl::VolConeImpl(), and dd4hep::rec::VolCylinderImpl::VolCylinderImpl().
|
inline |
|
inline |
Cartesian cartesian z coordinate.
Definition at line 109 of file Vector3D.h.
References _z.
Referenced by cross(), dd4hep::rec::VolConeImpl::distance(), dot(), dd4hep::rec::Surface::getLines(), dd4hep::rec::VolCylinderImpl::globalToLocal(), dd4hep::rec::VolConeImpl::globalToLocal(), isEqual(), dd4hep::rec::VolCylinderImpl::localToGlobal(), dd4hep::rec::VolConeImpl::localToGlobal(), dd4hep::rec::operator*(), dd4hep::rec::operator+(), dd4hep::rec::operator-(), dd4hep::rec::operator==(), dd4hep::rec::VolConeImpl::VolConeImpl(), dd4hep::rec::ConeSurface::z0(), and dd4hep::rec::ConeSurface::z1().
|
inline |
|
protected |
Definition at line 266 of file Vector3D.h.
Referenced by array(), const_array(), cross(), dot(), fill(), operator const double *(), operator=(), operator[](), phi(), r(), r2(), theta(), to(), trans(), trans2(), unit(), and x().
|
protected |
|
protected |
Definition at line 266 of file Vector3D.h.
Referenced by cross(), dot(), fill(), operator=(), operator[](), r(), r2(), theta(), to(), unit(), and z().