Public Member Functions | Private Attributes | List of all members
lar_content::LArHitWidthHelper::ConstituentHit::SortByDistanceToPoint Class Reference

SortByDistanceToPoint class. More...

#include <LArHitWidthHelper.h>

Public Member Functions

 SortByDistanceToPoint (const pandora::CartesianVector referencePoint)
 Constructor. More...
 
bool operator() (const ConstituentHit &lhs, const ConstituentHit &rhs)
 Sort constituent hits by their position relative to a referencePoint. More...
 

Private Attributes

const pandora::CartesianVector m_referencePoint
 The point relative to which constituent hits are ordered. More...
 

Detailed Description

SortByDistanceToPoint class.

Definition at line 55 of file LArHitWidthHelper.h.

Constructor & Destructor Documentation

lar_content::LArHitWidthHelper::ConstituentHit::SortByDistanceToPoint::SortByDistanceToPoint ( const pandora::CartesianVector  referencePoint)
inline

Constructor.

Parameters
referencePointthe point relative to which constituent hits are ordered

Definition at line 63 of file LArHitWidthHelper.h.

63  : m_referencePoint(referencePoint)
64  {
65  }
const pandora::CartesianVector m_referencePoint
The point relative to which constituent hits are ordered.

Member Function Documentation

bool lar_content::LArHitWidthHelper::ConstituentHit::SortByDistanceToPoint::operator() ( const ConstituentHit lhs,
const ConstituentHit rhs 
)

Sort constituent hits by their position relative to a referencePoint.

Parameters
lhsfirst constituent hit
rhssecond constituent hit
Returns
whether lhs hit is closer to the referencePoint than the rhs hit

Definition at line 25 of file LArHitWidthHelper.cc.

26 {
27  const CartesianVector &lhsPosition(lhs.GetPositionVector());
28  const CartesianVector &rhsPosition(rhs.GetPositionVector());
29 
30  return (m_referencePoint.GetDistanceSquared(lhsPosition) < m_referencePoint.GetDistanceSquared(rhsPosition));
31 }
const pandora::CartesianVector m_referencePoint
The point relative to which constituent hits are ordered.

Member Data Documentation

const pandora::CartesianVector lar_content::LArHitWidthHelper::ConstituentHit::SortByDistanceToPoint::m_referencePoint
private

The point relative to which constituent hits are ordered.

Definition at line 78 of file LArHitWidthHelper.h.


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