CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
18  typedef T ScalarType;
22  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,
44  const Geom::Phi<T>& ph, const T& r) : theVector(th,ph,r) {}
45 
48  template <class U>
49  explicit PV3DBase( const Basic3DVector<U>& v) : theVector(v) {}
50 
54  const BasicVectorType& basicVector() const { return theVector;}
55 
56  T x() const { return basicVector().x();}
57  T y() const { return basicVector().y();}
58  T z() const { return basicVector().z();}
59 
60  T mag2() const { return basicVector().mag2();}
61  T mag() const { return basicVector().mag();}
62  T barePhi() const { return basicVector().barePhi();}
63  Geom::Phi<T> phi() const { return basicVector().phi();}
64 
65  T perp2() const { return basicVector().perp2();}
66  T perp() const { return basicVector().perp();}
67  T transverse() const { return basicVector().transverse();}
68  T bareTheta() const { return basicVector().bareTheta();}
69  Geom::Theta<T> theta() const { return basicVector().theta();}
70  T eta() const { return basicVector().eta();}
71 
72 protected:
74 };
75 
76 template <class T, class PV, class F>
77 inline std::ostream & operator<<( std::ostream& s, const PV3DBase<T,PV,F>& v) {
78  return s << v.basicVector();
79 }
80 
81 #endif // GeometryVector_PV3DBase_h
T mag2() const
Definition: PV3DBase.h:60
T y() const
Cartesian y coordinate.
T perp() const
Definition: PV3DBase.h:66
T x() const
Cartesian x coordinate.
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
T perp2() const
Squared magnitude of transverse component.
Geom::Theta< T > theta() const
T barePhi() const
Geom::Phi< T > phi() const
Definition: PV3DBase.h:63
PV3DBase(const T &x, const T &y, const T &z)
construct from cartesian coordinates
Definition: PV3DBase.h:31
T bareTheta() const
Definition: PV3DBase.h:68
T y() const
Definition: PV3DBase.h:57
T perp2() const
Definition: PV3DBase.h:65
Geom::Phi< T > phi() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:69
T transverse() const
Definition: PV3DBase.h:67
T ScalarType
Definition: PV3DBase.h:18
T barePhi() const
Definition: PV3DBase.h:62
Basic3DVector< T > BasicVectorType
Definition: PV3DBase.h:19
T mag() const
Definition: PV3DBase.h:61
T z() const
Cartesian z coordinate.
T z() const
Definition: PV3DBase.h:58
BasicVectorType::Cylindrical Cylindrical
Definition: PV3DBase.h:20
PV3DBase(const Cylindrical &set)
Definition: PV3DBase.h:35
PV3DBase()
Definition: PV3DBase.h:28
T perp() const
Magnitude of transverse component.
PV3DBase(const Basic3DVector< U > &v)
Definition: PV3DBase.h:49
PV3DBase(const Geom::Theta< T > &th, const Geom::Phi< T > &ph, const T &r)
Definition: PV3DBase.h:43
T eta() const
Definition: PV3DBase.h:70
BasicVectorType theVector
Definition: PV3DBase.h:73
BasicVectorType::Polar Polar
Definition: PV3DBase.h:22
BasicVectorType::Spherical Spherical
Definition: PV3DBase.h:21
T transverse() const
Another name for perp()
PV3DBase(const Polar &set)
construct from polar coordinates
Definition: PV3DBase.h:38
T bareTheta() const
string s
Definition: asciidump.py:422
long double T
T x() const
Definition: PV3DBase.h:56
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:54
Definition: Phi.h:20
mathSSE::Vec4< T > v
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)