LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
A trajectory in space reconstructed from hits. More...
#include "Trajectory.h"
Public Types | |
enum | Ends_t { kStart, kVertex = kStart, kEnd, NEnds } |
Mnemonics for the access to begin and end of trajectory. More... | |
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 | Positions_t = tracking::Positions_t |
Type of trajectory point list. More... | |
using | Momenta_t = tracking::Momenta_t |
Type of momentum list. 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 | |
Trajectory ()=default | |
Default constructor; do not use it! it's needed by ROOT I/O. More... | |
Trajectory (Positions_t &&positions, Momenta_t &&momenta, bool hasMomenta) | |
Constructor: specifies all the data for the trajectory. More... | |
Trajectory (Positions_t const &positions, Momenta_t const &momenta, bool hasMomenta) | |
Constructor: copies positions and momenta. 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... | |
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... | |
TrajectoryPoint_t | TrajectoryPoint (size_t i) const |
Returns position and momentum at the specified trajectory point. More... | |
Point_t const & | Vertex () const |
Returns the position of the first point of the trajectory [cm]. More... | |
Point_t const & | Start () const |
Returns the position of the first point of the trajectory [cm]. More... | |
Point_t const & | End () const |
Returns the position of the last point of the trajectory [cm]. More... | |
Point_t const & | LocationAtPoint (size_t i) const |
Returns the position at the specified trajectory point. More... | |
template<typename T > | |
std::pair< T, T > | Extent () const |
Fills the first and last point in the trajectory. More... | |
std::pair< Point_t, Point_t > | Extent () const |
Returns a copy of the first and last point in the trajectory. More... | |
double | Length (size_t startAt=0) const |
Returns the approximate length of the trajectory. More... | |
Access to direction and momentum information | |
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=0) const |
Trajectory angle at point, with respect to positive z direction. More... | |
double | Phi (size_t p=0) const |
Azimuthal angle at a point on the trajectory, with respect to z. More... | |
double | ZenithAngle (size_t p=0) const |
"Zenith" angle of trajectory, with respect to the vertical axis. More... | |
double | AzimuthAngle (size_t p=0) 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 point [GeV/c]. More... | |
Vector_t const & | StartMomentumVector () const |
Returns the momentum of the trajectory at the first point [GeV/c]. More... | |
Vector_t const & | EndMomentumVector () const |
Returns the momentum of the trajectory at the last point [GeV/c]. More... | |
double | VertexMomentum () const |
Computes and returns the modulus of momentum at the first point [GeV/c]. More... | |
double | StartMomentum () const |
Computes and returns the modulus of momentum at the first point [GeV/c]. More... | |
double | EndMomentum () const |
Computes and returns the modulus of momentum at the last point [GeV/c]. More... | |
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... | |
template<typename T > | |
std::pair< T, T > | Direction () 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 point. More... | |
Rotation_t | GlobalToLocalRotationAtPoint (size_t p) const |
Returns 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... | |
Templated version of homonymous functions to access to position, direction, and momentum information. | |
template<typename T > | |
T | Start () const |
Start position. Use e.g. as: More... | |
template<typename T > | |
T | Vertex () const |
Start position. Use e.g. as: More... | |
template<typename T > | |
T | End () const |
End position. Use e.g. as: More... | |
template<typename T > | |
T | LocationAtPoint (unsigned int p) const |
Position at point p. Use e.g. as: More... | |
template<typename T > | |
T | StartDirection () const |
Start direction. Use e.g. as: More... | |
template<typename T > | |
T | VertexDirection () const |
Start direction. Use e.g. as: More... | |
template<typename T > | |
T | EndDirection () const |
End direction. Use e.g. as: More... | |
template<typename T > | |
T | DirectionAtPoint (unsigned int p) const |
Direction at point p. Use e.g. as: More... | |
template<typename T > | |
T | StartMomentumVector () const |
Momentum vector at start point. Use e.g. as: More... | |
template<typename T > | |
T | VertexMomentumVector () const |
Momentum vector at start point. Use e.g. as: More... | |
template<typename T > | |
T | EndMomentumVector () const |
Momentum vector at end point. Use e.g. as: More... | |
template<typename T > | |
T | MomentumVectorAtPoint (unsigned int p) const |
Momentum vector at point p. Use e.g. as: More... | |
template<typename T > | |
T | GlobalToLocalRotationAtPoint (unsigned int p) const |
Returns a rotation matrix that brings trajectory direction along z. Use e.g. as: More... | |
template<typename T > | |
T | LocalToGlobalRotationAtPoint (unsigned int p) const |
Returns a rotation matrix bringing relative directions to global. Use e.g. as: More... | |
Static Public Attributes | |
static constexpr unsigned int | MaxDumpVerbosity = 6 |
Largest verbosity level supported by Dump(). More... | |
Private Attributes | |
Positions_t | fPositions |
List of points the trajectory goes through. More... | |
Momenta_t | fMomenta |
Momentum of each of the points in trajectory. More... | |
bool | fHasMomentum = true |
Whether we have momentum modulus information. More... | |
A trajectory in space reconstructed from hits.
The 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); for a discussion on the object type for coordinates see: recob::tracking::Coord_t.
The object contains information about the trajectory, and no uncertainty, as that is considered a fit result (see recob::Track
). By convention the first point is considered "start" (or "vertex") and the last point "end", although this assignment can be arbitrary and should not be relied upon for physics decisions.
The momentum content is in part optional: the trajectory creating algorithm may decide not to provide information about the modulus of the momentum. In that case, Trajectory::HasMomentum()
will return false and every attempt to access the momentum vector will yield only the trajectory direction.
Trajectory::HasMomentum()
reports whether momentum modulus information is available;recob::TrajectoryCollectionMaker
. Definition at line 66 of file Trajectory.h.
Type used for coordinates and values in general.
Definition at line 69 of file Trajectory.h.
Type of momentum list.
Definition at line 81 of file Trajectory.h.
Type for representation of position in physical 3D space.
Definition at line 72 of file Trajectory.h.
Type of trajectory point list.
Definition at line 78 of file Trajectory.h.
Type for representation of space rotations.
Definition at line 95 of file Trajectory.h.
A point in the trajectory, with position and momentum.
Definition at line 92 of file Trajectory.h.
Type for representation of momenta in 3D space.
Definition at line 75 of file Trajectory.h.
Mnemonics for the access to begin and end of trajectory.
Enumerator | |
---|---|
kStart |
Index representing the start of the trajectory. |
kVertex |
Index representing the start of the trajectory. |
kEnd |
Index representing the end of the trajectory. |
NEnds |
Number of ends. |
Definition at line 84 of file Trajectory.h.
|
default |
Default constructor; do not use it! it's needed by ROOT I/O.
recob::Trajectory::Trajectory | ( | Positions_t && | positions, |
Momenta_t && | momenta, | ||
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 |
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::makeTrajectory()
.
Definition at line 21 of file Trajectory.cxx.
References fMomenta, fPositions, and util::to_string().
|
inline |
Constructor: copies positions and momenta.
positions | trajectory as a sorted list of points |
momenta | momentum along the trajectory, one per point |
hasMomenta | whether the information on momentum modulus is provided |
std::runtime_error | if the invariants are violated |
Definition at line 128 of file Trajectory.h.
double recob::Trajectory::AzimuthAngle | ( | size_t | p = 0 | ) | const |
"Azimuth" angle of trajectory, with respect to the sky.
p | the point index to extract the angle from (default: start) |
The angle is defined on the plane orthogonal to the y direction. It describes the angle of the trajectory at the specified point. The angle is measured starting from the positive z direction, counterclockwise. Therefore, a trajectory start lying on the demiplane of y axis and positive z axis returns 0 radians, while one lying on the demiplane of y axis and positive x axis returns radians.
If the point number is invalid, the behaviour is undefined.
Definition at line 88 of file Trajectory.cxx.
References DirectionAtPoint().
Referenced by recob::TrackTrajectory::AzimuthAngle(), and Phi().
|
inline |
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.
Definition at line 431 of file Trajectory.h.
Returns the trajectory directions at first and last point.
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 453 of file Trajectory.h.
References EndDirection(), GlobalToLocalRotationAtPoint(), LocalToGlobalRotationAtPoint(), and StartDirection().
recob::Trajectory::Vector_t recob::Trajectory::DirectionAtPoint | ( | size_t | i | ) | const |
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 109 of file Trajectory.cxx.
References HasMomentum(), and MomentumVectorAtPoint().
Referenced by AzimuthAngle(), DirectionAtPoint(), EndDirection(), EndMomentum(), recob::TrackTrajectory::EndMomentum(), GlobalToLocalRotationAtPoint(), LocalToGlobalRotationAtPoint(), trkf::KalmanFilterFinalTrackFitter::restoreInputPoints(), StartDirection(), and ZenithAngle().
|
inline |
Direction at point p. Use e.g. as:
.
Definition at line 558 of file Trajectory.h.
References dir, and DirectionAtPoint().
void recob::Trajectory::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 trajectory points5
: also 10 more intermediate trajectory points (19 total)6
: all trajectory points Referenced by lar::example::CheatTrack::dump(), Dump(), LocalToGlobalRotationAtPoint(), and recob::operator<<().
|
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 665 of file Trajectory.h.
References Dump(), and LowLevelDump().
|
inline |
Returns the position of the last point of the trajectory [cm].
Definition at line 207 of file Trajectory.h.
References LastPoint(), and LocationAtPoint().
Referenced by End(), Extent(), and Length().
|
inline |
End position. Use e.g. as:
.
Definition at line 518 of file Trajectory.h.
References End().
|
inline |
Returns the direction of the trajectory at the last point.
Definition at line 280 of file Trajectory.h.
References DirectionAtPoint(), and LastPoint().
Referenced by Direction(), and EndDirection().
|
inline |
End direction. Use e.g. as:
.
Definition at line 550 of file Trajectory.h.
References dir, and EndDirection().
|
inline |
Computes and returns the modulus of momentum at the last point [GeV/c].
Definition at line 366 of file Trajectory.h.
References DirectionAtPoint(), and EndMomentumVector().
|
inline |
Returns the momentum of the trajectory at the last point [GeV/c].
Definition at line 357 of file Trajectory.h.
References LastPoint(), and MomentumVectorAtPoint().
Referenced by EndMomentum(), and EndMomentumVector().
|
inline |
Momentum vector at end point. Use e.g. as:
.
Definition at line 582 of file Trajectory.h.
References EndMomentumVector().
|
inline |
Fills the first and last 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.
Definition at line 227 of file Trajectory.h.
Returns a copy of the first and last 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 248 of file Trajectory.h.
References End(), Length(), and Start().
|
inline |
Returns the index of the first point in the trajectory (yep, it's 0
).
Definition at line 156 of file Trajectory.h.
Referenced by recob::Track::FirstPoint(), Start(), StartDirection(), StartMomentumVector(), and recob::TrackTrajectory::Trajectory().
recob::Trajectory::Rotation_t recob::Trajectory::GlobalToLocalRotationAtPoint | ( | size_t | p | ) | const |
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 118 of file Trajectory.cxx.
References DirectionAtPoint(), and recob::tracking::Plane::Global3DToLocal3DRotation().
Referenced by Direction(), recob::TrackTrajectory::Direction(), and GlobalToLocalRotationAtPoint().
|
inline |
Returns a rotation matrix that brings trajectory direction along z. Use e.g. as:
.
Definition at line 598 of file Trajectory.h.
References GlobalToLocalRotationAtPoint().
|
inline |
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 387 of file Trajectory.h.
References fHasMomentum.
Referenced by recob::Track::DirectionAtPoint(), DirectionAtPoint(), recob::TrackTrajectory::EndMomentum(), and trkmkr::KalmanFilterFitTrackMaker::restoreInputPoints().
|
inline |
Returns whether the specified trajectory point is available.
i | index of the trajectory point |
Definition at line 166 of file Trajectory.h.
References NPoints().
Referenced by recob::Track::HasPoint(), recob::TrackTrajectory::HasValidPoint(), and recob::TrackTrajectory::Trajectory().
|
inline |
Returns the index of the last point in the trajectory.
Definition at line 159 of file Trajectory.h.
References NPoints().
Referenced by End(), EndDirection(), EndMomentumVector(), recob::Track::LastPoint(), recob::TrackTrajectory::LastValidPoint(), Length(), recob::TrackTrajectory::Length(), and recob::TrackTrajectory::Trajectory().
double recob::Trajectory::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. 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 55 of file Trajectory.cxx.
References End(), LastPoint(), and LocationAtPoint().
Referenced by Extent().
recob::Trajectory::Rotation_t recob::Trajectory::LocalToGlobalRotationAtPoint | ( | size_t | p | ) | const |
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 124 of file Trajectory.cxx.
References DirectionAtPoint(), and recob::tracking::Plane::Local3DToGlobal3DRotation().
Referenced by Direction(), recob::TrackTrajectory::Direction(), and LocalToGlobalRotationAtPoint().
|
inline |
Returns a rotation matrix bringing relative directions to global. Use e.g. as:
.
Definition at line 607 of file Trajectory.h.
References Dump(), art::detail::indent(), and LocalToGlobalRotationAtPoint().
|
inline |
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 216 of file Trajectory.h.
References fPositions.
Referenced by End(), recob::TrackTrajectory::End(), Length(), LocationAtPoint(), trkf::KalmanFilterFinalTrackFitter::restoreInputPoints(), Start(), and TrajectoryPoint().
|
inline |
Position at point p. Use e.g. as:
.
Definition at line 526 of file Trajectory.h.
References LocationAtPoint().
void recob::Trajectory::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().
|
inline |
Returns reference to stored vector of momenta.
Definition at line 178 of file Trajectory.h.
References fMomenta.
|
inline |
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 402 of file Trajectory.h.
References MomentumVectorAtPoint().
Referenced by recob::TrackTrajectory::EndMomentum(), and recob::Track::MomentumAtPoint().
|
inline |
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 416 of file Trajectory.h.
References fMomenta.
Referenced by DirectionAtPoint(), recob::TrackTrajectory::EndMomentum(), EndMomentumVector(), MomentumAtPoint(), MomentumVectorAtPoint(), Phi(), StartMomentumVector(), Theta(), and TrajectoryPoint().
|
inline |
Momentum vector at point p. Use e.g. as:
.
Definition at line 590 of file Trajectory.h.
References MomentumVectorAtPoint().
|
inline |
Returns the number of stored trajectory points.
For each point, both position and momentum are available.
Definition at line 153 of file Trajectory.h.
References fPositions.
Referenced by recob::TrackTrajectory::AtLeastValidTrajectoryPoints(), recob::TrackTrajectory::CountValidPoints(), trkf::TrajectoryMCSFitter::fitMcs(), HasPoint(), LastPoint(), recob::Track::NPoints(), NumberTrajectoryPoints(), recob::TrackTrajectory::TrackTrajectory(), and recob::TrackTrajectory::Trajectory().
|
inline |
Returns the number of stored trajectory points.
For each point, both position and momentum are available.
Definition at line 143 of file Trajectory.h.
References NPoints().
Referenced by recob::Track::Trajectory(), and recob::TrackTrajectory::Trajectory().
|
inline |
Azimuthal angle at a point on the trajectory, with respect to z.
p | the point index to extract the angle from (default: start) |
The angle is measured on the plane orthogonal to the z axis, in the same reference where Theta()
is measured. The angle is measured counterclockwise from the x axis. Skyward direction is expected to be radians in this system, provided that the standard reference frame with the y axis pointing skyward is chosen.
If the point number is invalid, the behaviour is undefined.
Definition at line 311 of file Trajectory.h.
References AzimuthAngle(), MomentumVectorAtPoint(), and ZenithAngle().
Referenced by recob::TrackTrajectory::Phi().
|
inline |
Returns reference to stored vector of positions.
Definition at line 172 of file Trajectory.h.
References fPositions.
|
inline |
Returns the position of the first point of the trajectory [cm].
Definition at line 204 of file Trajectory.h.
References FirstPoint(), and LocationAtPoint().
Referenced by Extent(), Start(), and Vertex().
|
inline |
Start position. Use e.g. as:
.
Definition at line 502 of file Trajectory.h.
References Start().
|
inline |
Returns the direction of the trajectory at the first point.
Definition at line 277 of file Trajectory.h.
References DirectionAtPoint(), and FirstPoint().
Referenced by Direction(), StartDirection(), and VertexDirection().
|
inline |
Start direction. Use e.g. as:
.
Definition at line 534 of file Trajectory.h.
References dir, and StartDirection().
|
inline |
Computes and returns the modulus of momentum at the first point [GeV/c].
Definition at line 363 of file Trajectory.h.
References StartMomentumVector().
Referenced by lar::example::CheatTrack::momentum(), and VertexMomentum().
|
inline |
Returns the momentum of the trajectory at the first point [GeV/c].
Definition at line 354 of file Trajectory.h.
References FirstPoint(), and MomentumVectorAtPoint().
Referenced by StartMomentum(), StartMomentumVector(), and VertexMomentumVector().
|
inline |
Momentum vector at start point. Use e.g. as:
.
Definition at line 566 of file Trajectory.h.
References StartMomentumVector().
|
inline |
Trajectory angle at point, with respect to positive z direction.
p | the index point to extract the angle from (default: start) |
The reference direction is the positive z axis. Although this usually matches the beam direction, this is not guaranteed and if the explicit angle from beam direction is needed, the scalar product of the beam direction and the direction from StartDirection()
should be used instead.
If the point number is invalid, the behaviour is undefined.
Definition at line 295 of file Trajectory.h.
References MomentumVectorAtPoint().
Referenced by recob::TrackTrajectory::Theta().
|
inline |
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 195 of file Trajectory.h.
References LocationAtPoint(), and MomentumVectorAtPoint().
Referenced by recob::Track::CountValidPoints(), and recob::TrackTrajectory::LastValidPoint().
|
inline |
Returns the position of the first point of the trajectory [cm].
Definition at line 201 of file Trajectory.h.
References Start().
Referenced by Vertex().
|
inline |
Start position. Use e.g. as:
.
Definition at line 510 of file Trajectory.h.
References Vertex().
|
inline |
Returns the direction of the trajectory at the first point.
Definition at line 274 of file Trajectory.h.
References StartDirection().
Referenced by VertexDirection().
|
inline |
Start direction. Use e.g. as:
.
Definition at line 542 of file Trajectory.h.
References dir, and VertexDirection().
|
inline |
Computes and returns the modulus of momentum at the first point [GeV/c].
Definition at line 360 of file Trajectory.h.
References StartMomentum().
|
inline |
Returns the momentum of the trajectory at the first point [GeV/c].
Definition at line 351 of file Trajectory.h.
References StartMomentumVector().
Referenced by VertexMomentumVector().
|
inline |
Momentum vector at start point. Use e.g. as:
.
Definition at line 574 of file Trajectory.h.
References VertexMomentumVector().
double recob::Trajectory::ZenithAngle | ( | size_t | p = 0 | ) | const |
"Zenith" angle of trajectory, with respect to the vertical axis.
p | the point index to extract the angle from (default: start) |
The angle is defined with respect to the negative y direction. It describes the angle at the specified point on the trajectory. Therefore, a trajectory starting along the positive y direction returns radians, while a trajectory going downward along the negative y direction returns 0.
This is designed so that vertical cosmic rays produce trajectories with angle 0 radians.
If the point number is invalid, the behaviour is undefined.
Definition at line 74 of file Trajectory.cxx.
References DirectionAtPoint().
Referenced by Phi(), and recob::TrackTrajectory::ZenithAngle().
|
private |
Whether we have momentum modulus information.
Definition at line 688 of file Trajectory.h.
Referenced by HasMomentum().
|
private |
Momentum of each of the points in trajectory.
Definition at line 686 of file Trajectory.h.
Referenced by Momenta(), MomentumVectorAtPoint(), and Trajectory().
|
private |
List of points the trajectory goes through.
Definition at line 685 of file Trajectory.h.
Referenced by LocationAtPoint(), NPoints(), Positions(), and Trajectory().
|
static |
Largest verbosity level supported by Dump().
Definition at line 681 of file Trajectory.h.