20 #ifndef ROOT_Math_GenVector_DisplacementVector3D 21 #define ROOT_Math_GenVector_DisplacementVector3D 1 66 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
95 template <
class OtherCoords>
104 template <
class OtherCoords>
113 template <
class ForeignVector>
127 template <
class LAVector>
129 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
140 template <
class OtherCoords>
151 template <
class OtherCoords>
154 SetXYZ(rhs.x(), rhs.y(), rhs.z());
163 template <
class ForeignVector>
165 SetXYZ( v.x(), v.y(), v.z() );
179 template <
class LAVector>
181 fCoordinates = CoordSystem ( v[index0], v[index0+1], v[index0+2] );
216 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
217 assert (++begin==end);
243 { IT
a = begin; IT
b = ++begin; IT
c = ++begin;
244 assert (++begin==end);
340 template <typename SCALAR = Scalar, typename std::enable_if<std::is_arithmetic<SCALAR>::value>
::type * =
nullptr>
343 const auto tot =
R();
350 template <typename SCALAR = Scalar, typename std::enable_if<!std::is_arithmetic<SCALAR>::value>::type * =
nullptr>
354 tot(tot == SCALAR(0)) = SCALAR(1);
409 template<
class OtherCoords >
411 return X()*v.
X() +
Y()*v.
Y() +
Z()*v.
Z();
418 template<
class OtherVector >
419 Scalar
Dot(
const OtherVector & v)
const {
420 return X()*v.x() +
Y()*v.y() +
Z()*v.z();
429 template <
class OtherCoords>
433 Z()*v.
X() - v.
Z()*
X(),
434 X()*v.
Y() - v.
X()*
Y() );
443 template <
class OtherVector>
446 result.
SetXYZ (
Y()*v.z() - v.y()*
Z(),
447 Z()*v.x() - v.z()*
X(),
448 X()*v.y() - v.x()*
Y() );
457 template <
class OtherCoords>
460 SetXYZ(
X() + v.X(),
Y() + v.Y(),
Z() + v.Z() );
467 template <
class OtherCoords>
470 SetXYZ(
x() - v.x(),
y() - v.y(),
z() - v.z() );
544 #ifdef NOT_SURE_THIS_SHOULD_BE_FORBIDDEN 555 template <
class OtherCoords,
class OtherTag>
558 template <
class OtherCoords,
class OtherTag>
561 template <
class OtherCoords,
class OtherTag>
565 template <
class OtherCoords,
class OtherTag>
568 template <
class OtherCoords,
class OtherTag>
571 template <
class OtherCoords,
class OtherTag>
574 template<
class OtherCoords,
class OtherTag >
577 template<
class OtherCoords,
class OtherTag >
593 template <
class CoordSystem1,
class CoordSystem2,
class U>
606 template <
class CoordSystem1,
class CoordSystem2,
class U>
619 template <
class CoordSystem,
class U>
637 template <
class char_t,
class traits_t,
class T,
class U,
640 std::basic_ostream<char_t, traits_t> &operator<<(std::basic_ostream<char_t, traits_t> &os,
646 v.GetCoordinates(a, b, c);
662 template <
class char_t,
class traits_t,
class T,
class U,
665 std::basic_ostream<char_t, traits_t> &operator<<(std::basic_ostream<char_t, traits_t> &os,
671 os <<
"(" << v.x()[i] <<
"," << v.y()[i] <<
"," << v.z()[i] <<
") ";
678 template<
class char_t,
class traits_t,
class T,
class U >
680 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.
Scalar Eta() const
Polar eta, converting if necessary from internal coordinate system.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(const Scalar src[])
Set internal data based on a C-style array of 3 Scalar numbers.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
DisplacementVector3D operator*(Scalar a) const
Multiply a vector by a real number.
DisplacementVector3D< CoordSystem, Tag > & SetZ(Scalar zz)
Change Z - Cartesian3D coordinates only.
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...
Namespace for new ROOT classes and functions.
CoordSystem CoordinateType
void GetCoordinates(Scalar dest[]) const
get internal data into a C-style array of 3 Scalar numbers
DisplacementVector3D operator/(Scalar a) const
Division of a vector with a real number.
CoordSystem Coordinates() const
Retrieve a copy of the coordinates object.
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.
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(IT begin, IT end) const
get internal data into 3 Scalars at *begin to *end (3 past begin)
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
void GetCoordinates(IT begin) const
get internal data into 3 Scalars starting at *begin
DisplacementVector3D Unit() const
return unit vector parallel to this (scalar)
Scalar Phi() const
Polar phi, converting if necessary from internal coordinate system.
Scalar Z() const
Cartesian Z, converting if necessary from internal coordinate system.
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
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.
bool operator!=(const DisplacementVector3D &rhs) const
DisplacementVector3D & operator=(const DisplacementVector3D< OtherCoords, Tag > &v)
Assignment operator from a displacement vector of arbitrary type.
DisplacementVector3D operator-() const
Negative of the vector.
DisplacementVector3D & operator*=(Scalar a)
multiply this vector by a scalar quantity
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 > &)
Scalar Dot(const OtherVector &v) const
Return the scalar (dot) product of two vectors.
CoordSystem::Scalar Scalar
Class describing a generic displacement vector in 3 dimensions.
DisplacementVector3D unit() const
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 > & SetR(Scalar rr)
Change R - Polar3D coordinates only.
Scalar Theta() const
Polar theta, converting if necessary from internal coordinate system.
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.
Scalar Perp2() const
Transverse component squared (rho^2 in cylindrical coordinates.
DisplacementVector3D()
Default constructor.
DisplacementVector3D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar3D or CylindricalEta3D coordinates.
DisplacementVector3D operator+() const
Positive of the vector, return itself.
void GetCoordinates(Scalar &a, Scalar &b, Scalar &c) const
get internal data into 3 Scalar numbers
DisplacementVector3D Cross(const OtherVector &v) const
Return vector (cross) product of two vectors, as a vector in the coordinate system of this class...
DisplacementVector3D & operator/=(Scalar a)
divide this vector by a scalar quantity
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)
Namespace for new Math classes and functions.
DisplacementVector3D< CoordSystem, Tag > & SetRho(Scalar rr)
Change Rho - CylindricalEta3D coordinates only.
DisplacementVector3D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b, Scalar c)
Set internal data based on 3 Scalar numbers.
Scalar Rho() const
Cylindrical transverse component rho.
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
#define dest(otri, vertexptr)
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
bool operator==(const DisplacementVector3D &rhs) const
Exact equality.
DisplacementVector3D< CoordSystem, Tag > & SetTheta(Scalar ang)
Change Theta - Polar3D coordinates only.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
DisplacementVector3D(const PositionVector3D< OtherCoords, Tag > &p)
Construct from a position vector expressed in different coordinates but with the same coordinate syst...
Rotation3D::Scalar Scalar
Scalar Dot(const DisplacementVector3D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.