LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PCAxis.h
Go to the documentation of this file.
1 //
3 // \file PCAxis.h
4 // \brief Definition of a Principal Component Axis object for LArSoft
5 //
6 // \author usher@slac.stanford.edu
7 //
8 // \see PCAxis.cxx
9 //
11 
12 #ifndef PCAxis_H
13 #define PCAxis_H
14 
15 #include <vector>
16 
17 #include <iosfwd>
18 
19 namespace recob {
20  //
21  // @brief PCAxis is an object containting the results of a Principal Components
22  // Analysis of a group of space points.
23 
24  class PCAxis {
25  public:
26  typedef std::vector<std::vector<double>> EigenVectors;
27 
28  PCAxis();
29 
30  private:
31  bool fSvdOK;
33  double fEigenValues[3];
34  EigenVectors fEigenVectors;
35  double fAvePosition[3];
36  double fAveHitDoca;
37  size_t fID;
38 
39  public:
40  PCAxis(bool ok,
41  int nHits,
42  const double* eigenValues,
43  const EigenVectors& eigenVecs,
44  const double* avePos,
45  const double aveHitDoca = 9999.,
46  size_t id = 0);
47 
48  bool getSvdOK() const;
49  int getNumHitsUsed() const;
50  const double* getEigenValues() const;
51  const EigenVectors& getEigenVectors() const;
52  const double* getAvePosition() const;
53  double getAveHitDoca() const;
54  size_t getID() const;
55 
56  friend std::ostream& operator<<(std::ostream& o, const PCAxis& a);
57  friend bool operator<(const PCAxis& a, const PCAxis& b);
58  };
59 
60 }
61 
62 inline bool recob::PCAxis::getSvdOK() const
63 {
64  return fSvdOK;
65 }
67 {
68  return fNumHitsUsed;
69 }
70 inline const double* recob::PCAxis::getEigenValues() const
71 {
72  return fEigenValues;
73 }
75 {
76  return fEigenVectors;
77 }
78 inline const double* recob::PCAxis::getAvePosition() const
79 {
80  return fAvePosition;
81 }
82 inline double recob::PCAxis::getAveHitDoca() const
83 {
84  return fAveHitDoca;
85 }
86 inline size_t recob::PCAxis::getID() const
87 {
88  return fID;
89 }
90 
91 #endif // PCAxis_H
double getAveHitDoca() const
Definition: PCAxis.h:82
const EigenVectors & getEigenVectors() const
Definition: PCAxis.h:74
const double * getEigenValues() const
Definition: PCAxis.h:70
bool fSvdOK
SVD Decomposition was successful.
Definition: PCAxis.h:31
Reconstruction base classes.
friend bool operator<(const PCAxis &a, const PCAxis &b)
Definition: PCAxis.cxx:69
double fEigenValues[3]
Eigen values from SVD decomposition.
Definition: PCAxis.h:33
int getNumHitsUsed() const
Definition: PCAxis.h:66
size_t getID() const
Definition: PCAxis.h:86
friend std::ostream & operator<<(std::ostream &o, const PCAxis &a)
Definition: PCAxis.cxx:43
size_t fID
axis ID
Definition: PCAxis.h:37
EigenVectors fEigenVectors
The three principle axes.
Definition: PCAxis.h:34
const double * getAvePosition() const
Definition: PCAxis.h:78
int fNumHitsUsed
Number of hits in the decomposition.
Definition: PCAxis.h:32
double fAveHitDoca
Average doca of hits used in PCA.
Definition: PCAxis.h:36
double fAvePosition[3]
Average position of hits fed to PCA.
Definition: PCAxis.h:35
std::vector< std::vector< double > > EigenVectors
Definition: PCAxis.h:26
bool getSvdOK() const
Definition: PCAxis.h:62