CMS 3D CMS Logo

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 15 of file Line3D.h.

Constructor & Destructor Documentation

◆ HepLine3D() [1/3]

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

Definition at line 22 of file Line3D.h.

23  : pp(p), uu(v * (v.mag() > 1.e-10 ? 1. / v.mag() : 1)), eps(fabs(sml)) {}
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
double eps
Definition: Line3D.h:19
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ HepLine3D() [2/3]

HepLine3D::HepLine3D ( const HepGeom::Point3D< double > &  p1,
const HepGeom::Point3D< double > &  p2,
double  sml = 1.e-10 
)
inline

Definition at line 25 of file Line3D.h.

26  : pp(p1), uu((p2 - p1) * ((p2 - p1).mag() > 1.e-10 ? 1. / (p2 - p1).mag() : 1)), eps(fabs(sml)) {}
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
double eps
Definition: Line3D.h:19
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ HepLine3D() [3/3]

HepLine3D::HepLine3D ( const HepLine3D line)
inline

Definition at line 29 of file Line3D.h.

29 : pp(line.pp), uu(line.uu), eps(line.eps) {}
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
double eps
Definition: Line3D.h:19
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ ~HepLine3D()

HepLine3D::~HepLine3D ( )
inline

Definition at line 32 of file Line3D.h.

32 {}

Member Function Documentation

◆ dist()

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

Definition at line 66 of file Line3D.h.

References point(), and submitPVResolutionJobs::q.

66 { return (q - point(q)).mag(); }
HepGeom::Point3D< double > point(const HepGeom::Plane3D< double > &pl, bool &parallel) const
Definition: Line3D.h:52

◆ dist2()

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

Definition at line 65 of file Line3D.h.

References point(), and submitPVResolutionJobs::q.

65 { return (q - point(q)).mag2(); }
HepGeom::Point3D< double > point(const HepGeom::Plane3D< double > &pl, bool &parallel) const
Definition: Line3D.h:52

◆ operator!=()

bool HepLine3D::operator!= ( const HepLine3D l) const
inline

Definition at line 46 of file Line3D.h.

References MainPageGenerator::l, pp, and uu.

46 { return pp != l.pp || uu != l.uu; }
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ operator=()

HepLine3D& HepLine3D::operator= ( const HepLine3D line)
inline

Definition at line 35 of file Line3D.h.

References eps, mps_splice::line, pp, and uu.

35  {
36  pp = line.pp;
37  uu = line.uu;
38  eps = line.eps;
39  return *this;
40  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
double eps
Definition: Line3D.h:19
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ operator==()

bool HepLine3D::operator== ( const HepLine3D l) const
inline

Definition at line 43 of file Line3D.h.

References MainPageGenerator::l, pp, and uu.

43 { return pp == l.pp && uu == l.uu; }
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ point() [1/2]

HepGeom::Point3D<double> HepLine3D::point ( const HepGeom::Plane3D< double > &  pl,
bool &  parallel 
) const
inline

Definition at line 52 of file Line3D.h.

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

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

52  {
53  const double num(-pl.d() - pl.a() * pp.x() - pl.b() * pp.y() - pl.c() * pp.z());
54  const double den(pl.a() * uu.x() + pl.b() * uu.y() + pl.c() * uu.z());
55 
56  parallel = (eps > fabs(num)) || (eps > fabs(den));
57 
58  return (parallel ? pp : HepGeom::Point3D<double>(pp + uu * (num / den)));
59  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
double eps
Definition: Line3D.h:19
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ point() [2/2]

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

Definition at line 61 of file Line3D.h.

References pp, submitPVResolutionJobs::q, and uu.

61  {
62  return (pp + ((q.x() - pp.x()) * uu.x() + (q.y() - pp.y()) * uu.y() + (q.z() - pp.z()) * uu.z()) * uu);
63  }
HepGeom::Point3D< double > pp
Definition: Line3D.h:17
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

◆ pt()

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

◆ uv()

const HepGeom::Vector3D<double>& HepLine3D::uv ( ) const
inline

Definition at line 50 of file Line3D.h.

References uu.

50 { return uu; }
HepGeom::Vector3D< double > uu
Definition: Line3D.h:18

Member Data Documentation

◆ eps

double HepLine3D::eps
protected

Definition at line 19 of file Line3D.h.

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

◆ pp

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

Definition at line 17 of file Line3D.h.

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

◆ uu

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

Definition at line 18 of file Line3D.h.

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