20#ifndef ROOT_Math_GenVector_DisplacementVector3D
21#define ROOT_Math_GenVector_DisplacementVector3D 1
55 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
60 typedef typename CoordSystem::Scalar
Scalar;
84 template <
class OtherCoords>
93 template <
class OtherCoords>
102 template <
class ForeignVector>
116 template <
class LAVector>
129 template <
class OtherCoords>
140 template <
class OtherCoords>
143 SetXYZ(rhs.x(), rhs.y(), rhs.z());
152 template <
class ForeignVector>
168 template <
class LAVector>
201 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
203 assert (++begin==end);
225 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
227 assert (++begin==end);
323 template <typename SCALAR = Scalar, typename std::enable_if<std::is_arithmetic<SCALAR>::value>
::type * =
nullptr>
326 const auto tot =
R();
333 template <typename SCALAR = Scalar, typename std::enable_if<!std::is_arithmetic<SCALAR>::value>
::type * =
nullptr>
337 tot(tot == SCALAR(0)) = SCALAR(1);
392 template<
class OtherCoords >
394 return X()*
v.X() +
Y()*
v.Y() +
Z()*
v.Z();
401 template<
class OtherVector >
403 return X()*
v.x() +
Y()*
v.y() +
Z()*
v.z();
412 template <
class OtherCoords>
416 Z()*
v.X() -
v.Z()*
X(),
417 X()*
v.Y() -
v.X()*
Y() );
426 template <
class OtherVector>
430 Z()*
v.x() -
v.z()*
X(),
431 X()*
v.y() -
v.x()*
Y() );
440 template <
class OtherCoords>
450 template <
class OtherCoords>
527#ifdef NOT_SURE_THIS_SHOULD_BE_FORBIDDEN
538 template <
class OtherCoords,
class OtherTag>
541 template <
class OtherCoords,
class OtherTag>
544 template <
class OtherCoords,
class OtherTag>
548 template <
class OtherCoords,
class OtherTag>
551 template <
class OtherCoords,
class OtherTag>
554 template <
class OtherCoords,
class OtherTag>
557 template<
class OtherCoords,
class OtherTag >
560 template<
class OtherCoords,
class OtherTag >
576 template <
class CoordSystem1,
class CoordSystem2,
class U>
589 template <
class CoordSystem1,
class CoordSystem2,
class U>
591 DisplacementVector3D<CoordSystem1,U>
602 template <
class CoordSystem,
class U>
604 DisplacementVector3D<CoordSystem,U>
620 template <
class char_t,
class traits_t,
class T,
class U,
621 typename std::enable_if<std::is_arithmetic<typename DisplacementVector3D<T, U>::Scalar>::value>
::type * =
623 std::basic_ostream<char_t, traits_t> &
operator<<(std::basic_ostream<char_t, traits_t> &os,
624 DisplacementVector3D<T, U>
const &
v)
628 typename T::Scalar
a,
b,
c;
629 v.GetCoordinates(
a,
b,
c);
633 typedef GenVector_detail::BitReproducible BR;
645 template <
class char_t,
class traits_t,
class T,
class U,
646 typename std::enable_if<!std::is_arithmetic<typename DisplacementVector3D<T, U>::Scalar>::value>
::type * =
648 std::basic_ostream<char_t, traits_t> &
operator<<(std::basic_ostream<char_t, traits_t> &os,
649 DisplacementVector3D<T, U>
const &
v)
653 for (std::size_t i = 0; i < PositionVector3D<T, U>::Scalar::Size; ++i) {
654 os <<
"(" <<
v.x()[i] <<
"," <<
v.y()[i] <<
"," <<
v.z()[i] <<
") ";
661 template<
class char_t,
class traits_t,
class T,
class U >
663 std::basic_istream<char_t,traits_t> &
670 typename T::Scalar
a,
b,
c;
687 v.SetCoordinates(
a,
b,
c);
typedef void(GLAPIENTRYP _GLUfuncptr)(void)
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
Class describing a generic displacement vector in 3 dimensions.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(IT begin, IT end)
Set internal data based on 3 Scalars at *begin to *end.
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
DisplacementVector3D & operator-=(const DisplacementVector3D< OtherCoords, OtherTag > &)
CoordSystem Coordinates() const
Retrieve a copy of the coordinates object.
DisplacementVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, Tag > &v)
Assignment operator from a displacement vector of arbitrary type.
DisplacementVector3D & operator+=(const DisplacementVector3D< OtherCoords, OtherTag > &)
DisplacementVector3D< CoordSystem, Tag > & SetEta(Scalar etaval)
Change Eta - CylindricalEta3D coordinates only.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
DisplacementVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
DisplacementVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
DisplacementVector3D< CoordSystem, Tag > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
DisplacementVector3D Cross(const OtherVector &v) const
Return vector (cross) product of two vectors, as a vector in the coordinate system of this class.
DisplacementVector3D Unit() const
return unit vector parallel to this (scalar)
DisplacementVector3D operator+() const
Positive of the vector, return itself.
DisplacementVector3D operator-() const
Negative of the vector.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
DisplacementVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
DisplacementVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
DisplacementVector3D(const PositionVector3D< OtherCoords, OtherTag > &)
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
void GetCoordinates(IT begin) const
get internal data into 3 Scalars starting at *begin
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
DisplacementVector3D(const PositionVector3D< OtherCoords, Tag > &p)
Construct from a position vector expressed in different coordinates but with the same coordinate syst...
Scalar Dot(const OtherVector &v) const
Return the scalar (dot) product of two vectors.
DisplacementVector3D Cross(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return vector (cross) product of two displacement vectors, as a vector in the coordinate system of th...
DisplacementVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
DisplacementVector3D operator*(Scalar a) const
Multiply a vector by a real number.
bool operator==(const DisplacementVector3D &rhs) const
Exact equality.
Scalar Rho() const
Cylindrical transverse component rho.
DisplacementVector3D Cross(const DisplacementVector3D< OtherCoords, OtherTag > &) const
bool operator!=(const DisplacementVector3D &rhs) const
DisplacementVector3D unit() const
DisplacementVector3D()
Default constructor.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
DisplacementVector3D(Scalar a, Scalar b, Scalar c)
Construct from three values of type Scalar.
DisplacementVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
DisplacementVector3D & operator=(const PositionVector3D< OtherCoords, OtherTag > &)
Scalar Dot(const DisplacementVector3D< OtherCoords, OtherTag > &) const
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
CoordSystem CoordinateType
DisplacementVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
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...
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
DisplacementVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
DisplacementVector3D operator/(Scalar a) const
Division of a vector with a real number.
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
DisplacementVector3D(const DisplacementVector3D< OtherCoords, Tag > &v)
Construct from a displacement vector expressed in different coordinates, or using a different Scalar ...
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
DisplacementVector3D(const DisplacementVector3D< OtherCoords, OtherTag > &)
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.
CoordSystem::Scalar Scalar
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, OtherTag > &)
Class describing a generic position vector (point) in 3 dimensions.
Namespace for new Math classes and functions.
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
std::basic_istream< char_t, traits_t > & operator>>(std::basic_istream< char_t, traits_t > &is, DisplacementVector2D< T, U > &v)
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
#define dest(otri, vertexptr)