Public Member Functions | Private Attributes | List of all members
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 32 of file VertexWrapper.h.

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

Definition at line 33 of file VertexWrapper.h.

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

Definition at line 34 of file VertexWrapper.h.

34 { vtx_ = recob::Vertex(pos,cov,chi2,ndof); }
recob::Vertex vtx_
Definition: VertexWrapper.h:66
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 43 of file VertexWrapper.h.

43 { vtxtks_.push_back(tk); }
TrackRefVec vtxtks_
Definition: VertexWrapper.h:67
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 44 of file VertexWrapper.h.

45  {
46  vtx_ = recob::Vertex(pos, cov, vtx_.chi2()+chi2, vtx_.ndof()+ndof);
47  addTrack(tk);
48  }
void addTrack(const recob::Track &tk)
Definition: VertexWrapper.h:43
recob::Vertex vtx_
Definition: VertexWrapper.h:66
double chi2() const
Definition: Vertex.h:64
int ndof() const
Definition: Vertex.h:66
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
const recob::tracking::SMatrixSym33& trkf::VertexWrapper::covariance ( ) const
inline

Definition at line 39 of file VertexWrapper.h.

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

Definition at line 50 of file VertexWrapper.h.

50  {
51  for (size_t it = 0; it!=vtxtks_.size(); ++it) {
52  if (&tk==&vtxtks_[it].get()) return it;
53  }
54  return vtxtks_.size();
55  }
TrackRefVec vtxtks_
Definition: VertexWrapper.h:67
bool trkf::VertexWrapper::isValid ( ) const
inline

Definition at line 37 of file VertexWrapper.h.

37 {return vtx_.isValid();}
recob::Vertex vtx_
Definition: VertexWrapper.h:66
bool isValid() const
Definition: Vertex.h:72
const recob::tracking::Point_t& trkf::VertexWrapper::position ( ) const
inline

Definition at line 38 of file VertexWrapper.h.

38 { return vtx_.position(); }
recob::Vertex vtx_
Definition: VertexWrapper.h:66
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:60
void trkf::VertexWrapper::setVertexId ( int  newID)
inline

Definition at line 41 of file VertexWrapper.h.

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

Definition at line 58 of file VertexWrapper.h.

58 { return vtxtks_; }
TrackRefVec vtxtks_
Definition: VertexWrapper.h:67
size_t trkf::VertexWrapper::tracksSize ( ) const
inline

Definition at line 57 of file VertexWrapper.h.

57 { return vtxtks_.size(); }
TrackRefVec vtxtks_
Definition: VertexWrapper.h:67
TrackRefVec trkf::VertexWrapper::tracksWithoutElement ( size_t  element) const
inline

Definition at line 59 of file VertexWrapper.h.

59  {
60  TrackRefVec tks = vtxtks_;
61  tks.erase(tks.begin()+element);
62  return tks;
63  }
TrackRefVec vtxtks_
Definition: VertexWrapper.h:67
std::vector< std::reference_wrapper< const recob::Track > > TrackRefVec
Definition: VertexWrapper.h:26
const recob::Vertex& trkf::VertexWrapper::vertex ( ) const
inline

Definition at line 36 of file VertexWrapper.h.

36 { return vtx_; }
recob::Vertex vtx_
Definition: VertexWrapper.h:66

Member Data Documentation

recob::Vertex trkf::VertexWrapper::vtx_
private

Definition at line 66 of file VertexWrapper.h.

TrackRefVec trkf::VertexWrapper::vtxtks_
private

Definition at line 67 of file VertexWrapper.h.


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