CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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::Side
SurfaceAndSide
 
typedef std::vector
< SurfaceAndSide
SurfaceContainer
 

Public Member Functions

Boundsclone () const override
 
 GeneralNSurfaceDelimitedBounds (const Surface *surf, const std::vector< SurfaceAndSide > &limits)
 
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

Definition at line 18 of file GeneralNSurfaceDelimitedBounds.h.

Definition at line 19 of file GeneralNSurfaceDelimitedBounds.h.

Constructor & Destructor Documentation

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

Member Function Documentation

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)
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
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(), 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 }
const double tolerance
T sqrt(T t)
Definition: SSEVec.h:19
bool myInside(const Local3DPoint &lp, float tolerance) const
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; }
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, and Surface::toGlobal().

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 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
const double tolerance
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; }
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

SurfaceContainer GeneralNSurfaceDelimitedBounds::theLimits
private

Definition at line 37 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().

const Surface* GeneralNSurfaceDelimitedBounds::theSurface
private

Definition at line 38 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().