LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 58 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 353 of file BdtBeamParticleIdTool.cc.

References m_unitNormal.

353  :
354  m_unitNormal(0.f, 0.f, 0.f),
355  m_point(point),
356  m_d(-1. * static_cast<double>(normal.GetDotProduct(point)))
357 {
358  try
359  {
360  m_unitNormal = normal.GetUnitVector();
361  }
362  catch (const StatusCodeException &statusCodeException)
363  {
364  std::cout << "BdtBeamParticleIdTool::Plane::Plane - normal vector to plane has a magnitude of zero" << std::endl;
365  throw statusCodeException;
366  }
367 }
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 371 of file BdtBeamParticleIdTool.cc.

References m_d, and m_unitNormal.

372 {
373  if (std::fabs(direction.GetDotProduct(m_unitNormal)) < std::numeric_limits<float>::epsilon())
374  return CartesianVector(std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max());
375 
376  const float denominator(direction.GetDotProduct(m_unitNormal));
377 
378  if (std::fabs(denominator) < std::numeric_limits<float>::epsilon())
379  throw StatusCodeException(STATUS_CODE_OUT_OF_RANGE);
380 
381  const double t(-1. * (static_cast<double>(point.GetDotProduct(m_unitNormal)) + m_d) / static_cast<double>(denominator));
382  return (point + (direction * t));
383 }
double m_d
Parameter defining a plane.
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 80 of file BdtBeamParticleIdTool.h.

Referenced by GetLineIntersection().

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

A point on the plane.

Definition at line 79 of file BdtBeamParticleIdTool.h.

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

Unit normal to plane.

Definition at line 78 of file BdtBeamParticleIdTool.h.

Referenced by GetLineIntersection(), and Plane().


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