CMS 3D CMS Logo

Public Member Functions | Private Attributes

DiskSectorBounds Class Reference

#include <DiskSectorBounds.h>

Inheritance diagram for DiskSectorBounds:
Bounds

List of all members.

Public Member Functions

virtual Boundsclone () const
 DiskSectorBounds (float rmin, float rmax, float zmin, float zmax, float phiExt)
float innerRadius () const
virtual bool inside (const Local3DPoint &p) const
 Determine if the point is inside the bounds.
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 LocalError &err) const
virtual float length () const
float outerRadius () const
float phiExtension () const
virtual float thickness () const
virtual float width () const

Private Attributes

float theOffset
float thePhiExt
float theRmax
float theRmin
float theZmax
float theZmin

Detailed Description

Definition at line 13 of file DiskSectorBounds.h.


Constructor & Destructor Documentation

DiskSectorBounds::DiskSectorBounds ( float  rmin,
float  rmax,
float  zmin,
float  zmax,
float  phiExt 
) [inline]

Definition at line 16 of file DiskSectorBounds.h.

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

Referenced by clone().

                                                                                   : 
     theRmin(rmin), theRmax(rmax), theZmin(zmin), theZmax(zmax), thePhiExt(phiExt) {
     if ( theRmin > theRmax) std::swap( theRmin, theRmax);
     if ( theZmin > theZmax) std::swap( theZmin, theZmax);
     theOffset = theRmin + (theRmax-theRmin)/2. ;
   }

Member Function Documentation

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

Implements Bounds.

Definition at line 35 of file DiskSectorBounds.h.

References DiskSectorBounds().

                                 { 
     return new DiskSectorBounds(*this);
   }
float DiskSectorBounds::innerRadius ( void  ) const [inline]

Definition at line 39 of file DiskSectorBounds.h.

References theRmin.

Referenced by BoundDiskSector::innerRadius().

{return theRmin;}
bool DiskSectorBounds::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 17 of file DiskSectorBounds.cc.

References SiPixelRawToDigiRegional_cfi::deltaPhi, deltaR(), f, max(), perp(), perp2(), LocalError::rotate(), mathSSE::sqrt(), tmp, PV3DBase< T, PVType, FrameType >::x(), LocalError::xx(), LocalError::xy(), PV3DBase< T, PVType, FrameType >::y(), LocalError::yy(), and PV3DBase< T, PVType, FrameType >::z().

                                                                                              {

  if (p.z() < theZmin || p.z() > theZmax) return false;

  Local3DPoint tmp( p.x(), p.y()+ theOffset, p.z());
  double perp2 = tmp.perp2();
  double perp = sqrt(perp2);

  // this is not really correct, should consider also the angle of the error ellipse
   if (perp2 == 0) return scale*scale*err.yy()   > theRmin*theRmin;

   LocalError tmpErr( err.xx(), err.xy(), err.yy());
   LocalError rotatedErr = tmpErr.rotate(tmp.x(), tmp.y());
   // x direction in this system is now r, phi is y
 
   float deltaR = scale*sqrt(rotatedErr.xx());
   float deltaPhi = atan( scale*sqrt(rotatedErr.yy())/perp);

   float tmpPhi = acos( tmp.y() / perp);
   
   return  perp >= max(theRmin-deltaR, 0.f) && perp <= theRmax+deltaR 
     && tmpPhi <= thePhiExt + deltaPhi ;  

}
bool DiskSectorBounds::inside ( const Local3DPoint ) const [virtual]

Determine if the point is inside the bounds.

Implements Bounds.

Definition at line 5 of file DiskSectorBounds.cc.

References tmp, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by inside().

                                                          {
  
  // transform to system with local frame situated at disk center
  // and rotated  x/y axis
  Local3DPoint tmp( p.y()+theOffset, -p.x(), p.z());
  
  return  fabs(tmp.phi()) <= thePhiExt/2. &&
    tmp.perp() >= theRmin && tmp.perp() <= theRmax &&
    tmp.z() >= theZmin && tmp.z() <= theZmax ;

}
virtual bool DiskSectorBounds::inside ( const Local2DPoint p,
const LocalError err 
) const [inline, virtual]

Definition at line 31 of file DiskSectorBounds.h.

References inside().

                                                                            {
     return Bounds::inside(p,err);
   }
virtual float DiskSectorBounds::length ( ) const [inline, virtual]

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

Implements Bounds.

Definition at line 23 of file DiskSectorBounds.h.

References funct::cos(), thePhiExt, theRmax, and theRmin.

{ return theRmax-theRmin*cos(thePhiExt/2.);}
float DiskSectorBounds::outerRadius ( void  ) const [inline]

Definition at line 40 of file DiskSectorBounds.h.

References theRmax.

Referenced by BoundDiskSector::outerRadius().

{return theRmax;}
float DiskSectorBounds::phiExtension ( ) const [inline]

Definition at line 41 of file DiskSectorBounds.h.

References thePhiExt.

Referenced by BoundDiskSector::phiExtension().

{return thePhiExt;}
virtual float DiskSectorBounds::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 25 of file DiskSectorBounds.h.

References theZmax, and theZmin.

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

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

Implements Bounds.

Definition at line 24 of file DiskSectorBounds.h.

References funct::sin(), thePhiExt, and theRmax.

{ return 2*theRmax*sin(thePhiExt/2.);}

Member Data Documentation

float DiskSectorBounds::theOffset [private]

Definition at line 49 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds().

float DiskSectorBounds::thePhiExt [private]

Definition at line 48 of file DiskSectorBounds.h.

Referenced by length(), phiExtension(), and width().

float DiskSectorBounds::theRmax [private]

Definition at line 45 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), length(), outerRadius(), and width().

float DiskSectorBounds::theRmin [private]

Definition at line 44 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), innerRadius(), and length().

float DiskSectorBounds::theZmax [private]

Definition at line 47 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().

float DiskSectorBounds::theZmin [private]

Definition at line 46 of file DiskSectorBounds.h.

Referenced by DiskSectorBounds(), and thickness().