CMS 3D CMS Logo

GeneralTrapezoidalPlaneBounds Class Reference

GeneralTrapezoidal detector bounds. More...

#include <DataFormats/GeometrySurface/interface/GeneralTrapezoidalPlaneBounds.h>

Inheritance diagram for GeneralTrapezoidalPlaneBounds:

Bounds

List of all members.

Public Member Functions

virtual Boundsclone () 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 Local3DPoint &p) const
 Determine if the point is inside the bounds.
virtual bool inside (const Local2DPoint &p) const
virtual float length () const
 "Lenght" of the bounded volume; refer to the concrete class documentation for the specific definition.
virtual const std::vector< float > parameters () const
virtual float thickness () const
 "Thickness" of the bound around the surface; refer to the concrete class documentation for the specific definition.
virtual float width () const
 "width" of the bounds; refer to the concrete class documentation for the specific definition.
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


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 offsetn, offsetp, funct::tan(), tan_an, tan_ap, tg_tilt, and xoff.

Referenced by clone().

00007                                                                                 : 
00008   hbotedge(be), htopedge(te), tilt_angle(ang), hapothem(a), hthickness(t) {
00009 
00010   // pre-compute offsets of triangles and tg of (half) opening
00011   // angles of the trapezoid for faster inside() implementation
00012     
00013   tg_tilt = tan(ang*M_PI/180.);
00014   xoff = a * tg_tilt;
00015   offsetp = a * (te+be) / (te-be+2.*xoff);  // for x > 0 
00016   tan_ap = (te+xoff) / (offsetp + a);
00017   offsetn = a * (te+be) / (te-be-2.*xoff);  // for x < 0 
00018   tan_an = (xoff-te) / (offsetn + a);
00019 }


Member Function Documentation

virtual Bounds* GeneralTrapezoidalPlaneBounds::clone ( void   )  const [inline, virtual]

Implements Bounds.

Definition at line 40 of file GeneralTrapezoidalPlaneBounds.h.

References GeneralTrapezoidalPlaneBounds().

00040                                 { 
00041     return new GeneralTrapezoidalPlaneBounds(*this);
00042   }

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 Bounds::inside().

00034                                                                                         {
00035     return Bounds::inside(p,err,scale);
00036   }

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(), funct::sqrt(), tilt_angle, tmp, LocalError::xx(), and LocalError::yy().

00035                                                                                       {
00036 
00037   GeneralTrapezoidalPlaneBounds tmp( hbotedge + sqrt(err.xx())*scale,
00038                                      htopedge + sqrt(err.xx())*scale,
00039                                      tilt_angle,
00040                                      hapothem + sqrt(err.yy())*scale,
00041                                      hthickness);
00042   return tmp.inside(p);
00043 }

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 funct::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().

00027                                                                        {
00028   return std::abs(p.y()) <= hapothem &&
00029     ( (p.x() >=0. && p.x()/(p.y()+offsetp) <= tan_ap) ||
00030       (p.x() < 0. && p.x()/(p.y()+offsetn) >= tan_an) ) &&
00031     std::abs(p.z()) <= hthickness;
00032 }

bool GeneralTrapezoidalPlaneBounds::inside ( const Local2DPoint p  )  const [virtual]

Reimplemented from Bounds.

Definition at line 21 of file GeneralTrapezoidalPlaneBounds.cc.

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

Referenced by inside().

00021                                                                        {
00022   return std::abs(p.y()) <= hapothem && 
00023     ( (p.x() >=0. && p.x()/(p.y()+offsetp) <= tan_ap) ||
00024       (p.x() < 0. && p.x()/(p.y()+offsetn) >= tan_an) );
00025 }

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.

00022 { 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.

00045                                                                        { 
00046   std::vector<float> vec(7);
00047   // Same order as geant3 for constructor compatibility
00048   vec[0] = hthickness;
00049   vec[1] = 0;
00050   vec[2] = 0;
00051   vec[3] = hapothem;
00052   vec[4] = hbotedge;
00053   vec[5] = htopedge;
00054   vec[6] = tilt_angle;
00055   return vec;
00056 }

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.

00024 { return 2 * hthickness;}

virtual float GeneralTrapezoidalPlaneBounds::width (  )  const [inline, virtual]

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

00023 { return 2 * std::max( hbotedge, htopedge);}

virtual float GeneralTrapezoidalPlaneBounds::widthAtHalfLength (  )  const [inline, virtual]

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.

00026 {return hbotedge+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().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:21:11 2009 for CMSSW by  doxygen 1.5.4