LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
Vertex.cxx
Go to the documentation of this file.
1 //
3 // \brief Definition of vertex object for LArSoft
4 //
5 // \author brebel@fnal.gov
6 //
9 
11 
12 #include <iomanip>
13 
14 namespace recob{
15 
16  //----------------------------------------------------------------------
18  {
19  status_ = Invalid;
23  }
24 
25  //----------------------------------------------------------------------
26  Vertex::Vertex(double *xyz,
27  int id)
28  : id_(id)
29  {
30  pos_ = Point_t(xyz[0],xyz[1],xyz[2]);
31  status_ = Valid;
34  }
35 
36  //----------------------------------------------------------------------
37  void Vertex::XYZ(double *xyz) const
38  {
39  xyz[0] = pos_.X();
40  xyz[1] = pos_.Y();
41  xyz[2] = pos_.Z();
42 
43  return;
44  }
45 
46  //----------------------------------------------------------------------
47  // ostream operator.
48  //
49  std::ostream& operator<< (std::ostream& o, const Vertex & a)
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  }
58 
59  //----------------------------------------------------------------------
60  // < operator.
61  //
62  bool operator < (const Vertex & a, const Vertex & b)
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  }
72 
73 
74 }
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.
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
constexpr int kBogusI
obviously bogus integer value
Definition of vertex object for LArSoft.
Definition: Vertex.h:35
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
friend bool operator<(const Vertex &a, const Vertex &b)
Definition: Vertex.cxx:62
constexpr double kBogusD
obviously bogus double value