Class describing a generic position vector (point) in 2 dimensions.
Class describing a 2D Position vector.
This class is templated on the type of Coordinate system. One example is the XYPoint 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 50 of file PositionVector2D.h.
Public Types | |
typedef Tag | CoordinateSystemTag |
typedef CoordSystem | CoordinateType |
typedef CoordSystem::Scalar | Scalar |
Public Member Functions | |
constexpr | PositionVector2D () |
Default constructor. | |
template<class T > | |
constexpr | PositionVector2D (const DisplacementVector2D< T, Tag > &p) |
Construct from an arbitrary displacement vector. | |
template<class ForeignVector > | |
constexpr | PositionVector2D (const ForeignVector &v) |
Construct from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y() | |
template<class T > | |
constexpr | PositionVector2D (const PositionVector2D< T, Tag > &v) |
Construct from a position vector expressed in different coordinates, or using a different Scalar type. | |
constexpr | PositionVector2D (const Scalar &a, const Scalar &b) |
Construct from three values of type Scalar. | |
const CoordSystem & | Coordinates () const |
Retrieve a copy of the coordinates object. | |
unsigned int | Dimension () const |
Dimension. | |
template<class OtherCoords > | |
Scalar | Dot (const DisplacementVector2D< OtherCoords, Tag > &v) const |
Return the scalar (Dot) product of this with a displacement vector in any coordinate system, but with the same tag. | |
void | GetCoordinates (Scalar &a, Scalar &b) const |
get internal data into 2 Scalar numbers. | |
Scalar | Mag2 () const |
Magnitute squared ( r^2 in spherical coordinate) | |
Scalar | mag2 () const |
bool | operator!= (const PositionVector2D &rhs) const |
PositionVector2D | operator* (Scalar a) const |
Multiply a vector by a real number. | |
PositionVector2D & | operator*= (Scalar a) |
multiply this vector by a scalar quantity | |
template<class OtherCoords > | |
PositionVector2D & | operator+= (const DisplacementVector2D< OtherCoords, Tag > &v) |
Self Addition with a displacement vector. | |
template<class OtherCoords > | |
PositionVector2D & | operator-= (const DisplacementVector2D< OtherCoords, Tag > &v) |
Self Difference with a displacement vector. | |
PositionVector2D | operator/ (Scalar a) const |
Division of a vector with a real number. | |
PositionVector2D & | operator/= (Scalar a) |
divide this vector by a scalar quantity | |
template<class OtherCoords > | |
PositionVector2D & | operator= (const DisplacementVector2D< OtherCoords, Tag > &v) |
Assignment operator from a displacement vector of arbitrary type. | |
template<class ForeignVector > | |
PositionVector2D & | operator= (const ForeignVector &v) |
Assignment from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y() | |
template<class OtherCoords > | |
PositionVector2D & | operator= (const PositionVector2D< OtherCoords, Tag > &v) |
Assignment operator from a position vector of arbitrary type. | |
bool | operator== (const PositionVector2D &rhs) const |
Exact equality. | |
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 |
void | Rotate (Scalar angle) |
Rotate by an angle. | |
PositionVector2D< CoordSystem, Tag > & | SetCoordinates (Scalar a, Scalar b) |
Set internal data based on 2 Scalar numbers. | |
PositionVector2D< CoordSystem, Tag > & | SetPhi (Scalar ang) |
Change Phi - Polar2D coordinates. | |
PositionVector2D< CoordSystem, Tag > & | SetR (Scalar a) |
Change R - Polar2D coordinates only. | |
PositionVector2D< CoordSystem, Tag > & | SetX (Scalar a) |
Change X - Cartesian2D coordinates only. | |
PositionVector2D< 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) | |
PositionVector2D< CoordSystem, Tag > & | SetY (Scalar a) |
Change Y - Cartesian2D coordinates only. | |
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 |
Private Member Functions | |
template<class OtherCoords , class OtherTag > | |
constexpr | PositionVector2D (const DisplacementVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
constexpr | PositionVector2D (const PositionVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
PositionVector2D & | operator+= (const DisplacementVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
PositionVector2D & | operator-= (const DisplacementVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
PositionVector2D & | operator= (const DisplacementVector2D< OtherCoords, OtherTag > &) |
template<class OtherCoords , class OtherTag > | |
PositionVector2D & | operator= (const PositionVector2D< OtherCoords, OtherTag > &) |
Private Attributes | |
CoordSystem | fCoordinates |
Static Private Attributes | |
static constexpr unsigned int | fDimension = CoordinateType::Dimension |
#include <Math/GenVector/PositionVector2D.h>
typedef Tag ROOT::Math::PositionVector2D< CoordSystem, Tag >::CoordinateSystemTag |
Definition at line 56 of file PositionVector2D.h.
typedef CoordSystem ROOT::Math::PositionVector2D< CoordSystem, Tag >::CoordinateType |
Definition at line 55 of file PositionVector2D.h.
typedef CoordSystem::Scalar ROOT::Math::PositionVector2D< CoordSystem, Tag >::Scalar |
Definition at line 54 of file PositionVector2D.h.
|
inlineconstexpr |
Default constructor.
Construct an empty object with zero values
Definition at line 64 of file PositionVector2D.h.
|
inlineconstexpr |
Construct from three values of type Scalar.
In the case of a XYPoint the values are x,y In the case of a polar vector they are r,phi
Definition at line 71 of file PositionVector2D.h.
|
inlineexplicitconstexpr |
Construct from a position vector expressed in different coordinates, or using a different Scalar type.
Definition at line 79 of file PositionVector2D.h.
|
inlineexplicitconstexpr |
Construct from an arbitrary displacement vector.
Definition at line 86 of file PositionVector2D.h.
|
inlineexplicitconstexpr |
Construct from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y()
Definition at line 94 of file PositionVector2D.h.
|
explicitconstexprprivate |
|
explicitconstexprprivate |
|
inline |
Retrieve a copy of the coordinates object.
Definition at line 134 of file PositionVector2D.h.
|
inline |
Dimension.
Definition at line 183 of file PositionVector2D.h.
|
inline |
Return the scalar (Dot) product of this with a displacement vector in any coordinate system, but with the same tag.
Definition at line 258 of file PositionVector2D.h.
|
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 152 of file PositionVector2D.h.
|
inline |
Magnitute squared ( r^2 in spherical coordinate)
Definition at line 208 of file PositionVector2D.h.
|
inline |
Definition at line 336 of file PositionVector2D.h.
|
inline |
Definition at line 174 of file PositionVector2D.h.
|
inline |
Multiply a vector by a real number.
Definition at line 308 of file PositionVector2D.h.
|
inline |
multiply this vector by a scalar quantity
Definition at line 290 of file PositionVector2D.h.
|
private |
|
inline |
Self Addition with a displacement vector.
Definition at line 271 of file PositionVector2D.h.
|
private |
|
inline |
Self Difference with a displacement vector.
Definition at line 281 of file PositionVector2D.h.
|
inline |
Division of a vector with a real number.
Definition at line 317 of file PositionVector2D.h.
|
inline |
divide this vector by a scalar quantity
Definition at line 298 of file PositionVector2D.h.
|
private |
|
inline |
Assignment operator from a displacement vector of arbitrary type.
Definition at line 115 of file PositionVector2D.h.
|
inline |
Assignment from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement methods x() and y()
Definition at line 126 of file PositionVector2D.h.
|
private |
|
inline |
Assignment operator from a position vector of arbitrary type.
Definition at line 105 of file PositionVector2D.h.
|
inline |
Exact equality.
Definition at line 171 of file PositionVector2D.h.
|
inline |
Polar phi, converting if necessary from internal coordinate system.
Definition at line 203 of file PositionVector2D.h.
|
inline |
Definition at line 335 of file PositionVector2D.h.
|
inline |
Polar R, converting if necessary from internal coordinate system.
Definition at line 198 of file PositionVector2D.h.
|
inline |
Definition at line 334 of file PositionVector2D.h.
|
inline |
Rotate by an angle.
Definition at line 326 of file PositionVector2D.h.
|
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 142 of file PositionVector2D.h.
|
inline |
Change Phi - Polar2D coordinates.
Definition at line 244 of file PositionVector2D.h.
|
inline |
Change R - Polar2D coordinates only.
Definition at line 236 of file PositionVector2D.h.
|
inline |
Change X - Cartesian2D coordinates only.
Definition at line 219 of file PositionVector2D.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 161 of file PositionVector2D.h.
|
inline |
Change Y - Cartesian2D coordinates only.
Definition at line 227 of file PositionVector2D.h.
|
inline |
Cartesian X, converting if necessary from internal coordinate system.
Definition at line 188 of file PositionVector2D.h.
|
inline |
Definition at line 332 of file PositionVector2D.h.
|
inline |
Cartesian Y, converting if necessary from internal coordinate system.
Definition at line 193 of file PositionVector2D.h.
|
inline |
Definition at line 333 of file PositionVector2D.h.
|
private |
Definition at line 340 of file PositionVector2D.h.
|
staticconstexprprivate |
Definition at line 341 of file PositionVector2D.h.