LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
SpacePoint.cxx
Go to the documentation of this file.
1 //
3 // Implementation of SpacePoint class for LArSoft
4 //
5 // msoderbe@syr.edu
6 //
8 
10 
11 #include <iomanip>
12 #include <iostream>
13 
14 namespace recob{
15 
16  //----------------------------------------------------------------------
18  fID(-1),
19  fChisq(0.)
20  {
21  for(int i=0; i<6; ++i)
22  fErrXYZ[i] = 0.;
23  }
24 
25  //----------------------------------------------------------------------
26  SpacePoint::SpacePoint(double const*xyz,
27  double const*err,
28  double chisq,
29  int id)
30  : fID(id)
31  , fChisq(chisq)
32  {
33  for(int i = 0; i < 3; ++i) fXYZ[i] = xyz[i];
34  for(int i = 0; i < 6; ++i) fErrXYZ[i] = err[i];
35  }
36 
37  //----------------------------------------------------------------------
38  // ostream operator.
39  //
40  std::ostream& operator<< (std::ostream& o, const SpacePoint & a)
41  {
42  o << std::setiosflags(std::ios::fixed) << std::setprecision(2);
43  o << " SpacePoint ID " << std::setw(5) << std::right << a.ID()
44  << " (X,Y,Z) = (" << std::setw(5) << std::right << a.XYZ()[0]
45  << " , " << std::setw(5) << std::right << a.XYZ()[1]
46  << " , " << std::setw(5) << std::right << a.XYZ()[2]
47  << ")" ;
48 
49  return o;
50  }
51 
52 
53  //----------------------------------------------------------------------
54  // < operator.
55  //
56  bool operator < (const SpacePoint & a, const SpacePoint & b)
57  {
58  if(a.ID() != b. ID())
59  return a.ID()<b.ID();
60 
61  return false; //They are equal
62 
63  }
64 
65 }
66 
constexpr auto const & right(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:112
Reconstruction base classes.
ID_t fID
Default constructor.
Definition: SpacePoint.h:33
double fChisq
Chisquare.
Definition: SpacePoint.h:36
friend bool operator<(const SpacePoint &a, const SpacePoint &b)
Definition: SpacePoint.cxx:56
double fErrXYZ[6]
Error matrix (triangular).
Definition: SpacePoint.h:35
ID_t ID() const
Definition: SpacePoint.h:63
const double * XYZ() const
Definition: SpacePoint.h:64
friend std::ostream & operator<<(std::ostream &o, const SpacePoint &a)
Definition: SpacePoint.cxx:40
double fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:34