LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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:
38 
44 
48 
50  Vertex();
51 
53  explicit Vertex(double *xyz, int id=util::kBogusI);
54 
56  Vertex(const Point_t& pos, const SMatrixSym33& cov, double chi2, int ndof, int id=util::kBogusI)
57  : pos_(pos), cov_(cov), chi2_(chi2), ndof_(ndof), status_(ValidWithCovariance), id_(id) {}
58 
60  const Point_t& position() const { return pos_; }
62  const SMatrixSym33& covariance() const { return cov_; }
63  // Return vertex fit chi2.
64  double chi2() const { return chi2_; }
65  // Return vertex fit ndof.
66  int ndof() const { return ndof_; }
67  // Return vertex fit chi2 per ndof.
68  double chi2PerNdof() const { return (ndof_>0. ? chi2_/ndof_ : util::kBogusD); }
69  //
70  // Return vertex status.
71  Status status() const { return status_; }
72  bool isValid() const { return status_>=Valid; }
73  bool isValidCovariance() const { return status_>=ValidWithCovariance; }
74 
76  void XYZ(double *xyz) const;
77 
79  int ID() const;
80 
82  void setID(int newID) { id_ = newID; }
83 
84  friend bool operator < (const Vertex & a, const Vertex & b);
85  friend std::ostream& operator << (std::ostream& o, const Vertex & a);
86 
87  private:
88 
91  double chi2_;
92  int ndof_;
94  int id_;
95 
96  };
97 }
98 
99 inline int recob::Vertex::ID() const { return id_; }
100 
101 #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:37
Reconstruction base classes.
tracking::SMatrixSym33 SMatrixSym33
Definition: Vertex.h:40
friend std::ostream & operator<<(std::ostream &o, const Vertex &a)
Definition: Vertex.cxx:49
Vertex()
Default constructor, initializes status to Invalid, and data members to default or kBogus values...
Definition: Vertex.cxx:17
ROOT::Math::SMatrix< Double32_t, 3, 3, ROOT::Math::MatRepSym< Double32_t, 3 > > SMatrixSym33
Definition: TrackingTypes.h:84
Status status() const
Definition: Vertex.h:71
constexpr int kBogusI
obviously bogus integer value
ROOT::Math::SVector< Double32_t, 3 > SVector3
Definition: TrackingTypes.h:93
void setID(int newID)
Set vertex id.
Definition: Vertex.h:82
Vertex(const Point_t &pos, const SMatrixSym33 &cov, double chi2, int ndof, int id=util::kBogusI)
Constructor initializing all data members.
Definition: Vertex.h:56
Definition of vertex object for LArSoft.
Definition: Vertex.h:35
double chi2() const
Definition: Vertex.h:64
bool isValidCovariance() const
Definition: Vertex.h:73
tracking::Point_t Point_t
Definition: Vertex.h:39
double chi2PerNdof() const
Definition: Vertex.h:68
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
ROOT::Math::SVector< Double32_t, 2 > SVector2
Definition: TrackingTypes.h:94
SMatrixSym33 cov_
Vertex covariance matrix 3x3.
Definition: Vertex.h:90
bool isValid() const
Definition: Vertex.h:72
int id_
id number for vertex
Definition: Vertex.h:94
const SMatrixSym33 & covariance() const
Return vertex 3D covariance (be careful, the matrix may have rank=2).
Definition: Vertex.h:62
int ndof_
Vertex fit degrees of freedom.
Definition: Vertex.h:92
tracking::SMatrixSym22 SMatrixSym22
Definition: Vertex.h:41
tracking::SVector3 SVector3
Definition: Vertex.h:42
Point_t pos_
Vertex 3D position.
Definition: Vertex.h:89
double chi2_
Vertex fit chi2.
Definition: Vertex.h:91
int ID() const
Return vertex id.
Definition: Vertex.h:99
friend bool operator<(const Vertex &a, const Vertex &b)
Definition: Vertex.cxx:62
ROOT::Math::SMatrix< Double32_t, 2, 2, ROOT::Math::MatRepSym< Double32_t, 2 > > SMatrixSym22
Definition: TrackingTypes.h:83
int ndof() const
Definition: Vertex.h:66
tracking::SVector2 SVector2
Definition: Vertex.h:43
constexpr double kBogusD
obviously bogus double value
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:26
const Point_t & position() const
Return vertex 3D position.
Definition: Vertex.h:60