CMS 3D CMS Logo

PV2DBase.h
Go to the documentation of this file.
1 #ifndef GeometryVector_PV2DBase_h
2 #define GeometryVector_PV2DBase_h
3 
5 
6 #include <iosfwd>
7 #include <ostream>
8 
9 template <class T, class PVType, class FrameType>
10 class PV2DBase {
11 public:
12  typedef T ScalarType;
14  typedef typename BasicVectorType::Polar Polar;
16 
22 
24  PV2DBase(const T& x, const T& y) : theVector(x, y) {}
25 
27  PV2DBase(const Polar& set) : theVector(set) {}
28 
31  template <class U>
32  explicit PV2DBase(const Basic2DVector<U>& v) : theVector(v) {}
33 
37  const BasicVectorType& basicVector() const { return theVector; }
38 #ifndef __REFLEX__
39  MathVector const& mathVector() const { return theVector.v; }
41 #endif
42 
43  T x() const { return basicVector().x(); }
44  T y() const { return basicVector().y(); }
45  T mag2() const { return basicVector().mag2(); }
46  T r() const { return basicVector().r(); }
47  T mag() const { return basicVector().mag(); }
48  T barePhi() const { return basicVector().barePhi(); }
49  Geom::Phi<T> phi() const { return basicVector().phi(); }
50 
51 protected:
52  // required in the implementation of inherited types...
54 
56 };
57 
58 template <class T, class PV, class F>
59 inline std::ostream& operator<<(std::ostream& s, const PV2DBase<T, PV, F>& v) {
60  return s << " (" << v.x() << ',' << v.y() << ") ";
61 }
62 #endif // GeometryVector_PV2DBase_h
PV2DBase::r
T r() const
Definition: PV2DBase.h:46
PV2DBase::PV2DBase
PV2DBase(const Basic2DVector< U > &v)
Definition: PV2DBase.h:32
PV2DBase::PV2DBase
PV2DBase()
Definition: PV2DBase.h:21
Basic2DVector::phi
Geom::Phi< T > phi() const
Definition: extBasic2DVector.h:83
PV2DBase::mag
T mag() const
Definition: PV2DBase.h:47
PV2DBase::basicVector
const BasicVectorType & basicVector() const
Definition: PV2DBase.h:37
PV2DBase::mathVector
MathVector const & mathVector() const
Definition: PV2DBase.h:39
Basic2DVector::v
Vec2< T > v
Definition: extBasic2DVector.h:156
findQualityFiles.v
v
Definition: findQualityFiles.py:179
PV2DBase::MathVector
BasicVectorType::MathVector MathVector
Definition: PV2DBase.h:15
Basic2DVector::mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: extBasic2DVector.h:73
PV2DBase::PV2DBase
PV2DBase(const T &x, const T &y)
construct from cartesian coordinates
Definition: PV2DBase.h:24
Basic2DVector::r
T r() const
Radius, same as mag()
Definition: extBasic2DVector.h:76
PV2DBase::phi
Geom::Phi< T > phi() const
Definition: PV2DBase.h:49
Basic2DVector< double >::MathVector
Vec2< double > MathVector
Definition: extBasic2DVector.h:20
alignCSCRings.s
s
Definition: alignCSCRings.py:92
Geom::Polar2Cartesian
Definition: CoordinateSets.h:14
Basic2DVector::y
T y() const
Cartesian y coordinate.
Definition: extBasic2DVector.h:67
PV2DBase::theVector
BasicVectorType theVector
Definition: PV2DBase.h:55
Basic2DVector::x
T x() const
Cartesian x coordinate.
Definition: extBasic2DVector.h:64
PV2DBase::PV2DBase
PV2DBase(const Polar &set)
construct from polar coordinates
Definition: PV2DBase.h:27
Basic2DVector
Definition: extBasic2DVector.h:15
operator<<
std::ostream & operator<<(std::ostream &s, const PV2DBase< T, PV, F > &v)
Definition: PV2DBase.h:59
PV2DBase::basicVector
BasicVectorType & basicVector()
Definition: PV2DBase.h:53
PV2DBase::y
T y() const
Definition: PV2DBase.h:44
PV2DBase::x
T x() const
Definition: PV2DBase.h:43
Geom::Phi
Definition: Phi.h:52
PV2DBase::BasicVectorType
Basic2DVector< T > BasicVectorType
Definition: PV2DBase.h:13
PV2DBase::Polar
BasicVectorType::Polar Polar
Definition: PV2DBase.h:14
PV2DBase::mathVector
MathVector & mathVector()
Definition: PV2DBase.h:40
Basic2DVector.h
T
long double T
Definition: Basic3DVectorLD.h:48
PV2DBase
Definition: PV2DBase.h:10
PV2DBase::barePhi
T barePhi() const
Definition: PV2DBase.h:48
PV2DBase::ScalarType
T ScalarType
Definition: PV2DBase.h:12
Basic2DVector::mag2
T mag2() const
The vector magnitude squared. Equivalent to vec.dot(vec)
Definition: extBasic2DVector.h:70
PV2DBase::mag2
T mag2() const
Definition: PV2DBase.h:45
Basic2DVector::barePhi
T barePhi() const
Definition: extBasic2DVector.h:82