CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Public Attributes | Private Attributes
Basic2DVector< T > Class Template Reference

#include <extBasic2DVector.h>

Public Types

typedef Vec2< TMathVector
 
typedef mathSSE::Vec2< TMathVector
 
typedef Basic2DVector< TMathVector
 
typedef Geom::Polar2Cartesian< TPolar
 
typedef Geom::Polar2Cartesian< TPolar
 
typedef Geom::Polar2Cartesian< TPolar
 
typedef T ScalarType
 
typedef T ScalarType
 
typedef T ScalarType
 
typedef mathSSE::Vec2< TVectorType
 
typedef Vec2< TVectorType
 

Public Member Functions

T barePhi () const
 
T barePhi () const
 
T barePhi () const
 
 Basic2DVector ()
 
 Basic2DVector ()
 
 Basic2DVector (const Basic2DVector &p)
 Copy constructor from same type. Should not be needed but for gcc bug 12685. More...
 
 Basic2DVector (const Basic2DVector &p)
 Copy constructor from same type. Should not be needed but for gcc bug 12685. More...
 
 Basic2DVector ()
 
template<typename U >
 Basic2DVector (const Basic2DVector< U > &p)
 
 Basic2DVector (const Basic2DVector &p)
 Copy constructor from same type. Should not be needed but for gcc bug 12685. More...
 
template<typename U >
 Basic2DVector (const Basic2DVector< U > &p)
 
template<class Other >
 Basic2DVector (const Other &p)
 
template<class Other >
 Basic2DVector (const Other &p)
 
 Basic2DVector (const T &x, const T &y)
 construct from cartesian coordinates More...
 
template<class Other >
 Basic2DVector (const Other &p)
 
 Basic2DVector (const T &x, const T &y)
 construct from cartesian coordinates More...
 
 Basic2DVector (MathVector const &iv)
 
 Basic2DVector (const T &x, const T &y)
 construct from cartesian coordinates More...
 
template<typename U >
 Basic2DVector (Vec2< U > const &iv)
 
template<typename U >
 Basic2DVector (Vec4< U > const &iv)
 
template<typename U >
 Basic2DVector (mathSSE::Vec2< U > const &iv)
 
template<typename U >
 Basic2DVector (mathSSE::Vec4< U > const &iv)
 
T cross (const Basic2DVector &lh) const
 Vector product, or "cross" product, with a vector of same type. More...
 
T cross (const Basic2DVector &lh) const
 Vector product, or "cross" product, with a vector of same type. More...
 
template<class U >
PreciseFloatType< T, U >::Type cross (const Basic2DVector< U > &lh) const
 
template<class U >
PreciseFloatType< T, U >::Type cross (const Basic2DVector< U > &lh) const
 
T cross (const Basic2DVector &v) const
 Vector product, or "cross" product, with a vector of same type. More...
 
template<class U >
PreciseFloatType< T, U >::Type cross (const Basic2DVector< U > &v) const
 
T dot (const Basic2DVector &lh) const
 Scalar product, or "dot" product, with a vector of same type. More...
 
T dot (const Basic2DVector &lh) const
 Scalar product, or "dot" product, with a vector of same type. More...
 
template<class U >
PreciseFloatType< T, U >::Type dot (const Basic2DVector< U > &lh) const
 
template<class U >
PreciseFloatType< T, U >::Type dot (const Basic2DVector< U > &lh) const
 
T dot (const Basic2DVector &v) const
 Scalar product, or "dot" product, with a vector of same type. More...
 
template<class U >
PreciseFloatType< T, U >::Type dot (const Basic2DVector< U > &v) const
 
T mag () const
 The vector magnitude. Equivalent to sqrt(vec.mag2()) More...
 
T mag () const
 The vector magnitude. Equivalent to sqrt(vec.mag2()) More...
 
T mag () const
 The vector magnitude. Equivalent to sqrt(vec.mag2()) More...
 
T mag2 () const
 The vector magnitude squared. Equivalent to vec.dot(vec) More...
 
T mag2 () const
 The vector magnitude squared. Equivalent to vec.dot(vec) More...
 
T mag2 () const
 The vector magnitude squared. Equivalent to vec.dot(vec) More...
 
MathVector const & mathVector () const
 
MathVectormathVector ()
 
MathVector const & mathVector () const
 
MathVectormathVector ()
 
Basic2DVectoroperator*= (T t)
 Scaling by a scalar value (multiplication) More...
 
Basic2DVectoroperator*= (T t)
 Scaling by a scalar value (multiplication) More...
 
Basic2DVectoroperator*= (const T &t)
 Scaling by a scalar value (multiplication) More...
 
template<class U >
Basic2DVectoroperator+= (const Basic2DVector< U > &p)
 
template<class U >
Basic2DVectoroperator+= (const Basic2DVector< U > &p)
 
template<class U >
Basic2DVectoroperator+= (const Basic2DVector< U > &p)
 
Basic2DVector operator- () const
 Unary minus, returns a vector with components (-x(),-y(),-z()) More...
 
Basic2DVector operator- () const
 Unary minus, returns a vector with components (-x(),-y(),-z()) More...
 
Basic2DVector operator- () const
 Unary minus, returns a vector with components (-x(),-y(),-z()) More...
 
template<class U >
Basic2DVectoroperator-= (const Basic2DVector< U > &p)
 
template<class U >
Basic2DVectoroperator-= (const Basic2DVector< U > &p)
 
template<class U >
Basic2DVectoroperator-= (const Basic2DVector< U > &p)
 
Basic2DVectoroperator/= (T t)
 Scaling by a scalar value (division) More...
 
Basic2DVectoroperator/= (T t)
 Scaling by a scalar value (division) More...
 
Basic2DVectoroperator/= (const T &t)
 Scaling by a scalar value (division) More...
 
Basic2DVectoroperator= (const Basic2DVector &)=default
 Assignment operator. More...
 
T operator[] (int i) const
 
Toperator[] (int i)
 
T operator[] (int i) const
 
Toperator[] (int i)
 
T operator[] (int i) const
 
Toperator[] (int i)
 
Geom::Phi< Tphi () const
 
Geom::Phi< Tphi () const
 
Geom::Phi< Tphi () const
 
T r () const
 Radius, same as mag() More...
 
T r () const
 Radius, same as mag() More...
 
T r () const
 Radius, same as mag() More...
 
Basic2DVector unit () const
 
Basic2DVector unit () const
 
Basic2DVector unit () const
 
T x () const
 Cartesian x coordinate. More...
 
T x () const
 Cartesian x coordinate. More...
 
T x () const
 Cartesian x coordinate. More...
 
T y () const
 Cartesian y coordinate. More...
 
T y () const
 Cartesian y coordinate. More...
 
T y () const
 Cartesian y coordinate. More...
 

Public Attributes

Vec2< Tv
 
mathSSE::Vec2< Tv
 

Private Attributes

T theX
 
T theY
 

Detailed Description

template<class T>
class Basic2DVector< T >

Definition at line 13 of file extBasic2DVector.h.

Member Typedef Documentation

◆ MathVector [1/3]

template<class T>
typedef Vec2<T> Basic2DVector< T >::MathVector

Definition at line 17 of file extBasic2DVector.h.

◆ MathVector [2/3]

template<class T>
typedef mathSSE::Vec2<T> Basic2DVector< T >::MathVector

Definition at line 17 of file sseBasic2DVector.h.

◆ MathVector [3/3]

template<class T>
typedef Basic2DVector<T> Basic2DVector< T >::MathVector

Definition at line 19 of file oldBasic2DVector.h.

◆ Polar [1/3]

template<class T>
typedef Geom::Polar2Cartesian<T> Basic2DVector< T >::Polar

Definition at line 18 of file extBasic2DVector.h.

◆ Polar [2/3]

template<class T>
typedef Geom::Polar2Cartesian<T> Basic2DVector< T >::Polar

Definition at line 18 of file sseBasic2DVector.h.

◆ Polar [3/3]

template<class T>
typedef Geom::Polar2Cartesian<T> Basic2DVector< T >::Polar

Definition at line 22 of file oldBasic2DVector.h.

◆ ScalarType [1/3]

template<class T>
typedef T Basic2DVector< T >::ScalarType

Definition at line 15 of file sseBasic2DVector.h.

◆ ScalarType [2/3]

template<class T>
typedef T Basic2DVector< T >::ScalarType

Definition at line 15 of file extBasic2DVector.h.

◆ ScalarType [3/3]

template<class T>
typedef T Basic2DVector< T >::ScalarType

Definition at line 21 of file oldBasic2DVector.h.

◆ VectorType [1/2]

template<class T>
typedef mathSSE::Vec2<T> Basic2DVector< T >::VectorType

Definition at line 16 of file sseBasic2DVector.h.

◆ VectorType [2/2]

template<class T>
typedef Vec2<T> Basic2DVector< T >::VectorType

Definition at line 16 of file extBasic2DVector.h.

Constructor & Destructor Documentation

◆ Basic2DVector() [1/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( )
inline

default constructor uses default constructor of T to initialize the components. For built-in floating-point types this means initialization to zero

Definition at line 24 of file extBasic2DVector.h.

Referenced by Basic2DVector< float >::operator-().

24 : v{0, 0} {}

◆ Basic2DVector() [2/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( const Basic2DVector< T > &  p)
inline

Copy constructor from same type. Should not be needed but for gcc bug 12685.

Definition at line 27 of file extBasic2DVector.h.

◆ Basic2DVector() [3/19]

template<class T>
template<typename U >
Basic2DVector< T >::Basic2DVector ( const Basic2DVector< U > &  p)
inline

Definition at line 30 of file extBasic2DVector.h.

30 : v{T(p.v[0]), T(p.v[1])} {}
long double T

◆ Basic2DVector() [4/19]

template<class T>
template<class Other >
Basic2DVector< T >::Basic2DVector ( const Other &  p)
inlineexplicit

Explicit constructor from other (possibly unrelated) vector classes The only constraint on the argument type is that it has methods x() and y(), and that these methods return a type convertible to T. Examples of use are
construction from a Basic2DVector with different precision
construction from a coordinate system converter

Definition at line 40 of file extBasic2DVector.h.

40 : v{T(p.x()), T(p.y())} {}
long double T

◆ Basic2DVector() [5/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( const T x,
const T y 
)
inline

construct from cartesian coordinates

Definition at line 43 of file extBasic2DVector.h.

43 : v{x, y} {}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ Basic2DVector() [6/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( MathVector const &  iv)
inline

Definition at line 46 of file extBasic2DVector.h.

◆ Basic2DVector() [7/19]

template<class T>
template<typename U >
Basic2DVector< T >::Basic2DVector ( Vec2< U > const &  iv)
inline

Definition at line 48 of file extBasic2DVector.h.

48 : v{iv[0], iv[1]} {}

◆ Basic2DVector() [8/19]

template<class T>
template<typename U >
Basic2DVector< T >::Basic2DVector ( Vec4< U > const &  iv)
inline

Definition at line 50 of file extBasic2DVector.h.

50 : v{iv[0], iv[1]} {}

◆ Basic2DVector() [9/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( )
inline

default constructor uses default constructor of T to initialize the components. For built-in floating-point types this means initialization to zero

Definition at line 28 of file oldBasic2DVector.h.

◆ Basic2DVector() [10/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( const Basic2DVector< T > &  p)
inline

Copy constructor from same type. Should not be needed but for gcc bug 12685.

Definition at line 31 of file oldBasic2DVector.h.

◆ Basic2DVector() [11/19]

template<class T>
template<class Other >
Basic2DVector< T >::Basic2DVector ( const Other &  p)
inlineexplicit

Explicit constructor from other (possibly unrelated) vector classes The only constraint on the argument type is that it has methods x() and y(), and that these methods return a type convertible to T. Examples of use are
construction from a Basic2DVector with different precision
construction from a coordinate system converter

Definition at line 42 of file oldBasic2DVector.h.

◆ Basic2DVector() [12/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( const T x,
const T y 
)
inline

construct from cartesian coordinates

Definition at line 45 of file oldBasic2DVector.h.

45 : theX(x), theY(y) {}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ Basic2DVector() [13/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( )
inline

default constructor uses default constructor of T to initialize the components. For built-in floating-point types this means initialization to zero

Definition at line 24 of file sseBasic2DVector.h.

24 {}

◆ Basic2DVector() [14/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( const Basic2DVector< T > &  p)
inline

Copy constructor from same type. Should not be needed but for gcc bug 12685.

Definition at line 27 of file sseBasic2DVector.h.

◆ Basic2DVector() [15/19]

template<class T>
template<typename U >
Basic2DVector< T >::Basic2DVector ( const Basic2DVector< U > &  p)
inline

Definition at line 33 of file sseBasic2DVector.h.

◆ Basic2DVector() [16/19]

template<class T>
template<class Other >
Basic2DVector< T >::Basic2DVector ( const Other &  p)
inlineexplicit

Explicit constructor from other (possibly unrelated) vector classes The only constraint on the argument type is that it has methods x() and y(), and that these methods return a type convertible to T. Examples of use are
construction from a Basic2DVector with different precision
construction from a coordinate system converter

Definition at line 43 of file sseBasic2DVector.h.

◆ Basic2DVector() [17/19]

template<class T>
Basic2DVector< T >::Basic2DVector ( const T x,
const T y 
)
inline

construct from cartesian coordinates

Definition at line 46 of file sseBasic2DVector.h.

46 : v(x, y) {}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ Basic2DVector() [18/19]

template<class T>
template<typename U >
Basic2DVector< T >::Basic2DVector ( mathSSE::Vec2< U > const &  iv)
inline

Definition at line 50 of file sseBasic2DVector.h.

◆ Basic2DVector() [19/19]

template<class T>
template<typename U >
Basic2DVector< T >::Basic2DVector ( mathSSE::Vec4< U > const &  iv)
inline

Definition at line 52 of file sseBasic2DVector.h.

52 : v(iv.xy()) {}

Member Function Documentation

◆ barePhi() [1/3]

template<class T>
T Basic2DVector< T >::barePhi ( ) const
inline

Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. Same precision as the system atan2(x,y) function. The return type is Geom::Phi<T>, see it's documentation.

Definition at line 77 of file extBasic2DVector.h.

Referenced by PV2DBase< double, PointTag, LocalTag >::barePhi().

77 { return std::atan2(y(), x()); }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ barePhi() [2/3]

template<class T>
T Basic2DVector< T >::barePhi ( ) const
inline

Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. Same precision as the system atan2(x,y) function. The return type is Geom::Phi<T>, see it's documentation.

Definition at line 79 of file sseBasic2DVector.h.

79 { return std::atan2(y(), x()); }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ barePhi() [3/3]

template<class T>
T Basic2DVector< T >::barePhi ( ) const
inline

Azimuthal angle. The value is returned in radians, in the range (-pi,pi]. Same precision as the system atan2(x,y) function. The return type is Geom::Phi<T>, see it's documentation.

Definition at line 88 of file oldBasic2DVector.h.

88 {return std::atan2(theY,theX);}

◆ cross() [1/6]

template<class T>
T Basic2DVector< T >::cross ( const Basic2DVector< T > &  lh) const
inline

Vector product, or "cross" product, with a vector of same type.

Definition at line 135 of file extBasic2DVector.h.

Referenced by Basic2DVector< float >::cross().

135 { return ::cross2(v, lh.v); }
auto cross2(V1 x, V2 y) -> typename std::remove_reference< decltype(x[0])>::type
Definition: ExtVec.h:98
bool int lh
Definition: SIMDVec.h:20

◆ cross() [2/6]

template<class T>
T Basic2DVector< T >::cross ( const Basic2DVector< T > &  lh) const
inline

Vector product, or "cross" product, with a vector of same type.

Definition at line 137 of file sseBasic2DVector.h.

137 { return ::cross(v, lh.v); }
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
bool int lh
Definition: SIMDVec.h:20

◆ cross() [3/6]

template<class T>
template<class U >
PreciseFloatType<T, U>::Type Basic2DVector< T >::cross ( const Basic2DVector< U > &  lh) const
inline

Vector (or cross) product with a vector of different precision. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.

Definition at line 143 of file extBasic2DVector.h.

143  {
146  }
bool int lh
Definition: SIMDVec.h:20
T cross(const Basic2DVector &lh) const
Vector product, or "cross" product, with a vector of same type.

◆ cross() [4/6]

template<class T>
template<class U >
PreciseFloatType<T, U>::Type Basic2DVector< T >::cross ( const Basic2DVector< U > &  lh) const
inline

Vector (or cross) product with a vector of different precision. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.

Definition at line 145 of file sseBasic2DVector.h.

145  {
148  }
bool int lh
Definition: SIMDVec.h:20
T cross(const Basic2DVector &lh) const
Vector product, or "cross" product, with a vector of same type.

◆ cross() [5/6]

template<class T>
T Basic2DVector< T >::cross ( const Basic2DVector< T > &  v) const
inline

Vector product, or "cross" product, with a vector of same type.

Definition at line 150 of file oldBasic2DVector.h.

150 { return x()*v.y() - y()*v.x();}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ cross() [6/6]

template<class T>
template<class U >
PreciseFloatType<T,U>::Type Basic2DVector< T >::cross ( const Basic2DVector< U > &  v) const
inline

Vector (or cross) product with a vector of different precision. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.

Definition at line 158 of file oldBasic2DVector.h.

158  {
159  return x()*v.y() - y()*v.x();
160  }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ dot() [1/6]

template<class T>
T Basic2DVector< T >::dot ( const Basic2DVector< T > &  lh) const
inline

Scalar product, or "dot" product, with a vector of same type.

Definition at line 121 of file extBasic2DVector.h.

Referenced by Vector2DBase< float, GlobalTag >::dot(), Basic2DVector< float >::dot(), and InnerDeltaPhi::phiRange().

121 { return ::dot(v, lh.v); }
bool int lh
Definition: SIMDVec.h:20
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.

◆ dot() [2/6]

template<class T>
T Basic2DVector< T >::dot ( const Basic2DVector< T > &  lh) const
inline

Scalar product, or "dot" product, with a vector of same type.

Definition at line 123 of file sseBasic2DVector.h.

123 { return ::dot(v, lh.v); }
bool int lh
Definition: SIMDVec.h:20
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.

◆ dot() [3/6]

template<class T>
template<class U >
PreciseFloatType<T, U>::Type Basic2DVector< T >::dot ( const Basic2DVector< U > &  lh) const
inline

Scalar (or dot) product with a vector of different precision. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.

Definition at line 129 of file extBasic2DVector.h.

129  {
132  }
bool int lh
Definition: SIMDVec.h:20
T dot(const Basic2DVector &lh) const
Scalar product, or "dot" product, with a vector of same type.

◆ dot() [4/6]

template<class T>
template<class U >
PreciseFloatType<T, U>::Type Basic2DVector< T >::dot ( const Basic2DVector< U > &  lh) const
inline

Scalar (or dot) product with a vector of different precision. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.

Definition at line 131 of file sseBasic2DVector.h.

131  {
134  }
bool int lh
Definition: SIMDVec.h:20
T dot(const Basic2DVector &lh) const
Scalar product, or "dot" product, with a vector of same type.

◆ dot() [5/6]

template<class T>
T Basic2DVector< T >::dot ( const Basic2DVector< T > &  v) const
inline

Scalar product, or "dot" product, with a vector of same type.

Definition at line 135 of file oldBasic2DVector.h.

135 { return x()*v.x() + y()*v.y();}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ dot() [6/6]

template<class T>
template<class U >
PreciseFloatType<T,U>::Type Basic2DVector< T >::dot ( const Basic2DVector< U > &  v) const
inline

Scalar (or dot) product with a vector of different precision. The product is computed without loss of precision. The type of the returned scalar is the more precise of the scalar types of the two vectors.

Definition at line 143 of file oldBasic2DVector.h.

143  {
144  return x()*v.x() + y()*v.y();
145  }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ mag() [1/3]

template<class T>
T Basic2DVector< T >::mag ( ) const
inline

◆ mag() [2/3]

template<class T>
T Basic2DVector< T >::mag ( ) const
inline

The vector magnitude. Equivalent to sqrt(vec.mag2())

Definition at line 70 of file sseBasic2DVector.h.

70 { return std::sqrt(mag2()); }
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T sqrt(T t)
Definition: SSEVec.h:19

◆ mag() [3/3]

template<class T>
T Basic2DVector< T >::mag ( ) const
inline

The vector magnitude. Equivalent to sqrt(vec.mag2())

Definition at line 79 of file oldBasic2DVector.h.

79 { return std::sqrt( mag2());}
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
T sqrt(T t)
Definition: SSEVec.h:19

◆ mag2() [1/3]

template<class T>
T Basic2DVector< T >::mag2 ( ) const
inline

◆ mag2() [2/3]

template<class T>
T Basic2DVector< T >::mag2 ( ) const
inline

The vector magnitude squared. Equivalent to vec.dot(vec)

Definition at line 67 of file sseBasic2DVector.h.

67 { return ::dot(v, v); }
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.

◆ mag2() [3/3]

template<class T>
T Basic2DVector< T >::mag2 ( ) const
inline

The vector magnitude squared. Equivalent to vec.dot(vec)

Definition at line 76 of file oldBasic2DVector.h.

◆ mathVector() [1/4]

template<class T>
MathVector const& Basic2DVector< T >::mathVector ( ) const
inline

Definition at line 52 of file extBasic2DVector.h.

52 { return v; }

◆ mathVector() [2/4]

template<class T>
MathVector& Basic2DVector< T >::mathVector ( )
inline

Definition at line 53 of file extBasic2DVector.h.

53 { return v; }

◆ mathVector() [3/4]

template<class T>
MathVector const& Basic2DVector< T >::mathVector ( ) const
inline

Definition at line 54 of file sseBasic2DVector.h.

54 { return v; }

◆ mathVector() [4/4]

template<class T>
MathVector& Basic2DVector< T >::mathVector ( )
inline

Definition at line 55 of file sseBasic2DVector.h.

55 { return v; }

◆ operator*=() [1/3]

template<class T>
Basic2DVector& Basic2DVector< T >::operator*= ( T  t)
inline

Scaling by a scalar value (multiplication)

Definition at line 108 of file extBasic2DVector.h.

108  {
109  v = v * t;
110  return *this;
111  }

◆ operator*=() [2/3]

template<class T>
Basic2DVector& Basic2DVector< T >::operator*= ( T  t)
inline

Scaling by a scalar value (multiplication)

Definition at line 110 of file sseBasic2DVector.h.

110  {
111  v = v * t;
112  return *this;
113  }

◆ operator*=() [3/3]

template<class T>
Basic2DVector& Basic2DVector< T >::operator*= ( const T t)
inline

Scaling by a scalar value (multiplication)

Definition at line 121 of file oldBasic2DVector.h.

121  {
122  theX *= t;
123  theY *= t;
124  return *this;
125  }

◆ operator+=() [1/3]

template<class T>
template<class U >
Basic2DVector& Basic2DVector< T >::operator+= ( const Basic2DVector< U > &  p)
inline

Operator += with a Basic2DVector of possibly different precision.

Definition at line 91 of file extBasic2DVector.h.

91  {
92  v = v + p.v;
93  return *this;
94  }

◆ operator+=() [2/3]

template<class T>
template<class U >
Basic2DVector& Basic2DVector< T >::operator+= ( const Basic2DVector< U > &  p)
inline

Operator += with a Basic2DVector of possibly different precision.

Definition at line 93 of file sseBasic2DVector.h.

93  {
94  v = v + p.v;
95  return *this;
96  }

◆ operator+=() [3/3]

template<class T>
template<class U >
Basic2DVector& Basic2DVector< T >::operator+= ( const Basic2DVector< U > &  p)
inline

Operator += with a Basic2DVector of possibly different precision.

Definition at line 102 of file oldBasic2DVector.h.

102  {
103  theX += p.x();
104  theY += p.y();
105  return *this;
106  }

◆ operator-() [1/3]

template<class T>
Basic2DVector Basic2DVector< T >::operator- ( ) const
inline

Unary minus, returns a vector with components (-x(),-y(),-z())

Definition at line 105 of file extBasic2DVector.h.

105 { return Basic2DVector(-v); }

◆ operator-() [2/3]

template<class T>
Basic2DVector Basic2DVector< T >::operator- ( ) const
inline

Unary minus, returns a vector with components (-x(),-y(),-z())

Definition at line 107 of file sseBasic2DVector.h.

107 { return Basic2DVector(-v); }

◆ operator-() [3/3]

template<class T>
Basic2DVector Basic2DVector< T >::operator- ( ) const
inline

Unary minus, returns a vector with components (-x(),-y(),-z())

Definition at line 118 of file oldBasic2DVector.h.

118 { return Basic2DVector(-x(),-y());}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.

◆ operator-=() [1/3]

template<class T>
template<class U >
Basic2DVector& Basic2DVector< T >::operator-= ( const Basic2DVector< U > &  p)
inline

Operator -= with a Basic2DVector of possibly different precision.

Definition at line 99 of file extBasic2DVector.h.

99  {
100  v = v - p.v;
101  return *this;
102  }

◆ operator-=() [2/3]

template<class T>
template<class U >
Basic2DVector& Basic2DVector< T >::operator-= ( const Basic2DVector< U > &  p)
inline

Operator -= with a Basic2DVector of possibly different precision.

Definition at line 101 of file sseBasic2DVector.h.

101  {
102  v = v - p.v;
103  return *this;
104  }

◆ operator-=() [3/3]

template<class T>
template<class U >
Basic2DVector& Basic2DVector< T >::operator-= ( const Basic2DVector< U > &  p)
inline

Operator -= with a Basic2DVector of possibly different precision.

Definition at line 111 of file oldBasic2DVector.h.

111  {
112  theX -= p.x();
113  theY -= p.y();
114  return *this;
115  }

◆ operator/=() [1/3]

template<class T>
Basic2DVector& Basic2DVector< T >::operator/= ( T  t)
inline

Scaling by a scalar value (division)

Definition at line 114 of file extBasic2DVector.h.

114  {
115  t = T(1) / t;
116  v = v * t;
117  return *this;
118  }
long double T

◆ operator/=() [2/3]

template<class T>
Basic2DVector& Basic2DVector< T >::operator/= ( T  t)
inline

Scaling by a scalar value (division)

Definition at line 116 of file sseBasic2DVector.h.

116  {
117  t = T(1) / t;
118  v = v * t;
119  return *this;
120  }
long double T

◆ operator/=() [3/3]

template<class T>
Basic2DVector& Basic2DVector< T >::operator/= ( const T t)
inline

Scaling by a scalar value (division)

Definition at line 128 of file oldBasic2DVector.h.

128  {
129  theX /= t;
130  theY /= t;
131  return *this;
132  }

◆ operator=()

template<class T>
Basic2DVector& Basic2DVector< T >::operator= ( const Basic2DVector< T > &  )
default

Assignment operator.

◆ operator[]() [1/6]

template<class T>
T Basic2DVector< T >::operator[] ( int  i) const
inline

Definition at line 55 of file extBasic2DVector.h.

55 { return v[i]; }

◆ operator[]() [2/6]

template<class T>
T& Basic2DVector< T >::operator[] ( int  i)
inline

Definition at line 56 of file extBasic2DVector.h.

56 { return v[i]; }

◆ operator[]() [3/6]

template<class T>
T Basic2DVector< T >::operator[] ( int  i) const
inline

Definition at line 57 of file sseBasic2DVector.h.

57 { return v[i]; }

◆ operator[]() [4/6]

template<class T>
T& Basic2DVector< T >::operator[] ( int  i)
inline

Definition at line 58 of file sseBasic2DVector.h.

58 { return v[i]; }

◆ operator[]() [5/6]

template<class T>
T Basic2DVector< T >::operator[] ( int  i) const
inline

Definition at line 66 of file oldBasic2DVector.h.

66 { return i==0 ? theX : theY ;}

◆ operator[]() [6/6]

template<class T>
T& Basic2DVector< T >::operator[] ( int  i)
inline

Definition at line 67 of file oldBasic2DVector.h.

67 { return i==0 ? theX : theY ;}

◆ phi() [1/3]

template<class T>
Geom::Phi<T> Basic2DVector< T >::phi ( ) const
inline

◆ phi() [2/3]

template<class T>
Geom::Phi<T> Basic2DVector< T >::phi ( ) const
inline

Definition at line 80 of file sseBasic2DVector.h.

Referenced by Particle.Particle::__str__(), datamodel.Object::DeltaR(), datamodel.Object::p4(), and ntupleDataFormat.Track::phiPull().

80 { return Geom::Phi<T>(atan2(y(), x())); }
T y() const
Cartesian y coordinate.
Definition: Phi.h:52
T x() const
Cartesian x coordinate.

◆ phi() [3/3]

template<class T>
Geom::Phi<T> Basic2DVector< T >::phi ( ) const
inline

◆ r() [1/3]

template<class T>
T Basic2DVector< T >::r ( ) const
inline

Radius, same as mag()

Definition at line 71 of file extBasic2DVector.h.

Referenced by PixelTripletLargeTipGenerator::hitTriplets(), and PV2DBase< double, PointTag, LocalTag >::r().

71 { return mag(); }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())

◆ r() [2/3]

template<class T>
T Basic2DVector< T >::r ( ) const
inline

Radius, same as mag()

Definition at line 73 of file sseBasic2DVector.h.

73 { return mag(); }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())

◆ r() [3/3]

template<class T>
T Basic2DVector< T >::r ( ) const
inline

Radius, same as mag()

Definition at line 82 of file oldBasic2DVector.h.

82 { return mag();}
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())

◆ unit() [1/3]

template<class T>
Basic2DVector Basic2DVector< T >::unit ( ) const
inline

Unit vector parallel to this. If mag() is zero, a zero vector is returned.

Definition at line 83 of file extBasic2DVector.h.

Referenced by InnerDeltaPhi::phiRange(), and TkRotation2D< Scalar >::TkRotation2D().

83  {
84  T my_mag = mag();
85  return my_mag == 0 ? *this : *this / my_mag;
86  }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
long double T

◆ unit() [2/3]

template<class T>
Basic2DVector Basic2DVector< T >::unit ( ) const
inline

Unit vector parallel to this. If mag() is zero, a zero vector is returned.

Definition at line 85 of file sseBasic2DVector.h.

85  {
86  T my_mag = mag();
87  return my_mag == 0 ? *this : *this / my_mag;
88  }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
long double T

◆ unit() [3/3]

template<class T>
Basic2DVector Basic2DVector< T >::unit ( ) const
inline

Unit vector parallel to this. If mag() is zero, a zero vector is returned.

Definition at line 94 of file oldBasic2DVector.h.

94  {
95  T my_mag = mag();
96  return my_mag == 0 ? *this : *this / my_mag;
97  }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
long double T

◆ x() [1/3]

template<class T>
T Basic2DVector< T >::x ( ) const
inline

◆ x() [2/3]

template<class T>
T Basic2DVector< T >::x ( ) const
inline

◆ x() [3/3]

template<class T>
T Basic2DVector< T >::x ( ) const
inline

◆ y() [1/3]

template<class T>
T Basic2DVector< T >::y ( ) const
inline

◆ y() [2/3]

template<class T>
T Basic2DVector< T >::y ( ) const
inline

Cartesian y coordinate.

Definition at line 64 of file sseBasic2DVector.h.

Referenced by svgfig.Ellipse::__repr__(), geometryXMLparser.Alignable::pos(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

64 { return v[1]; }

◆ y() [3/3]

template<class T>
T Basic2DVector< T >::y ( ) const
inline

Member Data Documentation

◆ theX

template<class T>
T Basic2DVector< T >::theX
private

◆ theY

template<class T>
T Basic2DVector< T >::theY
private

◆ v [1/2]

template<class T>
Vec2<T> Basic2DVector< T >::v

◆ v [2/2]

template<class T>
mathSSE::Vec2<T> Basic2DVector< T >::v

Definition at line 151 of file sseBasic2DVector.h.