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 = "
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  //----------------------------------------------------------------------------
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 
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 }
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
SMatrixSym66 EndCovarianceGlobal6D() const
Definition: Track.cxx:85
TrackTrajectory fTraj
Stored trajectory data member.
Definition: Track.h:72
double EndMomentum() const
Definition: Track.h:144
double VertexMomentum() const
Definition: Track.h:142
tracking::SVector5 SVector5
Definition: Track.h:65
SMatrixSym55 fCovVertex
Covariance matrix (local 5D representation) at start point (vertex)
Definition: Track.h:76
SVector6 EndParametersGlobal6D() const
Definition: Track.cxx:60
Reconstruction base classes.
static QCString result
SMatrixSym55 fCovEnd
Covariance matrix (local 5D representation) at end point.
Definition: Track.h:77
bool operator<(Cluster const &a, Cluster const &b)
Definition: Cluster.cxx:196
unsigned int ID
bool HasMomentum() const
Definition: Track.h:140
SVector5 VertexParametersLocal5D() const
Accessors to track parameters and covariance matrices in Local5D and Global6D coordinates.
Definition: Track.cxx:71
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:102
Vector_t const & VertexMomentumVector() const
Returns the momentum of the trajectory at the first valid point [GeV/c].
Vector_t VertexDirection() const
Definition: Track.h:132
tracking::SMatrixSym66 SMatrixSym66
Definition: Track.h:61
tracking::SVector6 SVector6
Definition: Track.h:64
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
SMatrixSym66 VertexCovarianceGlobal6D() const
Definition: Track.cxx:81
Vector_t VertexDirection() const
Returns the direction of the trajectory at the first point.
double Phi() const
Definition: Track.h:178
double Theta() const
Access to spherical or geographical angles at vertex or at any point.
Definition: Track.h:176
const double a
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
Definition: Track.h:124
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
SVector5 EndParametersLocal5D() const
Definition: Track.cxx:76
Vector_t EndDirection() const
Returns the direction of the trajectory at the last point.
int ID() const
Definition: Track.h:198
Vector_t const & EndMomentumVector() const
Returns the momentum of the trajectory at the last valid point [GeV/c].
Vector_t EndDirection() const
Definition: Track.h:133
Provides recob::Track data product.
static bool * b
Definition: config.cpp:1043
Point_t const & End() const
Definition: Track.h:125
SVector6 VertexParametersGlobal6D() const
Definition: Track.cxx:49
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition: Track.h:49
QTextStream & endl(QTextStream &s)
std::ostream & operator<<(std::ostream &o, Cluster const &c)
Definition: Cluster.cxx:173