LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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.

References operator()().

63  :
64  m_referencePoint(referencePoint)
65  {
66  }
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.

References lar_content::LArHitWidthHelper::ClusterParameters::ClusterParameters(), lar_content::LArHitWidthHelper::GetConstituentHits(), lar_content::LArHitWidthHelper::GetExtremalCoordinatesHigherX(), lar_content::LArHitWidthHelper::GetExtremalCoordinatesLowerX(), lar_content::LArHitWidthHelper::ConstituentHit::GetPositionVector(), and lar_content::LArHitWidthHelper::GetTotalClusterWeight().

Referenced by SortByDistanceToPoint().

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 79 of file LArHitWidthHelper.h.


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