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
Vector3DBase
Definition: Vector3DBase.h:8
Point2DBase
Definition: Point2DBase.h:9
Point3DBase::BaseClass
PV3DBase< T, PointTag, FrameTag > BaseClass
Definition: Point3DBase.h:12
PV3DBase.h
PV3DBase< T, PointTag, FrameTag >::x
T x() const
Definition: PV3DBase.h:59
Geom::Theta
Definition: Theta.h:12
Geom::Spherical2Cartesian
Definition: CoordinateSets.h:58
PV3DBase< T, PointTag, FrameTag >::theVector
BasicVectorType theVector
Definition: PV3DBase.h:76
Point3DBase::operator-=
Point3DBase & operator-=(const Vector3DBase< U, FrameTag > &v)
Definition: Point3DBase.h:72
operator+
Point3DBase< typename PreciseFloatType< T, U >::Type, Frame > operator+(const Point3DBase< T, Frame > &p, const Vector3DBase< U, Frame > &v)
Definition: Point3DBase.h:83
Point3DBase::Point3DBase
Point3DBase(const T &x, const T &y)
Definition: Point3DBase.h:49
Point2DBase.h
PV3DBase
Definition: PV3DBase.h:15
findQualityFiles.v
v
Definition: findQualityFiles.py:179
Point3DBase::Point3DBase
Point3DBase(const T &x, const T &y, const T &z)
construct from cartesian coordinates
Definition: Point3DBase.h:32
Point3DBase::Point3DBase
Point3DBase(const Geom::Theta< T > &th, const Geom::Phi< T > &ph, const T &r)
Definition: Point3DBase.h:44
PV3DBase< T, PointTag, FrameTag >::z
T z() const
Definition: PV3DBase.h:61
Point3DBase::Polar
BaseClass::Polar Polar
Definition: Point3DBase.h:16
Point3DBase::Cylindrical
BaseClass::Cylindrical Cylindrical
Definition: Point3DBase.h:14
Geom::Cylindrical2Cartesian
Definition: CoordinateSets.h:34
p2
double p2[4]
Definition: TauolaWrapper.h:90
Vector3DBase.h
Point3DBase
Definition: Point3DBase.h:10
operator-
Vector3DBase< typename PreciseFloatType< T, U >::Type, Frame > operator-(const Point3DBase< T, Frame > &p1, const Point3DBase< U, Frame > &p2)
Definition: Point3DBase.h:103
pixelCPEforGPU::Frame
SOAFrame< float > Frame
Definition: pixelCPEforGPU.h:18
PointTag.h
Point3DBase::Point3DBase
Point3DBase(Point2DBase< T, FrameTag > p)
Definition: Point3DBase.h:50
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
Point3DBase::Spherical
BaseClass::Spherical Spherical
Definition: Point3DBase.h:15
PV3DBase< T, PointTag, FrameTag >::y
T y() const
Definition: PV3DBase.h:60
Point3DBase::Point3DBase
Point3DBase(const Basic3DVector< U > &v)
Definition: Point3DBase.h:57
Geom::Phi
Definition: Phi.h:52
p1
double p1[4]
Definition: TauolaWrapper.h:89
Point3DBase::operator==
bool operator==(const Point3DBase &rh) const
Definition: Point3DBase.h:60
PV3DBase< T, PointTag, FrameTag >::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
alignCSCRings.r
r
Definition: alignCSCRings.py:93
Point3DBase::Point3DBase
Point3DBase()
Definition: Point3DBase.h:23
T
long double T
Definition: Basic3DVectorLD.h:48
Point3DBase::Point3DBase
Point3DBase(const Cylindrical &set)
Definition: Point3DBase.h:36
Point3DBase::VectorType
Vector3DBase< T, FrameTag > VectorType
Definition: Point3DBase.h:13
Point3DBase::operator+=
Point3DBase & operator+=(const Vector3DBase< U, FrameTag > &v)
Definition: Point3DBase.h:66
Point3DBase::Point3DBase
Point3DBase(const Point3DBase< U, FrameTag > &p)
Definition: Point3DBase.h:29
Point3DBase::Point3DBase
Point3DBase(const Polar &set)
construct from polar coordinates
Definition: Point3DBase.h:39
Basic3DVector< Scalar >
Point3DBase::BasicVectorType
BaseClass::BasicVectorType BasicVectorType
Definition: Point3DBase.h:17