LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
trkf::VertexWrapper Class Reference

Wrapper class to facilitate vertex production. More...

#include "VertexWrapper.h"

Public Member Functions

 VertexWrapper ()
 
 VertexWrapper (const recob::Vertex &vtx)
 
 VertexWrapper (const recob::tracking::Point_t &pos, const recob::tracking::SMatrixSym33 &cov, double chi2, int ndof)
 
const recob::Vertexvertex () const
 
bool isValid () const
 
const recob::tracking::Point_tposition () const
 
const recob::tracking::SMatrixSym33covariance () const
 
void setVertexId (int newID)
 
void addTrack (const recob::Track &tk)
 
void addTrackAndUpdateVertex (const recob::tracking::Point_t &pos, const recob::tracking::SMatrixSym33 &cov, double chi2, int ndof, const recob::Track &tk)
 
size_t findTrack (const recob::Track &tk) const
 
size_t tracksSize () const
 
const TrackRefVectracks () const
 
TrackRefVec tracksWithoutElement (size_t element) const
 

Private Attributes

recob::Vertex vtx_
 
TrackRefVec vtxtks_
 

Detailed Description

Wrapper class to facilitate vertex production.

It stores the recob::Vertex being built and the references to the tracks being used in the vertex fit. Tracks are stored in a vector of std::reference_wrapper<const recob::Track>, so the wrapper does not own the pointer to the original track object.

Author
G. Cerati (FNAL, MicroBooNE)
Date
2017
Version
1.0

Definition at line 28 of file VertexWrapper.h.

Constructor & Destructor Documentation

trkf::VertexWrapper::VertexWrapper ( )
inline

Definition at line 31 of file VertexWrapper.h.

References vtx_.

31 { vtx_ = recob::Vertex(); }
recob::Vertex vtx_
Definition: VertexWrapper.h:77
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
trkf::VertexWrapper::VertexWrapper ( const recob::Vertex vtx)
inline

Definition at line 32 of file VertexWrapper.h.

32 : vtx_(vtx) {}
recob::Vertex vtx_
Definition: VertexWrapper.h:77
trkf::VertexWrapper::VertexWrapper ( const recob::tracking::Point_t pos,
const recob::tracking::SMatrixSym33 cov,
double  chi2,
int  ndof 
)
inline

Definition at line 33 of file VertexWrapper.h.

References vtx_.

37  {
38  vtx_ = recob::Vertex(pos, cov, chi2, ndof);
39  }
recob::Vertex vtx_
Definition: VertexWrapper.h:77
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25

Member Function Documentation

void trkf::VertexWrapper::addTrack ( const recob::Track tk)
inline

Definition at line 48 of file VertexWrapper.h.

References vtxtks_.

Referenced by addTrackAndUpdateVertex(), and trkf::Geometric3DVertexFitter::fitTwoTracks().

48 { vtxtks_.push_back(tk); }
TrackRefVec vtxtks_
Definition: VertexWrapper.h:78
void trkf::VertexWrapper::addTrackAndUpdateVertex ( const recob::tracking::Point_t pos,
const recob::tracking::SMatrixSym33 cov,
double  chi2,
int  ndof,
const recob::Track tk 
)
inline

Definition at line 49 of file VertexWrapper.h.

References addTrack(), recob::Vertex::chi2(), recob::Vertex::ndof(), and vtx_.

Referenced by trkf::Geometric3DVertexFitter::addTrackToVertex(), trkf::Geometric3DVertexFitter::closestPointAlongTrack(), and trkf::Geometric3DVertexFitter::fitTwoTracks().

54  {
55  vtx_ = recob::Vertex(pos, cov, vtx_.chi2() + chi2, vtx_.ndof() + ndof);
56  addTrack(tk);
57  }
void addTrack(const recob::Track &tk)
Definition: VertexWrapper.h:48
recob::Vertex vtx_
Definition: VertexWrapper.h:77
double chi2() const
Definition: Vertex.h:68
int ndof() const
Definition: Vertex.h:70
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
const recob::tracking::SMatrixSym33& trkf::VertexWrapper::covariance ( ) const
inline

Definition at line 44 of file VertexWrapper.h.

References recob::Vertex::covariance(), and vtx_.

Referenced by trkf::Geometric3DVertexFitter::addTrackToVertex(), trkf::Geometric3DVertexFitter::fitTwoTracks(), and trkf::Geometric3DVertexFitter::getParsCovsOnPlane().

44 { return vtx_.covariance(); }
recob::Vertex vtx_
Definition: VertexWrapper.h:77
const SMatrixSym33 & covariance() const
Return vertex 3D covariance (be careful, the matrix may have rank=2).
Definition: Vertex.h:66
size_t trkf::VertexWrapper::findTrack ( const recob::Track tk) const
inline
bool trkf::VertexWrapper::isValid ( ) const
inline

Definition at line 42 of file VertexWrapper.h.

References recob::Vertex::isValid(), and vtx_.

Referenced by trkf::Geometric3DVertexFitter::fitTracks(), and trkf::VertexFitter::produce().

42 { return vtx_.isValid(); }
recob::Vertex vtx_
Definition: VertexWrapper.h:77
bool isValid() const
Definition: Vertex.h:76
const recob::tracking::Point_t& trkf::VertexWrapper::position ( ) const
inline
void trkf::VertexWrapper::setVertexId ( int  newID)
inline

Definition at line 46 of file VertexWrapper.h.

References recob::Vertex::setID(), and vtx_.

Referenced by trkf::VertexFitter::produce().

46 { vtx_.setID(newID); }
void setID(int newID)
Set vertex id.
Definition: Vertex.h:86
recob::Vertex vtx_
Definition: VertexWrapper.h:77
const TrackRefVec& trkf::VertexWrapper::tracks ( ) const
inline

Definition at line 68 of file VertexWrapper.h.

References vtxtks_.

Referenced by trkf::Geometric3DVertexFitter::computeMeta().

68 { return vtxtks_; }
TrackRefVec vtxtks_
Definition: VertexWrapper.h:78
TrackRefVec trkf::VertexWrapper::tracksWithoutElement ( size_t  element) const
inline
const recob::Vertex& trkf::VertexWrapper::vertex ( ) const
inline

Definition at line 41 of file VertexWrapper.h.

References vtx_.

Referenced by trkf::VertexFitter::produce().

41 { return vtx_; }
recob::Vertex vtx_
Definition: VertexWrapper.h:77

Member Data Documentation

recob::Vertex trkf::VertexWrapper::vtx_
private
TrackRefVec trkf::VertexWrapper::vtxtks_
private

Definition at line 78 of file VertexWrapper.h.

Referenced by addTrack(), findTrack(), tracks(), tracksSize(), and tracksWithoutElement().


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