LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 38 of file Vertex.h.

Definition at line 40 of file Vertex.h.

Definition at line 39 of file Vertex.h.

Definition at line 42 of file Vertex.h.

Definition at line 41 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 46 of file Vertex.h.

Constructor & Destructor Documentation

recob::Vertex::Vertex ( )

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

Definition at line 16 of file Vertex.cxx.

References chi2_, id_, Invalid, util::kBogusD, util::kBogusI, ndof_, and status_.

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:96
int id_
id number for vertex
Definition: Vertex.h:97
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:95
double chi2_
Vertex fit chi2.
Definition: Vertex.h:94
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.

References chi2_, util::kBogusD, util::kBogusI, ndof_, pos_, status_, and Valid.

25  : id_(id)
26  {
27  pos_ = Point_t(xyz[0], xyz[1], xyz[2]);
28  status_ = Valid;
31  }
constexpr int kBogusI
obviously bogus integer value
tracking::Point_t Point_t
Definition: Vertex.h:38
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:96
int id_
id number for vertex
Definition: Vertex.h:97
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:95
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:92
double chi2_
Vertex fit chi2.
Definition: Vertex.h:94
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 55 of file Vertex.h.

60  : pos_(pos), cov_(cov), chi2_(chi2), ndof_(ndof), status_(ValidWithCovariance), id_(id)
61  {}
double chi2() const
Definition: Vertex.h:68
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:96
SMatrixSym33 cov_
Vertex covariance matrix 3x3.
Definition: Vertex.h:93
int id_
id number for vertex
Definition: Vertex.h:97
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:95
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:92
double chi2_
Vertex fit chi2.
Definition: Vertex.h:94
int ndof() const
Definition: Vertex.h:70

Member Function Documentation

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

Definition at line 68 of file Vertex.h.

References chi2_.

Referenced by trkf::VertexWrapper::addTrackAndUpdateVertex(), and RecoProxyUsageExample::analyze().

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

Definition at line 72 of file Vertex.h.

References chi2_, util::kBogusD, and ndof_.

72 { return (ndof_ > 0. ? chi2_ / ndof_ : util::kBogusD); }
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:95
double chi2_
Vertex fit chi2.
Definition: Vertex.h:94
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 66 of file Vertex.h.

References cov_.

Referenced by trkf::VertexWrapper::covariance().

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

Return vertex id.

Definition at line 101 of file Vertex.h.

References id_.

Referenced by evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), isValidCovariance(), and lar_pandora::LArPandoraEventDump::PrintVertex().

102 {
103  return id_;
104 }
int id_
id number for vertex
Definition: Vertex.h:97
bool recob::Vertex::isValid ( ) const
inline

Definition at line 76 of file Vertex.h.

References status_, and Valid.

Referenced by trkf::VertexWrapper::isValid().

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

Definition at line 77 of file Vertex.h.

References ID(), status_, ValidWithCovariance, and XYZ().

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

Definition at line 70 of file Vertex.h.

References ndof_.

Referenced by trkf::VertexWrapper::addTrackAndUpdateVertex().

70 { return ndof_; }
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:95
void recob::Vertex::setID ( int  newID)
inline

Set vertex id.

Definition at line 86 of file Vertex.h.

References id_, operator<, and operator<<.

Referenced by trkf::VertexWrapper::setVertexId().

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

Definition at line 75 of file Vertex.h.

References status_.

75 { return status_; }
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:96
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 34 of file Vertex.cxx.

References pos_.

Referenced by lar_pandora::PFParticleAnalysis::analyze(), lar_pandora::PFParticleMonitoring::analyze(), pfpf::PFPAna::analyze(), cluster::ClusterAna::analyze(), evd::RecoBaseDrawer::DrawTrackVertexAssns2D(), isValidCovariance(), shower::EMShowerAlg::MakeShower(), and recob::operator<().

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

Friends And Related Function Documentation

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

Definition at line 58 of file Vertex.cxx.

Referenced by setID().

59  {
60  double xyza[3] = {0.};
61  double xyzb[3] = {0.};
62  a.XYZ(xyza);
63  b.XYZ(xyzb);
64 
65  return xyza[2] < xyzb[2];
66  }
std::ostream& operator<< ( std::ostream &  o,
const Vertex a 
)
friend

Definition at line 46 of file Vertex.cxx.

Referenced by setID().

47  {
48  o << std::setprecision(5);
49  o << "Vertex ID " << a.id_ << std::setw(5) << " (x,y,z) = (" << a.pos_.X() << ","
50  << a.pos_.Y() << "," << a.pos_.Z() << ")";
51 
52  return o;
53  }

Member Data Documentation

double recob::Vertex::chi2_
private

Vertex fit chi2.

Definition at line 94 of file Vertex.h.

Referenced by chi2(), chi2PerNdof(), and Vertex().

SMatrixSym33 recob::Vertex::cov_
private

Vertex covariance matrix 3x3.

Definition at line 93 of file Vertex.h.

Referenced by covariance().

int recob::Vertex::id_
private

id number for vertex

Definition at line 97 of file Vertex.h.

Referenced by ID(), recob::operator<<(), setID(), and Vertex().

int recob::Vertex::ndof_
private

Vertex fit degrees of freedom.

Definition at line 95 of file Vertex.h.

Referenced by chi2PerNdof(), ndof(), and Vertex().

Point_t recob::Vertex::pos_
private

Vertex 3D position.

Definition at line 92 of file Vertex.h.

Referenced by recob::operator<<(), position(), Vertex(), and XYZ().

Status recob::Vertex::status_
private

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

Definition at line 96 of file Vertex.h.

Referenced by isValid(), isValidCovariance(), status(), and Vertex().


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