CMS 3D CMS Logo

Surface.h
Go to the documentation of this file.
1 #ifndef Geom_Surface_H
2 #define Geom_Surface_H
3 
5 
7 
10 
12 
14 #include <algorithm>
15 
16 
17 
18 
22 namespace SurfaceOrientation {
25 }
26 
27 
28 //template <class T> class ReferenceCountingPointer;
29 
30 class Plane;
32 
43  , public GloballyPositioned<float>
44 {
45 public:
47 
49 
50  virtual ~Surface(){}
51 
52 protected:
53  Surface(){}
55  Base( pos, rot) {}
56 
58  Bounds* bounds) :
59  Base( pos, rot),
60  theBounds(bounds)
61  {}
62 
63 
65  MediumProperties mp) :
66  Base( pos, rot),
67  theMediumProperties(mp)
68  {}
69 
72  Bounds* bounds) :
73  Base( pos, rot),
74  theMediumProperties(mp),
75  theBounds(bounds)
76  {}
77 
78 
79 
80  Surface( const Surface& iSurface ) :
81  Base( iSurface),
82  theMediumProperties(iSurface.theMediumProperties),
83  theBounds(iSurface.theBounds)
84  {}
85 
86  Surface(Surface&& iSurface ) :
87  Base(iSurface),
88  theMediumProperties(iSurface.theMediumProperties),
89  theBounds(std::move(iSurface.theBounds))
90  {}
91 
92 public:
93 
98  virtual Side side( const LocalPoint& p, Scalar tolerance=0) const = 0;
99  virtual Side side( const GlobalPoint& p, Scalar tolerance=0) const {
100  return side( toLocal(p), tolerance);
101  }
102 
103  using Base::toGlobal;
104  using Base::toLocal;
105 
107  return GlobalPoint( rotation().multiplyInverse( lp.basicVector()) +
108  position().basicVector());
109  }
110 
111 
113  return theMediumProperties;
114  }
115 
117  theMediumProperties = mp;
118  }
119 
120  const Bounds& bounds() const { return *theBounds; }
121 
122  // here and not in plane because of PixelBarrelLayer::overlap
123  std::pair<float,float> const & phiSpan() const { return bounds().phiSpan(); }
124  std::pair<float,float> const & zSpan() const { return bounds().zSpan(); }
125  std::pair<float,float> const & rSpan() const { return bounds().rSpan(); }
126 
127 
134  virtual ConstReferenceCountingPointer<TangentPlane> tangentPlane (const GlobalPoint&) const = 0;
137  virtual ConstReferenceCountingPointer<TangentPlane> tangentPlane (const LocalPoint&) const = 0;
138 
139 protected:
142 };
143 
144 
145 #endif // Geom_Surface_H
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
MediumProperties theMediumProperties
Definition: Surface.h:140
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp)
Definition: Surface.h:64
Surface(Surface &&iSurface)
Definition: Surface.h:86
std::pair< float, float > const & phiSpan() const
Definition: Surface.h:123
std::pair< float, float > const & zSpan() const
Definition: Surface.h:124
std::pair< float, float > const & rSpan() const
Definition: Surface.h:125
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Surface(const PositionType &pos, const RotationType &rot, MediumProperties mp, Bounds *bounds)
Definition: Surface.h:70
const Bounds & bounds() const
Definition: Surface.h:120
Surface(const Surface &iSurface)
Definition: Surface.h:80
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
Definition: Plane.h:17
Surface()
Definition: Surface.h:53
void setMediumProperties(const MediumProperties &mp)
Definition: Surface.h:116
const BasicVectorType & basicVector() const
Definition: PV2DBase.h:38
Plane(Args &&...args)
Definition: Plane.h:20
Surface(const PositionType &pos, const RotationType &rot, Bounds *bounds)
Definition: Surface.h:57
virtual ~Surface()
Definition: Surface.h:50
static int position[264][3]
Definition: ReadPGInfo.cc:509
extstd::clone_ptr< Bounds > theBounds
Definition: Surface.h:141
virtual Side side(const GlobalPoint &p, Scalar tolerance=0) const
Definition: Surface.h:99
Definition: Bounds.h:22
const MediumProperties & mediumProperties() const
Definition: Surface.h:112
def move(src, dest)
Definition: eostools.py:510
Surface(const PositionType &pos, const RotationType &rot)
Definition: Surface.h:54