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 
18 class Bounds {
19 public:
20  virtual ~Bounds() {}
21 
24  virtual float length() const = 0;
25 
28  virtual float width() const = 0;
29 
32  virtual float thickness() const = 0;
33 
35  virtual float widthAtHalfLength() const { return width(); }
36 
38  virtual bool inside(const Local3DPoint&) const = 0;
39  virtual bool inside(const Local2DPoint& p) const { return inside(Local3DPoint(p.x(), p.y(), 0)); }
40 
42  virtual bool inside(const Local2DPoint& p, float tollerance) const {
43  return inside(p, LocalError(tollerance * tollerance, 0.f, tollerance * tollerance));
44  }
45 
46  // For propagation with uncertainties - one has to know by how
47  // much one missed a surface
48  // virtual Local2DVector<float> howFar( const Local2DPoint&) = 0;
49  //
50  // Or maybe a better way of determining if a surface is "touched"
51  // by a trajectory is to have a method
52 
54  virtual bool inside(const Local3DPoint&, const LocalError&, float scale = 1.f) const = 0;
55 
57  virtual bool inside(const Local2DPoint& p, const LocalError& err, float scale = 1.f) const {
58  return inside(Local3DPoint(p.x(), p.y(), 0), err, scale);
59  }
60 
61  virtual float significanceInside(const Local3DPoint&, const LocalError&) const;
62 
63  virtual Bounds* clone() const = 0;
64 
65  std::pair<float, float> const& phiSpan() const { return m_span.phiSpan(); }
66  std::pair<float, float> const& zSpan() const { return m_span.zSpan(); }
67  std::pair<float, float> const& rSpan() const { return m_span.rSpan(); }
68 
69  void computeSpan(Surface const& plane) { m_span.compute(plane); }
70 
71 private:
73 };
74 
75 #endif
std::pair< float, float > const & zSpan() const
Definition: Bounds.h:66
virtual float length() const =0
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
virtual float significanceInside(const Local3DPoint &, const LocalError &) const
Definition: Bounds.cc:4
virtual float widthAtHalfLength() const
Width at half length. Useful for e.g. pitch definition.
Definition: Bounds.h:35
virtual ~Bounds()
Definition: Bounds.h:20
virtual float thickness() const =0
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:42
std::pair< float, float > const & phiSpan() const
Definition: Bounds.h:65
double f[11][100]
std::pair< float, float > const & rSpan() const
Definition: BoundSpan.h:21
void compute(Surface const &plane)
Definition: BoundSpan.cc:8
virtual bool inside(const Local2DPoint &p) const
Definition: Bounds.h:39
std::pair< float, float > const & zSpan() const
Definition: BoundSpan.h:20
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:57
BoundSpan m_span
Definition: Bounds.h:72
Definition: Bounds.h:18
virtual Bounds * clone() const =0
virtual float width() const =0
std::pair< float, float > const & rSpan() const
Definition: Bounds.h:67
void computeSpan(Surface const &plane)
Definition: Bounds.h:69
std::pair< float, float > const & phiSpan() const
Definition: BoundSpan.h:19
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9