Public Types | Public Member Functions | Private Attributes | Friends | List of all members
recob::PCAxis Class Reference

#include <PCAxis.h>

Public Types

typedef std::vector< std::vector< double > > EigenVectors
 

Public Member Functions

 PCAxis ()
 
 PCAxis (bool ok, int nHits, const double *eigenValues, const EigenVectors &eigenVecs, const double *avePos, const double aveHitDoca=9999., size_t id=0)
 
bool getSvdOK () const
 
int getNumHitsUsed () const
 
const double * getEigenValues () const
 
const EigenVectorsgetEigenVectors () const
 
const double * getAvePosition () const
 
double getAveHitDoca () const
 
size_t getID () const
 

Private Attributes

bool fSvdOK
 SVD Decomposition was successful. More...
 
int fNumHitsUsed
 Number of hits in the decomposition. More...
 
double fEigenValues [3]
 Eigen values from SVD decomposition. More...
 
EigenVectors fEigenVectors
 The three principle axes. More...
 
double fAvePosition [3]
 Average position of hits fed to PCA. More...
 
double fAveHitDoca
 Average doca of hits used in PCA. More...
 
size_t fID
 axis ID More...
 

Friends

std::ostream & operator<< (std::ostream &o, const PCAxis &a)
 
bool operator< (const PCAxis &a, const PCAxis &b)
 

Detailed Description

Definition at line 25 of file PCAxis.h.

Member Typedef Documentation

Definition at line 29 of file PCAxis.h.

Constructor & Destructor Documentation

recob::PCAxis::PCAxis ( )

Definition at line 21 of file PCAxis.cxx.

22 {
23 }
recob::PCAxis::PCAxis ( bool  ok,
int  nHits,
const double *  eigenValues,
const EigenVectors eigenVecs,
const double *  avePos,
const double  aveHitDoca = 9999.,
size_t  id = 0 
)

Definition at line 26 of file PCAxis.cxx.

32  :
33  fSvdOK(ok),
34  fNumHitsUsed(nHits),
35  fEigenVectors(eigenVecs),
36  fAveHitDoca(aveHitDoca),
37  fID(id)
38 {
39  fEigenValues[0] = eigenValues[0];
40  fEigenValues[1] = eigenValues[1];
41  fEigenValues[2] = eigenValues[2];
42  fAvePosition[0] = avePos[0];
43  fAvePosition[1] = avePos[1];
44  fAvePosition[2] = avePos[2];
45 }
bool fSvdOK
SVD Decomposition was successful.
Definition: PCAxis.h:35
double fEigenValues[3]
Eigen values from SVD decomposition.
Definition: PCAxis.h:37
size_t fID
axis ID
Definition: PCAxis.h:41
EigenVectors fEigenVectors
The three principle axes.
Definition: PCAxis.h:38
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

Member Function Documentation

double recob::PCAxis::getAveHitDoca ( ) const
inline

Definition at line 68 of file PCAxis.h.

68 {return fAveHitDoca;}
double fAveHitDoca
Average doca of hits used in PCA.
Definition: PCAxis.h:40
const double * recob::PCAxis::getAvePosition ( ) const
inline

Definition at line 67 of file PCAxis.h.

67 {return fAvePosition;}
double fAvePosition[3]
Average position of hits fed to PCA.
Definition: PCAxis.h:39
const double * recob::PCAxis::getEigenValues ( ) const
inline

Definition at line 65 of file PCAxis.h.

65 {return fEigenValues;}
double fEigenValues[3]
Eigen values from SVD decomposition.
Definition: PCAxis.h:37
const recob::PCAxis::EigenVectors & recob::PCAxis::getEigenVectors ( ) const
inline

Definition at line 66 of file PCAxis.h.

66 {return fEigenVectors;}
EigenVectors fEigenVectors
The three principle axes.
Definition: PCAxis.h:38
size_t recob::PCAxis::getID ( ) const
inline

Definition at line 69 of file PCAxis.h.

69 {return fID;}
size_t fID
axis ID
Definition: PCAxis.h:41
int recob::PCAxis::getNumHitsUsed ( ) const
inline

Definition at line 64 of file PCAxis.h.

64 {return fNumHitsUsed;}
int fNumHitsUsed
Number of hits in the decomposition.
Definition: PCAxis.h:36
bool recob::PCAxis::getSvdOK ( ) const
inline

Definition at line 63 of file PCAxis.h.

63 {return fSvdOK;}
bool fSvdOK
SVD Decomposition was successful.
Definition: PCAxis.h:35

Friends And Related Function Documentation

bool operator< ( const PCAxis a,
const PCAxis b 
)
friend

Definition at line 73 of file PCAxis.cxx.

74 {
75  if(a.getID() != b. getID())
76  return a.getID() < b.getID();
77 
78  return false; //They are equal
79 }
size_t getID() const
Definition: PCAxis.h:69
const double a
static bool * b
Definition: config.cpp:1043
std::ostream& operator<< ( std::ostream &  o,
const PCAxis a 
)
friend

Definition at line 50 of file PCAxis.cxx.

51 {
52  if (a.fSvdOK)
53  {
54  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
55  o << " PCAxis ID " << a.fID << " run with " << a.fNumHitsUsed << " space points" << std::endl;
56  o << " - center position: " << std::setw(6) << a.fAvePosition[0] << ", " << a.fAvePosition[1] << ", " << a.fAvePosition[2] << std::endl;
57  o << " - eigen values: " << std::setw(8) << std::right << a.fEigenValues[0] << ", "
58  << a.fEigenValues[1] << ", " << a.fEigenValues[2] << std::endl;
59  o << " - average doca: " << a.fAveHitDoca << std::endl;
60  o << " - Principle axis: " << std::setw(7) << std::setprecision(4) << a.fEigenVectors[0][0] << ", " << a.fEigenVectors[0][1] << ", " << a.fEigenVectors[0][2] << std::endl;
61  o << " - second axis: " << std::setw(7) << std::setprecision(4) << a.fEigenVectors[1][0] << ", " << a.fEigenVectors[1][1] << ", " << a.fEigenVectors[1][2] << std::endl;
62  o << " - third axis: " << std::setw(7) << std::setprecision(4) << a.fEigenVectors[2][0] << ", " << a.fEigenVectors[2][1] << ", " << a.fEigenVectors[2][2] << std::endl;
63  }
64  else
65  o << " Principal Components Axis is not valid" << std::endl;
66 
67  return o;
68 }
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
const double a
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
QTextStream & endl(QTextStream &s)

Member Data Documentation

double recob::PCAxis::fAveHitDoca
private

Average doca of hits used in PCA.

Definition at line 40 of file PCAxis.h.

double recob::PCAxis::fAvePosition[3]
private

Average position of hits fed to PCA.

Definition at line 39 of file PCAxis.h.

double recob::PCAxis::fEigenValues[3]
private

Eigen values from SVD decomposition.

Definition at line 37 of file PCAxis.h.

EigenVectors recob::PCAxis::fEigenVectors
private

The three principle axes.

Definition at line 38 of file PCAxis.h.

size_t recob::PCAxis::fID
private

axis ID

Definition at line 41 of file PCAxis.h.

int recob::PCAxis::fNumHitsUsed
private

Number of hits in the decomposition.

Definition at line 36 of file PCAxis.h.

bool recob::PCAxis::fSvdOK
private

SVD Decomposition was successful.

Definition at line 35 of file PCAxis.h.


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