| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

SolidTrap Class Reference

A simple implementation of TRAP. More...

#include <DetDesc/SolidTrap.h>

Inheritance diagram for SolidTrap:

[legend]
Collaboration diagram for SolidTrap:
[legend]
List of all members.

Public Types

typedef std::vector< Gaudi::XYZPointVERTICES
 typedef for vertices
typedef double Tick
 useful type definition for dealing with intersections of the solid and the line
typedef StaticArray< Tick, 64 > Ticks
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
enum  Status

Public Member Functions

 SolidTrap (const std::string &name, const double zHalfLength, const double theta, const double phi, const double dyAtMinusZ, const double dxAtMinusZMinusY, const double dxAtMinusZPlusY, const double alphaAtMinusZ, const double dyAtPlusZ, const double dxAtPlusZMinusY, const double dxAtPlusZPlusY, const double alphaAtPlusZ)
 constructor
virtual ~SolidTrap ()
 destructor
std::string typeName () const
 
  • retrieve the TRAP type
    • implementation of ISolid abstract interface

const ISolidcover () const
 
  • retrieve the pointer to "simplified" solid - "cover" -# the cover for Trap is Trd
    • implementation of ISolid abstract interface

virtual std::ostream & printOut (std::ostream &os=std::cout) const
 
  • printout to STD/STL stream
    • implementation of ISolid abstract interface
    • reimplementation of SolidBase::printOut( std::ostream& )

virtual MsgStreamprintOut (MsgStream &os) const
 
  • printout to Gaudi MsgStream stream
    • implementation of ISolid abstract interface
    • reimplementation of SolidBase::printOut( MsgStream& )

const double & zHalfLength () const
 half size in z
virtual const std::string & name () const
 
  • retrieve the name of the concrete Solid object
    • implementation of ISolid abstract interface

virtual ISolidreset ()
 
  • reset solid to its inititial state, remove all auxillary data fields and pointers.

virtual unsigned int intersectionTicks (const Gaudi::XYZPoint &Point, const Gaudi::XYZVector &Vector, ISolid::Ticks &ticks) const
 
  • calculate the intersection points("ticks") of the solid objects with given line.

virtual unsigned int intersectionTicks (const Gaudi::Polar3DPoint &Point, const Gaudi::Polar3DVector &Vector, ISolid::Ticks &ticks) const
virtual unsigned int intersectionTicks (const Gaudi::RhoZPhiPoint &Point, const Gaudi::RhoZPhiVector &Vector, ISolid::Ticks &ticks) const
virtual unsigned int intersectionTicks (const Gaudi::XYZPoint &Point, const Gaudi::XYZVector &Vector, const ISolid::Tick &tickMin, const ISolid::Tick &tickMax, ISolid::Ticks &ticks) const
 
  • calculate the intersection points("ticks") of the solid objects with given line.

virtual unsigned int intersectionTicks (const Gaudi::Polar3DPoint &Point, const Gaudi::Polar3DVector &Vector, const ISolid::Tick &tickMin, const ISolid::Tick &tickMax, ISolid::Ticks &ticks) const
virtual unsigned int intersectionTicks (const Gaudi::RhoZPhiPoint &Point, const Gaudi::RhoZPhiVector &Vector, const ISolid::Tick &tickMin, const ISolid::Tick &tickMax, ISolid::Ticks &ticks) const
virtual StatusCode queryInterface (const InterfaceID &ID, void **ppI)
 
  • query the interface

virtual unsigned long addRef ()
 
  • increment the reference count of Interface instance

virtual unsigned long release ()
 
  • release interface instance

virtual const ISolidcoverTop () const
 
  • retrieve the pointer to "the most simplified cover", ideally to something like "the bounding box"
    • implementation of ISolid interface

double xMin () const
 accessor to "minimal x" value of the solid ("bounding box")
double xMax () const
 accessor to "maximal x" value of the solid ("bounding box")
double yMin () const
 accessor to "minimal y" value of the solid ("bounding box")
double yMax () const
 accessor to "maximal y" value of the solid ("bounding box")
double zMin () const
 accessor to "minimal z" value of the solid ("bounding box")
double zMax () const
 accessor to "maximal z" value of the solid ("bounding box")
double rMax () const
 accessor to "maximal r" value of the solid ("bounding sphere")
double rhoMax () const
 accessor to "maximal rho" value of the solid ("bounding sphere")
virtual bool isInside (const Gaudi::XYZPoint &point) const =0
 check for the given 3D-point.
virtual bool isInside (const Gaudi::Polar3DPoint &point) const =0
virtual bool isInside (const Gaudi::RhoZPhiPoint &point) const =0
virtual Ticks::size_type maxNumberOfTicks () const =0
 Calculate the maximum number of ticks that a straight line could make with this solid.
const double & theta () const
 polar and asimutal angle of the trapezoid
const double & phi () const
const double & dyAtMinusZ () const
 parameters of the bottom face of general trapezoid
const double & dxAtMinusZMinusY () const
const double & dxAtMinusZPlusY () const
const double & alphaAtMinusZ () const
const double & dyAtPlusZ () const
 parameters of the top face of general trapezoid
const double & dxAtPlusZMinusY () const
const double & dxAtPlusZPlusY () const
const double & alphaAtPlusZ () const

Static Public Member Functions

static const InterfaceIDinterfaceID ()
 retrieve the uninque interface identifier

Public Attributes

 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR

Protected Types

typedef std::vector< Gaudi::Plane3DPLANES
 useful type for vector of planes

Protected Member Functions

 SolidTrap (const std::string &Name="Anonymous Trap")
 constructor
void makeAll ()
 initialize the polihedron base
Exceptions:
SolidException wrong parameters

const Gaudi::XYZPointpoint (const VERTICES::size_type &indx) const
 acessor to vertices
template<class aPoint>
bool isOutBBox (const aPoint &point, const double tolerance) const
 Fast check if the point is outside the bounding box of the solid.
template<class aPoint>
bool isOutBBox (const aPoint &point) const
 Fast check if the point is outside the bounding box of the solid.
template<class aPointA, class aPointB>
bool isOutBBox (const aPointA &p1, const aPointB &p2, const double tolerance) const
 Fast check if the segment of the line between two points is outside the bounding box.
template<class aPointA, class aPointB>
bool isOutBBox (const aPointA &p1, const aPointB &p2) const
 Fast check if the segment of the line between two points is outside the bounding box.
template<class aPoint, class aVector>
bool isOutBBox (const aPoint &p, const aVector &v, const ISolid::Tick &tmin, const ISolid::Tick &tmax, const double tolerance) const
 Fast check if the segment of the line between two points is outside the bounding box.
template<class aPoint, class aVector>
bool isOutBBox (const aPoint &p, const aVector &v, const ISolid::Tick &tmin, const ISolid::Tick &tmax) const
 Fast check if the segment of the line between two points is outside the bounding box.
template<class aPoint>
bool isOutBSphere (const aPoint &point, const double tolerance) const
 Fast check if the point is outside the bounding sphere of the solid.
template<class aPoint>
bool isOutBSphere (const aPoint &point) const
 Fast check if the point is outside the bounding sphere of the solid.
template<class aPoint>
bool isOutBCylinder (const aPoint &point, const double tolerance) const
 Fast check if the point is outside the bounding cylinder of the solid.
template<class aPoint>
bool isOutBCylinder (const aPoint &point) const
 Fast check if the point is outside the bounding cylinder of the solid.
template<class aPoint, class aVector>
bool crossBSphere (const aPoint &p, const aVector &v, const double tolerance=0) const
 Fast check if the line cross the bounding sphere.
template<class aPoint, class aVector>
bool crossBCylinder (const aPoint &p, const aVector &v, const double tolerance=0) const
 Fast check if the line cross the surface of bounding cylinder.
void setXMin (const double value)
 set "minimal x" for the solid
void setXMax (const double value)
 set "maximal x" for the solid
void setYMin (const double value)
 set "minimal y" for the solid
void setYMax (const double value)
 set "maximal y" for the solid
void setZMin (const double value)
 set "minimal z" for the solid
void setZMax (const double value)
 set "maximal z" for the solid
void setRMax (const double value)
 set "maximal r" for the solid
void setRhoMax (const double value)
 set "maximal r" for the solid
void checkBP () const
 check bounding parameters
Exceptions:
SolidException for wrong set of bounding parameters

IMessageSvcmsgSvc () const
 accessor to massage service
virtual bool isInside (const Gaudi::XYZPoint &point) const
 
  • Check for the given 3D-point.

virtual bool isInside (const Gaudi::Polar3DPoint &point) const
virtual bool isInside (const Gaudi::RhoZPhiPoint &point) const
virtual unsigned int intersectionTicks (const Gaudi::XYZPoint &Point, const Gaudi::XYZVector &Vector, ISolid::Ticks &ticks) const
 
  • Calculate the intersection points("ticks") of the solid objects with given line.

virtual unsigned int intersectionTicks (const Gaudi::Polar3DPoint &Point, const Gaudi::Polar3DVector &Vector, ISolid::Ticks &ticks) const
virtual unsigned int intersectionTicks (const Gaudi::RhoZPhiPoint &Point, const Gaudi::RhoZPhiVector &Vector, ISolid::Ticks &ticks) const
Ticks::size_type maxNumberOfTicks () const
 Calculate the maximum number of ticks that a straight line could make with this solid.
bool addFace (const Gaudi::XYZPoint &Point1, const Gaudi::XYZPoint &Point2, const Gaudi::XYZPoint &Point3)
 add a face/plane given with 3 points
bool addFace (const Gaudi::XYZPoint &Point1, const Gaudi::XYZPoint &Point2, const Gaudi::XYZPoint &Point3, const Gaudi::XYZPoint &Point4)
 add a face/plane given with 4 points
const PLANESplanes () const
 return vector of faces/planes
template<class aPoint>
bool inside (const aPoint &Point, const Gaudi::Plane3D &Plane) const
 define "inside" method for the plane.
void setBP ()
 set bounding parameters

Protected Attributes

std::string m_name
 name of the solid
ISolidm_cover
 pointer to cover
double m_xmin
double m_ymin
double m_zmin
double m_xmax
double m_ymax
double m_zmax
double m_rmax
double m_rhomax
DetDesc::Servicesm_services
 reference to services
PLANES m_ph_planes
 vector of faces/planes
VERTICES m_ph_vertices

Private Member Functions

 SolidTrap (const SolidTrap &)
 no copy-constructor
SolidTrapoperator= (const SolidTrap &)
 no assignment

Private Attributes

double m_trap_zHalfLength
 trapezoid parameters
double m_trap_theta
double m_trap_phi
double m_trap_dyAtMinusZ
double m_trap_dxAtMinusZMinusY
double m_trap_dxAtMinusZPlusY
double m_trap_alphaAtMinusZ
double m_trap_dyAtPlusZ
double m_trap_dxAtPlusZMinusY
double m_trap_dxAtPlusZPlusY
double m_trap_alphaAtPlusZ
double m_trap_sinAlphaAtPlusZ
double m_trap_cosAlphaAtPlusZ

Friends

class SolidFactory< SolidTrap >
 friend factory for instantiation

Detailed Description

A simple implementation of TRAP.

Author:
Vanya Belyaev Ivan.Belyaev@itep.ru
Date:
xx/xx/xxxx

Definition at line 31 of file SolidTrap.h.


Member Typedef Documentation

typedef std::vector<Gaudi::XYZPoint> SolidTrap::VERTICES

typedef for vertices

Reimplemented from SolidPolyHedronHelper.

Definition at line 40 of file SolidTrap.h.

typedef double ISolid::Tick [inherited]

useful type definition for dealing with intersections of the solid and the line

Definition at line 35 of file ISolid.h.

typedef StaticArray<Tick,64> ISolid::Ticks [inherited]

Definition at line 36 of file ISolid.h.

typedef std::vector<Gaudi::Plane3D> SolidPolyHedronHelper::PLANES [inherited]

useful type for vector of planes

Definition at line 31 of file SolidPolyHedronHelper.h.


Constructor & Destructor Documentation

SolidTrap::SolidTrap ( const std::string &  name,
const double  zHalfLength,
const double  theta,
const double  phi,
const double  dyAtMinusZ,
const double  dxAtMinusZMinusY,
const double  dxAtMinusZPlusY,
const double  alphaAtMinusZ,
const double  dyAtPlusZ,
const double  dxAtPlusZMinusY,
const double  dxAtPlusZPlusY,
const double  alphaAtPlusZ 
)

constructor

Parameters:
name name of trap solid
zHalfLength half length in z
theta theta angle
phi phi angle
dyAtMinusZ delta y at bottom face
dxAtMinusZMinusY delta x at bottom face , minus y
dxAtMinusZPlusY delta x at bottom face , plus y
alphaAtMinusZ alpha angle at bottom face
dyAtPlusZ delta y at top face
dxAtPlusZMinusY delta x at top face, minus y
dxAtPlusZPlusY delta x at top face, plus y
alphaAtPlusZ alpha angle at top face
Exceptions:
SolidException wrong parameters range

virtual SolidTrap::~SolidTrap (  )  [virtual]

destructor

SolidTrap::SolidTrap ( const std::string &  Name = "Anonymous Trap"  )  [protected]

constructor

Parameters:
Name name of general trapezoid

SolidTrap::SolidTrap ( const SolidTrap  )  [private]

no copy-constructor


Member Function Documentation

std::string SolidTrap::typeName (  )  const [inline, virtual]

See also:
ISolid return box type

Implements ISolid.

Definition at line 80 of file SolidTrap.h.

00080 { return "SolidTrap"  ; };

const ISolid* SolidTrap::cover (  )  const [virtual]

See also:
ISolid
Returns:
pointer to "simplified" solid - "cover"

Implements ISolid.

virtual std::ostream& SolidTrap::printOut ( std::ostream &  os = std::cout  )  const [virtual]

See also:
SolidBase

ISolid

Parameters:
os STD/STL stream
Returns:
reference to the stream

Reimplemented from SolidBase.

virtual MsgStream& SolidTrap::printOut ( MsgStream os  )  const [virtual]

See also:
SolidBase

ISolid

Parameters:
os Gaudi MsgStream stream
Returns:
reference to the stream

Reimplemented from SolidBase.

const double& SolidTrap::zHalfLength (  )  const [inline]

half size in z

Returns:
half size in z

Definition at line 113 of file SolidTrap.h.

00114   { return m_trap_zHalfLength      ; };

const double& SolidTrap::theta (  )  const [inline]

polar and asimutal angle of the trapezoid

Definition at line 118 of file SolidTrap.h.

00119   { return m_trap_theta            ; };

const double& SolidTrap::phi (  )  const [inline]

Definition at line 120 of file SolidTrap.h.

00121   { return m_trap_phi              ; }; 

const double& SolidTrap::dyAtMinusZ (  )  const [inline]

parameters of the bottom face of general trapezoid

Definition at line 126 of file SolidTrap.h.

00127   { return m_trap_dyAtMinusZ       ; }; 

const double& SolidTrap::dxAtMinusZMinusY (  )  const [inline]

Definition at line 128 of file SolidTrap.h.

00129   { return m_trap_dxAtMinusZMinusY ; };

const double& SolidTrap::dxAtMinusZPlusY (  )  const [inline]

Definition at line 130 of file SolidTrap.h.

00131   { return m_trap_dxAtMinusZPlusY  ; };

const double& SolidTrap::alphaAtMinusZ (  )  const [inline]

Definition at line 132 of file SolidTrap.h.

00133   { return m_trap_alphaAtMinusZ    ; }; 

const double& SolidTrap::dyAtPlusZ (  )  const [inline]

parameters of the top face of general trapezoid

Definition at line 138 of file SolidTrap.h.

00139   { return m_trap_dyAtPlusZ        ; }; 

const double& SolidTrap::dxAtPlusZMinusY (  )  const [inline]

Definition at line 140 of file SolidTrap.h.

00141   { return m_trap_dxAtPlusZMinusY  ; };

const double& SolidTrap::dxAtPlusZPlusY (  )  const [inline]

Definition at line 142 of file SolidTrap.h.

00143   { return m_trap_dxAtPlusZPlusY   ; };

const double& SolidTrap::alphaAtPlusZ (  )  const [inline]

Definition at line 144 of file SolidTrap.h.

00145   { return m_trap_alphaAtPlusZ     ; }; 

void SolidTrap::makeAll (  )  [protected]

initialize the polihedron base

Exceptions:
SolidException wrong parameters

const Gaudi::XYZPoint& SolidTrap::point ( const VERTICES::size_type &  indx  )  const [inline, protected]

acessor to vertices

Parameters:
indx index of the vertex
Returns:
vertex

Definition at line 164 of file SolidTrap.h.

00165   { return m_ph_vertices[indx]; } 

SolidTrap& SolidTrap::operator= ( const SolidTrap  )  [private]

no assignment

virtual const std::string& SolidBase::name (  )  const [inline, virtual, inherited]

See also:
ISolid
Returns:
name of the solid object

Implements ISolid.

Definition at line 30 of file SolidBase.h.

00030 { return m_name ; }

virtual ISolid* SolidBase::reset (  )  [virtual, inherited]

Implements ISolid.

Reimplemented in SolidBoolean, and SolidChild.

virtual unsigned int SolidBase::intersectionTicks ( const Gaudi::XYZPoint Point,
const Gaudi::XYZVector Vector,
ISolid::Ticks ticks 
) const [virtual, inherited]

  1. Line is parametrized with parameter t : $ \vec{x}(t) = \vec{p} + t \times \vec{v} $
    • $ \vec{p} $ is a point on the line
    • $ \vec{v} $ is a vector along the line
  2. tick is just a value of parameter t, at which the intersection of the solid and the line occurs
  3. both Point ($\vec{p}$) and Vector ($\vec{v}$) are defined in local reference system of the solid

Implements ISolid.

Reimplemented in SolidBoolean, SolidBox, SolidChild, SolidCons, SolidPolycone, SolidPolyHedronHelper, SolidSphere, and SolidTubs.

virtual unsigned int SolidBase::intersectionTicks ( const Gaudi::Polar3DPoint Point,
const Gaudi::Polar3DVector Vector,
ISolid::Ticks ticks 
) const [virtual, inherited]

Implements ISolid.

Reimplemented in SolidBoolean, SolidBox, SolidChild, SolidCons, SolidPolycone, SolidPolyHedronHelper, SolidSphere, and SolidTubs.

virtual unsigned int SolidBase::intersectionTicks ( const Gaudi::RhoZPhiPoint Point,
const Gaudi::RhoZPhiVector Vector,
ISolid::Ticks ticks 
) const [virtual, inherited]

Implements ISolid.

Reimplemented in SolidBoolean, SolidBox, SolidChild, SolidCons, SolidPolycone, SolidPolyHedronHelper, SolidSphere, and SolidTubs.

virtual unsigned int SolidBase::intersectionTicks ( const Gaudi::XYZPoint Point,
const Gaudi::XYZVector Vector,
const ISolid::Tick tickMin,
const ISolid::Tick tickMax,
ISolid::Ticks ticks 
) const [virtual, inherited]

  1. Line is parametrized with parameter t : $ \vec{x}(t) = \vec{p} + t \times \vec{v} $
    • $ \vec{p} $ is a point on the line
    • $ \vec{v} $ is a vector along the line
  2. tick is just a value of parameter t, at which the intersection of the solid and the line occurs
  3. both Point ($\vec{p}$) and Vector ($\vec{v}$) are defined in local reference system of the solid
  4. Only intersection ticks within the range tickMin and tickMax are taken into account.

Implements ISolid.

Reimplemented in SolidBoolean, SolidBox, SolidCons, and SolidTubs.

virtual unsigned int SolidBase::intersectionTicks ( const Gaudi::Polar3DPoint Point,
const Gaudi::Polar3DVector Vector,
const ISolid::Tick tickMin,
const ISolid::Tick tickMax,
ISolid::Ticks ticks 
) const [virtual, inherited]

Implements ISolid.

Reimplemented in SolidBoolean, SolidBox, SolidCons, and SolidTubs.

virtual unsigned int SolidBase::intersectionTicks ( const Gaudi::RhoZPhiPoint Point,
const Gaudi::RhoZPhiVector Vector,
const ISolid::Tick tickMin,
const ISolid::Tick tickMax,
ISolid::Ticks ticks 
) const [virtual, inherited]

Implements ISolid.

Reimplemented in SolidBoolean, SolidBox, SolidCons, and SolidTubs.

virtual StatusCode SolidBase::queryInterface ( const InterfaceID ID,
void **  ppI 
) [virtual, inherited]

See also:
IInterface
Parameters:
ID unique interafce identifier
ppI placeholder for returned interface
Returns:
status code

Implements IInterface.

virtual unsigned long SolidBase::addRef (  )  [virtual, inherited]

See also:
IInterface
Returns:
reference count

Implements IInterface.

virtual unsigned long SolidBase::release (  )  [virtual, inherited]

See also:
IInterface
Returns:
reference count

Implements IInterface.

virtual const ISolid* SolidBase::coverTop (  )  const [virtual, inherited]

See also:
ISolid

ISolid::cover()

Returns:
pointer to the most simplified cover

Implements ISolid.

Reimplemented in SolidBoolean, SolidBox, SolidChild, and SolidUnion.

double SolidBase::xMin (  )  const [inline, inherited]

accessor to "minimal x" value of the solid ("bounding box")

Definition at line 161 of file SolidBase.h.

00161 { return m_xmin    ; }

double SolidBase::xMax (  )  const [inline, inherited]

accessor to "maximal x" value of the solid ("bounding box")

Definition at line 163 of file SolidBase.h.

00163 { return m_xmax    ; }

double SolidBase::yMin (  )  const [inline, inherited]

accessor to "minimal y" value of the solid ("bounding box")

Definition at line 166 of file SolidBase.h.

00166 { return m_ymin    ; }

double SolidBase::yMax (  )  const [inline, inherited]

accessor to "maximal y" value of the solid ("bounding box")

Definition at line 168 of file SolidBase.h.

00168 { return m_ymax    ; }

double SolidBase::zMin (  )  const [inline, inherited]

accessor to "minimal z" value of the solid ("bounding box")

Definition at line 171 of file SolidBase.h.

00171 { return m_zmin    ; }

double SolidBase::zMax (  )  const [inline, inherited]

accessor to "maximal z" value of the solid ("bounding box")

Definition at line 173 of file SolidBase.h.

00173 { return m_zmax    ; }

double SolidBase::rMax (  )  const [inline, inherited]

accessor to "maximal r" value of the solid ("bounding sphere")

Definition at line 176 of file SolidBase.h.

00176 { return m_rmax    ; }

double SolidBase::rhoMax (  )  const [inline, inherited]

accessor to "maximal rho" value of the solid ("bounding sphere")

Definition at line 179 of file SolidBase.h.

00179 { return m_rhomax  ; }

template<class aPoint>
bool SolidBase::isOutBBox ( const aPoint &  point,
const double  tolerance 
) const [inline, protected, inherited]

Fast check if the point is outside the bounding box of the solid.

Parameters:
point point to be checked
tolerance tolerance parameter
Returns:
true of point is outside the bounding box

Definition at line 190 of file SolidBase.h.

00192   {
00193     return 
00194       point.z () < zMin () - tolerance ||
00195       point.z () > zMax () + tolerance ||
00196       point.x () < xMin () - tolerance ||
00197       point.x () > xMax () + tolerance ||
00198       point.y () < yMin () - tolerance ||
00199       point.y () > yMax () + tolerance ;
00200   };

template<class aPoint>
bool SolidBase::isOutBBox ( const aPoint &  point  )  const [inline, protected, inherited]

Fast check if the point is outside the bounding box of the solid.

Parameters:
point point to be checked
Returns:
true of point is outside the bounding box

Definition at line 207 of file SolidBase.h.

00208   {
00209     return 
00210       point.z () < zMin () ||
00211       point.z () > zMax () ||
00212       point.x () < xMin () ||
00213       point.x () > xMax () ||
00214       point.y () < yMin () ||
00215       point.y () > yMax () ;
00216   };

template<class aPointA, class aPointB>
bool SolidBase::isOutBBox ( const aPointA &  p1,
const aPointB &  p2,
const double  tolerance 
) const [inline, protected, inherited]

Fast check if the segment of the line between two points is outside the bounding box.

Parameters:
p1 first point of the segment
p2 second point of the segment
tolerance tolerance parameter
Returns:
true if the whole segment is "outside" of the bounding box

Definition at line 283 of file SolidBase.h.

00286   {  
00287     return 
00288       ( (p1.z() < zMin()-tolerance && p2.z() < zMin()-tolerance) ||
00289         (p1.z() > zMax()+tolerance && p2.z() > zMax()+tolerance) ||
00290         (p1.x() < xMin()-tolerance && p2.x() < xMin()-tolerance) ||
00291         (p1.x() > xMax()+tolerance && p2.x() > xMax()+tolerance) ||
00292         (p1.y() < yMin()-tolerance && p2.y() < yMin()-tolerance) ||
00293         (p1.y() > yMax()+tolerance && p2.y() > yMax()+tolerance) );
00294   };

template<class aPointA, class aPointB>
bool SolidBase::isOutBBox ( const aPointA &  p1,
const aPointB &  p2 
) const [inline, protected, inherited]

Fast check if the segment of the line between two points is outside the bounding box.

Parameters:
p1 first point of the segment
p2 second point of the segment
Returns:
true if the whole segment is "outside" of the bounding box

Definition at line 304 of file SolidBase.h.

00306   { 
00307     return 
00308       ( p1.z() < zMin() && p2.z() < zMin() ) ||
00309       ( p1.z() > zMax() && p2.z() > zMax() ) ||
00310       ( p1.x() < xMin() && p2.x() < xMin() ) ||
00311       ( p1.x() > xMax() && p2.x() > xMax() ) ||
00312       ( p1.y() < yMin() && p2.y() < yMin() ) ||
00313       ( p1.y() > yMax() && p2.y() > yMax() ) ;
00314   };

template<class aPoint, class aVector>
bool SolidBase::isOutBBox ( const aPoint &  p,
const aVector &  v,
const ISolid::Tick tmin,
const ISolid::Tick tmax,
const double  tolerance 
) const [inline, protected, inherited]

Fast check if the segment of the line between two points is outside the bounding box.

Parameters:
p first point of the segment
v vector along the line
tmin "minimal value of tick"
tmax "maximal value of tick"
tolerance tolerance parameter
Returns:
true if the whole segment is "outside" of the bounding box

Definition at line 327 of file SolidBase.h.

00332   {
00333     return isOutBBox( p + tmin * v , p + tmax * v , tolerance );
00334   };  

template<class aPoint, class aVector>
bool SolidBase::isOutBBox ( const aPoint &  p,
const aVector &  v,
const ISolid::Tick tmin,
const ISolid::Tick tmax 
) const [inline, protected, inherited]

Fast check if the segment of the line between two points is outside the bounding box.

Parameters:
p first point of the segment
v vector along the line
tmin "minimal value of tick"
tmax "maximal value of tick"
Returns:
true if the whole segment is "outside" of the bounding box

Definition at line 346 of file SolidBase.h.

00350   {
00351     return isOutBBox( p + tmin * v , p + tmax * v );
00352   };  

template<class aPoint>
bool SolidBase::isOutBSphere ( const aPoint &  point,
const double  tolerance 
) const [inline, protected, inherited]

Fast check if the point is outside the bounding sphere of the solid.

Parameters:
point point to be checked
tolerance tolerance parameter
Returns:
true of point is outside the bounding sphere

Definition at line 225 of file SolidBase.h.

00227   {
00228     const  double rmax = rMax()  + tolerance ;
00229     return rmax <= 0 || point.mag2() > rmax * rmax ;
00230   };

template<class aPoint>
bool SolidBase::isOutBSphere ( const aPoint &  point  )  const [inline, protected, inherited]

Fast check if the point is outside the bounding sphere of the solid.

Parameters:
point point to be checked
Returns:
true of point is outside the bounding sphere

Definition at line 237 of file SolidBase.h.

00238   {
00239     return  point.mag2 () > rMax () * rMax () ;
00240   };

template<class aPoint>
bool SolidBase::isOutBCylinder ( const aPoint &  point,
const double  tolerance 
) const [inline, protected, inherited]

Fast check if the point is outside the bounding cylinder of the solid.

Parameters:
point point to be checked
tolerance tolerance parameter
Returns:
true of point is outside the bounding cylinder

Definition at line 250 of file SolidBase.h.

00252   {
00253     const double rhomax = rhoMax() + tolerance ;
00254     return rhomax <= 0 ? true : 
00255       point.z     () < zMin   () - tolerance ? true :
00256       point.z     () > zMax   () + tolerance ? true :
00257       point.perp2 () > rhomax * rhomax       ? true : false ;
00258   };

template<class aPoint>
bool SolidBase::isOutBCylinder ( const aPoint &  point  )  const [inline, protected, inherited]

Fast check if the point is outside the bounding cylinder of the solid.

Parameters:
point point to be checked
Returns:
true of point is outside the bounding cylinder

Definition at line 266 of file SolidBase.h.

00267   {
00268     return 
00269       point.z     () < zMin   () ||
00270       point.z     () > zMax   () ||
00271       point.perp2 () > rhoMax () * rhoMax () ;
00272   };

template<class aPoint, class aVector>
bool SolidBase::crossBSphere ( const aPoint &  p,
const aVector &  v,
const double  tolerance = 0 
) const [inline, protected, inherited]

Fast check if the line cross the bounding sphere.

Parameters:
p first point on the line
v vector along the line
tolerance tolerance parameter
Returns:
true if line do not cross the bounding sphere

Definition at line 362 of file SolidBase.h.

00365   {
00366     const double pp   = p.mag2 ()           ;
00367     const double vv   = v.mag2 ()           ;
00368     const double pv   = p.Dot  ( v )        ;
00369     const double rmax = rMax() + tolerance  ;
00370     const double dd   = rmax * rmax         ;
00371     return ( rmax > 0                       && 
00372              !(0 == vv && pp > dd)          &&
00373              !( (vv*pp) - (pv*pv) > vv*dd ) );
00374   };

template<class aPoint, class aVector>
bool SolidBase::crossBCylinder ( const aPoint &  p,
const aVector &  v,
const double  tolerance = 0 
) const [inline, protected, inherited]

Fast check if the line cross the surface of bounding cylinder.

Parameters:
p first point on the line
v vector along the line
tolerance tolerance parameter
Returns:
true if line do not cross the surface of bounding cylinder

Definition at line 384 of file SolidBase.h.

00387   {
00388     const double pp     = p.perp2 ()                  ;
00389     const double vv     = v.perp2 ()                  ;
00390     const double pv     = p.Dot ( v ) - p.z() * v.z() ;
00391     const double rhomax = rhoMax() + tolerance  ;
00392     const double dd     = rhomax * rhomax     ;
00393     return ( rhomax > 0                     &&
00394              !( 0 == vv && pp > dd )        &&
00395              !( (vv*pp) - (pv*pv) > vv*dd ) );
00396   };

void SolidBase::setXMin ( const double  value  )  [inline, protected, inherited]

set "minimal x" for the solid

Definition at line 401 of file SolidBase.h.

00401 { m_xmin   = value ; }

void SolidBase::setXMax ( const double  value  )  [inline, protected, inherited]

set "maximal x" for the solid

Definition at line 403 of file SolidBase.h.

00403 { m_xmax   = value ; }

void SolidBase::setYMin ( const double  value  )  [inline, protected, inherited]

set "minimal y" for the solid

Definition at line 406 of file SolidBase.h.

00406 { m_ymin   = value ; }

void SolidBase::setYMax ( const double  value  )  [inline, protected, inherited]

set "maximal y" for the solid

Definition at line 408 of file SolidBase.h.

00408 { m_ymax   = value ; }

void SolidBase::setZMin ( const double  value  )  [inline, protected, inherited]

set "minimal z" for the solid

Definition at line 411 of file SolidBase.h.

00411 { m_zmin   = value ; }

void SolidBase::setZMax ( const double  value  )  [inline, protected, inherited]

set "maximal z" for the solid

Definition at line 413 of file SolidBase.h.

00413 { m_zmax   = value ; }

void SolidBase::setRMax ( const double  value  )  [inline, protected, inherited]

set "maximal r" for the solid

Definition at line 416 of file SolidBase.h.

00416 { m_rmax   = value ; }

void SolidBase::setRhoMax ( const double  value  )  [inline, protected, inherited]

set "maximal r" for the solid

Definition at line 418 of file SolidBase.h.

00418 { m_rhomax = value ; }

void SolidBase::checkBP (  )  const [protected, inherited]

check bounding parameters

Exceptions:
SolidException for wrong set of bounding parameters

IMessageSvc* SolidBase::msgSvc (  )  const [protected, inherited]

accessor to massage service

Returns:
pointer to message service

static const InterfaceID& ISolid::interfaceID (  )  [inline, static, inherited]

retrieve the uninque interface identifier

See also:
Interface::interfaceID()
Returns:
uniqie interface identifier

Reimplemented from IInterface.

Definition at line 44 of file ISolid.h.

00044 { return IID_ISolid; }

virtual bool ISolid::isInside ( const Gaudi::XYZPoint point  )  const [pure virtual, inherited]

check for the given 3D-point.

Point coordinated are in the local reference frame of the solid.

Parameters:
point point (in local reference system of the solid)
Returns:
true if the point is inside the solid

Implemented in SolidBox, SolidChild, SolidCons, SolidIntersection, SolidPolycone, SolidPolyHedronHelper, SolidSphere, SolidSubtraction, SolidTubs, and SolidUnion.

virtual bool ISolid::isInside ( const Gaudi::Polar3DPoint point  )  const [pure virtual, inherited]

Implemented in SolidBox, SolidChild, SolidCons, SolidIntersection, SolidPolycone, SolidPolyHedronHelper, SolidSphere, SolidSubtraction, SolidTubs, and SolidUnion.

virtual bool ISolid::isInside ( const Gaudi::RhoZPhiPoint point  )  const [pure virtual, inherited]

Implemented in SolidBox, SolidChild, SolidCons, SolidIntersection, SolidPolycone, SolidPolyHedronHelper, SolidSphere, SolidSubtraction, SolidTubs, and SolidUnion.

virtual Ticks::size_type ISolid::maxNumberOfTicks (  )  const [pure virtual, inherited]

Calculate the maximum number of ticks that a straight line could make with this solid.

Returns:
maximum number of ticks

Implemented in SolidBoolean, SolidBox, SolidChild, SolidCons, SolidPolycone, SolidPolyHedronHelper, SolidSphere, and SolidTubs.

virtual bool SolidPolyHedronHelper::isInside ( const Gaudi::XYZPoint point  )  const [virtual, inherited]

Point coordinated are in the local reference frame of the solid.

Implements ISolid.

virtual bool SolidPolyHedronHelper::isInside ( const Gaudi::Polar3DPoint point  )  const [virtual, inherited]

Implements ISolid.

virtual bool SolidPolyHedronHelper::isInside ( const Gaudi::RhoZPhiPoint point  )  const [virtual, inherited]

Implements ISolid.

virtual unsigned int SolidPolyHedronHelper::intersectionTicks ( const Gaudi::XYZPoint Point,
const Gaudi::XYZVector Vector,
ISolid::Ticks ticks 
) const [virtual, inherited]

  1. Line is parametrized with parameter t : $ \vec{x}(t) = \vec{p} + t \times \vec{v} $
    • $ \vec{p} $ is a point on the line
    • $ \vec{v} $ is a vector along the line
  2. tick is just a value of parameter t, at which the intersection of the solid and the line occurs
  3. both Point ($\vec{p}$) and Vector ($\vec{v}$) are defined in local reference system of the solid

Reimplemented from SolidBase.

virtual unsigned int SolidPolyHedronHelper::intersectionTicks ( const Gaudi::Polar3DPoint Point,
const Gaudi::Polar3DVector Vector,
ISolid::Ticks ticks 
) const [virtual, inherited]

Reimplemented from SolidBase.

virtual unsigned int SolidPolyHedronHelper::intersectionTicks ( const Gaudi::RhoZPhiPoint Point,
const Gaudi::RhoZPhiVector Vector,
ISolid::Ticks ticks 
) const [virtual, inherited]

Reimplemented from SolidBase.

Ticks::size_type SolidPolyHedronHelper::maxNumberOfTicks (  )  const [virtual, inherited]

Calculate the maximum number of ticks that a straight line could make with this solid.

Returns:
maximum number of ticks

Implements ISolid.

bool SolidPolyHedronHelper::addFace ( const Gaudi::XYZPoint Point1,
const Gaudi::XYZPoint Point2,
const Gaudi::XYZPoint Point3 
) [protected, inherited]

add a face/plane given with 3 points

See also:
addFace( const Gaudi::XYZPoint& , const Gaudi::XYZPoint& , const Gaudi::XYZPoint& , const Gaudi::XYZPoint& )
Parameters:
Point1 the first 3D-point of the plane
Point2 the second 3D-point of the plane
Point3 the third 3D-point of the plane
Returns:
"false" if 3 points belongs to one line

bool SolidPolyHedronHelper::addFace ( const Gaudi::XYZPoint Point1,
const Gaudi::XYZPoint Point2,
const Gaudi::XYZPoint Point3,
const Gaudi::XYZPoint Point4 
) [protected, inherited]

add a face/plane given with 4 points

See also:
addFace( const Gaudi::XYZPoint& , const Gaudi::XYZPoint& , const Gaudi::XYZPoint& )
Parameters:
Point1 the first 3D-point of the plane
Point2 the second 3D-point of the plane
Point3 the third 3D-point of the plane
Point4 the fourth 3D-point of the plane
Exceptions:
SolidException if 4 pointd do not define the place
Returns:
"false" if 3 points belongs to one line

const PLANES& SolidPolyHedronHelper::planes (  )  const [inline, protected, inherited]

return vector of faces/planes

Returns:
vector of faces/planes

Definition at line 125 of file SolidPolyHedronHelper.h.

00125 { return m_ph_planes   ; } 

template<class aPoint>
bool SolidPolyHedronHelper::inside ( const aPoint &  Point,
const Gaudi::Plane3D Plane 
) const [inline, protected, inherited]

define "inside" method for the plane.

Assume that normal direction is EXTERNAL!!!

Returns:
"true" if point is "inside"

Definition at line 133 of file SolidPolyHedronHelper.h.

00135   { return 0 >= Plane.Distance( Point ) ; };

void SolidPolyHedronHelper::setBP (  )  [protected, inherited]

set bounding parameters


Friends And Related Function Documentation

friend class SolidFactory< SolidTrap > [friend]

friend factory for instantiation

Definition at line 35 of file SolidTrap.h.


Member Data Documentation

double SolidTrap::m_trap_zHalfLength [private]

trapezoid parameters

Definition at line 176 of file SolidTrap.h.

double SolidTrap::m_trap_theta [private]

Definition at line 177 of file SolidTrap.h.

double SolidTrap::m_trap_phi [private]

Definition at line 178 of file SolidTrap.h.

double SolidTrap::m_trap_dyAtMinusZ [private]

Definition at line 179 of file SolidTrap.h.

double SolidTrap::m_trap_dxAtMinusZMinusY [private]

Definition at line 180 of file SolidTrap.h.

double SolidTrap::m_trap_dxAtMinusZPlusY [private]

Definition at line 181 of file SolidTrap.h.

double SolidTrap::m_trap_alphaAtMinusZ [private]

Definition at line 182 of file SolidTrap.h.

double SolidTrap::m_trap_dyAtPlusZ [private]

Definition at line 183 of file SolidTrap.h.

double SolidTrap::m_trap_dxAtPlusZMinusY [private]

Definition at line 184 of file SolidTrap.h.

double SolidTrap::m_trap_dxAtPlusZPlusY [private]

Definition at line 185 of file SolidTrap.h.

double SolidTrap::m_trap_alphaAtPlusZ [private]

Definition at line 186 of file SolidTrap.h.

double SolidTrap::m_trap_sinAlphaAtPlusZ [private]

Definition at line 187 of file SolidTrap.h.

double SolidTrap::m_trap_cosAlphaAtPlusZ [private]

Definition at line 188 of file SolidTrap.h.

std::string SolidBase::m_name [protected, inherited]

name of the solid

Definition at line 460 of file SolidBase.h.

ISolid* SolidBase::m_cover [mutable, protected, inherited]

pointer to cover

Definition at line 461 of file SolidBase.h.

double SolidBase::m_xmin [protected, inherited]

Definition at line 463 of file SolidBase.h.

double SolidBase::m_ymin [protected, inherited]

Definition at line 464 of file SolidBase.h.

double SolidBase::m_zmin [protected, inherited]

Definition at line 465 of file SolidBase.h.

double SolidBase::m_xmax [protected, inherited]

Definition at line 467 of file SolidBase.h.

double SolidBase::m_ymax [protected, inherited]

Definition at line 468 of file SolidBase.h.

double SolidBase::m_zmax [protected, inherited]

Definition at line 469 of file SolidBase.h.

double SolidBase::m_rmax [protected, inherited]

Definition at line 471 of file SolidBase.h.

double SolidBase::m_rhomax [protected, inherited]

Definition at line 472 of file SolidBase.h.

DetDesc::Services* SolidBase::m_services [protected, inherited]

reference to services

Definition at line 475 of file SolidBase.h.

PLANES SolidPolyHedronHelper::m_ph_planes [protected, inherited]

vector of faces/planes

Definition at line 158 of file SolidPolyHedronHelper.h.

VERTICES SolidPolyHedronHelper::m_ph_vertices [protected, inherited]

Definition at line 159 of file SolidPolyHedronHelper.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:00:21 2011 for DetDesc by doxygen 1.4.7