LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
SpacePoint.h
Go to the documentation of this file.
1 //
3 // Definition of SpacePoint class for LArSoft
4 //
5 // SpacePoints are 3D objects that contain pointers to Hits from multiple
6 // wireplanes that have been identified as matching.
7 //
8 // msoderbe@syr.edu
9 //
11 
12 #ifndef SPACEPOINT_H
13 #define SPACEPOINT_H
14 
15 #include <iosfwd>
16 
19 #include <RtypesCore.h>
20 
21 namespace recob {
22 
23  class SpacePoint {
24 
25  public:
26  using ID_t = int;
27 
29  static constexpr ID_t InvalidID = util::kBogusI;
30 
31  SpacePoint();
32 
33  private:
35  Double32_t fXYZ[3];
36  Double32_t fErrXYZ[6];
37  Double32_t fChisq;
38 
39  public:
40  SpacePoint(Double32_t const* xyz, Double32_t const* err, Double32_t chisq, int id = InvalidID);
41 
42  ID_t ID() const;
43  const Double32_t* XYZ() const;
44  const Double32_t* ErrXYZ() const;
45  Double32_t Chisq() const;
46 
48  geo::Point_t position() const;
49 
52  double covariance(unsigned int i, unsigned int j) const;
53 
55  static constexpr std::size_t covIndex(unsigned int i, unsigned int j);
56 
57  friend std::ostream& operator<<(std::ostream& o, const SpacePoint& a);
58  friend bool operator<(const SpacePoint& a, const SpacePoint& b);
59  };
60 
62  inline bool operator<(SpacePoint const& s, SpacePoint::ID_t id)
63  {
64  return s.ID() < id;
65  }
67  inline bool operator<(SpacePoint::ID_t id, SpacePoint const& s)
68  {
69  return id < s.ID();
70  }
71 
72 }
73 
75 {
76  return fID;
77 }
78 inline const Double32_t* recob::SpacePoint::XYZ() const
79 {
80  return fXYZ;
81 }
82 inline const Double32_t* recob::SpacePoint::ErrXYZ() const
83 {
84  return fErrXYZ;
85 }
86 inline Double32_t recob::SpacePoint::Chisq() const
87 {
88  return fChisq;
89 }
90 
92 {
93  return geo::Point_t{fXYZ[0], fXYZ[1], fXYZ[2]};
94 }
95 
96 #endif //SPACEPOINT_H
Reconstruction base classes.
int ID_t
type of spacepoint ID
Definition: SpacePoint.h:26
geo::Point_t position() const
Returns the position of the point in world coordinates [cm].
Definition: SpacePoint.h:91
Double32_t Chisq() const
Definition: SpacePoint.h:86
ID_t fID
Default constructor.
Definition: SpacePoint.h:34
constexpr int kBogusI
obviously bogus integer value
Double32_t fXYZ[3]
position of SpacePoint in xyz
Definition: SpacePoint.h:35
static constexpr std::size_t covIndex(unsigned int i, unsigned int j)
Returns the internal index of correlation structure for coordinates i and j.
Definition: SpacePoint.cxx:38
Definitions of geometry vector data types.
Double32_t fChisq
Chisquare.
Definition: SpacePoint.h:37
friend bool operator<(const SpacePoint &a, const SpacePoint &b)
Definition: SpacePoint.cxx:64
const Double32_t * XYZ() const
Definition: SpacePoint.h:78
static constexpr ID_t InvalidID
Special value for an invalid ID.
Definition: SpacePoint.h:29
const Double32_t * ErrXYZ() const
Definition: SpacePoint.h:82
double covariance(unsigned int i, unsigned int j) const
Definition: SpacePoint.cxx:30
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition: geo_vectors.h:180
Double32_t fErrXYZ[6]
Error matrix (lower triangular).
Definition: SpacePoint.h:36
ID_t ID() const
Definition: SpacePoint.h:74
friend std::ostream & operator<<(std::ostream &o, const SpacePoint &a)
Definition: SpacePoint.cxx:51
Collection of Physical constants used in LArSoft.