LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
lar_content::LArGraph::Edge Class Reference

#include "LArGraph.h"

Public Member Functions

 Edge (const pandora::CaloHit *const pVertex0, const pandora::CaloHit *const pVertex1)
 Constructor. More...
 
float LengthSquared () const
 Compute the square of the length of this edge. More...
 
bool operator== (const Edge &other) const
 Check if another edge shares the same calo hit end points. More...
 

Public Attributes

const pandora::CaloHit *const m_v0
 An endpoint of the edge. More...
 
const pandora::CaloHit *const m_v1
 An endpoint of the edge. More...
 

Detailed Description

Definition at line 24 of file LArGraph.h.

Constructor & Destructor Documentation

lar_content::LArGraph::Edge::Edge ( const pandora::CaloHit *const  pVertex0,
const pandora::CaloHit *const  pVertex1 
)

Constructor.

Parameters
vertex0An endpoint of the edge
vertex1An endpoint of the edge

Definition at line 242 of file LArGraph.cc.

References m_v1.

242  :
243  m_v0{pVertex0},
244  m_v1{pVertex1}
245 {
246 }
const pandora::CaloHit *const m_v1
An endpoint of the edge.
Definition: LArGraph.h:55
const pandora::CaloHit *const m_v0
An endpoint of the edge.
Definition: LArGraph.h:52

Member Function Documentation

float lar_content::LArGraph::Edge::LengthSquared ( ) const

Compute the square of the length of this edge.

Returns
The square of thelength of this edge

Definition at line 250 of file LArGraph.cc.

References m_v0, and m_v1.

251 {
252  const CartesianVector &pos0{this->m_v0->GetPositionVector()}, &pos1{this->m_v1->GetPositionVector()};
253  const float dx{pos0.GetX() - pos1.GetX()}, dz{pos0.GetZ() - pos1.GetZ()};
254 
255  return dx * dx + dz * dz;
256 }
const pandora::CaloHit *const m_v1
An endpoint of the edge.
Definition: LArGraph.h:55
const pandora::CaloHit *const m_v0
An endpoint of the edge.
Definition: LArGraph.h:52
bool lar_content::LArGraph::Edge::operator== ( const Edge other) const
inline

Check if another edge shares the same calo hit end points.

Parameters
otherThe edge to compare to this edge
Returns
true if the edges share the same endpoints, irrespective of direction

Definition at line 49 of file LArGraph.h.

References m_v0, and m_v1.

50  {
51  return (this->m_v0 == other.m_v0 && this->m_v1 == other.m_v1) || (this->m_v0 == other.m_v1 && this->m_v1 == other.m_v0);
52  };
const pandora::CaloHit *const m_v1
An endpoint of the edge.
Definition: LArGraph.h:55
const pandora::CaloHit *const m_v0
An endpoint of the edge.
Definition: LArGraph.h:52

Member Data Documentation

const pandora::CaloHit* const lar_content::LArGraph::Edge::m_v0

An endpoint of the edge.

Definition at line 52 of file LArGraph.h.

Referenced by LengthSquared(), and operator==().

const pandora::CaloHit* const lar_content::LArGraph::Edge::m_v1

An endpoint of the edge.

Definition at line 55 of file LArGraph.h.

Referenced by Edge(), LengthSquared(), and operator==().


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