DD4hep  1.28.0
Detector Description Toolkit for High Energy Physics
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
dd4hep::rec::Vector3D Class Reference

#include <Vector3D.h>

Classes

struct  Cartesian
 
struct  Cylindrical
 
struct  Spherical
 

Public Member Functions

 Vector3D ()
 
 Vector3D (const Vector3D &v)
 
 Vector3D (const float *v)
 
 Vector3D (const double *v)
 
template<class T >
 Vector3D (double x, double y, double z, T(&)())
 
 Vector3D (double x_val, double y_val, double z_val)
 
Vector3Doperator= (const Vector3D &v)
 
template<class T >
const Vector3Dfill (const T &v)
 fill vector from arbitrary class that defines operator[] More...
 
const Vector3Dfill (const double *v)
 fill vector from double array More...
 
const Vector3Dfill (double x_val, double y_val, double z_val)
 fill from double values More...
 
double x () const
 
double y () const
 
double z () const
 
double & x ()
 
double & y ()
 
double & z ()
 
double operator[] (int i) const
 
double & operator[] (int i)
 
double phi () const
 
double rho () const
 
double trans () const
 
double trans2 () const
 
double r () const
 
double r2 () const
 
double theta () const
 
double dot (const Vector3D &v) const
 
Vector3D cross (const Vector3D &v) const
 
Vector3D unit () const
 
 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)
 
template<class T >
to () const
 

Static Public Member Functions

static Cartesian cartesian ()
 
static Cylindrical cylindrical ()
 
static Spherical spherical ()
 

Protected Attributes

double _x
 
double _y
 
double _z
 

Detailed Description

Simple three dimensional vector providing the components for cartesian, cylindrical and spherical coordinate systems - internal reperesentation is cartesian. (copy of original version from gear).

Author
F. Gaede, DESY
Version
$Id$
Date
Apr 6 2014

Definition at line 32 of file Vector3D.h.

Constructor & Destructor Documentation

◆ Vector3D() [1/6]

dd4hep::rec::Vector3D::Vector3D ( )
inline

Default c'tor - zero vector

Definition at line 37 of file Vector3D.h.

◆ Vector3D() [2/6]

dd4hep::rec::Vector3D::Vector3D ( const Vector3D v)
inline

Copy constructor

Definition at line 41 of file Vector3D.h.

◆ Vector3D() [3/6]

dd4hep::rec::Vector3D::Vector3D ( const float *  v)
inline

Constructor for float array.

Definition at line 44 of file Vector3D.h.

◆ Vector3D() [4/6]

dd4hep::rec::Vector3D::Vector3D ( const double *  v)
inline

Constructor for double array.

Definition at line 47 of file Vector3D.h.

◆ Vector3D() [5/6]

template<class T >
dd4hep::rec::Vector3D::Vector3D ( double  x,
double  y,
double  z,
T(&)()   
)

Templated c'tor - allows to have overloaded c'tors for different coordinates

◆ Vector3D() [6/6]

dd4hep::rec::Vector3D::Vector3D ( double  x_val,
double  y_val,
double  z_val 
)
inline

Default corrdinate system for initialization is cartesian

Definition at line 56 of file Vector3D.h.

Member Function Documentation

◆ array()

double* dd4hep::rec::Vector3D::array ( )
inline

direct access to data as double* - allows modification

Definition at line 216 of file Vector3D.h.

◆ cartesian()

static Cartesian dd4hep::rec::Vector3D::cartesian ( )
inlinestatic

Definition at line 277 of file Vector3D.h.

◆ const_array()

const double* dd4hep::rec::Vector3D::const_array ( ) const
inline

direct access to data as const double*

Definition at line 211 of file Vector3D.h.

◆ cross()

Vector3D dd4hep::rec::Vector3D::cross ( const Vector3D v) const
inline

Vector product

Definition at line 191 of file Vector3D.h.

◆ cylindrical()

static Cylindrical dd4hep::rec::Vector3D::cylindrical ( )
inlinestatic

Definition at line 278 of file Vector3D.h.

◆ dot()

double dd4hep::rec::Vector3D::dot ( const Vector3D v) const
inline

Scalar product

Definition at line 185 of file Vector3D.h.

◆ fill() [1/3]

const Vector3D& dd4hep::rec::Vector3D::fill ( const double *  v)
inline

fill vector from double array

Definition at line 89 of file Vector3D.h.

◆ fill() [2/3]

template<class T >
const Vector3D& dd4hep::rec::Vector3D::fill ( const T &  v)
inline

fill vector from arbitrary class that defines operator[]

Definition at line 82 of file Vector3D.h.

◆ fill() [3/3]

const Vector3D& dd4hep::rec::Vector3D::fill ( double  x_val,
double  y_val,
double  z_val 
)
inline

fill from double values

Definition at line 96 of file Vector3D.h.

◆ isEqual()

bool dd4hep::rec::Vector3D::isEqual ( const Vector3D b,
double  epsilon = 1e-6 
)
inline

Component wise comparison of two vectors - true if all components differ less than epsilon

Definition at line 222 of file Vector3D.h.

◆ operator const double *()

dd4hep::rec::Vector3D::operator const double * ( ) const
inline

direct access to data as const double*

Definition at line 207 of file Vector3D.h.

◆ operator=()

Vector3D& dd4hep::rec::Vector3D::operator= ( const Vector3D v)
inline

Definition at line 73 of file Vector3D.h.

◆ operator[]() [1/2]

double& dd4hep::rec::Vector3D::operator[] ( int  i)
inline

Accessing x,y,z with bracket operator for assignment

Definition at line 131 of file Vector3D.h.

◆ operator[]() [2/2]

double dd4hep::rec::Vector3D::operator[] ( int  i) const
inline

Accessing x,y,z with bracket operator

Definition at line 122 of file Vector3D.h.

◆ phi()

double dd4hep::rec::Vector3D::phi ( ) const
inline

Azimuthal angle - cylindrical and spherical

Definition at line 142 of file Vector3D.h.

◆ r()

double dd4hep::rec::Vector3D::r ( ) const
inline

Spherical r/magnitude

Definition at line 166 of file Vector3D.h.

◆ r2()

double dd4hep::rec::Vector3D::r2 ( ) const
inline

Spherical r/magnitude, squared

Definition at line 173 of file Vector3D.h.

◆ rho()

double dd4hep::rec::Vector3D::rho ( ) const
inline

Transversal component - cylindrical 'r'

Definition at line 148 of file Vector3D.h.

◆ spherical()

static Spherical dd4hep::rec::Vector3D::spherical ( )
inlinestatic

Definition at line 279 of file Vector3D.h.

◆ theta()

double dd4hep::rec::Vector3D::theta ( ) const
inline

Polar angle - spherical

Definition at line 179 of file Vector3D.h.

◆ to()

template<class T >
T dd4hep::rec::Vector3D::to ( ) const
inline

Explicit, unchecked conversion to anything that has a c'tor T(x,y,z). Example: CLHEP::Vector3D clhv = v.to< CLHEP::Vector3D>() ;

See also
operator T()

Definition at line 261 of file Vector3D.h.

◆ trans()

double dd4hep::rec::Vector3D::trans ( ) const
inline

Transversal component

Definition at line 154 of file Vector3D.h.

◆ trans2()

double dd4hep::rec::Vector3D::trans2 ( ) const
inline

Transversal component squared

Definition at line 160 of file Vector3D.h.

◆ unit()

Vector3D dd4hep::rec::Vector3D::unit ( ) const
inline

Parallel unit vector

Definition at line 199 of file Vector3D.h.

◆ x() [1/2]

double& dd4hep::rec::Vector3D::x ( )
inline

Assign to cartesian x coordinate

Definition at line 112 of file Vector3D.h.

◆ x() [2/2]

double dd4hep::rec::Vector3D::x ( ) const
inline

Cartesian x coordinate

Definition at line 103 of file Vector3D.h.

◆ y() [1/2]

double& dd4hep::rec::Vector3D::y ( )
inline

Assign to cartesian y coordinate

Definition at line 115 of file Vector3D.h.

◆ y() [2/2]

double dd4hep::rec::Vector3D::y ( ) const
inline

Cartesian y coordinate

Definition at line 106 of file Vector3D.h.

◆ z() [1/2]

double& dd4hep::rec::Vector3D::z ( )
inline

Assign to cartesian z coordinate

Definition at line 118 of file Vector3D.h.

◆ z() [2/2]

double dd4hep::rec::Vector3D::z ( ) const
inline

Cartesian cartesian z coordinate

Definition at line 109 of file Vector3D.h.

Member Data Documentation

◆ _x

double dd4hep::rec::Vector3D::_x
protected

Definition at line 266 of file Vector3D.h.

◆ _y

double dd4hep::rec::Vector3D::_y
protected

Definition at line 266 of file Vector3D.h.

◆ _z

double dd4hep::rec::Vector3D::_z
protected

Definition at line 266 of file Vector3D.h.


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