CMS 3D CMS Logo

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