CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
GeneralTrapezoidalPlaneBounds Class Reference

#include <GeneralTrapezoidalPlaneBounds.h>

Inheritance diagram for GeneralTrapezoidalPlaneBounds:
Bounds

Public Member Functions

virtual Boundsclone () const
 
 GeneralTrapezoidalPlaneBounds (float be, float te, float ang, float a, float t)
 
virtual bool inside (const Local2DPoint &p) const
 
virtual bool inside (const Local3DPoint &p) const
 Determine if the point is inside the bounds. More...
 
virtual bool inside (const Local3DPoint &p, const LocalError &err, float scale) const
 Determine if a point is inside the bounds, taking error into account. More...
 
virtual bool inside (const Local2DPoint &p, const LocalError &err, float scale) const
 Determine if a 2D point is inside the bounds, taking error into account. More...
 
virtual float length () const
 
virtual const std::vector< float > parameters () const
 
virtual float thickness () const
 
virtual float width () const
 
virtual float widthAtHalfLength () const
 Width at half length. Useful for e.g. pitch definition. More...
 
- Public Member Functions inherited from Bounds
virtual ~Bounds ()
 

Private Attributes

float hapothem
 
float hbotedge
 
float hthickness
 
float htopedge
 
float offsetn
 
float offsetp
 
float tan_an
 
float tan_ap
 
float tg_tilt
 
float tilt_angle
 
float xoff
 

Detailed Description

GeneralTrapezoidal detector bounds. Local Coordinate system coincides with center of the box with y axis being the symmetry axis along the height and pointing in the direction of top_edge.

Definition at line 16 of file GeneralTrapezoidalPlaneBounds.h.

Constructor & Destructor Documentation

GeneralTrapezoidalPlaneBounds::GeneralTrapezoidalPlaneBounds ( float  be,
float  te,
float  ang,
float  a,
float  t 
)

Definition at line 6 of file GeneralTrapezoidalPlaneBounds.cc.

References M_PI, offsetn, offsetp, funct::tan(), tan_an, tan_ap, tg_tilt, and xoff.

Referenced by clone().

7  :
8  hbotedge(be), htopedge(te), tilt_angle(ang), hapothem(a), hthickness(t) {
9 
10  // pre-compute offsets of triangles and tg of (half) opening
11  // angles of the trapezoid for faster inside() implementation
12 
13  tg_tilt = tan(ang*M_PI/180.);
14  xoff = a * tg_tilt;
15  offsetp = a * (te+be) / (te-be+2.*xoff); // for x > 0
16  tan_ap = (te+xoff) / (offsetp + a);
17  offsetn = a * (te+be) / (te-be-2.*xoff); // for x < 0
18  tan_an = (xoff-te) / (offsetn + a);
19 }
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
#define M_PI
Definition: BFit3D.cc:3
double a
Definition: hdecay.h:121

Member Function Documentation

virtual Bounds* GeneralTrapezoidalPlaneBounds::clone ( void  ) const
inlinevirtual

Implements Bounds.

Definition at line 40 of file GeneralTrapezoidalPlaneBounds.h.

References GeneralTrapezoidalPlaneBounds().

40  {
41  return new GeneralTrapezoidalPlaneBounds(*this);
42  }
GeneralTrapezoidalPlaneBounds(float be, float te, float ang, float a, float t)
bool GeneralTrapezoidalPlaneBounds::inside ( const Local2DPoint p) const
virtual

Reimplemented from Bounds.

Definition at line 21 of file GeneralTrapezoidalPlaneBounds.cc.

References abs, hapothem, offsetn, offsetp, tan_an, tan_ap, PV2DBase< T, PVType, FrameType >::x(), and PV2DBase< T, PVType, FrameType >::y().

Referenced by inside().

21  {
22  return std::abs(p.y()) <= hapothem &&
23  ( (p.x() >=0. && p.x()/(p.y()+offsetp) <= tan_ap) ||
24  (p.x() < 0. && p.x()/(p.y()+offsetn) >= tan_an) );
25 }
T y() const
Definition: PV2DBase.h:40
#define abs(x)
Definition: mlp_lapack.h:159
T x() const
Definition: PV2DBase.h:39
bool GeneralTrapezoidalPlaneBounds::inside ( const Local3DPoint ) const
virtual
bool GeneralTrapezoidalPlaneBounds::inside ( const Local3DPoint ,
const LocalError ,
float  scale 
) const
virtual

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

Implements Bounds.

Definition at line 34 of file GeneralTrapezoidalPlaneBounds.cc.

References hapothem, hbotedge, hthickness, htopedge, inside(), mathSSE::sqrt(), tilt_angle, tmp, LocalError::xx(), and LocalError::yy().

virtual bool GeneralTrapezoidalPlaneBounds::inside ( const Local2DPoint p,
const LocalError err,
float  scale 
) const
inlinevirtual

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

Reimplemented from Bounds.

Definition at line 34 of file GeneralTrapezoidalPlaneBounds.h.

References Bounds::inside().

34  {
35  return Bounds::inside(p,err,scale);
36  }
virtual bool inside(const Local3DPoint &) const =0
Determine if the point is inside the bounds.
virtual float GeneralTrapezoidalPlaneBounds::length ( ) const
inlinevirtual

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

Implements Bounds.

Definition at line 22 of file GeneralTrapezoidalPlaneBounds.h.

References hapothem.

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

const std::vector< float > GeneralTrapezoidalPlaneBounds::parameters ( void  ) const
virtual
virtual float GeneralTrapezoidalPlaneBounds::thickness ( ) const
inlinevirtual

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

Implements Bounds.

Definition at line 24 of file GeneralTrapezoidalPlaneBounds.h.

References hthickness.

virtual float GeneralTrapezoidalPlaneBounds::width ( ) const
inlinevirtual

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

Implements Bounds.

Definition at line 23 of file GeneralTrapezoidalPlaneBounds.h.

References hbotedge, htopedge, and max().

Referenced by python.Vispa.Main.MainWindow.MainWindow::_saveIni(), python.Vispa.Gui.VispaWidget.VispaWidget::autosize(), python.Vispa.Gui.VispaWidget.VispaWidget::boundingRect(), python.Vispa.Gui.VispaWidget.VispaWidget::contentRect(), python.Vispa.Gui.VispaWidget.VispaWidget::defineArrowBackgroundShape(), python.Vispa.Gui.VispaWidget.VispaWidget::defineCircleBackgroundShape(), python.Vispa.Gui.VispaWidget.VispaWidget::defineRoundRectBackgroundShape(), python.Vispa.Gui.VispaWidget.VispaWidget::drawHeaderBackground(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::drawPortNames(), python.Vispa.Gui.VispaWidget.VispaWidget::imageRectF(), python.Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), python.Vispa.Views.PropertyView.PropertyView::resizeEvent(), python.Vispa.Views.PropertyView.PropertyView::sectionResized(), python.Vispa.Gui.VispaWidget.VispaWidget::setZoom(), and python.Vispa.Main.MainWindow.MainWindow::updateStartupScreenGeometry().

virtual float GeneralTrapezoidalPlaneBounds::widthAtHalfLength ( ) const
inlinevirtual

Width at half length. Useful for e.g. pitch definition.

Reimplemented from Bounds.

Definition at line 26 of file GeneralTrapezoidalPlaneBounds.h.

References hbotedge, and htopedge.

Member Data Documentation

float GeneralTrapezoidalPlaneBounds::hapothem
private

Definition at line 49 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by inside(), length(), and parameters().

float GeneralTrapezoidalPlaneBounds::hbotedge
private

Definition at line 46 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by inside(), parameters(), width(), and widthAtHalfLength().

float GeneralTrapezoidalPlaneBounds::hthickness
private

Definition at line 50 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by inside(), parameters(), and thickness().

float GeneralTrapezoidalPlaneBounds::htopedge
private

Definition at line 47 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by inside(), parameters(), width(), and widthAtHalfLength().

float GeneralTrapezoidalPlaneBounds::offsetn
private

Definition at line 55 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

float GeneralTrapezoidalPlaneBounds::offsetp
private

Definition at line 55 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

float GeneralTrapezoidalPlaneBounds::tan_an
private

Definition at line 56 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

float GeneralTrapezoidalPlaneBounds::tan_ap
private

Definition at line 56 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

float GeneralTrapezoidalPlaneBounds::tg_tilt
private

Definition at line 54 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds().

float GeneralTrapezoidalPlaneBounds::tilt_angle
private

Definition at line 48 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by inside(), and parameters().

float GeneralTrapezoidalPlaneBounds::xoff
private

Definition at line 53 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds().