CMS 3D CMS Logo

Bounds.h
Go to the documentation of this file.
1 #ifndef Geom_Bounds_H
2 #define Geom_Bounds_H
3 
6 
8 
10 
20 class Bounds {
21 public:
22  virtual ~Bounds() {}
23 
26  virtual float length() const = 0;
27 
30  virtual float width() const = 0;
31 
34  virtual float thickness() const = 0;
35 
37  virtual float widthAtHalfLength() const { return width(); }
38 
40  virtual bool inside(const Local3DPoint&) const = 0;
41  virtual bool inside(const Local2DPoint& p) const { return inside(Local3DPoint(p.x(), p.y(), 0)); }
42 
44  virtual bool inside(const Local2DPoint& p, float tollerance) const {
45  return inside(p, LocalError(tollerance * tollerance, 0.f, tollerance * tollerance));
46  }
47 
48  // For propagation with uncertainties - one has to know by how
49  // much one missed a surface
50  // virtual Local2DVector<float> howFar( const Local2DPoint&) = 0;
51  //
52  // Or maybe a better way of determining if a surface is "touched"
53  // by a trajectory is to have a method
54 
56  virtual bool inside(const Local3DPoint&, const LocalError&, float scale = 1.f) const = 0;
57 
59  virtual bool inside(const Local2DPoint& p, const LocalError& err, float scale = 1.f) const {
60  return inside(Local3DPoint(p.x(), p.y(), 0), err, scale);
61  }
62 
63  virtual float significanceInside(const Local3DPoint&, const LocalError&) const;
64 
65  virtual Bounds* clone() const = 0;
66 
67  std::pair<float, float> const& phiSpan() const { return m_span.phiSpan(); }
68  std::pair<float, float> const& zSpan() const { return m_span.zSpan(); }
69  std::pair<float, float> const& rSpan() const { return m_span.rSpan(); }
70 
71  void computeSpan(Surface const& plane) { m_span.compute(plane); }
72 
73 private:
75 };
76 
77 #endif
std::pair< float, float > const & zSpan() const
Definition: BoundSpan.h:20
std::pair< float, float > const & zSpan() const
Definition: Bounds.h:68
virtual float length() const =0
virtual float widthAtHalfLength() const
Width at half length. Useful for e.g. pitch definition.
Definition: Bounds.h:37
T y() const
Definition: PV2DBase.h:44
virtual Bounds * clone() const =0
virtual float significanceInside(const Local3DPoint &, const LocalError &) const
Definition: Bounds.cc:4
virtual ~Bounds()
Definition: Bounds.h:22
virtual float width() const =0
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
std::pair< float, float > const & phiSpan() const
Definition: BoundSpan.h:19
double f[11][100]
virtual float thickness() const =0
void compute(Surface const &plane)
Definition: BoundSpan.cc:8
std::pair< float, float > const & phiSpan() const
Definition: Bounds.h:67
virtual bool inside(const Local2DPoint &p) const
Definition: Bounds.h:41
BoundSpan m_span
Definition: Bounds.h:74
std::pair< float, float > const & rSpan() const
Definition: BoundSpan.h:21
virtual bool inside(const Local2DPoint &p, const LocalError &err, float scale=1.f) const
Determine if a 2D point is inside the bounds, taking error into account.
Definition: Bounds.h:59
Definition: Bounds.h:20
std::pair< float, float > const & rSpan() const
Definition: Bounds.h:69
T x() const
Definition: PV2DBase.h:43
void computeSpan(Surface const &plane)
Definition: Bounds.h:71
virtual bool inside(const Local2DPoint &p, float tollerance) const
Determine if a point is inside the bounds, taking a tollerance into account.
Definition: Bounds.h:44
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9