CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
GeneralNSurfaceDelimitedBounds Class Referencefinal

#include <GeneralNSurfaceDelimitedBounds.h>

Inheritance diagram for GeneralNSurfaceDelimitedBounds:
Bounds

Public Types

typedef std::pair< const Surface *, SurfaceOrientation::SideSurfaceAndSide
 
typedef std::vector< SurfaceAndSideSurfaceContainer
 

Public Member Functions

Boundsclone () const override
 
 GeneralNSurfaceDelimitedBounds (const Surface *surf, const std::vector< SurfaceAndSide > &limits)
 
virtual bool inside (const Local3DPoint &, const LocalError &, float scale=1.f) const=0
 Determine if a point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local3DPoint &) const=0
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local2DPoint &p) const
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
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. More...
 
bool inside (const Local3DPoint &lp) const override
 Determine if the point is inside the bounds. More...
 
bool inside (const Local3DPoint &, const LocalError &, float scale=1.f) const override
 Determine if a point is inside the bounds, taking error into account. More...
 
float length () const override
 
float thickness () const override
 
float width () const override
 
- Public Member Functions inherited from Bounds
void computeSpan (Surface const &plane)
 
virtual bool inside (const Local2DPoint &p) const
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance into account. More...
 
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. More...
 
std::pair< float, float > const & phiSpan () const
 
std::pair< float, float > const & rSpan () const
 
virtual float significanceInside (const Local3DPoint &, const LocalError &) const
 
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
std::pair< float, float > const & zSpan () const
 
virtual ~Bounds ()
 

Private Member Functions

bool myInside (const Local3DPoint &lp, float tolerance) const
 

Private Attributes

SurfaceContainer theLimits
 
const SurfacetheSurface
 

Detailed Description

Bounds for a surface of any type, delimited by N other surfaces of any type. A point is "inside" if it is on the correct side of all delimiting surfaces. This way of computing "inside" is relatively expensive, and should only be applied to situations where there is no specialized implementation for the concrete surface types.

Definition at line 16 of file GeneralNSurfaceDelimitedBounds.h.

Member Typedef Documentation

◆ SurfaceAndSide

Definition at line 18 of file GeneralNSurfaceDelimitedBounds.h.

◆ SurfaceContainer

Definition at line 19 of file GeneralNSurfaceDelimitedBounds.h.

Constructor & Destructor Documentation

◆ GeneralNSurfaceDelimitedBounds()

GeneralNSurfaceDelimitedBounds::GeneralNSurfaceDelimitedBounds ( const Surface surf,
const std::vector< SurfaceAndSide > &  limits 
)
inline

Member Function Documentation

◆ clone()

Bounds* GeneralNSurfaceDelimitedBounds::clone ( void  ) const
inlineoverridevirtual

Implements Bounds.

Definition at line 34 of file GeneralNSurfaceDelimitedBounds.h.

References GeneralNSurfaceDelimitedBounds().

34 { return new GeneralNSurfaceDelimitedBounds(*this); }
GeneralNSurfaceDelimitedBounds(const Surface *surf, const std::vector< SurfaceAndSide > &limits)

◆ inside() [1/7]

virtual bool Bounds::inside

Determine if the point is inside the bounds.

◆ inside() [2/7]

virtual bool Bounds::inside

Determine if a point is inside the bounds, taking error into account.

◆ inside() [3/7]

virtual bool Bounds::inside
inline

Definition at line 39 of file Bounds.h.

39 { return inside(Local3DPoint(p.x(), p.y(), 0)); }
bool inside(const Local3DPoint &lp) const override
Determine if the point is inside the bounds.
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

◆ inside() [4/7]

virtual bool Bounds::inside
inline

Determine if a point is inside the bounds, taking a tollerance into account.

Definition at line 42 of file Bounds.h.

42  {
43  return inside(p, LocalError(tollerance * tollerance, 0.f, tollerance * tollerance));
44  }
bool inside(const Local3DPoint &lp) const override
Determine if the point is inside the bounds.
double f[11][100]

◆ inside() [5/7]

virtual bool Bounds::inside
inline

Determine if a 2D point is inside the bounds, taking error into account.

Definition at line 57 of file Bounds.h.

57  {
58  return inside(Local3DPoint(p.x(), p.y(), 0), err, scale);
59  }
bool inside(const Local3DPoint &lp) const override
Determine if the point is inside the bounds.
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9

◆ inside() [6/7]

bool GeneralNSurfaceDelimitedBounds::inside ( const Local3DPoint ) const
inlineoverridevirtual

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 30 of file GeneralNSurfaceDelimitedBounds.h.

References myInside().

30 { return myInside(lp, 0); }
bool myInside(const Local3DPoint &lp, float tolerance) const

◆ inside() [7/7]

bool GeneralNSurfaceDelimitedBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale = 1.f 
) const
overridevirtual

Determine if a point is inside the bounds, taking error into account.

Implements Bounds.

Definition at line 6 of file GeneralNSurfaceDelimitedBounds.cc.

References myInside(), pfClustersFromCombinedCaloHF_cfi::scale, mathSSE::sqrt(), tolerance, LocalError::xx(), and LocalError::yy().

6  {
7  // derive on-surface tolerance from LocalError in a very approximate way
8  float tolerance = scale * sqrt(le.xx() * le.xx() + le.yy() * le.yy());
9 
10  return myInside(lp, tolerance);
11 }
bool myInside(const Local3DPoint &lp, float tolerance) const
const double tolerance
T sqrt(T t)
Definition: SSEVec.h:19

◆ length()

float GeneralNSurfaceDelimitedBounds::length ( ) const
inlineoverridevirtual

"Lenght" of the bounded volume; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 24 of file GeneralNSurfaceDelimitedBounds.h.

24 { return 0; }

◆ myInside()

bool GeneralNSurfaceDelimitedBounds::myInside ( const Local3DPoint lp,
float  tolerance 
) const
private

Definition at line 13 of file GeneralNSurfaceDelimitedBounds.cc.

References runTauDisplay::gp, mps_fire::i, SurfaceOrientation::onSurface, theLimits, theSurface, Surface::toGlobal(), and tolerance.

Referenced by inside().

13  {
14  // cout << "GeneralNSurfaceDelimitedBounds::myInside called with local point " << lp << endl;
15 
17 
18  // cout << "corresponding Global point " << gp << endl;
19 
20  for (SurfaceContainer::const_iterator i = theLimits.begin(); i != theLimits.end(); i++) {
21  // cout << "Local pos in boundary surface " << i->first->toLocal(gp)
22  // << " side " << i->first->side(gp, tolerance) << " should be "
23  // << i->second << endl;
24 
25  SurfaceOrientation::Side side = i->first->side(gp, tolerance);
26  if (side != i->second && side != SurfaceOrientation::onSurface)
27  return false;
28  }
29  return true;
30 }
const double tolerance
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79

◆ thickness()

float GeneralNSurfaceDelimitedBounds::thickness ( ) const
inlineoverridevirtual

"Thickness" of the bound around the surface; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 26 of file GeneralNSurfaceDelimitedBounds.h.

26 { return 0; }

◆ width()

float GeneralNSurfaceDelimitedBounds::width ( ) const
inlineoverridevirtual

"width" of the bounds; refer to the concrete class documentation for the specific definition.

Implements Bounds.

Definition at line 25 of file GeneralNSurfaceDelimitedBounds.h.

25 { return 0; }

Member Data Documentation

◆ theLimits

SurfaceContainer GeneralNSurfaceDelimitedBounds::theLimits
private

Definition at line 37 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().

◆ theSurface

const Surface* GeneralNSurfaceDelimitedBounds::theSurface
private

Definition at line 38 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().