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)
 
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 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 19 of file GeneralNSurfaceDelimitedBounds.h.

Definition at line 20 of file GeneralNSurfaceDelimitedBounds.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by clone().

Member Function Documentation

Bounds* GeneralNSurfaceDelimitedBounds::clone ( void  ) const
inlineoverridevirtual

Implements Bounds.

Definition at line 39 of file GeneralNSurfaceDelimitedBounds.h.

References GeneralNSurfaceDelimitedBounds().

39 {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 33 of file GeneralNSurfaceDelimitedBounds.h.

References f, myInside(), and Scenarios_cff::scale.

33  {
34  return myInside(lp,0);
35  }
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(), RecoTauCleanerPlugins::tolerance, LocalError::xx(), and LocalError::yy().

8 {
9  // derive on-surface tolerance from LocalError in a very approximate way
10  float tolerance = scale * sqrt( le.xx()*le.xx() + le.yy()*le.yy());
11 
12  return myInside( lp, tolerance);
13 }
T sqrt(T t)
Definition: SSEVec.h:18
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 26 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by Vispa.Views.LineDecayView.DecayLine::arrowBoundingRect(), Vispa.Views.LineDecayView.DecayLine::labelBoundingRect(), and Vispa.Views.LineDecayView.DecayLine::paint().

26 { return 0;}
bool GeneralNSurfaceDelimitedBounds::myInside ( const Local3DPoint lp,
float  tolerance 
) const
private

Definition at line 15 of file GeneralNSurfaceDelimitedBounds.cc.

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

Referenced by inside().

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

References Bounds::inside().

28 { return 0;}
float GeneralNSurfaceDelimitedBounds::width ( ) const
inlineoverridevirtual

Member Data Documentation

SurfaceContainer GeneralNSurfaceDelimitedBounds::theLimits
private

Definition at line 43 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().

const Surface* GeneralNSurfaceDelimitedBounds::theSurface
private

Definition at line 44 of file GeneralNSurfaceDelimitedBounds.h.

Referenced by myInside().