CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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)
 
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<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...
 
 Basic2DVector (MathVector const &iv)
 
template<typename U >
 Basic2DVector (mathSSE::Vec2< U > const &iv)
 
template<typename U >
 Basic2DVector (Vec2< U > const &iv)
 
template<typename U >
 Basic2DVector (mathSSE::Vec4< 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...
 
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
 
MathVector const & mathVector () const
 
MathVectormathVector ()
 
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...
 
T operator[] (int i) const
 
T operator[] (int i) const
 
Toperator[] (int i)
 
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

mathSSE::Vec2< Tv
 
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

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

Definition at line 17 of file extBasic2DVector.h.

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

Definition at line 17 of file sseBasic2DVector.h.

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

Definition at line 19 of file oldBasic2DVector.h.

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

Definition at line 18 of file extBasic2DVector.h.

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

Definition at line 18 of file sseBasic2DVector.h.

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

Definition at line 22 of file oldBasic2DVector.h.

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

Definition at line 15 of file sseBasic2DVector.h.

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

Definition at line 15 of file extBasic2DVector.h.

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

Definition at line 21 of file oldBasic2DVector.h.

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

Definition at line 16 of file sseBasic2DVector.h.

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

Definition at line 16 of file extBasic2DVector.h.

Constructor & Destructor Documentation

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} {}
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.

27 : v(p.v) {}
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
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
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.
template<class T>
Basic2DVector< T >::Basic2DVector ( MathVector const &  iv)
inline

Definition at line 46 of file extBasic2DVector.h.

46 : v(iv) {}
int32_t *__restrict__ iv
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]} {}
int32_t *__restrict__ iv
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]} {}
int32_t *__restrict__ iv
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.

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()) {}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
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.

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

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) {}
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
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) {}
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()) {}
Vec2< T > xy() const
Definition: SSEVec.h:200

Member Function Documentation

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()); }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
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.
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);}
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); }
Basic3DVector cross(const Basic3DVector &v) const
Vector product, or &quot;cross&quot; product, with a vector of same type.
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:102
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.

142  {
145  }
T cross(const Basic2DVector &lh) const
Vector product, or &quot;cross&quot; product, with a vector of same type.
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  }
T cross(const Basic2DVector &lh) const
Vector product, or &quot;cross&quot; product, with a vector of same type.
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.
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.
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); }
T dot(const Basic3DVector &v) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
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(), operator*(), and InnerDeltaPhi::phiRange().

121 { return ::dot(v, lh.v); }
T dot(const Basic3DVector &v) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
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.

128  {
131  }
T dot(const Basic2DVector &lh) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
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  }
T dot(const Basic2DVector &lh) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
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.
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.
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()); }
T sqrt(T t)
Definition: SSEVec.h:19
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
template<class T>
T Basic2DVector< T >::mag ( ) const
inline
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 sqrt(T t)
Definition: SSEVec.h:19
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
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); }
T dot(const Basic3DVector &v) const
Scalar product, or &quot;dot&quot; product, with a vector of same type.
template<class T>
T Basic2DVector< T >::mag2 ( ) const
inline
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.

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

Definition at line 51 of file sseBasic2DVector.h.

51 { return v; }
template<class T>
MathVector& Basic2DVector< T >::mathVector ( )
inline

Definition at line 52 of file sseBasic2DVector.h.

52 { return v; }
template<class T>
MathVector const& Basic2DVector< T >::mathVector ( ) const
inline

Definition at line 52 of file extBasic2DVector.h.

52 { return v; }
template<class T>
MathVector& Basic2DVector< T >::mathVector ( )
inline

Definition at line 53 of file extBasic2DVector.h.

53 { return v; }
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  }
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  }
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  }
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  }
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  }
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  }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
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); }
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); }
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.
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  }
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  }
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  }
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
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  }
long double T
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
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  }
template<class T>
T Basic2DVector< T >::operator[] ( int  i) const
inline

Definition at line 54 of file sseBasic2DVector.h.

54 { return v[i]; }
template<class T>
T Basic2DVector< T >::operator[] ( int  i) const
inline

Definition at line 55 of file extBasic2DVector.h.

55 { return v[i]; }
template<class T>
T& Basic2DVector< T >::operator[] ( int  i)
inline

Definition at line 55 of file sseBasic2DVector.h.

55 { return v[i]; }
template<class T>
T& Basic2DVector< T >::operator[] ( int  i)
inline

Definition at line 56 of file extBasic2DVector.h.

56 { return v[i]; }
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 ;}
template<class T>
T& Basic2DVector< T >::operator[] ( int  i)
inline

Definition at line 67 of file oldBasic2DVector.h.

67 { return i==0 ? theX : theY ;}
template<class T>
Geom::Phi<T> Basic2DVector< T >::phi ( ) const
inline

Definition at line 77 of file sseBasic2DVector.h.

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

77 { return Geom::Phi<T>(atan2(y(), x())); }
T y() const
Cartesian y coordinate.
Definition: Phi.h:52
T x() const
Cartesian x coordinate.
template<class T>
Geom::Phi<T> Basic2DVector< T >::phi ( ) const
inline

Definition at line 78 of file extBasic2DVector.h.

Referenced by Particle.Particle::__str__(), ThirdHitPredictionFromCircle::phi(), PV2DBase< double, PointTag, LocalTag >::phi(), and ntupleDataFormat.Track::phiPull().

78 { return Geom::Phi<T>(atan2(y(), x())); }
T y() const
Cartesian y coordinate.
Definition: Phi.h:52
T x() const
Cartesian x coordinate.
template<class T>
Geom::Phi<T> Basic2DVector< T >::phi ( ) const
inline
template<class T>
T Basic2DVector< T >::r ( ) const
inline

Radius, same as mag()

Definition at line 70 of file sseBasic2DVector.h.

70 { return mag(); }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
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())
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())
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  }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
long double T
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
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
template<class T>
T Basic2DVector< T >::x ( ) const
inline
template<class T>
T Basic2DVector< T >::x ( ) const
inline

Cartesian x coordinate.

Definition at line 59 of file extBasic2DVector.h.

Referenced by svgfig.Curve.Sample::__repr__(), svgfig.Ellipse::__repr__(), Basic2DVector< float >::barePhi(), Basic2DVector< float >::Basic2DVector(), Basic3DVector< align::Scalar >::Basic3DVector(), HelixBarrelPlaneCrossingByCircle::chooseSolution(), HelixBarrelCylinderCrossing::chooseSolution(), Basic2DVector< float >::cross(), ThirdHitPredictionFromInvLine::crossing(), ThirdHitPredictionFromCircle::curvature(), Basic2DVector< float >::dot(), ConformalMappingFit::findRot(), ClusterShapeTrackFilter::getGlobalDirs(), HelixBarrelCylinderCrossing::HelixBarrelCylinderCrossing(), CircleFromThreePoints::init(), ThirdHitPredictionFromInvParabola::init(), ThirdHitPredictionFromCircle::invCenterOnAxis(), TkRotation< align::Scalar >::multiplyInverse(), TkRotation< align::Scalar >::operator*(), operator*(), operator+(), Basic2DVector< float >::operator+=(), Basic2DVector< float >::operator-(), operator-(), Basic2DVector< float >::operator-=(), operator/(), Basic2DVector< float >::phi(), geometryXMLparser.Alignable::pos(), HelixBarrelPlaneCrossingByCircle::position(), ntupleDataFormat._HitObject::r(), ntupleDataFormat._HitObject::r3D(), ThirdHitPredictionFromCircle::HelixRZ::rAtZ(), PixelFitterByHelixProjections::run(), TrackFitter::run(), KFBasedPixelFitter::run(), TkRotation2D< Scalar >::TkRotation2D(), and PV2DBase< double, PointTag, LocalTag >::x().

59 { return v[0]; }
template<class T>
T Basic2DVector< T >::x ( ) const
inline
template<class T>
T Basic2DVector< T >::y ( ) const
inline

Cartesian y coordinate.

Definition at line 61 of file sseBasic2DVector.h.

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

61 { return v[1]; }
template<class T>
T Basic2DVector< T >::y ( ) const
inline
template<class T>
T Basic2DVector< T >::y ( ) const
inline

Member Data Documentation

template<class T>
T Basic2DVector< T >::theX
private
template<class T>
T Basic2DVector< T >::theY
private
template<class T>
mathSSE::Vec2<T> Basic2DVector< T >::v

Definition at line 148 of file sseBasic2DVector.h.

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