CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
BoundingBox Class Reference

#include <BoundingBox.h>

Public Member Functions

 BoundingBox ()
 
 BoundingBox (const Plane &plane)
 
GlobalPoint const & corner (unsigned int i) const
 
GlobalPoint const & operator[] (unsigned int i) const
 

Static Public Member Functions

static std::vector< GlobalPointcorners (const Plane &)
 

Private Attributes

GlobalPoint m_corners [8]
 

Detailed Description

A helper class that returns the corners of a rectangle that fully contains a bound plane.

Definition at line 12 of file BoundingBox.h.

Constructor & Destructor Documentation

BoundingBox::BoundingBox ( )
inline

Definition at line 14 of file BoundingBox.h.

References corners().

14 {}
BoundingBox::BoundingBox ( const Plane plane)

Member Function Documentation

GlobalPoint const& BoundingBox::corner ( unsigned int  i) const
inline

Definition at line 21 of file BoundingBox.h.

References mps_fire::i, and m_corners.

21 { return m_corners[i]; }
GlobalPoint m_corners[8]
Definition: BoundingBox.h:24
std::vector< GlobalPoint > BoundingBox::corners ( const Plane )
static

Definition at line 20 of file BoundingBox.cc.

References mps_fire::result.

Referenced by BoundingBox(), RodPlaneBuilderFromDet::computeBounds(), ForwardRingDiskBuilderFromDet::computeBounds(), Phase1PixelBlade::computeRadiusRanges(), PlaneBuilderForGluedDet::computeRectBounds(), BarrelDetLayer::computeSurface(), ForwardDetLayer::computeSurface(), CylinderBuilderFromDet::operator()(), and PhiBorderFinder::PhiBorderFinder().

20  {
21  std::vector<GlobalPoint> result;
22  result.reserve(8);
23 
24  float hLen = plane.bounds().length() / 2;
25  float hWid = plane.bounds().width() / 2;
26  float hThick = plane.bounds().thickness() / 2;
27 
28  result.push_back(plane.toGlobal(LocalPoint(hWid, hLen, hThick)));
29  result.push_back(plane.toGlobal(LocalPoint(hWid, hLen, -hThick)));
30  result.push_back(plane.toGlobal(LocalPoint(hWid, -hLen, hThick)));
31  result.push_back(plane.toGlobal(LocalPoint(hWid, -hLen, -hThick)));
32  result.push_back(plane.toGlobal(LocalPoint(-hWid, hLen, hThick)));
33  result.push_back(plane.toGlobal(LocalPoint(-hWid, hLen, -hThick)));
34  result.push_back(plane.toGlobal(LocalPoint(-hWid, -hLen, hThick)));
35  result.push_back(plane.toGlobal(LocalPoint(-hWid, -hLen, -hThick)));
36 
37  return result;
38 }
GlobalPoint const& BoundingBox::operator[] ( unsigned int  i) const
inline

Definition at line 20 of file BoundingBox.h.

References mps_fire::i, and m_corners.

20 { return m_corners[i]; }
GlobalPoint m_corners[8]
Definition: BoundingBox.h:24

Member Data Documentation

GlobalPoint BoundingBox::m_corners[8]
private

Definition at line 24 of file BoundingBox.h.

Referenced by corner(), and operator[]().