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 Local2DPoint &p) const
 
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...
 
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 Local3DPoint &) const=0
 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...
 
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...
 
bool inside (const Local3DPoint &lp) const override
 Determine if the point is inside the bounds. 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, const LocalError &err, float scale=1.f) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, float tollerance) const
 Determine if a point is inside the bounds, taking a tollerance 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

Definition at line 21 of file GeneralNSurfaceDelimitedBounds.h.

22  : theLimits(limits), theSurface(surf) {}

Referenced by clone().

Member Function Documentation

◆ clone()

Bounds* GeneralNSurfaceDelimitedBounds::clone ( void  ) const
inlineoverridevirtual

Implements Bounds.

Definition at line 34 of file GeneralNSurfaceDelimitedBounds.h.

34 { return new GeneralNSurfaceDelimitedBounds(*this); }

References GeneralNSurfaceDelimitedBounds().

◆ inside() [1/7]

virtual bool Bounds::inside
inline

Definition at line 39 of file Bounds.h.

39 { return inside(Local3DPoint(p.x(), p.y(), 0)); }

◆ inside() [2/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  }

◆ inside() [3/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  }

◆ inside() [4/7]

virtual bool Bounds::inside

Determine if the point is inside the bounds.

◆ inside() [5/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.

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 }

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

◆ inside() [6/7]

virtual bool Bounds::inside

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

◆ inside() [7/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.

30 { return myInside(lp, 0); }

References myInside().

◆ 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.

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 }

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

Referenced by inside().

◆ 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().

mps_fire.i
i
Definition: mps_fire.py:428
SurfaceOrientation::onSurface
Definition: Surface.h:18
L1EGammaCrystalsEmulatorProducer_cfi.scale
scale
Definition: L1EGammaCrystalsEmulatorProducer_cfi.py:10
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
GeneralNSurfaceDelimitedBounds::myInside
bool myInside(const Local3DPoint &lp, float tolerance) const
Definition: GeneralNSurfaceDelimitedBounds.cc:13
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
Surface::toGlobal
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:79
Point3DBase< float, GlobalTag >
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
LocalError
Definition: LocalError.h:12
tolerance
const double tolerance
Definition: HGCalGeomParameters.cc:29
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
SurfaceOrientation::Side
Side
Definition: Surface.h:18
TH2PolyOfflineMaps.limits
limits
Definition: TH2PolyOfflineMaps.py:45
GeneralNSurfaceDelimitedBounds::theLimits
SurfaceContainer theLimits
Definition: GeneralNSurfaceDelimitedBounds.h:37
GeneralNSurfaceDelimitedBounds::GeneralNSurfaceDelimitedBounds
GeneralNSurfaceDelimitedBounds(const Surface *surf, const std::vector< SurfaceAndSide > &limits)
Definition: GeneralNSurfaceDelimitedBounds.h:21
GeneralNSurfaceDelimitedBounds::theSurface
const Surface * theSurface
Definition: GeneralNSurfaceDelimitedBounds.h:38
GeneralNSurfaceDelimitedBounds::inside
bool inside(const Local3DPoint &lp) const override
Determine if the point is inside the bounds.
Definition: GeneralNSurfaceDelimitedBounds.h:30
Local3DPoint
Point3DBase< float, LocalTag > Local3DPoint
Definition: LocalPoint.h:9