CMS 3D CMS Logo

Public Member Functions | Private Attributes

GeneralTrapezoidalPlaneBounds Class Reference

#include <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 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

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

                                                                                : 
  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);
}

Member Function Documentation

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

                                                                       {
  return std::abs(p.y()) <= hapothem && 
    ( (p.x() >=0. && p.x()/(p.y()+offsetp) <= tan_ap) ||
      (p.x() < 0. && p.x()/(p.y()+offsetn) >= tan_an) );
}
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().

                                                                       {
  return std::abs(p.y()) <= hapothem &&
    ( (p.x() >=0. && p.x()/(p.y()+offsetp) <= tan_ap) ||
      (p.x() < 0. && p.x()/(p.y()+offsetn) >= tan_an) ) &&
    std::abs(p.z()) <= hthickness;
}
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]

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

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

{return hbotedge+htopedge;}

Member Data Documentation

Definition at line 49 of file GeneralTrapezoidalPlaneBounds.h.

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

Definition at line 46 of file GeneralTrapezoidalPlaneBounds.h.

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

Definition at line 50 of file GeneralTrapezoidalPlaneBounds.h.

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

Definition at line 47 of file GeneralTrapezoidalPlaneBounds.h.

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

Definition at line 55 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

Definition at line 55 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

Definition at line 56 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

Definition at line 56 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds(), and inside().

Definition at line 54 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds().

Definition at line 48 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by inside(), and parameters().

Definition at line 53 of file GeneralTrapezoidalPlaneBounds.h.

Referenced by GeneralTrapezoidalPlaneBounds().