LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
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 33 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 251 of file BeamParticleIdTool.cc.

251  :
252  m_unitNormal(normal.GetUnitVector()),
253  m_point(point),
254  m_d(-1.f * (normal.GetDotProduct(point)))
255 {
256 }
pandora::CartesianVector m_point
A point on the plane.
float m_d
Parameter defining a plane.
TFile f
Definition: plotHisto.C:6
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 260 of file BeamParticleIdTool.cc.

References f, m_d, m_unitNormal, max, and min.

261 {
262  if (std::fabs(a.GetDotProduct(m_unitNormal)) < std::numeric_limits<float>::min())
264 
265  const float denominator(a.GetDotProduct(m_unitNormal));
266 
267  if (std::fabs(denominator) < std::numeric_limits<float>::epsilon())
268  throw StatusCodeException(STATUS_CODE_OUT_OF_RANGE);
269 
270  const float t(-1.f * (a0.GetDotProduct(m_unitNormal) + m_d) / denominator);
271  return (a0 + (a * t));
272 }
#define a0
float m_d
Parameter defining a plane.
TFile f
Definition: plotHisto.C:6
Int_t max
Definition: plot.C:27
pandora::CartesianVector m_unitNormal
Unit normal to plane.
Int_t min
Definition: plot.C:26

Member Data Documentation

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

Parameter defining a plane.

Definition at line 55 of file BeamParticleIdTool.h.

Referenced by GetLineIntersection().

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

A point on the plane.

Definition at line 54 of file BeamParticleIdTool.h.

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

Unit normal to plane.

Definition at line 53 of file BeamParticleIdTool.h.

Referenced by GetLineIntersection().


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