17 #ifndef ROOT_Math_GenVector_DisplacementVector2D 18 #define ROOT_Math_GenVector_DisplacementVector2D 1 20 #ifndef ROOT_Math_GenVector_Cartesian2D 24 #ifndef ROOT_Math_GenVector_PositionVector2Dfwd 28 #ifndef ROOT_Math_GenVector_GenVectorIO 32 #ifndef ROOT_Math_GenVector_BitReproducible 36 #ifndef ROOT_Math_GenVector_CoordinateSystemTags 65 template <
class CoordSystem,
class Tag = DefaultCoordinateSystemTag >
94 template <
class OtherCoords>
103 template <
class OtherCoords>
112 template <
class ForeignVector>
125 template <
class OtherCoords>
136 template <
class OtherCoords>
139 SetXY(rhs.x(), rhs.y() );
148 template <
class ForeignVector>
150 SetXY( v.x(), v.y() );
291 template<
class OtherCoords >
293 return X()*v.
X() +
Y()*v.
Y();
300 template<
class OtherVector >
301 Scalar
Dot(
const OtherVector &
v)
const {
302 return X()*v.x() +
Y()*v.y();
310 template <
class OtherCoords>
320 template <
class OtherCoords>
403 template <
class OtherCoords,
class OtherTag>
406 template <
class OtherCoords,
class OtherTag>
409 template <
class OtherCoords,
class OtherTag>
413 template <
class OtherCoords,
class OtherTag>
416 template <
class OtherCoords,
class OtherTag>
419 template <
class OtherCoords,
class OtherTag>
422 template<
class OtherCoords,
class OtherTag >
425 template<
class OtherCoords,
class OtherTag >
440 template <
class CoordSystem1,
class CoordSystem2,
class U>
453 template <
class CoordSystem1,
class CoordSystem2,
class U>
468 template <
class CoordSystem,
class U>
486 template<
class char_t,
class traits_t,
class T,
class U >
488 std::basic_ostream<char_t,traits_t> &
489 operator << ( std::basic_ostream<char_t,traits_t> & os
496 v.GetCoordinates(a, b);
515 template<
class char_t,
class traits_t,
class T,
class U >
517 std::basic_istream<char_t,traits_t> &
DisplacementVector2D()
Default constructor.
DisplacementVector2D & operator/=(Scalar a)
divide this vector by a scalar quantity
DisplacementVector2D unit() const
This namespace contains pre-defined functions to be used in conjuction with TExecutor::Map and TExecu...
void GetCoordinates(Scalar &a, Scalar &b) const
get internal data into 2 Scalar numbers.
DisplacementVector2D< CoordSystem, Tag > & SetY(Scalar a)
Change Y - Cartesian2D coordinates only.
CoordSystem Coordinates() const
Retrieve a copy of the coordinates object.
Scalar Mag2() const
Magnitute squared ( r^2 in spherical coordinate)
Scalar Phi() const
Polar phi, 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)
DisplacementVector2D< CoordSystem, Tag > & SetCoordinates(Scalar a, Scalar b)
Set internal data based on 2 Scalar numbers.
Scalar Dot(const DisplacementVector2D< OtherCoords, Tag > &v) const
Return the scalar (dot) product of two displacement vectors.
CoordSystem::Scalar Scalar
DisplacementVector2D(const PositionVector2D< OtherCoords, OtherTag > &)
DisplacementVector2D & operator=(const DisplacementVector2D< OtherCoords, Tag > &v)
Assignment operator from a displacement vector of arbitrary type.
DisplacementVector2D operator-() const
Negative of the vector.
DisplacementVector2D(const DisplacementVector2D< OtherCoords, Tag > &v)
Construct from a displacement vector expressed in different coordinates, or using a different Scalar ...
Scalar Dot(const OtherVector &v) const
Return the scalar (dot) product of two vectors.
Scalar X() const
Cartesian X, converting if necessary from internal coordinate system.
void Rotate(Scalar angle)
Rotate by an angle.
char_t get_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m)
Scalar Y() const
Cartesian Y, converting if necessary from internal coordinate system.
Scalar R() const
Polar R, converting if necessary from internal coordinate system.
DisplacementVector2D & operator+=(const DisplacementVector2D< OtherCoords, Tag > &v)
Self Addition with a displacement vector.
CoordSystem CoordinateType
DisplacementVector2D(const PositionVector2D< OtherCoords, Tag > &p)
Construct from a position vector expressed in different coordinates but with the same coordinate syst...
DisplacementVector2D< CoordSystem, Tag > & SetR(Scalar a)
Change R - Polar2D coordinates only.
Class describing a generic position vector (point) in 2 dimensions.
DisplacementVector2D(const DisplacementVector2D< OtherCoords, OtherTag > &)
DisplacementVector2D operator*(Scalar a) const
Multiply a vector by a real number.
DisplacementVector2D< CoordSystem, Tag > & SetX(Scalar a)
Change X - Cartesian2D coordinates only.
DisplacementVector2D Cross(const DisplacementVector2D< OtherCoords, OtherTag > &) const
bool operator==(const DisplacementVector2D &rhs) const
Exact equality.
DisplacementVector2D< CoordSystem, Tag > & SetXY(Scalar a, Scalar b)
set the values of the vector from the cartesian components (x,y) (if the vector is held in polar coor...
DisplacementVector2D< CoordSystem, Tag > & SetPhi(Scalar ang)
Change Phi - Polar2D coordinates.
Class describing a 2D cartesian coordinate system (x, y coordinates)
DisplacementVector2D Unit() const
return unit vector parallel to this
void set_manip(std::basic_ios< char_t, traits_t > &ios, manip_t m, char_t ch)
Namespace for new Math classes and functions.
std::basic_istream< char_t, traits_t > & require_delim(std::basic_istream< char_t, traits_t > &is, manip_t m)
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
DisplacementVector2D(Scalar a, Scalar b)
Construct from three values of type Scalar.
DisplacementVector2D(const ForeignVector &v)
Construct from a foreign 2D vector type, for example, Hep2Vector Precondition: v must implement metho...
DisplacementVector2D & operator*=(Scalar a)
multiply this vector by a scalar quantity
DisplacementVector2D operator+() const
Positive of the vector, return itself.
bool operator!=(const DisplacementVector2D &rhs) const
DisplacementVector2D & operator-=(const DisplacementVector2D< OtherCoords, Tag > &v)
Self Difference with a displacement vector.
Class describing a generic displacement vector in 2 dimensions.
DisplacementVector2D operator/(Scalar a) const
Division of a vector with a real number.