LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
PmaSegment3D.h
Go to the documentation of this file.
1 
11 #ifndef PmaSegment3D_h
12 #define PmaSegment3D_h
13 
17 
18 namespace pma
19 {
20  class Segment3D;
21  class Track3D; // only declare here to keep "parent" of Segment3D
22 }
23 
25 {
26 public:
27  Segment3D(void) : fParent(0) {}
29 
30  Vector3D Start(void) const
31  {
32  auto const & p = static_cast< Node3D* >(Prev())->Point3D();
33  return Vector3D(p.X(), p.Y(), p.Z());
34  }
35  Vector3D End(void) const
36  {
37  auto const & p = static_cast< Node3D* >(Next())->Point3D();
38  return Vector3D(p.X(), p.Y(), p.Z());
39  }
40 
42  double GetDistance2To(const TVector3& p3d) const override;
43 
45  double GetDistance2To(const TVector2& p2d, unsigned int view) const override;
46 
48  pma::Vector3D GetDirection3D(void) const override;
49 
51  TVector3 GetProjection(const TVector2& p, unsigned int view) const;
52 
55  TVector3 GetUnconstrainedProj3D(const TVector2& p2d, unsigned int view) const override;
56 
58  void SetProjection(pma::Hit3D& h) const override;
59 
62  double Length2(void) const override;
63 
64  pma::Track3D* Parent(void) const { return fParent; }
65 
66 private:
67  Segment3D(const pma::Segment3D& src);
68 
69  double SumDist2Hits(void) const override;
70 
72 
73  static double GetDist2(const TVector3& psrc, const TVector3& p0, const TVector3& p1);
74  static double GetDist2(const TVector2& psrc, const TVector2& p0, const TVector2& p1);
75 
76 };
77 
78 #endif
79 
::fhicl::TupleAs< Point(::geo::Length_t,::geo::Length_t,::geo::Length_t)> Point3D
Atom object for reading a 3D point or vector (centimeters).
Implementation of the Projection Matching Algorithm.
double Length2(void) const override
recob::tracking::Vector_t Vector3D
Definition: Utilities.h:29
Vector3D Start(void) const
Definition: PmaSegment3D.h:30
pma::Track3D * fParent
Definition: PmaSegment3D.h:71
Implementation of the Projection Matching Algorithm.
TVector3 GetProjection(const TVector2 &p, unsigned int view) const
Get 3D projection of a 2D point from the view.
pma::Vector3D GetDirection3D(void) const override
Get 3D direction cosines of this segment.
double GetDistance2To(const TVector3 &p3d) const override
Distance [cm] from the 3D segment to the point 3D.
TVector3 GetUnconstrainedProj3D(const TVector2 &p2d, unsigned int view) const override
virtual pma::SortedObjectBase * Prev(void) const
Definition: SortedObjects.h:44
double SumDist2Hits(void) const override
pma::Track3D * Parent(void) const
Definition: PmaSegment3D.h:64
virtual pma::SortedObjectBase * Next(unsigned int index=0) const
Definition: SortedObjects.h:45
void SetProjection(pma::Hit3D &h) const override
Set hit 3D position and its 2D projection to the vertex.
Implementation of the Projection Matching Algorithm.
static double GetDist2(const TVector3 &psrc, const TVector3 &p0, const TVector3 &p1)
Vector3D End(void) const
Definition: PmaSegment3D.h:35