Class describing a generic displacement vector in 3 dimensions.
Class template describing a 3D displacement vector.
This class is templated on the type of Coordinate system. One example is the XYZVector which is a vector based on double precision x,y,z data members by using the ROOT::Math::Cartesian3D<double> Coordinate system. The class is having also an extra template parameter, the coordinate system tag, to be able to identify (tag) vector described in different reference coordinate system, like global or local coordinate systems.
Definition at line 56 of file DisplacementVector3D.h.
Public Types | |
typedef Tag | CoordinateSystemTag |
typedef CoordSystem | CoordinateType |
typedef CoordSystem::Scalar | Scalar |
Public Member Functions | |
DisplacementVector3D () | |
Default constructor. | |
template<class OtherCoords > | |
DisplacementVector3D (const DisplacementVector3D< OtherCoords, Tag > &v) | |
Construct from a displacement vector expressed in different coordinates, or using a different Scalar type, but with same coordinate system tag. | |
template<class ForeignVector > | |
DisplacementVector3D (const ForeignVector &v) | |
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement methods x(), y() and z() | |
template<class OtherCoords > | |
DisplacementVector3D (const PositionVector3D< OtherCoords, Tag > &p) | |
Construct from a position vector expressed in different coordinates but with the same coordinate system tag. | |
DisplacementVector3D (Scalar a, Scalar b, Scalar c) | |
Construct from three values of type Scalar. | |
CoordSystem | Coordinates () const |
Retrieve a copy of the coordinates object. | |
template<class OtherCoords > | |
DisplacementVector3D | Cross (const DisplacementVector3D< OtherCoords, Tag > &v) const |
Return vector (cross) product of two displacement vectors, as a vector in the coordinate system of this class. | |
template<class OtherVector > | |
DisplacementVector3D | Cross (const OtherVector &v) const |
Return vector (cross) product of two vectors, as a vector in the coordinate system of this class. | |
template<class OtherCoords > | |
Scalar | Dot (const DisplacementVector3D< OtherCoords, Tag > &v) const |
Return the scalar (dot) product of two displacement vectors. | |
template<class OtherVector > | |
Scalar | Dot (const OtherVector &v) const |
Return the scalar (dot) product of two vectors. | |
Scalar | Eta () const |
Polar eta, converting if necessary from internal coordinate system. | |
Scalar | eta () const |
template<class IT > | |
void | GetCoordinates (IT begin) const |
get internal data into 3 Scalars starting at *begin | |
template<class IT > | |
void | GetCoordinates (IT begin, IT end) const |
get internal data into 3 Scalars at *begin to *end (3 past begin) | |
void | GetCoordinates (Scalar &a, Scalar &b, Scalar &c) const |
get internal data into 3 Scalar numbers | |
void | GetCoordinates (Scalar dest[]) const |
get internal data into a C-style array of 3 Scalar numbers | |
Scalar | Mag2 () const |
Magnitute squared ( r^2 in spherical coordinate) | |
Scalar | mag2 () const |
bool | operator!= (const DisplacementVector3D &rhs) const |
DisplacementVector3D | operator* (Scalar a) const |
Multiply a vector by a real number. | |
DisplacementVector3D & | operator*= (Scalar a) |
multiply this vector by a scalar quantity | |
DisplacementVector3D | operator+ () const |
Positive of the vector, return itself. | |
template<class OtherCoords > | |
DisplacementVector3D & | operator+= (const DisplacementVector3D< OtherCoords, Tag > &v) |
Self Addition with a displacement vector. | |
DisplacementVector3D | operator- () const |
Negative of the vector. | |
template<class OtherCoords > | |
DisplacementVector3D & | operator-= (const DisplacementVector3D< OtherCoords, Tag > &v) |
Self Difference with a displacement vector. | |
DisplacementVector3D | operator/ (Scalar a) const |
Division of a vector with a real number. | |
DisplacementVector3D & | operator/= (Scalar a) |
divide this vector by a scalar quantity | |
template<class OtherCoords > | |
DisplacementVector3D & | operator= (const DisplacementVector3D< OtherCoords, Tag > &v) |
Assignment operator from a displacement vector of arbitrary type. | |
template<class ForeignVector > | |
DisplacementVector3D & | operator= (const ForeignVector &v) |
Assignment from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement methods x(), y() and z() | |
template<class OtherCoords > | |
DisplacementVector3D & | operator= (const PositionVector3D< OtherCoords, Tag > &rhs) |
Assignment operator from a position vector (not necessarily efficient unless one or the other is Cartesian) | |
bool | operator== (const DisplacementVector3D &rhs) const |
Exact equality. | |
Scalar | Perp2 () const |
Transverse component squared (rho^2 in cylindrical coordinates. | |
Scalar | perp2 () const |
Scalar | Phi () const |
Polar phi, converting if necessary from internal coordinate system. | |
Scalar | phi () const |
Scalar | R () const |
Polar R, converting if necessary from internal coordinate system. | |
Scalar | r () const |
Scalar | Rho () const |
Cylindrical transverse component rho. | |
Scalar | rho () const |
DisplacementVector3D< CoordSystem, Tag > & | SetCoordinates (const Scalar src[]) |
Set internal data based on a C-style array of 3 Scalar numbers. | |
template<class IT > | |
DisplacementVector3D< CoordSystem, Tag > & | SetCoordinates (IT begin, IT end) |
Set internal data based on 3 Scalars at *begin to *end. | |
DisplacementVector3D< CoordSystem, Tag > & | SetCoordinates (Scalar a, Scalar b, Scalar c) |
Set internal data based on 3 Scalar numbers. | |
DisplacementVector3D< CoordSystem, Tag > & | SetEta (Scalar etaval) |
Change Eta - CylindricalEta3D coordinates only. | |
DisplacementVector3D< CoordSystem, Tag > & | SetPhi (Scalar ang) |
Change Phi - Polar3D or CylindricalEta3D coordinates. | |
DisplacementVector3D< CoordSystem, Tag > & | SetR (Scalar rr) |
Change R - Polar3D coordinates only. | |
DisplacementVector3D< CoordSystem, Tag > & | SetRho (Scalar rr) |
Change Rho - CylindricalEta3D coordinates only. | |
DisplacementVector3D< CoordSystem, Tag > & | SetTheta (Scalar ang) |
Change Theta - Polar3D coordinates only. | |
DisplacementVector3D< CoordSystem, Tag > & | SetX (Scalar xx) |
Change X - Cartesian3D coordinates only. | |
DisplacementVector3D< CoordSystem, Tag > & | SetXYZ (Scalar a, Scalar b, Scalar c) |
set the values of the vector from the cartesian components (x,y,z) (if the vector is held in polar or cylindrical eta coordinates, then (x, y, z) are converted to that form) | |
DisplacementVector3D< CoordSystem, Tag > & | SetY (Scalar yy) |
Change Y - Cartesian3D coordinates only. | |
DisplacementVector3D< CoordSystem, Tag > & | SetZ (Scalar zz) |
Change Z - Cartesian3D coordinates only. | |
Scalar | Theta () const |
Polar theta, converting if necessary from internal coordinate system. | |
Scalar | theta () const |
template<typename SCALAR = Scalar, typename std::enable_if< std::is_arithmetic< SCALAR >::value >::type * = nullptr> | |
DisplacementVector3D | Unit () const |
return unit vector parallel to this (scalar) | |
template<typename SCALAR = Scalar, typename std::enable_if<!std::is_arithmetic< SCALAR >::value >::type * = nullptr> | |
DisplacementVector3D | Unit () const |
return unit vector parallel to this (vector) | |
DisplacementVector3D | unit () const |
Scalar | X () const |
Cartesian X, converting if necessary from internal coordinate system. | |
Scalar | x () const |
Scalar | Y () const |
Cartesian Y, converting if necessary from internal coordinate system. | |
Scalar | y () const |
Scalar | Z () const |
Cartesian Z, converting if necessary from internal coordinate system. | |
Scalar | z () const |
Private Member Functions | |
template<class OtherCoords , class OtherTag > | |
DisplacementVector3D (const DisplacementVector3D< OtherCoords, OtherTag > &) | |
template<class OtherCoords , class OtherTag > | |
DisplacementVector3D (const PositionVector3D< OtherCoords, OtherTag > &) | |
template<class OtherCoords , class OtherTag > | |
DisplacementVector3D | Cross (const DisplacementVector3D< OtherCoords, OtherTag > &) const |
template<class OtherCoords , class OtherTag > | |
Scalar | Dot (const DisplacementVector3D< OtherCoords, OtherTag > &) const |
template<class OtherCoords , class OtherTag > | |
DisplacementVector3D & | operator+= (const DisplacementVector3D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
DisplacementVector3D & | operator-= (const DisplacementVector3D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
DisplacementVector3D & | operator= (const DisplacementVector3D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
DisplacementVector3D & | operator= (const PositionVector3D< OtherCoords, OtherTag > &) |
Private Attributes | |
CoordSystem | fCoordinates |
#include <Math/GenVector/DisplacementVector3D.h>
typedef Tag ROOT::Math::DisplacementVector3D< CoordSystem, Tag >::CoordinateSystemTag |
Definition at line 62 of file DisplacementVector3D.h.
typedef CoordSystem ROOT::Math::DisplacementVector3D< CoordSystem, Tag >::CoordinateType |
Definition at line 61 of file DisplacementVector3D.h.
typedef CoordSystem::Scalar ROOT::Math::DisplacementVector3D< CoordSystem, Tag >::Scalar |
Definition at line 60 of file DisplacementVector3D.h.
|
inline |
Default constructor.
Construct an empty object with zero values
Definition at line 69 of file DisplacementVector3D.h.
|
inline |
Construct from three values of type Scalar.
In the case of a XYZVector the values are x,y,z In the case of a polar vector they are r,theta, phi
Definition at line 77 of file DisplacementVector3D.h.
|
inlineexplicit |
Construct from a displacement vector expressed in different coordinates, or using a different Scalar type, but with same coordinate system tag.
Definition at line 85 of file DisplacementVector3D.h.
|
inlineexplicit |
Construct from a position vector expressed in different coordinates but with the same coordinate system tag.
Definition at line 94 of file DisplacementVector3D.h.
|
inlineexplicit |
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement methods x(), y() and z()
Definition at line 103 of file DisplacementVector3D.h.
|
inlineexplicitprivate |
Definition at line 539 of file DisplacementVector3D.h.
|
inlineexplicitprivate |
Definition at line 542 of file DisplacementVector3D.h.
|
inline |
Retrieve a copy of the coordinates object.
Definition at line 180 of file DisplacementVector3D.h.
|
private |
|
inline |
Return vector (cross) product of two displacement vectors, as a vector in the coordinate system of this class.
It is possible to perform the product for any type of vector coordinates, but they must have the same coordinate system tag
Definition at line 413 of file DisplacementVector3D.h.
|
inline |
Return vector (cross) product of two vectors, as a vector in the coordinate system of this class.
It is possible to perform the product for any classes implementing X(), Y() and Z() member functions
Definition at line 427 of file DisplacementVector3D.h.
|
private |
|
inline |
Return the scalar (dot) product of two displacement vectors.
It is possible to perform the product for any type of vector coordinates, but they must have the same coordinate system tag
Definition at line 393 of file DisplacementVector3D.h.
|
inline |
Return the scalar (dot) product of two vectors.
It is possible to perform the product for any classes implementing x(), y() and z() member functions
Definition at line 402 of file DisplacementVector3D.h.
|
inline |
Polar eta, converting if necessary from internal coordinate system.
Definition at line 301 of file DisplacementVector3D.h.
|
inline |
Definition at line 516 of file DisplacementVector3D.h.
|
inline |
get internal data into 3 Scalars starting at *begin
Definition at line 234 of file DisplacementVector3D.h.
|
inline |
get internal data into 3 Scalars at *begin to *end (3 past begin)
Definition at line 224 of file DisplacementVector3D.h.
|
inline |
get internal data into 3 Scalar numbers
Definition at line 211 of file DisplacementVector3D.h.
|
inline |
get internal data into a C-style array of 3 Scalar numbers
Definition at line 217 of file DisplacementVector3D.h.
|
inline |
Magnitute squared ( r^2 in spherical coordinate)
Definition at line 313 of file DisplacementVector3D.h.
|
inline |
Definition at line 518 of file DisplacementVector3D.h.
|
inline |
Definition at line 262 of file DisplacementVector3D.h.
|
inline |
Multiply a vector by a real number.
Definition at line 480 of file DisplacementVector3D.h.
|
inline |
multiply this vector by a scalar quantity
Definition at line 461 of file DisplacementVector3D.h.
|
inline |
Positive of the vector, return itself.
Definition at line 496 of file DisplacementVector3D.h.
|
private |
|
inline |
Self Addition with a displacement vector.
Definition at line 441 of file DisplacementVector3D.h.
|
inline |
Negative of the vector.
Definition at line 489 of file DisplacementVector3D.h.
|
private |
|
inline |
Self Difference with a displacement vector.
Definition at line 451 of file DisplacementVector3D.h.
|
inline |
Division of a vector with a real number.
Definition at line 501 of file DisplacementVector3D.h.
|
inline |
divide this vector by a scalar quantity
Definition at line 469 of file DisplacementVector3D.h.
|
private |
|
inline |
Assignment operator from a displacement vector of arbitrary type.
Definition at line 130 of file DisplacementVector3D.h.
|
inline |
Assignment from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement methods x(), y() and z()
Definition at line 153 of file DisplacementVector3D.h.
|
private |
|
inline |
Assignment operator from a position vector (not necessarily efficient unless one or the other is Cartesian)
Definition at line 141 of file DisplacementVector3D.h.
|
inline |
Exact equality.
Definition at line 259 of file DisplacementVector3D.h.
|
inline |
Transverse component squared (rho^2 in cylindrical coordinates.
Definition at line 318 of file DisplacementVector3D.h.
|
inline |
Definition at line 519 of file DisplacementVector3D.h.
|
inline |
Polar phi, converting if necessary from internal coordinate system.
Definition at line 296 of file DisplacementVector3D.h.
|
inline |
Definition at line 515 of file DisplacementVector3D.h.
|
inline |
Polar R, converting if necessary from internal coordinate system.
Definition at line 286 of file DisplacementVector3D.h.
|
inline |
Definition at line 513 of file DisplacementVector3D.h.
|
inline |
Cylindrical transverse component rho.
Definition at line 306 of file DisplacementVector3D.h.
|
inline |
Definition at line 517 of file DisplacementVector3D.h.
|
inline |
Set internal data based on a C-style array of 3 Scalar numbers.
Definition at line 187 of file DisplacementVector3D.h.
|
inline |
Set internal data based on 3 Scalars at *begin to *end.
Definition at line 200 of file DisplacementVector3D.h.
|
inline |
Set internal data based on 3 Scalar numbers.
Definition at line 193 of file DisplacementVector3D.h.
|
inline |
Change Eta - CylindricalEta3D coordinates only.
Definition at line 381 of file DisplacementVector3D.h.
|
inline |
Change Phi - Polar3D or CylindricalEta3D coordinates.
Definition at line 371 of file DisplacementVector3D.h.
|
inline |
Change R - Polar3D coordinates only.
Definition at line 361 of file DisplacementVector3D.h.
|
inline |
Change Rho - CylindricalEta3D coordinates only.
Definition at line 376 of file DisplacementVector3D.h.
|
inline |
Change Theta - Polar3D coordinates only.
Definition at line 366 of file DisplacementVector3D.h.
|
inline |
Change X - Cartesian3D coordinates only.
Definition at line 346 of file DisplacementVector3D.h.
|
inline |
set the values of the vector from the cartesian components (x,y,z) (if the vector is held in polar or cylindrical eta coordinates, then (x, y, z) are converted to that form)
Definition at line 249 of file DisplacementVector3D.h.
|
inline |
Change Y - Cartesian3D coordinates only.
Definition at line 351 of file DisplacementVector3D.h.
|
inline |
Change Z - Cartesian3D coordinates only.
Definition at line 356 of file DisplacementVector3D.h.
|
inline |
Polar theta, converting if necessary from internal coordinate system.
Definition at line 291 of file DisplacementVector3D.h.
|
inline |
Definition at line 514 of file DisplacementVector3D.h.
|
inline |
return unit vector parallel to this (scalar)
Definition at line 324 of file DisplacementVector3D.h.
|
inline |
return unit vector parallel to this (vector)
Definition at line 334 of file DisplacementVector3D.h.
|
inline |
Definition at line 520 of file DisplacementVector3D.h.
|
inline |
Cartesian X, converting if necessary from internal coordinate system.
Definition at line 271 of file DisplacementVector3D.h.
|
inline |
Definition at line 510 of file DisplacementVector3D.h.
|
inline |
Cartesian Y, converting if necessary from internal coordinate system.
Definition at line 276 of file DisplacementVector3D.h.
|
inline |
Definition at line 511 of file DisplacementVector3D.h.
|
inline |
Cartesian Z, converting if necessary from internal coordinate system.
Definition at line 281 of file DisplacementVector3D.h.
|
inline |
Definition at line 512 of file DisplacementVector3D.h.
|
private |
Definition at line 525 of file DisplacementVector3D.h.