CMS 3D CMS Logo

Public Member Functions | Private Attributes

SimpleCylinderBounds Class Reference

#include <SimpleCylinderBounds.h>

Inheritance diagram for SimpleCylinderBounds:
Bounds

List of all members.

Public Member Functions

virtual Boundsclone () const
virtual bool inside (const Local3DPoint &p) const
 Determine if the point is inside the bounds.
virtual bool inside (const Local2DPoint &p, const LocalError &err) const
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 float length () const
 Lenght of the cylinder.
 SimpleCylinderBounds (float rmin, float rmax, float zmin, float zmax)
virtual float thickness () const
 Thikness of the "pipe", i.e. difference between outer and inner radius.
virtual float width () const
 Outer diameter of the cylinder.

Private Attributes

float theRmax
float theRmin
float theZmax
float theZmin

Detailed Description

Cylinder bounds. The cylinder axis coincides with the Z axis. The bounds limit the length at constant Z, and allow finite thickness. The cylinder bound in this way looks like a pipe cut perpendicularily to it's axis. Width is intended as the (outer) diameter of the pipe and thickness as the thickness of the pipe, i.e. difference between outer and inner radius

Definition at line 20 of file SimpleCylinderBounds.h.


Constructor & Destructor Documentation

SimpleCylinderBounds::SimpleCylinderBounds ( float  rmin,
float  rmax,
float  zmin,
float  zmax 
)

Definition at line 5 of file SimpleCylinderBounds.cc.

References swap(), theRmax, theRmin, theZmax, and theZmin.

Referenced by clone().

                                                                                          : 
  theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax) {
  if ( theRmin > theRmax) std::swap( theRmin, theRmax);
  if ( theZmin > theZmax) std::swap( theZmin, theZmax);
}

Member Function Documentation

Bounds * SimpleCylinderBounds::clone ( void  ) const [virtual]

Implements Bounds.

Definition at line 29 of file SimpleCylinderBounds.cc.

References SimpleCylinderBounds().

                                          { 
  return new SimpleCylinderBounds(*this);
}
bool SimpleCylinderBounds::inside ( const Local2DPoint p,
const LocalError err 
) const [virtual]

Definition at line 25 of file SimpleCylinderBounds.cc.

References inside().

                                                                                     {
  return Bounds::inside(p,err);
}
bool SimpleCylinderBounds::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 16 of file SimpleCylinderBounds.cc.

References inside(), mathSSE::sqrt(), theRmax, theRmin, theZmax, theZmin, tmp, and LocalError::yy().

                                                                                                 {

    SimpleCylinderBounds tmp( theRmin, theRmax,
                              theZmin - sqrt(err.yy())*scale,
                              theZmax + sqrt(err.yy())*scale);
    
    return tmp.inside(p);
  }
bool SimpleCylinderBounds::inside ( const Local3DPoint ) const [virtual]

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 11 of file SimpleCylinderBounds.cc.

References PV3DBase< T, PVType, FrameType >::perp(), theRmax, theRmin, theZmax, theZmin, and PV3DBase< T, PVType, FrameType >::z().

Referenced by inside().

                                                              {
  return p.z()    > theZmin && p.z()    < theZmax &&
    p.perp() > theRmin && p.perp() < theRmax;
}
virtual float SimpleCylinderBounds::length ( ) const [inline, virtual]

Lenght of the cylinder.

Implements Bounds.

Definition at line 26 of file SimpleCylinderBounds.h.

References theZmax, and theZmin.

{ return theZmax - theZmin;}
virtual float SimpleCylinderBounds::thickness ( ) const [inline, virtual]

Thikness of the "pipe", i.e. difference between outer and inner radius.

Implements Bounds.

Definition at line 30 of file SimpleCylinderBounds.h.

References theRmax, and theRmin.

{ return theRmax-theRmin;}
virtual float SimpleCylinderBounds::width ( ) const [inline, virtual]

Outer diameter of the cylinder.

Implements Bounds.

Definition at line 28 of file SimpleCylinderBounds.h.

References theRmax.

{ return 2*theRmax;}

Member Data Documentation

Definition at line 44 of file SimpleCylinderBounds.h.

Referenced by inside(), SimpleCylinderBounds(), thickness(), and width().

Definition at line 43 of file SimpleCylinderBounds.h.

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

Definition at line 46 of file SimpleCylinderBounds.h.

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

Definition at line 45 of file SimpleCylinderBounds.h.

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