LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
A trajectory in space reconstructed from hits. More...
#include "TrackTrajectory.h"
Public Types | |
using | Coord_t = tracking::Coord_t |
Type used for coordinates and values in general. More... | |
using | Point_t = tracking::Point_t |
Type for representation of position in physical 3D space. More... | |
using | Vector_t = tracking::Vector_t |
Type for representation of momenta in 3D space. More... | |
using | PointFlags_t = recob::TrajectoryPointFlags |
Type for flags of a point/hit. More... | |
using | flag = PointFlags_t::flag |
Flag traits (including the definition of flag mnemonics). More... | |
using | Positions_t = tracking::Positions_t |
Type of trajectory point list. More... | |
using | Momenta_t = tracking::Momenta_t |
Type of momentum list. More... | |
using | Flags_t = std::vector< PointFlags_t > |
Type of point flag list. More... | |
using | Ends_t = Trajectory_t::Ends_t |
Mnemonics for the access to begin and end of trajectory. More... | |
using | TrajectoryPoint_t = tracking::TrajectoryPoint_t |
A point in the trajectory, with position and momentum. More... | |
using | Rotation_t = tracking::Rotation_t |
Type for representation of space rotations. More... | |
Public Member Functions | |
TrackTrajectory ()=default | |
Default constructor; do not use it! it's needed by ROOT I/O. More... | |
TrackTrajectory (Positions_t &&positions, Momenta_t &&momenta, Flags_t &&flags, bool hasMomenta) | |
Constructor: specifies all the data for the trajectory. More... | |
TrackTrajectory (const Trajectory &traj, Flags_t &&flags) | |
Constructor: copies positions and momenta from an existing Trajecotry, adds the flags. More... | |
Trajectory_t const & | Trajectory () const |
Returns the plain trajectory of this object. More... | |
PointFlags_t const & | FlagsAtPoint (size_t i) const |
Returns the flags for the specified trajectory point. More... | |
Flags_t const & | Flags () const |
Returns all flags. More... | |
bool | HasValidPoint (size_t i) const |
Returns whether the specified point has NoPoint flag unset. More... | |
size_t | FirstValidPoint () const |
Returns the index of the first valid point in the trajectory. More... | |
size_t | NextValidPoint (size_t index) const |
Returns the index of the next valid point in the trajectory. More... | |
size_t | PreviousValidPoint (size_t index) const |
Returns the index of the previous valid point in the trajectory. More... | |
size_t | LastValidPoint () const |
Returns the index of the last valid point in the trajectory. More... | |
unsigned int | CountValidPoints () const |
Computes and returns the number of points with valid location. More... | |
Point_t const & | Vertex () const |
Returns the position of the first valid point of the trajectory [cm]. More... | |
Point_t const & | Start () const |
Returns the position of the first valid point of the trajectory [cm]. More... | |
Point_t const & | End () const |
Returns the position of the last valid point of the trajectory [cm]. More... | |
void | Extent (std::vector< double > &start, std::vector< double > &end) const |
Fills the first and last valid point in the trajectory. More... | |
std::pair< Point_t, Point_t > | Extent () const |
Returns a copy of the first and last valid point in the trajectory. More... | |
double | Length (size_t startAt=0) const |
Returns the approximate length of the trajectory. More... | |
size_t | NumberFitMomentum () const |
Vector_t | VertexDirection () const |
Returns the direction of the trajectory at the first point. More... | |
Vector_t | StartDirection () const |
Returns the direction of the trajectory at the first point. More... | |
Vector_t | EndDirection () const |
Returns the direction of the trajectory at the last point. More... | |
double | Theta (size_t p) const |
Trajectory angle at point, with respect to positive z direction. More... | |
double | Theta () const |
Trajectory angle at start, with respect to positive z direction. More... | |
double | Phi (size_t p) const |
Azimuthal angle at a point on the trajectory, with respect to z. More... | |
double | Phi () const |
Azimuthal angle at a first valid point, with respect to z. More... | |
double | ZenithAngle (size_t p) const |
"Zenith" angle of trajectory, with respect to the vertical axis. More... | |
double | ZenithAngle () const |
"Zenith" angle of trajectory, with respect to the vertical axis. More... | |
double | AzimuthAngle (size_t p) const |
"Azimuth" angle of trajectory, with respect to the sky. More... | |
double | AzimuthAngle () const |
"Azimuth" angle of trajectory, with respect to the sky. More... | |
Vector_t const & | VertexMomentumVector () const |
Returns the momentum of the trajectory at the first valid point [GeV/c]. More... | |
Vector_t const & | StartMomentumVector () const |
Returns the momentum of the trajectory at the first valid point [GeV/c]. More... | |
Vector_t const & | EndMomentumVector () const |
Returns the momentum of the trajectory at the last valid point [GeV/c]. More... | |
double | VertexMomentum () const |
double | StartMomentum () const |
double | EndMomentum () const |
void | Direction (double *start, double *end) const |
Fills the starting and ending direction of the trajectory. More... | |
std::pair< Vector_t, Vector_t > | Direction () const |
Returns the trajectory directions at first and last valid points. More... | |
template<typename Stream > | |
void | Dump (Stream &&out, unsigned int verbosity, std::string indent, std::string indentFirst) const |
Prints trajectory content into a stream. More... | |
template<typename Stream > | |
void | Dump (Stream &&out, unsigned int verbosity=1, std::string indent={}) const |
Prints trajectory content into a stream. More... | |
template<typename Stream > | |
void | LowLevelDump (Stream &&out, std::string indent, std::string indentFirst) const |
Prints low-level trajectory content into a stream. More... | |
Static Public Attributes | |
static constexpr unsigned int | MaxDumpVerbosity = 7 |
Largest verbosity level supported by Dump(). More... | |
static constexpr size_t | InvalidIndex = std::numeric_limits<size_t>::max() |
Value returned on failed index queries. More... | |
Private Types | |
using | Trajectory_t = recob::Trajectory |
Private Member Functions | |
template<int Dir> | |
size_t | ToValidPoint (size_t index) const |
Returns the index of the first valid point from index on. More... | |
bool | AtLeastValidTrajectoryPoints (unsigned int left) const |
Returns whether there are at least min valid points in the trajectory. More... | |
Access to trajectory information | |
size_t | NumberTrajectoryPoints () const |
Returns the number of stored trajectory points. More... | |
size_t | NPoints () const |
Returns the number of stored trajectory points. More... | |
size_t | FirstPoint () const |
Returns the index of the first point in the trajectory (yep, it's 0 ). More... | |
size_t | LastPoint () const |
Returns the index of the last point in the trajectory. More... | |
bool | HasPoint (size_t i) const |
Returns whether the specified trajectory point is available. More... | |
const Positions_t & | Positions () const |
Returns reference to stored vector of positions. More... | |
const Momenta_t & | Momenta () const |
Returns reference to stored vector of momenta. More... | |
bool | TrajectoryAtPoint (size_t i, TVector3 &pos, TVector3 &dir) const |
Fills position and direction at the specified trajectory point. More... | |
TrajectoryPoint_t | TrajectoryPoint (size_t i) const |
Returns position and momentum at the specified trajectory point. More... | |
Point_t const & | LocationAtPoint (size_t i) const |
Returns the position at the specified trajectory point. More... | |
Access to direction and momentum information | |
Vector_t | DirectionAtPoint (size_t i) const |
Computes and returns the direction of the trajectory at a point. More... | |
bool | HasMomentum () const |
Returns whether information about the momentum is available. More... | |
double | MomentumAtPoint (size_t i) const |
Computes and returns the modulus of the momentum at a point. More... | |
Vector_t const & | MomentumVectorAtPoint (size_t i) const |
Returns the momentum vector at a point. More... | |
Rotation_t | GlobalToLocalRotationAtPoint (size_t p) const |
Returns a rotation matrix that brings trajectory direction along z. More... | |
void | GlobalToLocalRotationAtPoint (unsigned int p, TMatrixD &rot) const |
Fills a rotation matrix that brings trajectory direction along z. More... | |
Rotation_t | LocalToGlobalRotationAtPoint (size_t p) const |
Returns a rotation matrix bringing relative directions to global. More... | |
void | LocalToGlobalRotationAtPoint (unsigned int p, TMatrixD &rot) const |
Fills a rotation matrix bringing relative directions to global. More... | |
Private Attributes | |
Flags_t | fFlags |
Flags of each of the points in trajectory. More... | |
A trajectory in space reconstructed from hits.
The track trajectory class contains a trajectory in 6D space representing the path walked by a particle. A trajectory point is made of a 3D position component (measured in centimeters) and a momentum component (measured in GeV/c). The associated hits are integral part of the track trajectory. To store additional point-by-point information, the track trajectory augments recob::Trajectory
, of which it presents most of the interface, with point metadata called for convenience "flags".
Each point is formally associated to a reconstructed hit, as for recob::Trajectory
requirements. One flag set is provided for each point, whose flags describe the point and/or the hit.
The meaning of the flags is documented also in the flags class recob::TrajectoryPointFlagTraits
, which can be accessed as typedef flags
in this class (e.g. recob::TrackTrajectory::flag::NoPoint
).
The same as recob::Trajectory
, plus:
NoPoint
not set Definition at line 62 of file TrackTrajectory.h.
Type used for coordinates and values in general.
Definition at line 67 of file TrackTrajectory.h.
Mnemonics for the access to begin and end of trajectory.
Definition at line 91 of file TrackTrajectory.h.
Flag traits (including the definition of flag mnemonics).
Definition at line 79 of file TrackTrajectory.h.
using recob::TrackTrajectory::Flags_t = std::vector<PointFlags_t> |
Type of point flag list.
Definition at line 88 of file TrackTrajectory.h.
Type of momentum list.
Definition at line 85 of file TrackTrajectory.h.
Type for representation of position in physical 3D space.
Definition at line 70 of file TrackTrajectory.h.
Type for flags of a point/hit.
Definition at line 76 of file TrackTrajectory.h.
Type of trajectory point list.
Definition at line 82 of file TrackTrajectory.h.
Type for representation of space rotations.
Definition at line 97 of file TrackTrajectory.h.
|
private |
Definition at line 63 of file TrackTrajectory.h.
A point in the trajectory, with position and momentum.
Definition at line 94 of file TrackTrajectory.h.
Type for representation of momenta in 3D space.
Definition at line 73 of file TrackTrajectory.h.
|
default |
Default constructor; do not use it! it's needed by ROOT I/O.
recob::TrackTrajectory::TrackTrajectory | ( | Positions_t && | positions, |
Momenta_t && | momenta, | ||
Flags_t && | flags, | ||
bool | hasMomenta | ||
) |
Constructor: specifies all the data for the trajectory.
positions | (moved) trajectory as a sorted list of points |
momenta | (moved) momentum along the trajectory, one per point |
flags | (moved) flag sets, one flag set per point |
hasMomenta | whether the information on momentum modulus is provided |
std::runtime_error | if the invariants are violated |
The most convenient way to create a recob::Trajectory is to use recob::trackutil::makeTrackTrajectory()
.
Definition at line 21 of file TrackTrajectory.cxx.
References AtLeastValidTrajectoryPoints(), CountValidPoints(), fFlags, recob::Trajectory::NPoints(), and util::flags::to_string().
|
inline |
Constructor: copies positions and momenta from an existing Trajecotry, adds the flags.
traj | existing Trajectory |
flags | (moved) flag sets, one flag set per point |
std::runtime_error | if the invariants are violated |
Definition at line 139 of file TrackTrajectory.h.
|
private |
Returns whether there are at least min
valid points in the trajectory.
Definition at line 107 of file TrackTrajectory.cxx.
References HasValidPoint(), art::left(), min, and recob::Trajectory::NPoints().
Referenced by Direction(), and TrackTrajectory().
|
inline |
"Azimuth" angle of trajectory, with respect to the sky.
p | the index point to extract the angle from (no default!) |
The azimuth is returned, as defined in recob::Trajectory::Azimuth()
, for point with the specified index p
.
If the point is invalid, the behaviour is undefined.
p
; if p
is not specified at all, the method Azimuth()
is called instead. Definition at line 448 of file TrackTrajectory.h.
References recob::Trajectory::AzimuthAngle(), and Trajectory().
Referenced by recob::Track::AzimuthAngle().
|
inline |
"Azimuth" angle of trajectory, with respect to the sky.
The azimuth angle is returned, as defined in recob::Trajectory::Azimuth()
, for the first valid point in the trajectory.
Azimuth(0)
, but instead to Azimuth(FirstValidPoint())
. Definition at line 464 of file TrackTrajectory.h.
References FirstValidPoint().
unsigned int recob::TrackTrajectory::CountValidPoints | ( | ) | const |
Computes and returns the number of points with valid location.
This method is slow, taking O(NPoints()) time.
Definition at line 45 of file TrackTrajectory.cxx.
References Extent(), HasValidPoint(), and recob::Trajectory::NPoints().
Referenced by recob::Track::CountValidPoints(), LastValidPoint(), and TrackTrajectory().
void recob::TrackTrajectory::Direction | ( | double * | start, |
double * | end | ||
) | const |
Fills the starting and ending direction of the trajectory.
start | (output) direction at the beginning of the trajectory |
end | (output) direction at the end of the trajectory |
The two arguments are expected to point each one to an area with room for at least three double
numbers. The two filled vectors have norm 1.
The labelling of start and end is consistent within the trajectory but is not guaranteed to be physically correct.
Direction()
) Definition at line 100 of file TrackTrajectory.cxx.
References AtLeastValidTrajectoryPoints(), EndDirection(), recob::details::legacy::FillTwoVectors(), and StartDirection().
Referenced by recob::Track::Direction().
Returns the trajectory directions at first and last valid points.
The two returned vectors have norm 1. The labelling of start and end is consistent within the trajectory but is not guaranteed to be physically correct.
Example:
Definition at line 539 of file TrackTrajectory.h.
References Dump(), EndDirection(), recob::Trajectory::GlobalToLocalRotationAtPoint(), art::detail::indent(), recob::Trajectory::LocalToGlobalRotationAtPoint(), and StartDirection().
Referenced by EndMomentum().
|
inherited |
Computes and returns the direction of the trajectory at a point.
i | index of the point in the trajectory |
The direction is computed as unit vector parallel to the momentum at that trajectory point. If the index is not contained in the trajectory, the result is undefined.
Definition at line 157 of file Trajectory.cxx.
References recob::Trajectory::HasMomentum(), and recob::Trajectory::MomentumVectorAtPoint().
Referenced by recob::Trajectory::AzimuthAngle(), recob::Track::DirectionAtPoint(), EndDirection(), recob::Trajectory::EndDirection(), recob::Trajectory::EndMomentum(), EndMomentum(), trkf::BezierTrack::FillSeedVector(), recob::Trajectory::GlobalToLocalRotationAtPoint(), trkf::TrajectoryMCSFitter::linearRegression(), recob::Trajectory::LocalToGlobalRotationAtPoint(), trkf::KalmanFilterTrajectoryFitter::restoreInputPoints(), trkf::KalmanFilterFinalTrackFitter::restoreInputPoints(), StartDirection(), recob::Trajectory::StartDirection(), and recob::Trajectory::ZenithAngle().
void recob::TrackTrajectory::Dump | ( | Stream && | out, |
unsigned int | verbosity, | ||
std::string | indent, | ||
std::string | indentFirst | ||
) | const |
Prints trajectory content into a stream.
Stream | type of the output stream |
out | stream to output the information into |
verbosity | verbosity level (default: 1 ) |
indent | indentation string (default: none) |
indentFirst | indentation for first output line (default: as indent) |
The amount of information dumped to screen is regulated by the Indentation string is prepended to each line, and the first line has its own special indentation string (indentFirst
).
The output can be multi-line, it ends with no end-of-line and it does not inserts an end-of-line at its beginning (unless that is explicitly inside indentFirst
). The lowest verbosity is guaranteed to be on a single line.
verbosity
argument) 0
: start position, direction, momentum modulus and number of points1
: also end position, direction and momentum modulus2
: also trajectory length3
: also angles at start4
: also 9 intermediate valid trajectory points5
: also 10 more intermediate valid trajectory points (19 total)6
: all valid trajectory points7
: all trajectory points Referenced by Direction(), and Dump().
|
inline |
Prints trajectory content into a stream.
Stream | type of the output stream |
out | stream to output the information into |
verbosity | verbosity level (default: 1 ) |
indent | indentation string (default: none) |
Implementation detail for Dump(Stream&&, unsigned int, std::string).
Definition at line 601 of file TrackTrajectory.h.
References Dump(), and LowLevelDump().
|
inline |
Returns the position of the last valid point of the trajectory [cm].
Definition at line 260 of file TrackTrajectory.h.
References evd::details::end(), Extent(), LastValidPoint(), and recob::Trajectory::LocationAtPoint().
Referenced by recob::Track::End(), Extent(), trkf::TrackKalmanFitter::fitTrack(), and trkf::KalmanFilterFinalTrackFitter::setDirFlip().
|
inline |
Returns the direction of the trajectory at the last point.
Definition at line 332 of file TrackTrajectory.h.
References recob::Trajectory::DirectionAtPoint(), and LastValidPoint().
Referenced by Direction(), recob::Track::EndDirection(), and trkf::TrackKalmanFitter::fitTrack().
|
inline |
Computes and returns the modulus of momentum at the last point [GeV/c].
Definition at line 493 of file TrackTrajectory.h.
References Direction(), recob::Trajectory::DirectionAtPoint(), EndMomentumVector(), recob::Trajectory::HasMomentum(), recob::Trajectory::MomentumAtPoint(), and recob::Trajectory::MomentumVectorAtPoint().
Referenced by recob::Track::EndMomentum().
|
inline |
Returns the momentum of the trajectory at the last valid point [GeV/c].
Definition at line 477 of file TrackTrajectory.h.
References LastValidPoint(), and recob::Trajectory::MomentumVectorAtPoint().
Referenced by EndMomentum(), and recob::Track::EndMomentumVector().
void recob::TrackTrajectory::Extent | ( | std::vector< double > & | start, |
std::vector< double > & | end | ||
) | const |
Fills the first and last valid point in the trajectory.
start | (output) position of the beginning of the trajectory |
end | (output) position of the end of the trajectory |
The labelling of start and end is consistent within the trajectory but is not guaranteed to be physically correct.
Extent()
) Definition at line 58 of file TrackTrajectory.cxx.
References End(), recob::details::legacy::FillTwoVectors(), and Start().
Referenced by recob::Track::MomentumVectorAtPoint().
Returns a copy of the first and last valid point in the trajectory.
The labelling of start and end is consistent within the trajectory but is not guaranteed to be physically correct.
Example:
Definition at line 295 of file TrackTrajectory.h.
References End(), Length(), and Start().
Referenced by CountValidPoints(), and End().
|
inlineinherited |
Returns the index of the first point in the trajectory (yep, it's 0
).
Definition at line 176 of file Trajectory.h.
Referenced by recob::Track::FirstPoint(), recob::Trajectory::Start(), recob::Trajectory::StartDirection(), recob::Trajectory::StartMomentumVector(), and Trajectory().
|
inline |
Returns the index of the first valid point in the trajectory.
InvalidIndex
Returns the index of the first point with the flag NoPoint
unset. It never returns InvalidIndex
unless the track trajectory is invalid.
Definition at line 199 of file TrackTrajectory.h.
References NextValidPoint().
Referenced by AzimuthAngle(), trkf::TrajectoryMCSFitter::breakTrajInSegments(), recob::Track::FirstValidPoint(), Phi(), Start(), StartDirection(), StartMomentumVector(), Theta(), and ZenithAngle().
|
inline |
Returns all flags.
Definition at line 173 of file TrackTrajectory.h.
References fFlags.
Referenced by trkf::TrackKalmanFitter::fitTrack().
|
inline |
Returns the flags for the specified trajectory point.
i | index of the point in the trajectory |
If the point index is invalid, the result is undefined.
Definition at line 167 of file TrackTrajectory.h.
References fFlags.
Referenced by recob::Track::FlagsAtPoint(), and HasValidPoint().
|
inherited |
Returns a rotation matrix that brings trajectory direction along z.
p | index of the trajectory point where to apply the rotation |
The returned rotation matrix, applied to the direction vector of the trajectory at point p
, will make that direction point toward the positive z axis direction, in a sort of "first person view" of the trajectory at that point. If p
does not denote a valid trajectory point, the result is undefined.
The return value can be used on a Vector_t
to rotate it. For example:
local will be a Vector_t
object (like the direction at the right side of the product) that points to (0, 0, 1).
While the transformation that yields the rotation matrix is continuous, the direction of the new "local" x and y axes is not defined.
Definition at line 173 of file Trajectory.cxx.
References recob::Trajectory::DirectionAtPoint(), and recob::tracking::Plane::Global3DToLocal3DRotation().
Referenced by recob::Trajectory::Direction(), Direction(), recob::Track::GlobalToLocalRotationAtPoint(), and recob::Trajectory::GlobalToLocalRotationAtPoint().
|
inherited |
Fills a rotation matrix that brings trajectory direction along z.
p | index of the trajectory point where to apply the rotation |
rot | (output) the rotation matrix to be filled |
Definition at line 181 of file Trajectory.cxx.
References recob::Trajectory::GlobalToLocalRotationAtPoint(), and recob::Trajectory::LocalToGlobalRotationAtPoint().
|
inlineinherited |
Returns whether information about the momentum is available.
The trajectory may or may not store valid momentum information. If not, the methods returning momentum information will stick to a modulus 1 GeV/c and the momentum numerically matches the direction.
Definition at line 460 of file Trajectory.h.
References recob::Trajectory::fHasMomentum.
Referenced by recob::Trajectory::DirectionAtPoint(), EndMomentum(), recob::Track::FlagsAtPoint(), NumberFitMomentum(), recob::Trajectory::NumberFitMomentum(), and trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints().
|
inlineinherited |
Returns whether the specified trajectory point is available.
i | index of the trajectory point |
Definition at line 188 of file Trajectory.h.
References recob::Trajectory::NPoints().
Referenced by recob::Track::HasPoint(), HasValidPoint(), and Trajectory().
|
inline |
Returns whether the specified point has NoPoint
flag unset.
NoPoint
flag unsetA point with flag NoPoint
set is actually an invalid point, that the algorithm could not at all set, but it has still a hit associated with it.
If the point index is invalid, false is returned.
Definition at line 186 of file TrackTrajectory.h.
References FlagsAtPoint(), recob::Trajectory::HasPoint(), recob::TrajectoryPointFlags::isSet(), recob::TrajectoryPointFlagTraits::NoPoint, and Trajectory().
Referenced by AtLeastValidTrajectoryPoints(), CountValidPoints(), and recob::Track::HasValidPoint().
|
inlineinherited |
Returns the index of the last point in the trajectory.
Definition at line 180 of file Trajectory.h.
References recob::Trajectory::NPoints().
Referenced by recob::Trajectory::End(), recob::Trajectory::EndDirection(), recob::Trajectory::EndMomentumVector(), recob::Track::LastPoint(), LastValidPoint(), recob::Trajectory::Length(), Length(), and Trajectory().
|
inline |
Returns the index of the last valid point in the trajectory.
InvalidIndex
Returns the index of the last point with the flag NoPoint
unset. It never returns InvalidIndex
unless the track trajectory is invalid.
Definition at line 237 of file TrackTrajectory.h.
References CountValidPoints(), recob::Trajectory::LastPoint(), PreviousValidPoint(), and recob::Trajectory::TrajectoryPoint().
Referenced by trkf::TrajectoryMCSFitter::breakTrajInSegments(), End(), EndDirection(), EndMomentumVector(), recob::Track::LastValidPoint(), and Length().
double recob::TrackTrajectory::Length | ( | size_t | startAt = 0 | ) | const |
Returns the approximate length of the trajectory.
startAt | (default: 0, from beginning) point to start from |
The residual length from the trajectory point startAt to the end of the trajectory is computed and returned. By default, the whole trajectory length is returned. All invalid points are skipped. If after skipping, less than two valid points are left, 0 is returned.
The length approximation is just the sum of Euclidean distances between each valid trajectory point and the next (starting from the first valid one with index startAt
or larger).
This operation is slow, and the result should be stored in a variable.
startAt | (default: 0, from beginning) point to start from |
The residual length from the trajectory point startAt to the end of the trajectory is computed and returned. By default, the whole trajectory length is returned. If a non-existing point is specified, 0 is returned.
The length approximation is just the sum of Euclidean distances between all consecutive trajectory points (starting from the one with index startAt
).
This operation is slow, and the result should be stored in a variable.
Definition at line 79 of file TrackTrajectory.cxx.
References recob::Trajectory::LastPoint(), LastValidPoint(), recob::Trajectory::LocationAtPoint(), and R.
Referenced by trkf::TrajectoryMCSFitter::breakTrajInSegments(), recob::Track::Covariances(), Extent(), trkmkr::KalmanFilterFitTrackMaker::setMomentum(), trkf::KalmanFilterTrajectoryFitter::setMomValue(), and trkmkr::KalmanFilterFitTrackMaker::setParticleID().
|
inherited |
Returns a rotation matrix bringing relative directions to global.
p | index of the trajectory point where to apply the rotation |
The returned rotation matrix, applied to the unit vector (0, 0, 1) (local z axis direction), will turn it into the trajectory direction at point p
. If p
does not denote a valid trajectory point, the result is undefined.
While the transformation that yields the rotation matrix is continuous, the conversion of the directions orthogonal to the local z is not defined.
Definition at line 190 of file Trajectory.cxx.
References recob::Trajectory::DirectionAtPoint(), and recob::tracking::Plane::Local3DToGlobal3DRotation().
Referenced by recob::Trajectory::Direction(), Direction(), recob::Trajectory::GlobalToLocalRotationAtPoint(), recob::Track::LocalToGlobalRotationAtPoint(), and recob::Trajectory::LocalToGlobalRotationAtPoint().
|
inherited |
Fills a rotation matrix bringing relative directions to global.
p | index of the trajectory point where to apply the rotation |
rot | (output) the rotation matrix to be filled |
Definition at line 198 of file Trajectory.cxx.
References recob::Trajectory::LocalToGlobalRotationAtPoint().
|
inlineinherited |
Returns the position at the specified trajectory point.
i | index of the point in the trajectory |
If the point index is invalid, the result is undefined.
Definition at line 255 of file Trajectory.h.
References evd::details::end(), recob::Trajectory::Extent(), and recob::Trajectory::fPositions.
Referenced by trkf::TrajectoryMCSFitter::breakTrajInSegments(), recob::Trajectory::End(), End(), trkf::BezierTrack::FillSeedVector(), recob::Trajectory::Length(), Length(), trkf::TrajectoryMCSFitter::linearRegression(), recob::Track::LocationAtPoint(), TrackProducerFromTrack::produce(), TrackProducerFromTrackTrajectory::produce(), TrackProducerFromPFParticle::produce(), trkf::KalmanFilterTrajectoryFitter::restoreInputPoints(), trkf::KalmanFilterFinalTrackFitter::restoreInputPoints(), trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints(), recob::Trajectory::Start(), Start(), and recob::Trajectory::TrajectoryPoint().
void recob::TrackTrajectory::LowLevelDump | ( | Stream && | out, |
std::string | indent, | ||
std::string | indentFirst | ||
) | const |
Prints low-level trajectory content into a stream.
Stream | type of the output stream |
out | stream to output the information into |
indent | indentation string (default: none) |
indentFirst | indentation for first output line (default: as indent) |
Referenced by Dump().
|
inlineinherited |
Returns reference to stored vector of momenta.
Definition at line 201 of file Trajectory.h.
References dir, recob::Trajectory::fMomenta, and recob::Trajectory::TrajectoryAtPoint().
|
inlineinherited |
Computes and returns the modulus of the momentum at a point.
i | index of the point in the trajectory |
The modulus of the momentum at the specified trajectory point is computed and returned. If the trajectory does not have momentum information, the value 1 GeV/c is always returned. This can be tested trajectory by trajectory by HasMomentum(). If the index is not valid in the trajectory, the result is undefined.
Definition at line 477 of file Trajectory.h.
References recob::Trajectory::MomentumVectorAtPoint().
Referenced by EndMomentum(), and recob::Track::MomentumAtPoint().
|
inlineinherited |
Returns the momentum vector at a point.
i | index of the point in the trajectory |
The momentum at the specified trajectory point is returned. If the trajectory does not have momentum information, the returned value will represent the direction, that is a momentum with modulus 1 GeV/c. This can be tested trajectory by trajectory by HasMomentum(). If the index is not valid in the trajectory, the result is undefined.
Definition at line 492 of file Trajectory.h.
References recob::Trajectory::Direction(), and recob::Trajectory::fMomenta.
Referenced by recob::Trajectory::DirectionAtPoint(), EndMomentum(), recob::Trajectory::EndMomentumVector(), EndMomentumVector(), recob::Trajectory::MomentumAtPoint(), recob::Track::MomentumVectorAtPoint(), recob::Trajectory::Phi(), trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints(), recob::Trajectory::StartMomentumVector(), StartMomentumVector(), recob::Trajectory::Theta(), and recob::Trajectory::TrajectoryPoint().
|
inline |
Returns the index of the next valid point in the trajectory.
index | starting index |
InvalidIndex
Returns the index of the first point with the flag NoPoint
unset, starting with the point with the specified index (included), and moving forward toward the end of the trajectory. It returns InvalidIndex
if point at index is invalid and there are no valid points left after it.
Definition at line 213 of file TrackTrajectory.h.
Referenced by trkf::TrajectoryMCSFitter::breakTrajInSegments(), FirstValidPoint(), trkf::TrajectoryMCSFitter::linearRegression(), and recob::Track::NextValidPoint().
|
inlineinherited |
Returns the number of stored trajectory points.
For each point, both position and momentum are available.
Definition at line 172 of file Trajectory.h.
References recob::Trajectory::fPositions.
Referenced by AtLeastValidTrajectoryPoints(), CountValidPoints(), trkf::TrajectoryMCSFitter::fitMcs(), recob::Trajectory::HasPoint(), trkmkr::TrackMaker::initEvent(), recob::Trajectory::LastPoint(), trkmkr::TrackMaker::makeTrack(), recob::Track::NPoints(), NumberFitMomentum(), recob::Trajectory::NumberFitMomentum(), recob::Trajectory::NumberTrajectoryPoints(), TrackTrajectory(), and Trajectory().
|
inline |
Definition at line 320 of file TrackTrajectory.h.
References recob::Trajectory::HasMomentum(), and recob::Trajectory::NPoints().
|
inlineinherited |
Returns the number of stored trajectory points.
For each point, both position and momentum are available.
Definition at line 161 of file Trajectory.h.
References recob::Trajectory::NPoints().
Referenced by trkf::BezierTrack::NSegments(), recob::Track::Trajectory(), and Trajectory().
|
inline |
Azimuthal angle at a point on the trajectory, with respect to z.
p | the index point to extract the angle from (no default!) |
The angle is returned, as defined in recob::Trajectory::Phi()
, for point with the specified index p
.
If the point is invalid, the behaviour is undefined.
p
; if p
is not specified at all, the method Phi()
is called instead. Definition at line 382 of file TrackTrajectory.h.
References recob::Trajectory::Phi(), and Trajectory().
Referenced by recob::Track::Phi().
|
inline |
Azimuthal angle at a first valid point, with respect to z.
The angle is returned, as defined in recob::Trajectory::Phi()
, for the first valid point in the trajectory.
Phi(0)
, but instead to Phi(FirstValidPoint())
. Definition at line 396 of file TrackTrajectory.h.
References FirstValidPoint().
|
inlineinherited |
Returns reference to stored vector of positions.
Definition at line 195 of file Trajectory.h.
References recob::Trajectory::fPositions.
|
inline |
Returns the index of the previous valid point in the trajectory.
index | starting index |
InvalidIndex
Returns the index of the first point with the flag NoPoint
unset, starting with the point with the specified index (included), and moving backward toward the start of the trajectory. It returns InvalidIndex
if point at index is invalid and there are no valid points before it.
Definition at line 227 of file TrackTrajectory.h.
References ToValidPoint().
Referenced by LastValidPoint(), and recob::Track::PreviousValidPoint().
|
inline |
Returns the position of the first valid point of the trajectory [cm].
Definition at line 256 of file TrackTrajectory.h.
References FirstValidPoint(), and recob::Trajectory::LocationAtPoint().
Referenced by trkf::Geometric3DVertexFitter::closestPointAlongTrack(), Extent(), trkf::Geometric3DVertexFitter::fitTwoTracks(), recob::Track::FlagsAtPoint(), trkf::Geometric3DVertexFitter::getParsCovsOnPlane(), trkf::Geometric3DVertexFitter::pDist(), and Vertex().
|
inline |
Returns the direction of the trajectory at the first point.
Definition at line 328 of file TrackTrajectory.h.
References recob::Trajectory::DirectionAtPoint(), and FirstValidPoint().
Referenced by trkf::Geometric3DVertexFitter::closestPointAlongTrack(), Direction(), trkf::Geometric3DVertexFitter::fitTwoTracks(), recob::Track::FlagsAtPoint(), trkf::Geometric3DVertexFitter::getParsCovsOnPlane(), trkf::Geometric3DVertexFitter::pDist(), and VertexDirection().
|
inline |
Computes and returns the modulus of momentum at the first point [GeV/c].
Definition at line 488 of file TrackTrajectory.h.
References StartMomentumVector().
Referenced by recob::Track::StartMomentum(), and VertexMomentum().
|
inline |
Returns the momentum of the trajectory at the first valid point [GeV/c].
Definition at line 473 of file TrackTrajectory.h.
References FirstValidPoint(), and recob::Trajectory::MomentumVectorAtPoint().
Referenced by StartMomentum(), recob::Track::StartMomentumVector(), and VertexMomentumVector().
|
inline |
Trajectory angle at point, with respect to positive z direction.
p | the index point to extract the angle from (no default!) |
The angle is returned, as defined in recob::Trajectory::Theta()
, for point with the specified index p
.
If the point is invalid, the behaviour is undefined.
p
; if p
is not specified at all, the method Theta()
is called instead. Definition at line 350 of file TrackTrajectory.h.
References recob::Trajectory::Theta(), and Trajectory().
Referenced by recob::Track::ParticleId(), and recob::Track::Theta().
|
inline |
Trajectory angle at start, with respect to positive z direction.
The angle is returned, as defined in recob::Trajectory::Theta()
, for the first valid point in the trajectory.
Theta(0)
, but instead to Theta(FirstValidPoint())
. Definition at line 364 of file TrackTrajectory.h.
References FirstValidPoint().
|
private |
Returns the index of the first valid point from index on.
Dir | the direction to move when an index has an invalid point |
index | the starting index |
The valid direction Dir
values are only +1 and -1. The first point considered is always the one at index
. If no valid point is found, InvalidIndex
is returned. The invariant guarantees that all these calls return a valid index:
Referenced by PreviousValidPoint().
|
inline |
Returns the plain trajectory of this object.
Definition at line 144 of file TrackTrajectory.h.
References recob::Trajectory::FirstPoint(), recob::Trajectory::HasPoint(), recob::Trajectory::LastPoint(), recob::Trajectory::NPoints(), recob::Trajectory::NumberTrajectoryPoints(), and recob::Trajectory::TrajectoryAtPoint().
Referenced by AzimuthAngle(), HasValidPoint(), Phi(), trkf::KalmanFilterFinalTrackFitter::produce(), Theta(), and ZenithAngle().
|
inherited |
Fills position and direction at the specified trajectory point.
i | index of the trajectory point |
pos | (output) filled with the position at the given point [cm] |
dir | (output) filled with the direction at the given point |
Definition at line 66 of file Trajectory.cxx.
References recob::Trajectory::Extent().
Referenced by recob::Trajectory::Momenta(), recob::Trajectory::Trajectory(), Trajectory(), and recob::Track::TrajectoryAtPoint().
|
inlineinherited |
Returns position and momentum at the specified trajectory point.
i | index of the trajectory point |
Note that this method returns the momentum, not the direction.
If the specified index is not valid, result is undefined.
Definition at line 231 of file Trajectory.h.
References recob::Trajectory::LocationAtPoint(), and recob::Trajectory::MomentumVectorAtPoint().
Referenced by recob::Track::CountValidPoints(), and LastValidPoint().
|
inline |
Returns the position of the first valid point of the trajectory [cm].
Definition at line 252 of file TrackTrajectory.h.
References Start().
Referenced by trkf::TrackKalmanFitter::fitTrack(), trkf::KalmanFilterFinalTrackFitter::setDirFlip(), and recob::Track::Vertex().
|
inline |
Returns the direction of the trajectory at the first point.
Definition at line 324 of file TrackTrajectory.h.
References StartDirection().
Referenced by trkf::TrackKalmanFitter::fitTrack(), trkmkr::KalmanFilterFitTrackMaker::isFlipDirection(), trkf::KalmanFilterTrajectoryFitter::setDirFlip(), and recob::Track::VertexDirection().
|
inline |
Computes and returns the modulus of momentum at the first point [GeV/c].
Definition at line 483 of file TrackTrajectory.h.
References StartMomentum().
Referenced by recob::Track::VertexMomentum().
|
inline |
Returns the momentum of the trajectory at the first valid point [GeV/c].
Definition at line 469 of file TrackTrajectory.h.
References StartMomentumVector().
Referenced by recob::Track::VertexMomentumVector().
|
inline |
"Zenith" angle of trajectory, with respect to the vertical axis.
p | the index point to extract the angle from (no default!) |
The zenith is returned, as defined in recob::Trajectory::Zenith()
, for point with the specified index p
.
If the point is invalid, the behaviour is undefined.
p
; if p
is not specified at all, the method Zenith()
is called instead. Definition at line 415 of file TrackTrajectory.h.
References Trajectory(), and recob::Trajectory::ZenithAngle().
Referenced by recob::Track::ZenithAngle().
|
inline |
"Zenith" angle of trajectory, with respect to the vertical axis.
The zenith angle is returned, as defined in recob::Trajectory::Zenith()
, for the first valid point in the trajectory.
Zenith(0)
, but instead to Zenith(FirstValidPoint())
. Definition at line 430 of file TrackTrajectory.h.
References FirstValidPoint().
|
private |
Flags of each of the points in trajectory.
Definition at line 625 of file TrackTrajectory.h.
Referenced by Flags(), FlagsAtPoint(), and TrackTrajectory().
|
static |
Value returned on failed index queries.
Definition at line 621 of file TrackTrajectory.h.
Referenced by trkf::TrajectoryMCSFitter::breakTrajInSegments().
|
static |
Largest verbosity level supported by Dump().
Definition at line 618 of file TrackTrajectory.h.