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 mathSSE::Vec2< TMathVector
 
typedef Basic2DVector< TMathVector
 
typedef Vec2< 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 ()
 
 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 (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<typename U >
 Basic2DVector (const Basic2DVector< U > &p)
 
template<class Other >
 Basic2DVector (const Other &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...
 
 Basic2DVector (const T &x, const T &y)
 construct from cartesian coordinates More...
 
 Basic2DVector (const T &x, const T &y)
 construct from cartesian coordinates More...
 
template<typename U >
 Basic2DVector (mathSSE::Vec2< U > const &iv)
 
template<typename U >
 Basic2DVector (mathSSE::Vec4< U > const &iv)
 
 Basic2DVector (MathVector const &iv)
 
template<typename U >
 Basic2DVector (Vec2< U > const &iv)
 
template<typename U >
 Basic2DVector (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...
 
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 > &lh) const
 
template<class U >
PreciseFloatType< T, U >::Type cross (const Basic2DVector< U > &lh) const
 
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...
 
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 > &lh) const
 
template<class U >
PreciseFloatType< T, U >::Type dot (const Basic2DVector< U > &lh) const
 
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...
 
MathVectormathVector ()
 
MathVectormathVector ()
 
MathVector const & mathVector () const
 
const MathVectormathVector () const
 
Basic2DVectoroperator*= (const T &t)
 Scaling by a scalar value (multiplication) More...
 
Basic2DVectoroperator*= (T t)
 Scaling by a scalar value (multiplication) More...
 
Basic2DVectoroperator*= (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/= (const T &t)
 Scaling by a scalar value (division) More...
 
Basic2DVectoroperator/= (T t)
 Scaling by a scalar value (division) More...
 
Basic2DVectoroperator/= (T t)
 Scaling by a scalar value (division) More...
 
Toperator[] (int i)
 
Toperator[] (int i)
 
Toperator[] (int i)
 
T operator[] (int i) const
 
T operator[] (int i) const
 
T operator[] (int i) const
 
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

mathSSE::Vec2< Tv
 
Vec2< Tv
 

Private Attributes

T theX
 
T theY
 

Detailed Description

template<class T>
class Basic2DVector< T >

Definition at line 15 of file extBasic2DVector.h.

Member Typedef Documentation

◆ MathVector [1/3]

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

Definition at line 17 of file sseBasic2DVector.h.

◆ MathVector [2/3]

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

Definition at line 19 of file oldBasic2DVector.h.

◆ MathVector [3/3]

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

Definition at line 20 of file extBasic2DVector.h.

◆ Polar [1/3]

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

Definition at line 18 of file sseBasic2DVector.h.

◆ Polar [2/3]

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

Definition at line 21 of file extBasic2DVector.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 18 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 19 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 27 of file extBasic2DVector.h.

27 : v{0,0} {}

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

◆ 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 30 of file extBasic2DVector.h.

30 : v(p.v) {}

◆ Basic2DVector() [3/19]

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

Definition at line 33 of file extBasic2DVector.h.

33 : v{T(p.v[0]),T(p.v[1])} {}

◆ 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 44 of file extBasic2DVector.h.

44 : v{T(p.x()),T(p.y())} {}

◆ Basic2DVector() [5/19]

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

construct from cartesian coordinates

Definition at line 47 of file extBasic2DVector.h.

47 : v{x,y} {}

◆ Basic2DVector() [6/19]

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

Definition at line 50 of file extBasic2DVector.h.

50 : v(iv){}

◆ Basic2DVector() [7/19]

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

Definition at line 52 of file extBasic2DVector.h.

52 : 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 54 of file extBasic2DVector.h.

54 : 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.

28 : theX(0), theY(0) {}

◆ 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.

31  :
32  theX(p.x()), theY(p.y()) {}

◆ 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.

42 : theX(p.x()), theY(p.y()) {}

◆ 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) {}

◆ 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.

27 : v(p.v) {}

◆ Basic2DVector() [15/19]

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

Definition at line 30 of file sseBasic2DVector.h.

30 : v(p.v) {}

◆ 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 40 of file sseBasic2DVector.h.

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

◆ Basic2DVector() [17/19]

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

construct from cartesian coordinates

Definition at line 43 of file sseBasic2DVector.h.

43 : v(x, y) {}

◆ Basic2DVector() [18/19]

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

Definition at line 47 of file sseBasic2DVector.h.

47 : v(iv) {}

◆ Basic2DVector() [19/19]

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

Definition at line 49 of file sseBasic2DVector.h.

49 : 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 76 of file sseBasic2DVector.h.

76 { return std::atan2(y(), x()); }

◆ 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 82 of file extBasic2DVector.h.

82 {return std::atan2(y(),x());}

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

◆ 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 134 of file sseBasic2DVector.h.

134 { return ::cross(v, lh.v); }

◆ 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 140 of file extBasic2DVector.h.

140 { return ::cross2(v,lh.v);}

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

◆ cross() [3/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();}

◆ 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 142 of file sseBasic2DVector.h.

◆ cross() [5/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 148 of file extBasic2DVector.h.

◆ 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  }

◆ 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 120 of file sseBasic2DVector.h.

120 { return ::dot(v, lh.v); }

◆ 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 126 of file extBasic2DVector.h.

126 { return ::dot(v,lh.v);}

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

◆ dot() [3/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();}

◆ 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 128 of file sseBasic2DVector.h.

◆ dot() [5/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 134 of file extBasic2DVector.h.

◆ 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  }

◆ mag() [1/3]

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

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

Definition at line 67 of file sseBasic2DVector.h.

67 { return std::sqrt(mag2()); }

◆ mag() [2/3]

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

◆ 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());}

◆ mag2() [1/3]

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

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

Definition at line 64 of file sseBasic2DVector.h.

64 { return ::dot(v, v); }

◆ mag2() [2/3]

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

◆ 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.

76 { return theX*theX + theY*theY;}

◆ mathVector() [1/4]

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

Definition at line 52 of file sseBasic2DVector.h.

52 { return v; }

◆ mathVector() [2/4]

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

Definition at line 57 of file extBasic2DVector.h.

57 { return v;}

◆ mathVector() [3/4]

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

Definition at line 51 of file sseBasic2DVector.h.

51 { return v; }

◆ mathVector() [4/4]

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

Definition at line 56 of file extBasic2DVector.h.

56 { return v;}

◆ operator*=() [1/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*=() [2/3]

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

Scaling by a scalar value (multiplication)

Definition at line 107 of file sseBasic2DVector.h.

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

◆ operator*=() [3/3]

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

Scaling by a scalar value (multiplication)

Definition at line 113 of file extBasic2DVector.h.

113  {
114  v = v*t;
115  return *this;
116  }

◆ 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 90 of file sseBasic2DVector.h.

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

◆ 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 96 of file extBasic2DVector.h.

96  {
97  v = v + p.v;
98  return *this;
99  }

◆ 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 104 of file sseBasic2DVector.h.

104 { 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 110 of file extBasic2DVector.h.

110 { 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());}

◆ 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 98 of file sseBasic2DVector.h.

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

◆ 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 104 of file extBasic2DVector.h.

104  {
105  v = v - p.v;
106  return *this;
107  }

◆ 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/= ( 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/=() [2/3]

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

Scaling by a scalar value (division)

Definition at line 113 of file sseBasic2DVector.h.

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

◆ operator/=() [3/3]

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

Scaling by a scalar value (division)

Definition at line 119 of file extBasic2DVector.h.

119  {
120  t = T(1)/t;
121  v = v*t;
122  return *this;
123  }

◆ operator[]() [1/6]

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

Definition at line 55 of file sseBasic2DVector.h.

55 { return v[i]; }

◆ operator[]() [2/6]

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

Definition at line 60 of file extBasic2DVector.h.

60 { return v[i];}

◆ operator[]() [3/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 ;}

◆ operator[]() [4/6]

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

Definition at line 54 of file sseBasic2DVector.h.

54 { return v[i]; }

◆ operator[]() [5/6]

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

Definition at line 59 of file extBasic2DVector.h.

59 { return v[i];}

◆ operator[]() [6/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 ;}

◆ phi() [1/3]

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

Definition at line 77 of file sseBasic2DVector.h.

77 { return Geom::Phi<T>(atan2(y(), x())); }

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

◆ phi() [2/3]

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

◆ phi() [3/3]

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

Definition at line 89 of file oldBasic2DVector.h.

89 {return Geom::Phi<T>(atan2(theY,theX));}

Referenced by Particle.Particle::__str__(), and ntupleDataFormat.Track::phiPull().

◆ r() [1/3]

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

Radius, same as mag()

Definition at line 70 of file sseBasic2DVector.h.

70 { return mag(); }

◆ r() [2/3]

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

Radius, same as mag()

Definition at line 76 of file extBasic2DVector.h.

76 { return mag();}

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

◆ 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();}

◆ 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 82 of file sseBasic2DVector.h.

82  {
83  T my_mag = mag();
84  return my_mag == 0 ? *this : *this / my_mag;
85  }

◆ 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 88 of file extBasic2DVector.h.

88  {
89  T my_mag = mag();
90  return my_mag == 0 ? *this : *this / my_mag;
91  }

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

◆ 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  }

◆ 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

Cartesian y coordinate.

Definition at line 61 of file sseBasic2DVector.h.

61 { return v[1]; }

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

◆ y() [2/3]

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

◆ 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>
mathSSE::Vec2<T> Basic2DVector< T >::v

Definition at line 148 of file sseBasic2DVector.h.

◆ v [2/2]

template<class T>
Vec2<T> Basic2DVector< T >::v
dot
T dot(const Basic3DVector &v) const
Scalar product, or "dot" product, with a vector of same type.
Definition: Basic3DVectorLD.h:212
mps_fire.i
i
Definition: mps_fire.py:355
Basic2DVector::theX
T theX
Definition: oldBasic2DVector.h:164
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Basic2DVector::v
Vec2< T > v
Definition: extBasic2DVector.h:156
mathSSE::lh
bool int lh
Definition: SIMDVec.h:20
Basic2DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic2DVector.h:73
Basic2DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic2DVector.h:67
Basic2DVector::cross
T cross(const Basic2DVector &lh) const
Vector product, or "cross" product, with a vector of same type.
Definition: extBasic2DVector.h:140
Basic2DVector::dot
T dot(const Basic2DVector &lh) const
Scalar product, or "dot" product, with a vector of same type.
Definition: extBasic2DVector.h:126
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Basic2DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic2DVector.h:64
mathSSE::Vec4::xy
Vec2< T > xy() const
Definition: SSEVec.h:200
OrderedSet.t
t
Definition: OrderedSet.py:90
Basic2DVector
Definition: extBasic2DVector.h:15
cross
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or "cross" product, with a vector of same type.
Definition: Basic3DVectorLD.h:225
Geom::Phi
Definition: Phi.h:52
PreciseFloatType::Type
double Type
Definition: PreciseFloatType.h:24
T
long double T
Definition: Basic3DVectorLD.h:48
Basic2DVector::mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: extBasic2DVector.h:70
Basic2DVector::Basic2DVector
Basic2DVector()
Definition: extBasic2DVector.h:27
Basic2DVector::theY
T theY
Definition: oldBasic2DVector.h:165
cross2
auto cross2(V1 x, V2 y) -> typename std::remove_reference< decltype(x[0])>::type
Definition: ExtVec.h:102