All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
bj/lardataobj/RecoBase/Track.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////////
2 //
3 // \brief Definition of track object for LArSoft
4 //
5 // \author brebel@fnal.gov
6 //
7 ////////////////////////////////////////////////////////////////////////////
8 
9 
12 
13 #include <iomanip>
14 #include <iostream>
15 
16 namespace recob {
17 
18  //----------------------------------------------------------------------
19  // ostream operator.
20  //
21  std::ostream& operator<< (std::ostream& stream, Track const& a)
22  {
23  auto const& start = a.VertexDirection();
24  auto const& end = a.EndDirection();
25  stream << std::setiosflags(std::ios::fixed) << std::setprecision(3)
26  << "\n Track ID " << std::setw(4) << std::right << a.ID()
27  << " Theta = " << std::setw(6) << std::right << a.Theta()
28  << " Phi = " << std::setw(6) << std::right << a.Phi()
29  << "\n StartCosines : ( " << start.X() << " ; " << start.Y() << " ; " << start.Z()
30  << ") EndCosines : ( " << end.X() << " ; " << end.Y() << " ; " << end.Z()
31  << ")"
32  << "\n #Position and Direction = "
33  << std::setw(5) << std::right << a.NumberTrajectoryPoints();
34  stream << std::endl;
35 
36  return stream;
37  }
38 
39  //----------------------------------------------------------------------------
40  bool operator < (const Track & a, const Track & b)
41  {
42  if(a.ID() != b. ID())
43  return a.ID() < b.ID();
44 
45  return false; //They are equal
46  }
47 
48  //----------------------------------------------------------------------------
50  Track::SVector6 result;
51  result[0] = Vertex().X();
52  result[1] = Vertex().Y();
53  result[2] = Vertex().Z();
54  result[3] = VertexDirection().X();
55  result[4] = VertexDirection().Y();
56  result[5] = VertexDirection().Z();
57  return result;
58  }
59 
61  Track::SVector6 result;
62  result[0] = End().X();
63  result[1] = End().Y();
64  result[2] = End().Z();
65  result[3] = EndDirection().X();
66  result[4] = EndDirection().Y();
67  result[5] = EndDirection().Z();
68  return result;
69  }
70 
72  //return tracking::Plane::Global6DToLocal5DParameters(VertexParametersGlobal6D(), fTraj.Vertex(), fTraj.VertexDirection());
73  return Track::SVector5(0.,0.,0.,0.,(HasMomentum() ? 1./VertexMomentum() : 1. ));
74  }
75 
77  //return tracking::Plane::Global6DToLocal5DParameters(EndParametersGlobal6D(), fTraj.End(), fTraj.EndDirection());
78  return Track::SVector5(0.,0.,0.,0.,(HasMomentum() ? 1./EndMomentum() : 1. ));
79  }
80 
83  }
84 
87  }
88 
89 }
TrackTrajectory fTraj
Stored trajectory data member.
SVector6 EndParametersGlobal6D() const
double VertexMomentum() const
tracking::SVector5 SVector5
SMatrixSym55 fCovVertex
Covariance matrix (local 5D representation) at start point (vertex)
SMatrixSym55 fCovEnd
Covariance matrix (local 5D representation) at end point.
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
SMatrixSym66 EndCovarianceGlobal6D() const
walls no right
Definition: selectors.fcl:105
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Vector_t const & VertexMomentumVector() const
Returns the momentum of the trajectory at the first valid point [GeV/c].
Vector_t VertexDirection() const
tracking::SMatrixSym66 SMatrixSym66
tracking::SVector6 SVector6
SMatrixSym66 VertexCovarianceGlobal6D() const
process_name gaushit a
Vector_t VertexDirection() const
Returns the direction of the trajectory at the first point.
SVector5 EndParametersLocal5D() const
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
SMatrixSym66 Local5DToGlobal6DCovariance(SMatrixSym55 cov5d, bool hasMomentum, const Vector_t &trackMomOrDir) const
Translate track covariance from local to global coordinates. The track momentum (or direction) is nee...
Definition: TrackingPlane.h:97
Point_t const & Vertex() const
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
Provides recob::Track data product.
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
SVector6 VertexParametersGlobal6D() const
Vector_t const & EndMomentumVector() const
Returns the momentum of the trajectory at the last valid point [GeV/c].
Vector_t EndDirection() const
SVector5 VertexParametersLocal5D() const
Accessors to track parameters and covariance matrices in Local5D and Global6D coordinates.
Point_t const & End() const
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track:
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:173