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

Definition of vertex object for LArSoft. More...

#include <Vertex.h>

Public Types

enum  Status { Invalid, Valid, ValidWithCovariance }
 
using Point_t = tracking::Point_t
 
using SMatrixSym33 = tracking::SMatrixSym33
 
using SMatrixSym22 = tracking::SMatrixSym22
 
using SVector3 = tracking::SVector3
 
using SVector2 = tracking::SVector2
 

Public Member Functions

 Vertex ()
 Default constructor, initializes status to Invalid, and data members to default or kBogus values. More...
 
 Vertex (double *xyz, int id=util::kBogusI)
 Legacy constructor, preserved to avoid breaking code. Please try to use the new constructor. More...
 
 Vertex (const Point_t &pos, const SMatrixSym33 &cov, double chi2, int ndof, int id=util::kBogusI)
 Constructor initializing all data members. More...
 
const Point_tposition () const
 Return vertex 3D position. More...
 
const SMatrixSym33covariance () const
 Return vertex 3D covariance (be careful, the matrix may have rank=2). More...
 
double chi2 () const
 
int ndof () const
 
double chi2PerNdof () const
 
Status status () const
 
bool isValid () const
 
bool isValidCovariance () const
 
void XYZ (double *xyz) const
 Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::position(). More...
 
int ID () const
 Return vertex id. More...
 
void setID (int newID)
 Set vertex id. More...
 

Private Attributes

Point_t pos_
 Vertex 3D position. More...
 
SMatrixSym33 cov_
 Vertex covariance matrix 3x3. More...
 
double chi2_
 Vertex fit chi2. More...
 
int ndof_
 Vertex fit degrees of freedom. More...
 
Status status_
 Vertex status, as define in Vertex::Status enum. More...
 
int id_
 id number for vertex More...
 

Friends

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

Detailed Description

Definition of vertex object for LArSoft.

Vertex object, containing 3D position, position covariance (also in 3D, but the matrix rank may be = 2), vertex fit chi2 and number of degrees of freedom, plus a vertex status and a vertex id. The vertex object may be associated (via art Assn) to the recob::Track objects used in the vertex fit, possibly with a meta data, see recob::VertexAssnMeta.

Author
Original author: brebe.nosp@m.l@fn.nosp@m.al.go.nosp@m.v, updated by G. Cerati (FNAL, MicroBooNE)
Date
2017
Version
2.0

Definition at line 35 of file Vertex.h.

Member Typedef Documentation

Definition at line 39 of file Vertex.h.

Definition at line 41 of file Vertex.h.

Definition at line 40 of file Vertex.h.

Definition at line 43 of file Vertex.h.

Definition at line 42 of file Vertex.h.

Member Enumeration Documentation

Status of the vertex. Here the convention is that when adding new enum values all invalid go before 'Invalid', all valid go after 'Valid', and all valid with covariance go after 'ValidWithCovariance'

Enumerator
Invalid 
Valid 
ValidWithCovariance 

Definition at line 47 of file Vertex.h.

Constructor & Destructor Documentation

recob::Vertex::Vertex ( void  )

Default constructor, initializes status to Invalid, and data members to default or kBogus values.

Definition at line 16 of file Vertex.cxx.

17  {
18  status_ = Invalid;
22  }
constexpr int kBogusI
obviously bogus integer value
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
int id_
id number for vertex
Definition: Vertex.h:94
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:92
double chi2_
Vertex fit chi2.
Definition: Vertex.h:91
constexpr double kBogusD
obviously bogus double value
recob::Vertex::Vertex ( double *  xyz,
int  id = util::kBogusI 
)
explicit

Legacy constructor, preserved to avoid breaking code. Please try to use the new constructor.

Definition at line 25 of file Vertex.cxx.

27  : id_(id)
28  {
29  pos_ = Point_t(xyz[0],xyz[1],xyz[2]);
30  status_ = Valid;
33  }
constexpr int kBogusI
obviously bogus integer value
tracking::Point_t Point_t
Definition: Vertex.h:39
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
int id_
id number for vertex
Definition: Vertex.h:94
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:92
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:89
double chi2_
Vertex fit chi2.
Definition: Vertex.h:91
constexpr double kBogusD
obviously bogus double value
recob::Vertex::Vertex ( const Point_t pos,
const SMatrixSym33 cov,
double  chi2,
int  ndof,
int  id = util::kBogusI 
)
inline

Constructor initializing all data members.

Definition at line 56 of file Vertex.h.

double chi2() const
Definition: Vertex.h:64
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
SMatrixSym33 cov_
Vertex covariance matrix 3x3.
Definition: Vertex.h:90
int id_
id number for vertex
Definition: Vertex.h:94
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:92
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:89
double chi2_
Vertex fit chi2.
Definition: Vertex.h:91
int ndof() const
Definition: Vertex.h:66

Member Function Documentation

double recob::Vertex::chi2 ( ) const
inline

Definition at line 64 of file Vertex.h.

64 { return chi2_; }
double chi2_
Vertex fit chi2.
Definition: Vertex.h:91
double recob::Vertex::chi2PerNdof ( ) const
inline

Definition at line 68 of file Vertex.h.

68 { return (ndof_>0. ? chi2_/ndof_ : util::kBogusD); }
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:92
double chi2_
Vertex fit chi2.
Definition: Vertex.h:91
constexpr double kBogusD
obviously bogus double value
const SMatrixSym33& recob::Vertex::covariance ( ) const
inline

Return vertex 3D covariance (be careful, the matrix may have rank=2).

Definition at line 62 of file Vertex.h.

62 { return cov_; }
SMatrixSym33 cov_
Vertex covariance matrix 3x3.
Definition: Vertex.h:90
int recob::Vertex::ID ( ) const
inline

Return vertex id.

Definition at line 99 of file Vertex.h.

99 { return id_; }
int id_
id number for vertex
Definition: Vertex.h:94
bool recob::Vertex::isValid ( ) const
inline

Definition at line 72 of file Vertex.h.

72 { return status_>=Valid; }
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
bool recob::Vertex::isValidCovariance ( ) const
inline

Definition at line 73 of file Vertex.h.

73 { return status_>=ValidWithCovariance; }
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
int recob::Vertex::ndof ( ) const
inline

Definition at line 66 of file Vertex.h.

66 { return ndof_; }
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:92
const Point_t& recob::Vertex::position ( ) const
inline

Return vertex 3D position.

Definition at line 60 of file Vertex.h.

60 { return pos_; }
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:89
void recob::Vertex::setID ( int  newID)
inline

Set vertex id.

Definition at line 82 of file Vertex.h.

82 { id_ = newID; }
int id_
id number for vertex
Definition: Vertex.h:94
Status recob::Vertex::status ( ) const
inline

Definition at line 71 of file Vertex.h.

71 { return status_; }
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
void recob::Vertex::XYZ ( double *  xyz) const

Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::position().

Definition at line 36 of file Vertex.cxx.

37  {
38  xyz[0] = pos_.X();
39  xyz[1] = pos_.Y();
40  xyz[2] = pos_.Z();
41 
42  return;
43  }
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:89

Friends And Related Function Documentation

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

Definition at line 61 of file Vertex.cxx.

62  {
63  double xyza[3] = {0.};
64  double xyzb[3] = {0.};
65  a.XYZ(xyza);
66  b.XYZ(xyzb);
67 
68  return xyza[2] < xyzb[2];
69 
70  }
const double a
static bool * b
Definition: config.cpp:1043
std::ostream& operator<< ( std::ostream &  o,
const Vertex a 
)
friend

Definition at line 48 of file Vertex.cxx.

49  {
50  o << std::setprecision(5);
51  o << "Vertex ID " << a.id_ << std::setw(5)
52  << " (x,y,z) = (" << a.pos_.X() << "," << a.pos_.Y() << ","
53  << a.pos_.Z() << ")";
54 
55  return o;
56  }
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
const double a
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331

Member Data Documentation

double recob::Vertex::chi2_
private

Vertex fit chi2.

Definition at line 91 of file Vertex.h.

SMatrixSym33 recob::Vertex::cov_
private

Vertex covariance matrix 3x3.

Definition at line 90 of file Vertex.h.

int recob::Vertex::id_
private

id number for vertex

Definition at line 94 of file Vertex.h.

int recob::Vertex::ndof_
private

Vertex fit degrees of freedom.

Definition at line 92 of file Vertex.h.

Point_t recob::Vertex::pos_
private

Vertex 3D position.

Definition at line 89 of file Vertex.h.

Status recob::Vertex::status_
private

Vertex status, as define in Vertex::Status enum.

Definition at line 93 of file Vertex.h.


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