17#ifndef ROOT_Math_GenVector_PositionVector3D
18#define ROOT_Math_GenVector_PositionVector3D 1
52 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
96 template <
class ForeignVector>
109 template <
class LAVector>
122 template <
class OtherCoords>
132 template <
class OtherCoords>
143 template <
class ForeignVector>
158 template <
class LAVector>
193 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
194 assert (++begin==end);
220 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
221 assert (++begin==end);
367 template<
class OtherCoords >
369 return X()*
v.x() +
Y()*
v.y() +
Z()*
v.z();
377 template<
class OtherCoords >
381 Z()*
v.x() -
v.z()*
X(),
382 X()*
v.y() -
v.x()*
Y() );
396 template <
class OtherCoords>
406 template <
class OtherCoords>
470 template <
class OtherCoords,
class OtherTag>
473 template <
class OtherCoords,
class OtherTag>
476 template <
class OtherCoords,
class OtherTag>
479 template <
class OtherCoords,
class OtherTag>
482 template <
class OtherCoords,
class OtherTag>
485 template <
class OtherCoords,
class OtherTag>
510 template <
class CoordSystem,
class U>
527 template <
class CoordSystem1,
class CoordSystem2,
class U>
529 DisplacementVector3D<CoordSystem1,U>
533 v1.
X()-v2.
X(), v1.
Y()-v2.
Y(),v1.
Z()-v2.
Z() )
542 template <
class CoordSystem1,
class CoordSystem2,
class U>
544 PositionVector3D<CoordSystem2,U>
555 template <
class CoordSystem1,
class CoordSystem2,
class U>
557 PositionVector3D<CoordSystem2,U>
568 template <
class CoordSystem1,
class CoordSystem2,
class U>
570 PositionVector3D<CoordSystem2,U>
581 class char_t,
class traits_t,
class T,
class U,
583 std::basic_ostream<char_t, traits_t> &
operator<<(std::basic_ostream<char_t, traits_t> &os,
584 PositionVector3D<T, U>
const &
v)
591 v.GetCoordinates(
a,
b,
c);
595 typedef GenVector_detail::BitReproducible BR;
608 class char_t,
class traits_t,
class T,
class U,
610 std::basic_ostream<char_t, traits_t> &
operator<<(std::basic_ostream<char_t, traits_t> &os,
611 PositionVector3D<T, U>
const &
v)
616 os <<
"(" <<
v.x()[i] <<
"," <<
v.y()[i] <<
"," <<
v.z()[i] <<
") ";
623 template<
class char_t,
class traits_t,
class T,
class U >
625 std::basic_istream<char_t,traits_t> &
649 v.SetCoordinates(
a,
b,
c);
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.
PositionVector3D(const PositionVector3D< OtherCoords, OtherTag > &)
PositionVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
PositionVector3D(const DisplacementVector3D< OtherCoords, OtherTag > &)
PositionVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
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.
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.
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.
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.
PositionVector3D(const DisplacementVector3D< T, Tag > &p)
Construct from an arbitrary displacement vector.
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
PositionVector3D()
Default constructor.
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(const Scalar &a, const Scalar &b, const Scalar &c)
Construct from three values of type Scalar.
PositionVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars at *begin
PositionVector3D(const PositionVector3D< T, Tag > &v)
Construct from a position vector expressed in different coordinates, or using a different Scalar type...
const CoordSystem & Coordinates() const
Retrieve a copy of the coordinates object.
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::ostream & operator<<(std::ostream &os, const AxisAngle &a)
Stream Output and Input.
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.
Rotation3D::Scalar Scalar
Namespace for new ROOT classes and functions.
#define dest(otri, vertexptr)