20 #ifndef ROOT_Math_GenVector_DisplacementVector3D
21 #define ROOT_Math_GenVector_DisplacementVector3D 1
23 #ifndef ROOT_Math_GenVector_Cartesian3D
27 #ifndef ROOT_Math_GenVector_PositionVector3Dfwd
31 #ifndef ROOT_Math_GenVector_GenVectorIO
35 #ifndef ROOT_Math_GenVector_BitReproducible
39 #ifndef ROOT_Math_GenVector_CoordinateSystemTags
76 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
105 template <
class OtherCoords>
114 template <
class OtherCoords>
123 template <
class ForeignVector>
137 template <
class LAVector>
139 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
150 template <
class OtherCoords>
161 template <
class OtherCoords>
164 SetXYZ(rhs.x(), rhs.y(), rhs.z());
173 template <
class ForeignVector>
175 SetXYZ( v.x(), v.y(), v.z() );
189 template <
class LAVector>
191 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
226 { IT
a = begin; IT b = ++begin; IT
c = ++begin;
253 { IT
a = begin; IT b = ++begin; IT
c = ++begin;
404 template<
class OtherCoords >
406 return X()*v.
X() +
Y()*v.
Y() +
Z()*v.
Z();
413 template<
class OtherVector >
415 return X()*v.x() +
Y()*v.y() +
Z()*v.z();
424 template <
class OtherCoords>
428 Z()*v.
X() - v.
Z()*
X(),
429 X()*v.
Y() - v.
X()*
Y() );
438 template <
class OtherVector>
441 result.
SetXYZ (
Y()*v.z() - v.y()*
Z(),
442 Z()*v.x() - v.z()*
X(),
443 X()*v.y() - v.x()*
Y() );
452 template <
class OtherCoords>
462 template <
class OtherCoords>
539 #ifdef NOT_SURE_THIS_SHOULD_BE_FORBIDDEN
550 template <
class OtherCoords,
class OtherTag>
553 template <
class OtherCoords,
class OtherTag>
556 template <
class OtherCoords,
class OtherTag>
560 template <
class OtherCoords,
class OtherTag>
563 template <
class OtherCoords,
class OtherTag>
566 template <
class OtherCoords,
class OtherTag>
569 template<
class OtherCoords,
class OtherTag >
572 template<
class OtherCoords,
class OtherTag >
588 template <
class CoordSystem1,
class CoordSystem2,
class U>
590 DisplacementVector3D<CoordSystem1,U>
601 template <
class CoordSystem1,
class CoordSystem2,
class U>
603 DisplacementVector3D<CoordSystem1,U>
614 template <
class CoordSystem,
class U>
616 DisplacementVector3D<CoordSystem,U>
632 template<
class char_t,
class traits_t,
class T,
class U >
634 std::basic_ostream<char_t,traits_t> &
635 operator << ( std::basic_ostream<char_t,traits_t> & os
642 v.GetCoordinates(a, b, c);
663 template<
class char_t,
class traits_t,
class T,
class U >
665 std::basic_istream<char_t,traits_t> &
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(IT begin, IT end)
Set internal data based on 3 Scalars at *begin to *end.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
DisplacementVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
Scalar Dot(const OtherVector &v) const
Return the scalar (dot) product of two vectors.
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...
CoordSystem CoordinateType
DisplacementVector3D Cross(const OtherVector &v) const
Return vector (cross) product of two vectors, as a vector in the coordinate system of this class...
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
std::basic_istream< char_t, traits_t > & operator>>(std::basic_istream< char_t, traits_t > &is, DisplacementVector2D< T, U > &v)
Class describing a generic position vector (point) in 3 dimensions.
DisplacementVector3D unit() const
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
DisplacementVector3D(const PositionVector3D< OtherCoords, OtherTag > &)
DisplacementVector3D(const ForeignVector &v)
Construct from a foreign 3D vector type, for example, Hep3Vector Precondition: v must implement metho...
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
DisplacementVector3D operator-() const
Negative of the vector.
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.
Scalar Rho() const
Cylindrical transverse component rho.
DisplacementVector2D< CoordSystem1, U > operator-(DisplacementVector2D< CoordSystem1, U > v1, DisplacementVector2D< CoordSystem2, U > const &v2)
Difference between two DisplacementVector2D vectors.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars starting at *begin
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
CoordSystem Coordinates() const
Retrieve a copy of the coordinates object.
DisplacementVector3D & operator+=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
DisplacementVector3D & operator-=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, Tag > &v)
Assignment operator from a displacement vector of arbitrary type.
DisplacementVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
DisplacementVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.
DisplacementVector3D(const DisplacementVector3D< OtherCoords, OtherTag > &)
CoordSystem::Scalar Scalar
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
Class describing a generic displacement vector in 3 dimensions.
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
bool operator==(const DisplacementVector3D &rhs) const
Exact equality.
DisplacementVector3D< CoordSystem, Tag > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
DisplacementVector3D operator*(Scalar a) const
Multiply a vector by a real number.
bool operator!=(const DisplacementVector3D &rhs) const
DisplacementVector3D(const DisplacementVector3D< OtherCoords, Tag > &v)
Construct from a displacement vector expressed in different coordinates, or using a different Scalar ...
DisplacementVector3D< CoordSystem, Tag > & SetX(Scalar xx)
Change X - Cartesian3D coordinates only.
DisplacementVector3D()
Default constructor.
DisplacementVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
DisplacementVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
DisplacementVector3D< CoordSystem, Tag > & SetEta(Scalar etaval)
Change Eta - CylindricalEta3D coordinates only.
DisplacementVector3D(Scalar a, Scalar b, Scalar c)
Construct from three values of type Scalar.
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
DisplacementVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
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 > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
#define dest(otri, vertexptr)
DisplacementVector3D operator/(Scalar a) const
Division of a vector with a real number.
DisplacementVector3D Unit() const
return unit vector parallel to this
DisplacementVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
Scalar Phi() const
Polar phi, 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...
DisplacementVector3D operator+() const
Positive of the vector, return itself.
AxisAngle operator*(RotationX const &r1, AxisAngle const &r2)
Multiplication of an axial rotation by an AxisAngle.