25 #include "cetlib_except/exception.h"
38 throw cet::exception(
"TrackProjectedLength") <<
"cannot provide projected length for "
43 auto const* geom = lar::providerFrom<geo::Geometry>();
44 double angleToVert = 0.;
45 for(
unsigned int i = 0; i < geom->Nplanes(); ++i){
46 if(geom->Plane(i).View() == view){
47 angleToVert = geom->Plane(i).Wire(0).ThetaZ(
false) - 0.5*::util::pi<>();
58 double dist = std::sqrt( std::pow(pos_cur.x() - pos_prev.x(), 2) +
59 std::pow(pos_cur.y() - pos_prev.y(), 2) +
60 std::pow(pos_cur.z() - pos_prev.z(), 2) );
65 double cosgamma =
std::abs(std::sin(angleToVert)*dir_prev.Y() +
66 std::cos(angleToVert)*dir_prev.Z() );
69 length += dist/cosgamma;
91 cet::exception(
"TrackPitchInView") <<
"ERROR: Asking for trajectory point #"
92 << trajectory_point <<
" when trajectory vector size is of size "
100 auto const& geom = *(lar::providerFrom<geo::Geometry>());
103 #if 0 // this can be enabled after `geo::PlaneGeo::InterWireProjectedDistance()` becomes available in larcorealg
108 throw cet::exception(
"Track")
109 <<
"track at point #" << trajectory_point
110 <<
" is almost parallel to the wires in view "
129 throw cet::exception(
"Track")
130 <<
"track at point #" << trajectory_point
131 <<
" is almost parallel to the wires in view "
135 <<
", its projection on plane " << plane.
ID() <<
" is " << proj
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Vector_t
Type for representation of momenta in 3D space.
A point in the trajectory, with position and momentum.
static std::string ViewName(geo::View_t view)
Returns the name of the specified view.
Utilities related to art service access.
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
Provides simple real number checks.
constexpr bool zero(Value_t value) const
Returns whether the value is no farther from 0 than the threshold.
Point_t const & LocationAtPoint(size_t i) const
double TrackProjectedLength(recob::Track const &track, geo::View_t view)
Returns the length of the projection of a track on a view.
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
process_name use argoneut_mc_hitfinder track
WireCoordProjection_t Projection(geo::Point_t const &point) const
Returns the projection of the specified point on the plane.
Class for approximate comparisons.
double InterWireProjectedDistance(WireCoordProjection_t const &projDir) const
Returns the distance between wires along the specified direction.
Access the description of detector geometry.
Definitions of geometry vector data types.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
TrajectoryPoint_t TrajectoryPoint(size_t i) const
Access to i-th TrajectoryPoint or its Flags.
Provides recob::Track data product.
Vector_t direction() const
Returns the direction of the trajectory (unit vector of the momentum).
Encapsulate the construction of a single detector plane.
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
geo::PlaneID const & ID() const
Returns the identifier of this plane.
double TrackPitchInView(recob::Track const &track, geo::View_t view, size_t trajectory_point=0U)
Returns the projected length of track on a wire pitch step [cm].
Vector_t DirectionAtPoint(size_t i) const
Collection of Physical constants used in LArSoft.
Utility functions to extract information from recob::Track
art framework interface to geometry description
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
double WirePitch() const
Return the wire pitch (in centimeters). It is assumed constant.
Encapsulate the construction of a single detector plane.
Vector GetWireDirection() const
Returns the direction of the wires.
Point_t position
position in the trajectory [cm].