#include <GeneralTrapezoidalPlaneBounds.h>
Public Member Functions | |
virtual Bounds * | clone () const |
GeneralTrapezoidalPlaneBounds (float be, float te, float ang, float a, float t) | |
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. | |
virtual bool | inside (const Local3DPoint &p, const LocalError &err, float scale) const |
Determine if a point is inside the bounds, taking error into account. | |
virtual bool | inside (const Local2DPoint &p) const |
virtual bool | inside (const Local3DPoint &p) const |
Determine if the point is inside the bounds. | |
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. | |
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 |
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.
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().
: hbotedge(be), htopedge(te), tilt_angle(ang), hapothem(a), hthickness(t) { // pre-compute offsets of triangles and tg of (half) opening // angles of the trapezoid for faster inside() implementation tg_tilt = tan(ang*M_PI/180.); xoff = a * tg_tilt; offsetp = a * (te+be) / (te-be+2.*xoff); // for x > 0 tan_ap = (te+xoff) / (offsetp + a); offsetn = a * (te+be) / (te-be-2.*xoff); // for x < 0 tan_an = (xoff-te) / (offsetn + a); }
virtual Bounds* GeneralTrapezoidalPlaneBounds::clone | ( | void | ) | const [inline, virtual] |
Implements Bounds.
Definition at line 40 of file GeneralTrapezoidalPlaneBounds.h.
References GeneralTrapezoidalPlaneBounds().
{ return new GeneralTrapezoidalPlaneBounds(*this); }
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().
virtual bool GeneralTrapezoidalPlaneBounds::inside | ( | const Local2DPoint & | p, |
const LocalError & | err, | ||
float | scale | ||
) | const [inline, virtual] |
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 inside().
{ return Bounds::inside(p,err,scale); }
bool GeneralTrapezoidalPlaneBounds::inside | ( | const Local3DPoint & | ) | const [virtual] |
Determine if the point is inside the bounds.
Implements Bounds.
Definition at line 27 of file GeneralTrapezoidalPlaneBounds.cc.
References abs, hapothem, hthickness, offsetn, offsetp, tan_an, tan_ap, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().
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().
{ GeneralTrapezoidalPlaneBounds tmp( hbotedge + sqrt(err.xx())*scale, htopedge + sqrt(err.xx())*scale, tilt_angle, hapothem + sqrt(err.yy())*scale, hthickness); return tmp.inside(p); }
virtual float GeneralTrapezoidalPlaneBounds::length | ( | ) | const [inline, virtual] |
"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.
{ return 2 * hapothem;}
const std::vector< float > GeneralTrapezoidalPlaneBounds::parameters | ( | void | ) | const [virtual] |
Definition at line 45 of file GeneralTrapezoidalPlaneBounds.cc.
References hapothem, hbotedge, hthickness, htopedge, and tilt_angle.
{ std::vector<float> vec(7); // Same order as geant3 for constructor compatibility vec[0] = hthickness; vec[1] = 0; vec[2] = 0; vec[3] = hapothem; vec[4] = hbotedge; vec[5] = htopedge; vec[6] = tilt_angle; return vec; }
virtual float GeneralTrapezoidalPlaneBounds::thickness | ( | ) | const [inline, virtual] |
"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.
{ return 2 * hthickness;}
virtual float GeneralTrapezoidalPlaneBounds::width | ( | ) | const [inline, virtual] |
virtual float GeneralTrapezoidalPlaneBounds::widthAtHalfLength | ( | ) | const [inline, virtual] |
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().