CMS 3D CMS Logo

Point3DBase.h
Go to the documentation of this file.
1 #ifndef GeometryVector_Point3DBase_h
2 #define GeometryVector_Point3DBase_h
3 
8 
9 template <class T, class FrameTag>
10 class Point3DBase : public PV3DBase<T, PointTag, FrameTag> {
11 public:
15  typedef typename BaseClass::Spherical Spherical;
16  typedef typename BaseClass::Polar Polar;
18 
24 
28  template <class U>
30 
32  Point3DBase(const T& x, const T& y, const T& z) : BaseClass(x, y, z) {}
33 
36  explicit Point3DBase(const Cylindrical& set) : BaseClass(set) {}
37 
39  explicit Point3DBase(const Polar& set) : BaseClass(set) {}
40 
44  Point3DBase(const Geom::Theta<T>& th, const Geom::Phi<T>& ph, const T& r) : BaseClass(th, ph, r) {}
45 
49  Point3DBase(const T& x, const T& y) : BaseClass(x, y, 0) {}
51 
56  template <class U>
57  explicit Point3DBase(const Basic3DVector<U>& v) : BaseClass(v) {}
58 
59  // equality
60  bool operator==(const Point3DBase& rh) const { return this->basicVector() == rh.basicVector(); }
61 
65  template <class U>
67  this->theVector += v.basicVector();
68  return *this;
69  }
70 
71  template <class U>
73  this->theVector -= v.basicVector();
74  return *this;
75  }
76 };
77 
82 template <typename T, typename U, class Frame>
84  const Vector3DBase<U, Frame>& v) {
86  return RT(p.basicVector() + v.basicVector());
87 }
88 
91 template <typename T, typename U, class Frame>
93  const Point3DBase<U, Frame>& v) {
95  return RT(p.basicVector() + v.basicVector());
96 }
97 
102 template <typename T, typename U, class Frame>
104  const Point3DBase<U, Frame>& p2) {
106  return RT(p1.basicVector() - p2.basicVector());
107 }
108 
113 template <typename T, typename U, class Frame>
115  const Vector3DBase<U, Frame>& v) {
117  return RT(p.basicVector() - v.basicVector());
118 }
119 #endif // GeometryVector_Point3DBase_h
Point3DBase & operator+=(const Vector3DBase< U, FrameTag > &v)
Definition: Point3DBase.h:66
Point3DBase< typename PreciseFloatType< T, U >::Type, Frame > operator+(const Point3DBase< T, Frame > &p, const Vector3DBase< U, Frame > &v)
Definition: Point3DBase.h:83
BaseClass::BasicVectorType BasicVectorType
Definition: Point3DBase.h:17
Point3DBase & operator-=(const Vector3DBase< U, FrameTag > &v)
Definition: Point3DBase.h:72
Point3DBase(const Polar &set)
construct from polar coordinates
Definition: Point3DBase.h:39
SOAFrame< float > Frame
PV3DBase< T, PointTag, FrameTag > BaseClass
Definition: Point3DBase.h:12
Point3DBase(const T &x, const T &y, const T &z)
construct from cartesian coordinates
Definition: Point3DBase.h:32
BaseClass::Cylindrical Cylindrical
Definition: Point3DBase.h:14
BaseClass::Polar Polar
Definition: Point3DBase.h:16
Point3DBase(const T &x, const T &y)
Definition: Point3DBase.h:49
Point3DBase(const Geom::Theta< T > &th, const Geom::Phi< T > &ph, const T &r)
Definition: Point3DBase.h:44
BaseClass::Spherical Spherical
Definition: Point3DBase.h:15
Point3DBase(const Basic3DVector< U > &v)
Definition: Point3DBase.h:57
Point3DBase(Point2DBase< T, FrameTag > p)
Definition: Point3DBase.h:50
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
Vector3DBase< T, FrameTag > VectorType
Definition: Point3DBase.h:13
Vector3DBase< typename PreciseFloatType< T, U >::Type, Frame > operator-(const Point3DBase< T, Frame > &p1, const Point3DBase< U, Frame > &p2)
Definition: Point3DBase.h:103
bool operator==(const Point3DBase &rh) const
Definition: Point3DBase.h:60
Point3DBase(const Cylindrical &set)
Definition: Point3DBase.h:36
long double T
Point3DBase(const Point3DBase< U, FrameTag > &p)
Definition: Point3DBase.h:29
Definition: Phi.h:52