Public Member Functions | Private Attributes | List of all members
lar_content::BeamParticleIdTool::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 &a0, const pandora::CartesianVector &a) 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...
 
float m_d
 Parameter defining a plane. More...
 

Detailed Description

Plane class.

Definition at line 34 of file BeamParticleIdTool.h.

Constructor & Destructor Documentation

lar_content::BeamParticleIdTool::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 257 of file BeamParticleIdTool.cc.

257  :
258  m_unitNormal(normal.GetUnitVector()),
259  m_point(point),
260  m_d(-1.f * (normal.GetDotProduct(point)))
261 {
262 }
pandora::CartesianVector m_point
A point on the plane.
float m_d
Parameter defining a plane.
pandora::CartesianVector m_unitNormal
Unit normal to plane.

Member Function Documentation

CartesianVector lar_content::BeamParticleIdTool::Plane::GetLineIntersection ( const pandora::CartesianVector &  a0,
const pandora::CartesianVector &  a 
) const

Return the intersection between the plane and a line.

Parameters
a0point on the line
avector pointing along the line

Definition at line 266 of file BeamParticleIdTool.cc.

267 {
268  if (std::fabs(a.GetDotProduct(m_unitNormal)) < std::numeric_limits<float>::min())
270 
271  const float denominator(a.GetDotProduct(m_unitNormal));
272 
273  if (std::fabs(denominator) < std::numeric_limits<float>::epsilon())
274  throw StatusCodeException(STATUS_CODE_OUT_OF_RANGE);
275 
276  const float t(-1.f * (a0.GetDotProduct(m_unitNormal) + m_d) / denominator);
277  return (a0 + (a * t));
278 }
#define a0
float m_d
Parameter defining a plane.
const double a
pandora::CartesianVector m_unitNormal
Unit normal to plane.
static int max(int a, int b)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Definition: statistics.h:55

Member Data Documentation

float lar_content::BeamParticleIdTool::Plane::m_d
private

Parameter defining a plane.

Definition at line 56 of file BeamParticleIdTool.h.

pandora::CartesianVector lar_content::BeamParticleIdTool::Plane::m_point
private

A point on the plane.

Definition at line 55 of file BeamParticleIdTool.h.

pandora::CartesianVector lar_content::BeamParticleIdTool::Plane::m_unitNormal
private

Unit normal to plane.

Definition at line 54 of file BeamParticleIdTool.h.


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