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
Basic3DVector::theta
Geom::Theta< T > theta() const
Definition: extBasic3DVector.h:139
operator<<
std::ostream & operator<<(std::ostream &s, const PV3DBase< T, PV, F > &v)
Definition: PV3DBase.h:80
Basic3DVector::transverse
T transverse() const
Another name for perp()
Definition: extBasic3DVector.h:125
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
PV3DBase::ScalarType
T ScalarType
Definition: PV3DBase.h:17
PV3DBase::theta
Geom::Theta< T > theta() const
Definition: PV3DBase.h:72
Geom::Theta
Definition: Theta.h:12
PV3DBase::mathVector
MathVector const & mathVector() const
Definition: PV3DBase.h:55
PV3DBase::PV3DBase
PV3DBase(const Geom::Theta< T > &th, const Geom::Phi< T > &ph, const T &r)
Definition: PV3DBase.h:43
Basic3DVector.h
Basic3DVector::perp2
T perp2() const
Squared magnitude of transverse component.
Definition: extBasic3DVector.h:119
Geom::Spherical2Cartesian
Definition: CoordinateSets.h:58
PV3DBase::theVector
BasicVectorType theVector
Definition: PV3DBase.h:76
PV3DBase
Definition: PV3DBase.h:15
findQualityFiles.v
v
Definition: findQualityFiles.py:179
Basic3DVector::eta
T eta() const
Definition: extBasic3DVector.h:146
Basic3DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic3DVector.h:116
PV3DBase::mag2
T mag2() const
Definition: PV3DBase.h:63
Basic3DVector::mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: extBasic3DVector.h:113
PV3DBase::mathVector
MathVector & mathVector()
Definition: PV3DBase.h:56
Basic3DVector< long double >
Definition: Basic3DVectorLD.h:12
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Basic3DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic3DVector.h:97
PV3DBase::PV3DBase
PV3DBase(const T &x, const T &y, const T &z)
construct from cartesian coordinates
Definition: PV3DBase.h:31
PV3DBase::PV3DBase
PV3DBase(const Cylindrical &set)
Definition: PV3DBase.h:35
Geom::Cylindrical2Cartesian
Definition: CoordinateSets.h:34
PV3DBase::PV3DBase
PV3DBase(const Basic3DVector< U > &v)
Definition: PV3DBase.h:48
PV3DBase::bareTheta
T bareTheta() const
Definition: PV3DBase.h:71
PV3DBase::Spherical
BasicVectorType::Spherical Spherical
Definition: PV3DBase.h:20
PV3DBase::barePhi
T barePhi() const
Definition: PV3DBase.h:65
PV3DBase::PV3DBase
PV3DBase(const Polar &set)
construct from polar coordinates
Definition: PV3DBase.h:38
Basic3DVector::barePhi
T barePhi() const
Definition: extBasic3DVector.h:131
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
Geom::Phi
Definition: Phi.h:52
Basic3DVector::v
Vec4< T > v
Definition: extBasic3DVector.h:217
PV3DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
alignCSCRings.r
r
Definition: alignCSCRings.py:93
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
PV3DBase::Cylindrical
BasicVectorType::Cylindrical Cylindrical
Definition: PV3DBase.h:19
T
long double T
Definition: Basic3DVectorLD.h:48
PV3DBase::Polar
BasicVectorType::Polar Polar
Definition: PV3DBase.h:21
Basic3DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic3DVector.h:94
PV3DBase::PV3DBase
PV3DBase()
Definition: PV3DBase.h:28
Basic3DVector::perp
T perp() const
Magnitude of transverse component.
Definition: extBasic3DVector.h:122
PV3DBase::MathVector
BasicVectorType::MathVector MathVector
Definition: PV3DBase.h:22
Basic3DVector::bareTheta
T bareTheta() const
Definition: extBasic3DVector.h:138
Basic3DVector::z
T z() const
Cartesian z coordinate.
Definition: extBasic3DVector.h:100
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
Basic3DVector::phi
Geom::Phi< T > phi() const
Definition: extBasic3DVector.h:132
PV3DBase::transverse
T transverse() const
Definition: PV3DBase.h:70
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Basic3DVector
Definition: extBasic3DVector.h:30
PV3DBase::perp2
T perp2() const
Definition: PV3DBase.h:68
PV3DBase::BasicVectorType
Basic3DVector< T > BasicVectorType
Definition: PV3DBase.h:18