All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PCAxis.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 //
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 //
10 ////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef PCAxis_H
13 #define PCAxis_H
14 
15 #include <vector>
16 
17 #include <iosfwd>
18 
19 namespace recob
20 {
21  //
22  // @brief PCAxis is an object containting the results of a Principal Components
23  // Analysis of a group of space points.
24 
25  class PCAxis
26  {
27  public:
28 
29  typedef std::vector<std::vector<double> > EigenVectors;
30 
31  PCAxis();
32 
33  private:
34 
35  bool fSvdOK; ///< SVD Decomposition was successful
36  int fNumHitsUsed; ///< Number of hits in the decomposition
37  double fEigenValues[3]; ///< Eigen values from SVD decomposition
38  EigenVectors fEigenVectors; ///< The three principle axes
39  double fAvePosition[3]; ///< Average position of hits fed to PCA
40  double fAveHitDoca; ///< Average doca of hits used in PCA
41  size_t fID; ///< axis ID
42 
43  public:
44 
45  PCAxis(bool ok, int nHits, const double* eigenValues, const EigenVectors& eigenVecs, const double* avePos, const double aveHitDoca = 9999., size_t id=0);
46 
47  bool getSvdOK() const;
48  int getNumHitsUsed() const;
49  const double* getEigenValues() const;
50  const EigenVectors& getEigenVectors() const;
51  const double* getAvePosition() const;
52  double getAveHitDoca() const;
53  size_t getID() const;
54 
55  friend std::ostream& operator << (std::ostream & o, const PCAxis& a);
56  friend bool operator < (const PCAxis& a, const PCAxis& b);
57 
58  };
59 
60 }
61 
62 
63 inline bool recob::PCAxis::getSvdOK() const {return fSvdOK;}
64 inline int recob::PCAxis::getNumHitsUsed() const {return fNumHitsUsed;}
65 inline const double* recob::PCAxis::getEigenValues() const {return fEigenValues;}
66 inline const recob::PCAxis::EigenVectors& recob::PCAxis::getEigenVectors() const {return fEigenVectors;}
67 inline const double* recob::PCAxis::getAvePosition() const {return fAvePosition;}
68 inline double recob::PCAxis::getAveHitDoca() const {return fAveHitDoca;}
69 inline size_t recob::PCAxis::getID() const {return fID;}
70 
71 
72 
73 #endif // PCAxis_H
double getAveHitDoca() const
Definition: PCAxis.h:68
const EigenVectors & getEigenVectors() const
Definition: PCAxis.h:66
const double * getEigenValues() const
Definition: PCAxis.h:65
bool fSvdOK
SVD Decomposition was successful.
Definition: PCAxis.h:35
friend bool operator<(const PCAxis &a, const PCAxis &b)
Definition: PCAxis.cxx:73
double fEigenValues[3]
Eigen values from SVD decomposition.
Definition: PCAxis.h:37
int getNumHitsUsed() const
Definition: PCAxis.h:64
size_t getID() const
Definition: PCAxis.h:69
process_name gaushit a
friend std::ostream & operator<<(std::ostream &o, const PCAxis &a)
Definition: PCAxis.cxx:50
size_t fID
axis ID
Definition: PCAxis.h:41
EigenVectors fEigenVectors
The three principle axes.
Definition: PCAxis.h:38
const double * getAvePosition() const
Definition: PCAxis.h:67
int fNumHitsUsed
Number of hits in the decomposition.
Definition: PCAxis.h:36
double fAveHitDoca
Average doca of hits used in PCA.
Definition: PCAxis.h:40
double fAvePosition[3]
Average position of hits fed to PCA.
Definition: PCAxis.h:39
std::vector< std::vector< double > > EigenVectors
Definition: PCAxis.h:29
bool getSvdOK() const
Definition: PCAxis.h:63