ROOT
6.07/01
Reference Guide
|
Class describing a generic displacement vector in 2 dimensions.
Class template describing a 2D displacement vector.
This class is templated on the type of Coordinate system. One example is the XYVector which is a vector based on double precision x,y data members by using the ROOT::Math::Cartesian2D<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 66 of file DisplacementVector2D.h.
Public Types | |
typedef CoordSystem::Scalar | Scalar |
typedef CoordSystem | CoordinateType |
typedef Tag | CoordinateSystemTag |
Public Member Functions | |
DisplacementVector2D () | |
Default constructor. More... | |
DisplacementVector2D (Scalar a, Scalar b) | |
Construct from three values of type Scalar. More... | |
template<class OtherCoords > | |
DisplacementVector2D (const DisplacementVector2D< OtherCoords, Tag > &v) | |
Construct from a displacement vector expressed in different coordinates, or using a different Scalar type, but with same coordinate system tag. More... | |
template<class OtherCoords > | |
DisplacementVector2D (const PositionVector2D< OtherCoords, Tag > &p) | |
Construct from a position vector expressed in different coordinates but with the same coordinate system tag. More... | |
template<class ForeignVector > | |
DisplacementVector2D (const ForeignVector &v) | |
Construct from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y() More... | |
template<class OtherCoords > | |
DisplacementVector2D & | operator= (const DisplacementVector2D< OtherCoords, Tag > &v) |
Assignment operator from a displacement vector of arbitrary type. More... | |
template<class OtherCoords > | |
DisplacementVector2D & | operator= (const PositionVector2D< OtherCoords, Tag > &rhs) |
Assignment operator from a position vector (not necessarily efficient unless one or the other is Cartesian) More... | |
template<class ForeignVector > | |
DisplacementVector2D & | operator= (const ForeignVector &v) |
Assignment from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y() More... | |
CoordSystem | Coordinates () const |
Retrieve a copy of the coordinates object. More... | |
DisplacementVector2D < CoordSystem, Tag > & | SetCoordinates (Scalar a, Scalar b) |
Set internal data based on 2 Scalar numbers. More... | |
void | GetCoordinates (Scalar &a, Scalar &b) const |
get internal data into 2 Scalar numbers. More... | |
DisplacementVector2D < CoordSystem, Tag > & | SetXY (Scalar a, Scalar b) |
set the values of the vector from the cartesian components (x,y) (if the vector is held in polar coordinates, then (x, y) are converted to that form) More... | |
bool | operator== (const DisplacementVector2D &rhs) const |
Exact equality. More... | |
bool | operator!= (const DisplacementVector2D &rhs) const |
Scalar | X () const |
Cartesian X, converting if necessary from internal coordinate system. More... | |
Scalar | Y () const |
Cartesian Y, converting if necessary from internal coordinate system. More... | |
Scalar | R () const |
Polar R, converting if necessary from internal coordinate system. More... | |
Scalar | Phi () const |
Polar phi, converting if necessary from internal coordinate system. More... | |
Scalar | Mag2 () const |
Magnitute squared ( r^2 in spherical coordinate) More... | |
DisplacementVector2D | Unit () const |
return unit vector parallel to this More... | |
DisplacementVector2D < CoordSystem, Tag > & | SetX (Scalar a) |
Change X - Cartesian2D coordinates only. More... | |
DisplacementVector2D < CoordSystem, Tag > & | SetY (Scalar a) |
Change Y - Cartesian2D coordinates only. More... | |
DisplacementVector2D < CoordSystem, Tag > & | SetR (Scalar a) |
Change R - Polar2D coordinates only. More... | |
DisplacementVector2D < CoordSystem, Tag > & | SetPhi (Scalar ang) |
Change Phi - Polar2D coordinates. More... | |
template<class OtherCoords > | |
Scalar | Dot (const DisplacementVector2D< OtherCoords, Tag > &v) const |
Return the scalar (dot) product of two displacement vectors. More... | |
template<class OtherVector > | |
Scalar | Dot (const OtherVector &v) const |
Return the scalar (dot) product of two vectors. More... | |
template<class OtherCoords > | |
DisplacementVector2D & | operator+= (const DisplacementVector2D< OtherCoords, Tag > &v) |
Self Addition with a displacement vector. More... | |
template<class OtherCoords > | |
DisplacementVector2D & | operator-= (const DisplacementVector2D< OtherCoords, Tag > &v) |
Self Difference with a displacement vector. More... | |
DisplacementVector2D & | operator*= (Scalar a) |
multiply this vector by a scalar quantity More... | |
DisplacementVector2D & | operator/= (Scalar a) |
divide this vector by a scalar quantity More... | |
DisplacementVector2D | operator* (Scalar a) const |
Multiply a vector by a real number. More... | |
DisplacementVector2D | operator- () const |
Negative of the vector. More... | |
DisplacementVector2D | operator+ () const |
Positive of the vector, return itself. More... | |
DisplacementVector2D | operator/ (Scalar a) const |
Division of a vector with a real number. More... | |
void | Rotate (Scalar angle) |
Rotate by an angle. More... | |
Scalar | x () const |
Scalar | y () const |
Scalar | r () const |
Scalar | phi () const |
Scalar | mag2 () const |
DisplacementVector2D | unit () const |
Private Member Functions | |
template<class OtherCoords , class OtherTag > | |
DisplacementVector2D (const DisplacementVector2D< OtherCoords, OtherTag > &) | |
template<class OtherCoords , class OtherTag > | |
DisplacementVector2D (const PositionVector2D< OtherCoords, OtherTag > &) | |
template<class OtherCoords , class OtherTag > | |
DisplacementVector2D & | operator= (const DisplacementVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
DisplacementVector2D & | operator= (const PositionVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
DisplacementVector2D & | operator+= (const DisplacementVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
DisplacementVector2D & | operator-= (const DisplacementVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
Scalar | Dot (const DisplacementVector2D< OtherCoords, OtherTag > &) const |
template<class OtherCoords , class OtherTag > | |
DisplacementVector2D | Cross (const DisplacementVector2D< OtherCoords, OtherTag > &) const |
Private Attributes | |
CoordSystem | fCoordinates |
#include <Math/GenVector/DisplacementVector2D.h>
typedef Tag ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::CoordinateSystemTag |
Definition at line 72 of file DisplacementVector2D.h.
typedef CoordSystem ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::CoordinateType |
Definition at line 71 of file DisplacementVector2D.h.
typedef CoordSystem::Scalar ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Scalar |
Definition at line 70 of file DisplacementVector2D.h.
|
inline |
Default constructor.
Construct an empty object with zero values
Definition at line 79 of file DisplacementVector2D.h.
Referenced by ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Unit().
|
inline |
Construct from three values of type Scalar.
In the case of a XYVector the values are x,y In the case of a polar vector they are r, phi
Definition at line 87 of file DisplacementVector2D.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 95 of file DisplacementVector2D.h.
|
inlineexplicit |
Construct from a position vector expressed in different coordinates but with the same coordinate system tag.
Definition at line 104 of file DisplacementVector2D.h.
|
inlineexplicit |
Construct from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y()
Definition at line 113 of file DisplacementVector2D.h.
|
inlineexplicitprivate |
Definition at line 404 of file DisplacementVector2D.h.
|
inlineexplicitprivate |
Definition at line 407 of file DisplacementVector2D.h.
|
inline |
Retrieve a copy of the coordinates object.
Definition at line 160 of file DisplacementVector2D.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 292 of file DisplacementVector2D.h.
Referenced by testVector2D().
|
inline |
Return the scalar (dot) product of two vectors.
It is possible to perform the product for any classes implementing x() and y() member functions
Definition at line 301 of file DisplacementVector2D.h.
|
private |
|
inline |
get internal data into 2 Scalar numbers.
These are for example (x,y) for a cartesian vector or (r,phi) for a polar vector
Definition at line 178 of file DisplacementVector2D.h.
|
inline |
Magnitute squared ( r^2 in spherical coordinate)
Definition at line 234 of file DisplacementVector2D.h.
Referenced by testVector2D().
|
inline |
Definition at line 391 of file DisplacementVector2D.h.
|
inline |
Definition at line 200 of file DisplacementVector2D.h.
|
inline |
Multiply a vector by a real number.
Definition at line 350 of file DisplacementVector2D.h.
Referenced by ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator-().
|
inline |
multiply this vector by a scalar quantity
Definition at line 331 of file DisplacementVector2D.h.
|
inline |
Positive of the vector, return itself.
Definition at line 366 of file DisplacementVector2D.h.
|
inline |
Self Addition with a displacement vector.
Definition at line 312 of file DisplacementVector2D.h.
|
private |
|
inline |
Negative of the vector.
Definition at line 359 of file DisplacementVector2D.h.
|
inline |
Self Difference with a displacement vector.
Definition at line 322 of file DisplacementVector2D.h.
|
private |
|
inline |
Division of a vector with a real number.
Definition at line 371 of file DisplacementVector2D.h.
|
inline |
divide this vector by a scalar quantity
Definition at line 339 of file DisplacementVector2D.h.
|
inline |
Assignment operator from a displacement vector of arbitrary type.
Definition at line 127 of file DisplacementVector2D.h.
|
inline |
Assignment operator from a position vector (not necessarily efficient unless one or the other is Cartesian)
Definition at line 138 of file DisplacementVector2D.h.
|
inline |
Assignment from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y()
Definition at line 149 of file DisplacementVector2D.h.
|
private |
|
private |
|
inline |
Exact equality.
Definition at line 197 of file DisplacementVector2D.h.
Referenced by ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator!=().
|
inline |
Polar phi, converting if necessary from internal coordinate system.
Definition at line 226 of file DisplacementVector2D.h.
Referenced by testVector2D().
|
inline |
Definition at line 390 of file DisplacementVector2D.h.
|
inline |
Polar R, converting if necessary from internal coordinate system.
Definition at line 220 of file DisplacementVector2D.h.
Referenced by testVector2D(), and ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Unit().
|
inline |
Definition at line 389 of file DisplacementVector2D.h.
|
inline |
Rotate by an angle.
Definition at line 380 of file DisplacementVector2D.h.
Referenced by testVector2D().
|
inline |
Set internal data based on 2 Scalar numbers.
These are for example (x,y) for a cartesian vector or (r,phi) for a polar vector
Definition at line 168 of file DisplacementVector2D.h.
Referenced by ROOT::Math::operator>>().
|
inline |
Change Phi - Polar2D coordinates.
Definition at line 276 of file DisplacementVector2D.h.
|
inline |
Change R - Polar2D coordinates only.
Definition at line 267 of file DisplacementVector2D.h.
|
inline |
Change X - Cartesian2D coordinates only.
Definition at line 250 of file DisplacementVector2D.h.
|
inline |
set the values of the vector from the cartesian components (x,y) (if the vector is held in polar coordinates, then (x, y) are converted to that form)
Definition at line 187 of file DisplacementVector2D.h.
Referenced by ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator+=(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator-=(), and ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator=().
|
inline |
Change Y - Cartesian2D coordinates only.
Definition at line 258 of file DisplacementVector2D.h.
|
inline |
return unit vector parallel to this
Definition at line 240 of file DisplacementVector2D.h.
Referenced by testVector2D(), and ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::unit().
|
inline |
Definition at line 392 of file DisplacementVector2D.h.
|
inline |
Cartesian X, converting if necessary from internal coordinate system.
Definition at line 209 of file DisplacementVector2D.h.
Referenced by ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Dot(), ROOT::Math::PositionVector2D< CoordSystem, Tag >::operator+=(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator+=(), ROOT::Math::PositionVector2D< CoordSystem, Tag >::operator-=(), and testVector2D().
|
inline |
Definition at line 387 of file DisplacementVector2D.h.
Referenced by ROOT::Math::PositionVector2D< CoordSystem, Tag >::Dot(), and ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator-=().
|
inline |
Cartesian Y, converting if necessary from internal coordinate system.
Definition at line 214 of file DisplacementVector2D.h.
Referenced by ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Dot(), ROOT::Math::PositionVector2D< CoordSystem, Tag >::operator+=(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator+=(), ROOT::Math::PositionVector2D< CoordSystem, Tag >::operator-=(), and testVector2D().
|
inline |
Definition at line 388 of file DisplacementVector2D.h.
Referenced by ROOT::Math::PositionVector2D< CoordSystem, Tag >::Dot(), and ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator-=().
|
private |
Definition at line 397 of file DisplacementVector2D.h.
Referenced by ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Coordinates(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::GetCoordinates(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Mag2(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::mag2(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator*=(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator/=(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator=(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::operator==(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Phi(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::phi(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::R(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::r(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Rotate(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::SetCoordinates(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::SetPhi(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::SetR(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::SetX(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::SetXY(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::SetY(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::X(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::x(), ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::Y(), and ROOT::Math::DisplacementVector2D< CoordSystem, Tag >::y().