CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Surface.h
Go to the documentation of this file.
1 #ifndef Geom_Surface_H
2 #define Geom_Surface_H
3 
5 
7 
10 
12 #include <algorithm>
13 
17 namespace SurfaceOrientation {
20 } // namespace SurfaceOrientation
21 
22 //template <class T> class ReferenceCountingPointer;
23 
24 class Plane;
26 
37 public:
39 
41 
42  ~Surface() override {}
43 
44 protected:
45  Surface() {}
46  Surface(const PositionType& pos, const RotationType& rot) : Base(pos, rot) {}
47 
48  Surface(const PositionType& pos, const RotationType& rot, Bounds* bounds) : Base(pos, rot), theBounds(bounds) {}
49 
51  : Base(pos, rot), theMediumProperties(mp) {}
52 
54  : Base(pos, rot), theMediumProperties(mp), theBounds(bounds) {}
55 
56  Surface(const Surface& iSurface)
57  : ReferenceCountedInConditions(iSurface),
58  Base(iSurface),
60  theBounds(iSurface.theBounds) {}
61 
62  Surface(Surface&& iSurface)
63  : ReferenceCountedInConditions(iSurface),
64  Base(iSurface),
66  theBounds(std::move(iSurface.theBounds)) {}
67 
68 public:
73  virtual Side side(const LocalPoint& p, Scalar tolerance = 0) const = 0;
74  virtual Side side(const GlobalPoint& p, Scalar tolerance = 0) const { return side(toLocal(p), tolerance); }
75 
76  using Base::toGlobal;
77  using Base::toLocal;
78 
80  return GlobalPoint(rotation().multiplyInverse(lp.basicVector()) + position().basicVector());
81  }
82 
84 
86 
87  const Bounds& bounds() const { return *theBounds; }
88 
89  // here and not in plane because of PixelBarrelLayer::overlap
90  std::pair<float, float> const& phiSpan() const { return bounds().phiSpan(); }
91  std::pair<float, float> const& zSpan() const { return bounds().zSpan(); }
92  std::pair<float, float> const& rSpan() const { return bounds().rSpan(); }
93 
104 
105 protected:
108 };
109 
110 #endif // Geom_Surface_H
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
std::pair< float, float > const & zSpan() const
Definition: Bounds.h:66
MediumProperties theMediumProperties
Definition: Surface.h:106
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp)
Definition: Surface.h:50
virtual ConstReferenceCountingPointer< TangentPlane > tangentPlane(const GlobalPoint &) const =0
Surface(Surface &&iSurface)
Definition: Surface.h:62
const double tolerance
~Surface() override
Definition: Surface.h:42
std::pair< float, float > const & zSpan() const
Definition: Surface.h:91
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp, Bounds *bounds)
Definition: Surface.h:53
const Bounds & bounds() const
Definition: Surface.h:87
void move(const GlobalVector &displacement)
Surface(const Surface &iSurface)
Definition: Surface.h:56
virtual Side side(const LocalPoint &p, Scalar tolerance=0) const =0
Definition: Plane.h:16
Surface()
Definition: Surface.h:45
void setMediumProperties(const MediumProperties &mp)
Definition: Surface.h:85
std::pair< float, float > const & rSpan() const
Definition: Surface.h:92
LocalPoint toLocal(const GlobalPoint &gp) const
const BasicVectorType & basicVector() const
Definition: PV2DBase.h:37
Plane(Args &&...args)
Definition: Plane.h:19
std::pair< float, float > const & phiSpan() const
Definition: Surface.h:90
Surface(const PositionType &pos, const RotationType &rot, Bounds *bounds)
Definition: Surface.h:48
GlobalPoint toGlobal(const LocalPoint &lp) const
Point3DBase< float, GlobalTag > GlobalPoint
std::pair< float, float > const & phiSpan() const
Definition: Bounds.h:65
extstd::clone_ptr< Bounds > theBounds
Definition: Surface.h:107
virtual Side side(const GlobalPoint &p, Scalar tolerance=0) const
Definition: Surface.h:74
const RotationType & rotation() const
Definition: Bounds.h:18
std::pair< float, float > const & rSpan() const
Definition: Bounds.h:67
SurfaceOrientation::Side Side
Definition: Surface.h:38
const MediumProperties & mediumProperties() const
Definition: Surface.h:83
const BasicVectorType & basicVector() const
Definition: PV3DBase.h:53
const PositionType & position() const
Surface(const PositionType &pos, const RotationType &rot)
Definition: Surface.h:46