17 #ifndef ROOT_Math_GenVector_PositionVector3D
18 #define ROOT_Math_GenVector_PositionVector3D 1
20 #ifndef ROOT_Math_GenVector_DisplacementVector3Dfwd
24 #ifndef ROOT_Math_GenVector_Cartesian3D
28 #ifndef ROOT_Math_GenVector_GenVectorIO
32 #ifndef ROOT_Math_GenVector_BitReproducible
36 #ifndef ROOT_Math_GenVector_CoordinateSystemTags
62 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
106 template <
class ForeignVector>
119 template <
class LAVector>
121 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
132 template <
class OtherCoords>
142 template <
class OtherCoords>
153 template <
class ForeignVector>
155 SetXYZ( v.x(), v.y(), v.z() );
168 template <
class LAVector>
170 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
203 { IT
a = begin; IT b = ++begin; IT
c = ++begin;
230 { IT
a = begin; IT b = ++begin; IT
c = ++begin;
375 template<
class OtherCoords >
377 return X()*v.
x() +
Y()*v.
y() +
Z()*v.
z();
385 template<
class OtherCoords >
389 Z()*v.
x() - v.
z()*
X(),
390 X()*v.
y() - v.
x()*
Y() );
404 template <
class OtherCoords>
414 template <
class OtherCoords>
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>
493 template <
class OtherCoords,
class OtherTag>
518 template <
class CoordSystem,
class U>
535 template <
class CoordSystem1,
class CoordSystem2,
class U>
537 DisplacementVector3D<CoordSystem1,U>
541 v1.
X()-v2.
X(), v1.
Y()-v2.
Y(),v1.
Z()-v2.
Z() )
550 template <
class CoordSystem1,
class CoordSystem2,
class U>
552 PositionVector3D<CoordSystem2,U>
563 template <
class CoordSystem1,
class CoordSystem2,
class U>
565 PositionVector3D<CoordSystem2,U>
576 template <
class CoordSystem1,
class CoordSystem2,
class U>
578 PositionVector3D<CoordSystem2,U>
588 template<
class char_t,
class traits_t,
class T,
class U >
590 std::basic_ostream<char_t,traits_t> &
591 operator << ( std::basic_ostream<char_t,traits_t> & os
598 v.GetCoordinates(a, b, c);
619 template<
class char_t,
class traits_t,
class T,
class U >
621 std::basic_istream<char_t,traits_t> &
PositionVector3D & operator=(const PositionVector3D< OtherCoords, Tag > &v)
Assignment operator from a position vector of arbitrary type.
PositionVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
Namespace for new ROOT classes and functions.
bool operator!=(const PositionVector3D &rhs) const
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
PositionVector3D operator/(Scalar a) const
Division of a vector with a real number.
std::basic_istream< char_t, traits_t > & operator>>(std::basic_istream< char_t, traits_t > &is, DisplacementVector2D< T, U > &v)
PositionVector3D(const Scalar &a, const Scalar &b, const Scalar &c)
Construct from three values of type Scalar.
Class describing a generic position vector (point) in 3 dimensions.
PositionVector3D(const DisplacementVector3D< T, Tag > &p)
Construct from an arbitrary displacement vector.
Scalar Rho() const
Cylindrical transverse component rho.
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
PositionVector3D operator*(Scalar a) const
Multiply a vector by a real number.
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
PositionVector3D(const PositionVector3D< T, Tag > &v)
Construct from a position vector expressed in different coordinates, or using a different Scalar type...
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
PositionVector3D< CoordSystem, Tag > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
CoordSystem CoordinateType
static double p2(double t, double a, double b, double c)
PositionVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
PositionVector3D< CoordSystem, Tag > & SetEta(Scalar etaval)
Change Eta - CylindricalEta3D coordinates only.
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
Class describing a generic displacement vector in 3 dimensions.
PositionVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
PositionVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
static double p1(double t, double a, double b)
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
const CoordSystem & Coordinates() const
Retrieve a copy of the coordinates object.
PositionVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
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 DisplacementVector3D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (Dot) product of this with a displacement vector in any coordinate system...
Namespace for new Math classes and functions.
PositionVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
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...
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
#define dest(otri, vertexptr)
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
PositionVector3D()
Default constructor.
PositionVector3D< CoordSystem, Tag > & SetCoordinates(IT begin, IT end)
Set internal data based on 3 Scalars at *begin to *end.
PositionVector3D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
bool operator==(const PositionVector3D &rhs) const
Exact equality.
PositionVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
PositionVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
PositionVector3D & operator-=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars at *begin
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.
PositionVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
PositionVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.