Vertex.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 //
3 // \brief Definition of vertex object for LArSoft
4 //
5 // \author brebel@fnal.gov
6 //
7 ////////////////////////////////////////////////////////////////////////////
8 
10 
11 #include <iomanip>
12 
13 namespace recob{
14 
15  //----------------------------------------------------------------------
17  {
18  status_ = Invalid;
22  }
23 
24  //----------------------------------------------------------------------
25  Vertex::Vertex(double *xyz,
26  int id)
27  : id_(id)
28  {
29  pos_ = Point_t(xyz[0],xyz[1],xyz[2]);
30  status_ = Valid;
33  }
34 
35  //----------------------------------------------------------------------
36  void Vertex::XYZ(double *xyz) const
37  {
38  xyz[0] = pos_.X();
39  xyz[1] = pos_.Y();
40  xyz[2] = pos_.Z();
41 
42  return;
43  }
44 
45  //----------------------------------------------------------------------
46  // ostream operator.
47  //
48  std::ostream& operator<< (std::ostream& o, const Vertex & a)
49  {
50  o << std::setprecision(5);
51  o << "Vertex ID " << a.id_ << std::setw(5)
52  << " (x,y,z) = (" << a.pos_.X() << "," << a.pos_.Y() << ","
53  << a.pos_.Z() << ")";
54 
55  return o;
56  }
57 
58  //----------------------------------------------------------------------
59  // < operator.
60  //
61  bool operator < (const Vertex & a, const Vertex & b)
62  {
63  double xyza[3] = {0.};
64  double xyzb[3] = {0.};
65  a.XYZ(xyza);
66  b.XYZ(xyzb);
67 
68  return xyza[2] < xyzb[2];
69 
70  }
71 
72 
73 }
void XYZ(double *xyz) const
Legacy method to access vertex position, preserved to avoid breaking code. Please try to use Vertex::...
Definition: Vertex.cxx:36
Reconstruction base classes.
friend std::ostream & operator<<(std::ostream &o, const Vertex &a)
Definition: Vertex.cxx:48
Vertex()
Default constructor, initializes status to Invalid, and data members to default or kBogus values...
Definition: Vertex.cxx:16
constexpr int kBogusI
obviously bogus integer value
Definition of vertex object for LArSoft.
Definition: Vertex.h:35
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
tracking::Point_t Point_t
Definition: Vertex.h:39
Status status_
Vertex status, as define in Vertex::Status enum.
Definition: Vertex.h:93
const double a
int id_
id number for vertex
Definition: Vertex.h:94
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
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:61
static bool * b
Definition: config.cpp:1043
constexpr double kBogusD
obviously bogus double value