CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Attributes
HepLine3D Class Reference

#include <Line3D.h>

Public Member Functions

double dist (const HepGeom::Point3D< double > &q) const
 
double dist2 (const HepGeom::Point3D< double > &q) const
 
 HepLine3D (const HepGeom::Point3D< double > &p, const HepGeom::Vector3D< double > &v, double sml=1.e-10)
 
 HepLine3D (const HepGeom::Point3D< double > &p1, const HepGeom::Point3D< double > &p2, double sml=1.e-10)
 
 HepLine3D (const HepLine3D &line)
 
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.

32  :
33  pp ( p ),
34  uu ( v*( v.mag()>1.e-10 ? 1./v.mag() : 1 ) ),
35  eps ( fabs( sml ) ) {}
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
double eps
Definition: Line3D.h:26
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
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.

39  :
40  pp ( p1 ),
41  uu ( (p2-p1)*( (p2-p1).mag()>1.e-10 ? 1./(p2-p1).mag() : 1 ) ),
42  eps ( fabs( sml ) ) {}
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
double eps
Definition: Line3D.h:26
double p2[4]
Definition: TauolaWrapper.h:90
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
double p1[4]
Definition: TauolaWrapper.h:89
HepLine3D::HepLine3D ( const HepLine3D line)
inline

Definition at line 45 of file Line3D.h.

45  :
46  pp (line.pp), uu(line.uu), eps(line.eps) {}
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
double eps
Definition: Line3D.h:26
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
HepLine3D::~HepLine3D ( )
inline

Definition at line 49 of file Line3D.h.

49 {};

Member Function Documentation

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

Definition at line 91 of file Line3D.h.

References point().

Referenced by CaloCellCrossing::CaloCellCrossing().

91 { return ( q - point( q ) ).mag() ; }
HepGeom::Point3D< double > point(const HepGeom::Plane3D< double > &pl, bool &parallel) const
Definition: Line3D.h:73
double HepLine3D::dist2 ( const HepGeom::Point3D< double > &  q) const
inline

Definition at line 90 of file Line3D.h.

References point().

Referenced by CaloCellCrossing::CaloCellCrossing().

90 { return ( q - point( q ) ).mag2() ; }
HepGeom::Point3D< double > point(const HepGeom::Plane3D< double > &pl, bool &parallel) const
Definition: Line3D.h:73
bool HepLine3D::operator!= ( const HepLine3D l) const
inline

Definition at line 64 of file Line3D.h.

References pp, and uu.

65  {
66  return pp != l.pp || uu != l.uu ;
67  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
HepLine3D& HepLine3D::operator= ( const HepLine3D line)
inline

Definition at line 52 of file Line3D.h.

References eps, pp, and uu.

53  {
54  pp = line.pp; uu = line.uu; eps = line.eps; return *this;
55  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
double eps
Definition: Line3D.h:26
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
bool HepLine3D::operator== ( const HepLine3D l) const
inline

Definition at line 58 of file Line3D.h.

References pp, and uu.

59  {
60  return pp == l.pp && uu == l.uu ;
61  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
HepGeom::Point3D<double> HepLine3D::point ( const HepGeom::Plane3D< double > &  pl,
bool &  parallel 
) const
inline

Definition at line 73 of file Line3D.h.

References eps, pileupDistInMC::num, pp, and uu.

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

74  {
75  const double num ( -pl.d() - pl.a()*pp.x() - pl.b()*pp.y() - pl.c()*pp.z() ) ;
76  const double den ( pl.a()*uu.x() + pl.b()*uu.y() + pl.c()*uu.z() ) ;
77 
78  parallel = ( eps > fabs( num ) ) || ( eps > fabs( den ) ) ;
79 
80  return ( parallel ? pp : HepGeom::Point3D<double> ( pp + uu*(num/den) ) ) ;
81  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
double eps
Definition: Line3D.h:26
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
HepGeom::Point3D<double> HepLine3D::point ( const HepGeom::Point3D< double > &  q) const
inline

Definition at line 83 of file Line3D.h.

References pp, and uu.

84  {
85  return ( pp + ( ( q.x() - pp.x() )*uu.x() +
86  ( q.y() - pp.y() )*uu.y() +
87  ( q.z() - pp.z() )*uu.z() )*uu ) ;
88  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:24
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25
const HepGeom::Point3D<double>& HepLine3D::pt ( ) const
inline
const HepGeom::Vector3D<double>& HepLine3D::uv ( ) const
inline

Definition at line 71 of file Line3D.h.

References uu.

Referenced by CaloCellCrossing::CaloCellCrossing().

71 { return uu ; }
HepGeom::Vector3D< double > uu
Definition: Line3D.h:25

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