17#ifndef ROOT_Math_GenVector_PositionVector3D
18#define ROOT_Math_GenVector_PositionVector3D 1
54 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
59 typedef typename CoordSystem::Scalar
Scalar;
98 template <
class ForeignVector>
111 template <
class LAVector>
124 template <
class OtherCoords>
134 template <
class OtherCoords>
145 template <
class ForeignVector>
160 template <
class LAVector>
191 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
193 assert (++begin==end);
215 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
217 assert (++begin==end);
371 template<
class OtherCoords >
373 return X()*
v.x() +
Y()*
v.y() +
Z()*
v.z();
381 template<
class OtherCoords >
385 Z()*
v.x() -
v.z()*
X(),
386 X()*
v.y() -
v.x()*
Y() );
400 template <
class OtherCoords>
410 template <
class OtherCoords>
469 static constexpr unsigned int fDimension = CoordinateType::Dimension;
475 template <
class OtherCoords,
class OtherTag>
478 template <
class OtherCoords,
class OtherTag>
481 template <
class OtherCoords,
class OtherTag>
484 template <
class OtherCoords,
class OtherTag>
487 template <
class OtherCoords,
class OtherTag>
490 template <
class OtherCoords,
class OtherTag>
515 template <
class CoordSystem,
class U>
532 template <
class CoordSystem1,
class CoordSystem2,
class U>
534 DisplacementVector3D<CoordSystem1,U>
547 template <
class CoordSystem1,
class CoordSystem2,
class U>
549 PositionVector3D<CoordSystem2,U>
560 template <
class CoordSystem1,
class CoordSystem2,
class U>
562 PositionVector3D<CoordSystem2,U>
573 template <
class CoordSystem1,
class CoordSystem2,
class U>
575 PositionVector3D<CoordSystem2,U>
586 class char_t,
class traits_t,
class T,
class U,
587 typename std::enable_if<std::is_arithmetic<typename PositionVector3D<T, U>::Scalar>
::value>
::type * =
nullptr>
588 std::basic_ostream<char_t, traits_t> &
operator<<(std::basic_ostream<char_t, traits_t> &os,
589 PositionVector3D<T, U>
const &
v)
593 typename T::Scalar
a = 0;
594 typename T::Scalar
b = 0;
595 typename T::Scalar
c = 0;
596 v.GetCoordinates(
a,
b,
c);
600 typedef GenVector_detail::BitReproducible BR;
613 class char_t,
class traits_t,
class T,
class U,
614 typename std::enable_if<!std::is_arithmetic<typename PositionVector3D<T, U>::Scalar>
::value>
::type * =
nullptr>
615 std::basic_ostream<char_t, traits_t> &
operator<<(std::basic_ostream<char_t, traits_t> &os,
616 PositionVector3D<T, U>
const &
v)
620 for (std::size_t i = 0; i < PositionVector3D<T, U>::Scalar::Size; ++i) {
621 os <<
"(" <<
v.x()[i] <<
"," <<
v.y()[i] <<
"," <<
v.z()[i] <<
") ";
628 template<
class char_t,
class traits_t,
class T,
class U >
630 std::basic_istream<char_t,traits_t> &
637 typename T::Scalar
a,
b,
c;
654 v.SetCoordinates(
a,
b,
c);
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
Class describing a generic displacement vector in 3 dimensions.
Class describing a generic position vector (point) in 3 dimensions.
PositionVector3D & operator+=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
unsigned int Dimension() const
Dimension.
PositionVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
constexpr PositionVector3D(const PositionVector3D< OtherCoords, OtherTag > &)
PositionVector3D< CoordSystem, Tag > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
bool operator!=(const PositionVector3D &rhs) const
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
PositionVector3D< CoordSystem, Tag > & SetEta(Scalar etaval)
Change Eta - CylindricalEta3D coordinates only.
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
CoordSystem CoordinateType
PositionVector3D & operator-=(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
PositionVector3D & operator-=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
PositionVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
PositionVector3D operator*(Scalar a) const
Multiply a vector by a real number.
PositionVector3D & operator=(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D & operator=(const PositionVector3D< OtherCoords, Tag > &v)
Assignment operator from a position vector of arbitrary type.
PositionVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
constexpr PositionVector3D(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D & operator+=(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.
PositionVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
constexpr PositionVector3D(const PositionVector3D< T, Tag > &v)
Construct from a position vector expressed in different coordinates, or using a different Scalar type...
constexpr PositionVector3D(const Scalar &a, const Scalar &b, const Scalar &c)
Construct from three values of type Scalar.
CoordSystem::Scalar Scalar
PositionVector3D< 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...
PositionVector3D operator/(Scalar a) const
Division of a vector with a real number.
constexpr PositionVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
bool operator==(const PositionVector3D &rhs) const
Exact equality.
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
PositionVector3D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
Scalar Rho() const
Cylindrical transverse component rho.
PositionVector3D Cross(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return vector (Cross) product of this point with a displacement, as a point vector in this coordinate...
PositionVector3D & operator=(const PositionVector3D< OtherCoords, OtherTag > &)
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
PositionVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
PositionVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (Dot) product of this with a displacement vector in any coordinate system,...
PositionVector3D< CoordSystem, Tag > & SetCoordinates(IT begin, IT end)
Set internal data based on 3 Scalars at *begin to *end.
PositionVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars at *begin
static constexpr unsigned int fDimension
const CoordSystem & Coordinates() const
Retrieve a copy of the coordinates object.
constexpr PositionVector3D()
Default constructor.
constexpr PositionVector3D(const DisplacementVector3D< T, Tag > &p)
Construct from an arbitrary displacement vector.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
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...