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>
111 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
122 template <
class OtherCoords>
132 template <
class OtherCoords>
143 template <
class ForeignVector>
145 SetXYZ( v.x(), v.y(), v.z() );
158 template <
class LAVector>
160 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
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>
533 v1.
X()-v2.
X(), v1.
Y()-v2.
Y(),v1.
Z()-v2.
Z() )
542 template <
class CoordSystem1,
class CoordSystem2,
class U>
555 template <
class CoordSystem1,
class CoordSystem2,
class U>
568 template <
class CoordSystem1,
class CoordSystem2,
class 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,
591 v.GetCoordinates(a, b, c);
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,
615 for (std::size_t i = 0; i < PositionVector3D<T, U>::Scalar::Size; ++i) {
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> &
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
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.
PositionVector3D operator*(Scalar a) const
Multiply a vector by a real number.
Scalar Rho() const
Cylindrical transverse component rho.
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.
Class describing a 3D cartesian coordinate system (x, y, z coordinates)
PositionVector3D operator/(Scalar a) const
Division of a vector with a real number.
PositionVector3D(const PositionVector3D< T, Tag > &v)
Construct from a position vector expressed in different coordinates, or using a different Scalar type...
DisplacementVector2D< CoordSystem1, U > operator+(DisplacementVector2D< CoordSystem1, U > v1, const DisplacementVector2D< CoordSystem2, U > &v2)
Addition of DisplacementVector2D vectors.
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
Scalar X() const
Cartesian X, 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.
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...
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
CoordSystem CoordinateType
void GetCoordinates(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
PositionVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
bool operator==(const PositionVector3D &rhs) const
Exact equality.
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 Z() const
Cartesian Z, 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.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
PositionVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
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.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
PositionVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
PositionVector3D & operator+=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
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...
Scalar Y() const
Cartesian Y, 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...
void GetCoordinates(IT begin) const
get internal data into 3 Scalars at *begin
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
#define dest(otri, vertexptr)
bool operator!=(const PositionVector3D &rhs) const
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
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.
const CoordSystem & Coordinates() const
Retrieve a copy of the coordinates object.
PositionVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
PositionVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
Rotation3D::Scalar Scalar
PositionVector3D & operator-=(const DisplacementVector3D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (Dot) product of this with a displacement vector in any coordinate system...
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
PositionVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
PositionVector3D< CoordSystem, Tag > & SetY(Scalar yy)
Change Y - Cartesian3D coordinates only.