CMS 3D CMS Logo

PV3DBase.h
Go to the documentation of this file.
1 #ifndef GeometryVector_PV3DBase_h
2 #define GeometryVector_PV3DBase_h
3 
5 #include <iosfwd>
6 
14 template <class T, class PVType, class FrameType>
15 class PV3DBase {
16 public:
17  typedef T ScalarType;
21  typedef typename BasicVectorType::Polar Polar;
23 
29 
31  PV3DBase(const T& x, const T& y, const T& z) : theVector(x, y, z) {}
32 
35  PV3DBase(const Cylindrical& set) : theVector(set) {}
36 
38  PV3DBase(const Polar& set) : theVector(set) {}
39 
43  PV3DBase(const Geom::Theta<T>& th, const Geom::Phi<T>& ph, const T& r) : theVector(th, ph, r) {}
44 
47  template <class U>
48  explicit PV3DBase(const Basic3DVector<U>& v) : theVector(v) {}
49 
53  const BasicVectorType& basicVector() const { return theVector; }
54 #ifndef __REFLEX__
55  MathVector const& mathVector() const { return theVector.v; }
57 #endif
58 
59  T x() const { return basicVector().x(); }
60  T y() const { return basicVector().y(); }
61  T z() const { return basicVector().z(); }
62 
63  T mag2() const { return basicVector().mag2(); }
64  T mag() const { return basicVector().mag(); }
65  T barePhi() const { return basicVector().barePhi(); }
66  Geom::Phi<T> phi() const { return basicVector().phi(); }
67 
68  T perp2() const { return basicVector().perp2(); }
69  T perp() const { return basicVector().perp(); }
70  T transverse() const { return basicVector().transverse(); }
71  T bareTheta() const { return basicVector().bareTheta(); }
72  Geom::Theta<T> theta() const { return basicVector().theta(); }
73  T eta() const { return basicVector().eta(); }
74 
75 protected:
77 };
78 
79 template <class T, class PV, class F>
80 inline std::ostream& operator<<(std::ostream& s, const PV3DBase<T, PV, F>& v) {
81  return s << v.basicVector();
82 }
83 
84 #endif // GeometryVector_PV3DBase_h
T perp() const
Definition: PV3DBase.h:69
T x() const
Cartesian x coordinate.
T perp2() const
Squared magnitude of transverse component.
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T eta() const
Definition: PV3DBase.h:73
PV3DBase(const T &x, const T &y, const T &z)
construct from cartesian coordinates
Definition: PV3DBase.h:31
T mag2() const
Definition: PV3DBase.h:63
T y() const
Cartesian y coordinate.
T bareTheta() const
Definition: PV3DBase.h:71
Geom::Theta< T > theta() const
T barePhi() const
Definition: PV3DBase.h:65
T ScalarType
Definition: PV3DBase.h:17
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
Basic3DVector< T > BasicVectorType
Definition: PV3DBase.h:18
T bareTheta() const
MathVector const & mathVector() const
Definition: PV3DBase.h:55
BasicVectorType::Cylindrical Cylindrical
Definition: PV3DBase.h:19
MathVector & mathVector()
Definition: PV3DBase.h:56
T mag() const
Definition: PV3DBase.h:64
PV3DBase(const Cylindrical &set)
Definition: PV3DBase.h:35
T transverse() const
Another name for perp()
PV3DBase()
Definition: PV3DBase.h:28
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
T perp() const
Magnitude of transverse component.
PV3DBase(const Basic3DVector< U > &v)
Definition: PV3DBase.h:48
T transverse() const
Definition: PV3DBase.h:70
T z() const
Cartesian z coordinate.
BasicVectorType::MathVector MathVector
Definition: PV3DBase.h:22
T perp2() const
Definition: PV3DBase.h:68
PV3DBase(const Geom::Theta< T > &th, const Geom::Phi< T > &ph, const T &r)
Definition: PV3DBase.h:43
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
BasicVectorType theVector
Definition: PV3DBase.h:76
BasicVectorType::Polar Polar
Definition: PV3DBase.h:21
BasicVectorType::Spherical Spherical
Definition: PV3DBase.h:20
PV3DBase(const Polar &set)
construct from polar coordinates
Definition: PV3DBase.h:38
Geom::Phi< T > phi() const
long double T
Definition: Phi.h:52
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72