LArPcaHelper.h
Go to the documentation of this file.
1 /**
2  * @file larpandoracontent/LArHelpers/LArPcaHelper.h
3  *
4  * @brief Header file for the principal curve analysis helper class.
5  *
6  * $Log: $
7  */
8 #ifndef LAR_PCA_HELPER_H
9 #define LAR_PCA_HELPER_H 1
10 
11 #include "Objects/CartesianVector.h"
12 
13 #include <vector>
14 
15 namespace lar_content
16 {
17 
18 /**
19  * @brief LArPcaHelper class
20  */
22 {
23 public:
24  typedef pandora::CartesianVector EigenValues;
25  typedef std::vector<pandora::CartesianVector> EigenVectors;
26  typedef std::pair<const pandora::CartesianVector, double> WeightedPoint;
27  typedef std::vector<WeightedPoint> WeightedPointVector;
28 
29  /**
30  * @brief Run principal component analysis using input calo hits (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D points)
31  *
32  * @param t the input information
33  * @param centroid to receive the centroid position
34  * @param outputEigenValues to receive the eigen values
35  * @param outputEigenVectors to receive the eigen vectors
36  */
37  template <typename T>
38  static void RunPca(const T &t, pandora::CartesianVector &centroid, EigenValues &outputEigenValues, EigenVectors &outputEigenVectors);
39 
40  /**
41  * @brief Run principal component analysis using weighted input Cartesian vectors (TPC_VIEW_U,V,W or TPC_3D; all treated as 3D points)
42  *
43  * @param pointVector a vector of pairs of positions and weights
44  * @param centroid to receive the centroid position
45  * @param outputEigenValues to receive the eigen values
46  * @param outputEigenVectors to receive the eigen vectors
47  */
48  static void RunPca(const WeightedPointVector &pointVector, pandora::CartesianVector &centroid, EigenValues &outputEigenValues,
49  EigenVectors &outputEigenVectors);
50 };
51 
52 } // namespace lar_content
53 
54 #endif // #ifndef LAR_PCA_HELPER_H
pandora::CartesianVector EigenValues
Definition: LArPcaHelper.h:24
std::pair< const pandora::CartesianVector, double > WeightedPoint
Definition: LArPcaHelper.h:26
std::vector< WeightedPoint > WeightedPointVector
Definition: LArPcaHelper.h:27
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...
std::vector< pandora::CartesianVector > EigenVectors
Definition: LArPcaHelper.h:25
LArPcaHelper class.
Definition: LArPcaHelper.h:21