LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
lar_content::LArPcaHelper Class Reference

LArPcaHelper class. More...

#include "LArPcaHelper.h"

Public Types

typedef pandora::CartesianVector EigenValues
 
typedef std::vector< pandora::CartesianVector > EigenVectors
 
typedef std::pair< const pandora::CartesianVector, double > WeightedPoint
 
typedef std::vector< WeightedPointWeightedPointVector
 

Public Member Functions

template<typename T >
void RunPca (const T &t, CartesianVector &centroid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
 

Static Public Member Functions

template<typename T >
static void RunPca (const T &t, pandora::CartesianVector &centroid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
 Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D points) More...
 
static void RunPca (const WeightedPointVector &pointVector, pandora::CartesianVector &centroid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
 Run principal component analysis using weighted input Cartesian vectors (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D points) More...
 

Detailed Description

LArPcaHelper class.

Definition at line 18 of file LArPcaHelper.h.

Member Typedef Documentation

typedef pandora::CartesianVector lar_content::LArPcaHelper::EigenValues

Definition at line 21 of file LArPcaHelper.h.

typedef std::vector<pandora::CartesianVector> lar_content::LArPcaHelper::EigenVectors

Definition at line 22 of file LArPcaHelper.h.

typedef std::pair<const pandora::CartesianVector, double> lar_content::LArPcaHelper::WeightedPoint

Definition at line 23 of file LArPcaHelper.h.

Definition at line 24 of file LArPcaHelper.h.

Member Function Documentation

template<typename T >
void lar_content::LArPcaHelper::RunPca ( const T &  t,
CartesianVector &  centroid,
EigenValues outputEigenValues,
EigenVectors outputEigenVectors 
)

Definition at line 21 of file LArPcaHelper.cc.

References art::left(), art::right(), weight, x, y, and z.

22 {
23  WeightedPointVector weightedPointVector;
24 
25  for (const auto &point : t)
26  weightedPointVector.push_back(std::make_pair(LArObjectHelper::TypeAdaptor::GetPosition(point), 1.));
27 
28  return LArPcaHelper::RunPca(weightedPointVector, centroid, outputEigenValues, outputEigenVectors);
29 }
std::vector< WeightedPoint > WeightedPointVector
Definition: LArPcaHelper.h:24
static pandora::CartesianVector GetPosition(const T &t)
Get the associated position.
static void RunPca(const T &t, pandora::CartesianVector &centroid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors)
Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D p...
template<typename T >
static void lar_content::LArPcaHelper::RunPca ( const T &  t,
pandora::CartesianVector &  centroid,
EigenValues outputEigenValues,
EigenVectors outputEigenVectors 
)
static

Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D points)

Parameters
tthe input information
centroidto receive the centroid position
outputEigenValuesto receive the eigen values
outputEigenVectorsto receive the eigen vectors

Referenced by lar_content::TwoDSlidingFitResult::CalculateAxes(), lar_content::ThreeDSlidingFitResult::GetGlobalDirection(), lar_content::BdtBeamParticleIdTool::SliceFeatureParameters::Initialize(), lar_content::ThreeDOpeningAngleFeatureTool::Run(), lar_content::ThreeDPCAFeatureTool::Run(), lar_content::BeamParticleIdTool::SelectOutputPfos(), and lar_content::NeutrinoIdTool::SliceFeatures::SliceFeatures().

static void lar_content::LArPcaHelper::RunPca ( const WeightedPointVector pointVector,
pandora::CartesianVector &  centroid,
EigenValues outputEigenValues,
EigenVectors outputEigenVectors 
)
static

Run principal component analysis using weighted input Cartesian vectors (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D points)

Parameters
pointVectora vector of pairs of positions and weights
centroidto receive the centroid position
outputEigenValuesto receive the eigen values
outputEigenVectorsto receive the eigen vectors

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