CMS 3D CMS Logo

Public Member Functions | Protected Attributes

HepLine3D Class Reference

#include <Line3D.h>

List of all members.

Public Member Functions

double dist (const HepGeom::Point3D< double > &q) const
double dist2 (const HepGeom::Point3D< double > &q) const
 HepLine3D (const HepGeom::Point3D< double > &p1, const HepGeom::Point3D< double > &p2, double sml=1.e-10)
 HepLine3D (const HepLine3D &line)
 HepLine3D (const HepGeom::Point3D< double > &p, const HepGeom::Vector3D< double > &v, double sml=1.e-10)
bool operator!= (const HepLine3D &l) const
HepLine3Doperator= (const HepLine3D &line)
bool operator== (const HepLine3D &l) const
HepGeom::Point3D< double > point (const HepGeom::Plane3D< double > &pl, bool &parallel) const
HepGeom::Point3D< double > point (const HepGeom::Point3D< double > &q) const
const HepGeom::Point3D< double > & pt () const
const HepGeom::Vector3D< double > & uv () const
 ~HepLine3D ()

Protected Attributes

double eps
HepGeom::Point3D< double > pp
HepGeom::Vector3D< double > uu

Detailed Description

Definition at line 21 of file Line3D.h.


Constructor & Destructor Documentation

HepLine3D::HepLine3D ( const HepGeom::Point3D< double > &  p,
const HepGeom::Vector3D< double > &  v,
double  sml = 1.e-10 
) [inline]

Definition at line 30 of file Line3D.h.

                                                :
         pp  ( p ), 
         uu  ( v*( v.mag()>1.e-10 ? 1./v.mag() : 1 ) ), 
         eps ( fabs( sml ) ) {} 
HepLine3D::HepLine3D ( const HepGeom::Point3D< double > &  p1,
const HepGeom::Point3D< double > &  p2,
double  sml = 1.e-10 
) [inline]

Definition at line 37 of file Line3D.h.

                                               :
         pp  ( p1 ), 
         uu  ( (p2-p1)*( (p2-p1).mag()>1.e-10 ? 1./(p2-p1).mag() : 1 ) ),
         eps ( fabs( sml ) ) {} 
HepLine3D::HepLine3D ( const HepLine3D line) [inline]

Definition at line 45 of file Line3D.h.

                                         :
         pp (line.pp), uu(line.uu), eps(line.eps) {}
HepLine3D::~HepLine3D ( ) [inline]

Definition at line 49 of file Line3D.h.

{};

Member Function Documentation

double HepLine3D::dist ( const HepGeom::Point3D< double > &  q) const [inline]

Definition at line 91 of file Line3D.h.

References point().

{ return ( q - point( q ) ).mag() ; }
double HepLine3D::dist2 ( const HepGeom::Point3D< double > &  q) const [inline]

Definition at line 90 of file Line3D.h.

References point().

Referenced by CaloCellCrossing::CaloCellCrossing().

{ return ( q - point( q ) ).mag2() ; }
bool HepLine3D::operator!= ( const HepLine3D l) const [inline]

Definition at line 64 of file Line3D.h.

References pp, and uu.

      {
         return pp != l.pp || uu != l.uu ;
      }
HepLine3D& HepLine3D::operator= ( const HepLine3D line) [inline]

Definition at line 52 of file Line3D.h.

References eps, pp, and uu.

      {
         pp = line.pp; uu = line.uu; eps = line.eps; return *this;
      }
bool HepLine3D::operator== ( const HepLine3D l) const [inline]

Definition at line 58 of file Line3D.h.

References pp, and uu.

      {
         return pp == l.pp && uu == l.uu ;
      }
HepGeom::Point3D<double> HepLine3D::point ( const HepGeom::Plane3D< double > &  pl,
bool &  parallel 
) const [inline]

Definition at line 73 of file Line3D.h.

References eps, pp, and uu.

Referenced by CaloCellCrossing::CaloCellCrossing(), dist(), and dist2().

      {
         const double num ( -pl.d() - pl.a()*pp.x() - pl.b()*pp.y() - pl.c()*pp.z() ) ;
         const double den (           pl.a()*uu.x() + pl.b()*uu.y() + pl.c()*uu.z() ) ;

         parallel = ( eps > fabs( num ) ) || ( eps > fabs( den ) ) ;

         return ( parallel ? pp : HepGeom::Point3D<double> ( pp + uu*(num/den) ) ) ;
      }
HepGeom::Point3D<double> HepLine3D::point ( const HepGeom::Point3D< double > &  q) const [inline]

Definition at line 83 of file Line3D.h.

References pp, and uu.

      {
         return ( pp + ( ( q.x() - pp.x() )*uu.x() +
                         ( q.y() - pp.y() )*uu.y() +
                         ( q.z() - pp.z() )*uu.z() )*uu ) ; 
      }
const HepGeom::Point3D<double>& HepLine3D::pt ( ) const [inline]

Definition at line 69 of file Line3D.h.

References pp.

Referenced by CaloCellCrossing::CaloCellCrossing().

{ return pp ; }
const HepGeom::Vector3D<double>& HepLine3D::uv ( ) const [inline]

Definition at line 71 of file Line3D.h.

References uu.

Referenced by CaloCellCrossing::CaloCellCrossing().

{ return uu ; }

Member Data Documentation

double HepLine3D::eps [protected]

Definition at line 26 of file Line3D.h.

Referenced by operator=(), and point().

HepGeom::Point3D<double> HepLine3D::pp [protected]

Definition at line 24 of file Line3D.h.

Referenced by operator!=(), operator=(), operator==(), point(), and pt().

HepGeom::Vector3D<double> HepLine3D::uu [protected]

Definition at line 25 of file Line3D.h.

Referenced by operator!=(), operator=(), operator==(), point(), and uv().