LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
Vertex.h
Go to the documentation of this file.
1 //
3 // \file lardataobj/RecoBase/Vertex.h
4 // \brief Definition of vertex object for LArSoft
5 //
6 // \author brebel@fnal.gov
7 //
9 
10 #ifndef RB_VERTEX_H
11 #define RB_VERTEX_H
12 
13 #include <iosfwd>
14 
17 
18 namespace recob {
19 
35  class Vertex {
36 
37  public:
43 
47 
49  Vertex();
50 
52  explicit Vertex(double* xyz, int id = util::kBogusI);
53 
55  Vertex(const Point_t& pos,
56  const SMatrixSym33& cov,
57  double chi2,
58  int ndof,
59  int id = util::kBogusI)
60  : pos_(pos), cov_(cov), chi2_(chi2), ndof_(ndof), status_(ValidWithCovariance), id_(id)
61  {}
62 
64  const Point_t& position() const { return pos_; }
66  const SMatrixSym33& covariance() const { return cov_; }
67  // Return vertex fit chi2.
68  double chi2() const { return chi2_; }
69  // Return vertex fit ndof.
70  int ndof() const { return ndof_; }
71  // Return vertex fit chi2 per ndof.
72  double chi2PerNdof() const { return (ndof_ > 0. ? chi2_ / ndof_ : util::kBogusD); }
73  //
74  // Return vertex status.
75  Status status() const { return status_; }
76  bool isValid() const { return status_ >= Valid; }
77  bool isValidCovariance() const { return status_ >= ValidWithCovariance; }
78 
80  void XYZ(double* xyz) const;
81 
83  int ID() const;
84 
86  void setID(int newID) { id_ = newID; }
87 
88  friend bool operator<(const Vertex& a, const Vertex& b);
89  friend std::ostream& operator<<(std::ostream& o, const Vertex& a);
90 
91  private:
94  double chi2_;
95  int ndof_;
97  int id_;
98  };
99 }
100 
101 inline int recob::Vertex::ID() const
102 {
103  return id_;
104 }
105 
106 #endif // RB_VERTEX_H
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
Definition: Vertex.cxx:34
Reconstruction base classes.
tracking::SMatrixSym33 SMatrixSym33
Definition: Vertex.h:39
friend std::ostream & operator<<(std::ostream &o, const Vertex &a)
Definition: Vertex.cxx:46
Vertex()
Default constructor, initializes status to Invalid, and data members to default or kBogus values...
Definition: Vertex.cxx:16
Status status() const
Definition: Vertex.h:75
constexpr int kBogusI
obviously bogus integer value
void setID(int newID)
Set vertex id.
Definition: Vertex.h:86
Vertex(const Point_t &pos, const SMatrixSym33 &cov, double chi2, int ndof, int id=util::kBogusI)
Constructor initializing all data members.
Definition: Vertex.h:55
Definition of vertex object for LArSoft.
Definition: Vertex.h:35
double chi2() const
Definition: Vertex.h:68
bool isValidCovariance() const
Definition: Vertex.h:77
ROOT::Math::SVector< Double32_t, 2 > SVector2
tracking::Point_t Point_t
Definition: Vertex.h:38
ROOT::Math::SMatrix< Double32_t, 3, 3, ROOT::Math::MatRepSym< Double32_t, 3 >> SMatrixSym33
double chi2PerNdof() const
Definition: Vertex.h:72
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:96
ROOT::Math::SMatrix< Double32_t, 2, 2, ROOT::Math::MatRepSym< Double32_t, 2 >> SMatrixSym22
ROOT::Math::SVector< Double32_t, 3 > SVector3
SMatrixSym33 cov_
Vertex covariance matrix 3x3.
Definition: Vertex.h:93
bool isValid() const
Definition: Vertex.h:76
int id_
id number for vertex
Definition: Vertex.h:97
const SMatrixSym33 & covariance() const
Return vertex 3D covariance (be careful, the matrix may have rank=2).
Definition: Vertex.h:66
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:95
tracking::SMatrixSym22 SMatrixSym22
Definition: Vertex.h:40
tracking::SVector3 SVector3
Definition: Vertex.h:41
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:92
double chi2_
Vertex fit chi2.
Definition: Vertex.h:94
int ID() const
Return vertex id.
Definition: Vertex.h:101
friend bool operator<(const Vertex &a, const Vertex &b)
Definition: Vertex.cxx:58
int ndof() const
Definition: Vertex.h:70
tracking::SVector2 SVector2
Definition: Vertex.h:42
constexpr double kBogusD
obviously bogus double value
Collection of Physical constants used in LArSoft.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< Coord_t >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space. See recob::tracking::Coord_t for more detai...
Definition: TrackingTypes.h:27
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:64