LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::BdtBeamParticleIdTool::Plane Class Reference

Plane class. More...

Public Member Functions

 Plane (const pandora::CartesianVector &normal, const pandora::CartesianVector &point)
 Constructor, using equation of plane: m_a*x + m_b*y + m_c*z + m_d = 0. More...
 
pandora::CartesianVector GetLineIntersection (const pandora::CartesianVector &point, const pandora::CartesianVector &direction) const
 Return the intersection between the plane and a line. More...
 

Private Attributes

pandora::CartesianVector m_unitNormal
 Unit normal to plane. More...
 
pandora::CartesianVector m_point
 A point on the plane. More...
 
double m_d
 Parameter defining a plane. More...
 

Detailed Description

Plane class.

Definition at line 56 of file BdtBeamParticleIdTool.h.

Constructor & Destructor Documentation

lar_content::BdtBeamParticleIdTool::Plane::Plane ( const pandora::CartesianVector &  normal,
const pandora::CartesianVector &  point 
)

Constructor, using equation of plane: m_a*x + m_b*y + m_c*z + m_d = 0.

Parameters
normala Cartesian vector that points in a direction that is normal to the plane
pointa Cartesian vector that corresponds to any point on the plane

Definition at line 347 of file BdtBeamParticleIdTool.cc.

References m_unitNormal.

347  :
348  m_unitNormal(0.f, 0.f, 0.f),
349  m_point(point),
350  m_d(-1. * static_cast<double>(normal.GetDotProduct(point)))
351 {
352  try
353  {
354  m_unitNormal = normal.GetUnitVector();
355  }
356  catch (const StatusCodeException &statusCodeException)
357  {
358  std::cout << "BdtBeamParticleIdTool::Plane::Plane - normal vector to plane has a magnitude of zero" << std::endl;
359  throw statusCodeException;
360  }
361 }
double m_d
Parameter defining a plane.
TFile f
Definition: plotHisto.C:6
pandora::CartesianVector m_unitNormal
Unit normal to plane.
pandora::CartesianVector m_point
A point on the plane.

Member Function Documentation

CartesianVector lar_content::BdtBeamParticleIdTool::Plane::GetLineIntersection ( const pandora::CartesianVector &  point,
const pandora::CartesianVector &  direction 
) const

Return the intersection between the plane and a line.

Parameters
pointa point on the line
directionvector pointing along the line

Definition at line 365 of file BdtBeamParticleIdTool.cc.

References m_d, m_unitNormal, and max.

366 {
367  if (std::fabs(direction.GetDotProduct(m_unitNormal)) < std::numeric_limits<float>::epsilon())
369 
370  const float denominator(direction.GetDotProduct(m_unitNormal));
371 
372  if (std::fabs(denominator) < std::numeric_limits<float>::epsilon())
373  throw StatusCodeException(STATUS_CODE_OUT_OF_RANGE);
374 
375  const double t(-1. * (static_cast<double>(point.GetDotProduct(m_unitNormal)) + m_d) / static_cast<double>(denominator));
376  return (point + (direction * t));
377 }
double m_d
Parameter defining a plane.
Int_t max
Definition: plot.C:27
pandora::CartesianVector m_unitNormal
Unit normal to plane.

Member Data Documentation

double lar_content::BdtBeamParticleIdTool::Plane::m_d
private

Parameter defining a plane.

Definition at line 78 of file BdtBeamParticleIdTool.h.

Referenced by GetLineIntersection().

pandora::CartesianVector lar_content::BdtBeamParticleIdTool::Plane::m_point
private

A point on the plane.

Definition at line 77 of file BdtBeamParticleIdTool.h.

pandora::CartesianVector lar_content::BdtBeamParticleIdTool::Plane::m_unitNormal
private

Unit normal to plane.

Definition at line 76 of file BdtBeamParticleIdTool.h.

Referenced by GetLineIntersection(), and Plane().


The documentation for this class was generated from the following files: