test
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;
24 
25 
31 
33  PV3DBase(const T & x, const T & y, const T & z) : theVector(x, y, z) {}
34 
37  PV3DBase( const Cylindrical& set) : theVector( set) {}
38 
40  PV3DBase( const Polar& set) : theVector( set) {}
41 
45  PV3DBase( const Geom::Theta<T>& th,
46  const Geom::Phi<T>& ph, const T& r) : theVector(th,ph,r) {}
47 
50  template <class U>
51  explicit PV3DBase( const Basic3DVector<U>& v) : theVector(v) {}
52 
56  const BasicVectorType& basicVector() const { return theVector;}
57 #ifndef __REFLEX__
58  MathVector const & mathVector() const { return theVector.v;}
60 #endif
61 
62  T x() const { return basicVector().x();}
63  T y() const { return basicVector().y();}
64  T z() const { return basicVector().z();}
65 
66  T mag2() const { return basicVector().mag2();}
67  T mag() const { return basicVector().mag();}
68  T barePhi() const { return basicVector().barePhi();}
69  Geom::Phi<T> phi() const { return basicVector().phi();}
70 
71  T perp2() const { return basicVector().perp2();}
72  T perp() const { return basicVector().perp();}
73  T transverse() const { return basicVector().transverse();}
74  T bareTheta() const { return basicVector().bareTheta();}
75  Geom::Theta<T> theta() const { return basicVector().theta();}
76  T eta() const { return basicVector().eta();}
77 
78 protected:
80 };
81 
82 template <class T, class PV, class F>
83 inline std::ostream & operator<<( std::ostream& s, const PV3DBase<T,PV,F>& v) {
84  return s << v.basicVector();
85 }
86 
87 #endif // GeometryVector_PV3DBase_h
T mag2() const
Definition: PV3DBase.h:66
T y() const
Cartesian y coordinate.
T perp() const
Definition: PV3DBase.h:72
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:69
PV3DBase(const T &x, const T &y, const T &z)
construct from cartesian coordinates
Definition: PV3DBase.h:33
T bareTheta() const
Definition: PV3DBase.h:74
T y() const
Definition: PV3DBase.h:63
T perp2() const
Definition: PV3DBase.h:71
Geom::Phi< T > phi() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
T transverse() const
Definition: PV3DBase.h:73
T ScalarType
Definition: PV3DBase.h:18
T barePhi() const
Definition: PV3DBase.h:68
Basic3DVector< T > BasicVectorType
Definition: PV3DBase.h:19
T mag() const
Definition: PV3DBase.h:67
T z() const
Cartesian z coordinate.
T z() const
Definition: PV3DBase.h:64
BasicVectorType::Cylindrical Cylindrical
Definition: PV3DBase.h:20
MathVector & mathVector()
Definition: PV3DBase.h:59
PV3DBase(const Cylindrical &set)
Definition: PV3DBase.h:37
PV3DBase()
Definition: PV3DBase.h:30
T perp() const
Magnitude of transverse component.
MathVector const & mathVector() const
Definition: PV3DBase.h:58
PV3DBase(const Basic3DVector< U > &v)
Definition: PV3DBase.h:51
BasicVectorType::MathVector MathVector
Definition: PV3DBase.h:23
PV3DBase(const Geom::Theta< T > &th, const Geom::Phi< T > &ph, const T &r)
Definition: PV3DBase.h:45
T eta() const
Definition: PV3DBase.h:76
BasicVectorType theVector
Definition: PV3DBase.h:79
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:40
T bareTheta() const
long double T
T x() const
Definition: PV3DBase.h:62
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:56
Definition: Phi.h:20
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)