LArSoft  v07_01_00
Liquid Argon Software toolkit - http://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
 
double 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 ( )

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

Definition at line 17 of file Vertex.cxx.

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

18  {
19  status_ = Invalid;
23  }
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 26 of file Vertex.cxx.

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

28  : id_(id)
29  {
30  pos_ = Point_t(xyz[0],xyz[1],xyz[2]);
31  status_ = Valid;
34  }
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.

57  : pos_(pos), cov_(cov), chi2_(chi2), ndof_(ndof), status_(ValidWithCovariance), id_(id) {}
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
double ndof() const
Definition: Vertex.h:66

Member Function Documentation

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

Definition at line 64 of file Vertex.h.

References chi2_.

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

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.

References chi2_, util::kBogusD, and ndof_.

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.

References cov_.

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

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.

References id_.

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

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.

References status_, and Valid.

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

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.

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

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

Definition at line 66 of file Vertex.h.

References ndof_.

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

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.

References pos_.

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

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.

References id_, operator<, and operator<<.

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

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.

References status_.

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 37 of file Vertex.cxx.

References pos_.

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

38  {
39  xyz[0] = pos_.X();
40  xyz[1] = pos_.Y();
41  xyz[2] = pos_.Z();
42 
43  return;
44  }
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 62 of file Vertex.cxx.

Referenced by setID().

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

Definition at line 49 of file Vertex.cxx.

Referenced by setID().

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

Member Data Documentation

double recob::Vertex::chi2_
private

Vertex fit chi2.

Definition at line 91 of file Vertex.h.

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

SMatrixSym33 recob::Vertex::cov_
private

Vertex covariance matrix 3x3.

Definition at line 90 of file Vertex.h.

Referenced by covariance().

int recob::Vertex::id_
private

id number for vertex

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

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

Point_t recob::Vertex::pos_
private

Vertex 3D position.

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

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


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