CMS 3D CMS Logo

Point2DBase.h
Go to the documentation of this file.
1 #ifndef GeometryVector_Point2DBase_h
2 #define GeometryVector_Point2DBase_h
3 
7 
8 template <class T, class FrameTag>
9 class Point2DBase : public PV2DBase<T, PointTag, FrameTag> {
10 public:
14  typedef typename BaseClass::Polar Polar;
15 
21 
25  template <class U>
26  Point2DBase(const Point2DBase<U, FrameTag>& p) : BaseClass(p.basicVector()) {}
27 
29  Point2DBase(const T& x, const T& y) : BaseClass(x, y) {}
30 
32  explicit Point2DBase(const Polar& set) : BaseClass(set) {}
33 
38  template <class U>
39  explicit Point2DBase(const Basic2DVector<U>& v) : BaseClass(v) {}
40 
44  template <class U>
46  this->basicVector() += v.basicVector();
47  return *this;
48  }
49 
50  template <class U>
52  this->basicVector() -= v.basicVector();
53  return *this;
54  }
55 };
56 
61 template <typename T, typename U, class Frame>
63  const Vector2DBase<U, Frame>& v) {
65  return RT(p.basicVector() + v.basicVector());
66 }
67 
70 template <typename T, typename U, class Frame>
72  const Point2DBase<U, Frame>& v) {
74  return RT(p.basicVector() + v.basicVector());
75 }
76 
81 template <typename T, typename U, class Frame>
83  const Point2DBase<U, Frame>& p2) {
85  return RT(p1.basicVector() - p2.basicVector());
86 }
87 
88 #endif // GeometryVector_Point2DBase_h
PV2DBase< T, PointTag, FrameTag > BaseClass
Definition: Point2DBase.h:11
Vector2DBase< typename PreciseFloatType< T, U >::Type, Frame > operator-(const Point2DBase< T, Frame > &p1, const Point2DBase< U, Frame > &p2)
Definition: Point2DBase.h:82
Basic2DVector< T > BasicVectorType
Definition: Point2DBase.h:13
Point2DBase(const T &x, const T &y)
construct from cartesian coordinates
Definition: Point2DBase.h:29
Point2DBase< typename PreciseFloatType< T, U >::Type, Frame > operator+(const Point2DBase< T, Frame > &p, const Vector2DBase< U, Frame > &v)
Definition: Point2DBase.h:62
const BasicVectorType & basicVector() const
Definition: PV2DBase.h:37
double p2[4]
Definition: TauolaWrapper.h:90
Point2DBase(const Point2DBase< U, FrameTag > &p)
Definition: Point2DBase.h:26
Point2DBase(const Polar &set)
construct from polar coordinates
Definition: Point2DBase.h:32
BaseClass::Polar Polar
Definition: Point2DBase.h:14
Vector2DBase< T, FrameTag > VectorType
Definition: Point2DBase.h:12
Point2DBase(const Basic2DVector< U > &v)
Definition: Point2DBase.h:39
Point2DBase & operator+=(const Vector2DBase< U, FrameTag > &v)
Definition: Point2DBase.h:45
double p1[4]
Definition: TauolaWrapper.h:89
Point2DBase & operator-=(const Vector2DBase< U, FrameTag > &v)
Definition: Point2DBase.h:51
long double T