All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackUtils.h
Go to the documentation of this file.
1 /**
2  * @file lardata/ArtDataHelper/TrackUtils.h
3  * @brief Utility functions to extract information from `recob::Track`
4  * @author Gianluca Petrillo (petrillo@fnal.gov)
5  * @date March 8th, 2016
6  * @see TrackUtils.cxx
7  *
8  *
9  * `lar::util::TrackProjectedLength()` and `lar::util::TrackPitchInView()` have
10  * been factored out from `recob::Track`, from `recob::Track::ProjectedLength()`
11  * and `recob::Track::PitchInView()` respectively.
12  */
13 
14 #ifndef LARDATA_ARTDATAHELPER_TRACKUTILS_H
15 #define LARDATA_ARTDATAHELPER_TRACKUTILS_H
16 
17 // LArSoft libraries
18 #include "larcoreobj/SimpleTypesAndConstants/geo_types.h" // geo::View_t
19 
20 namespace recob { class Track; }
21 
22 namespace lar::util {
23 
24  /**
25  * @brief Returns the length of the projection of a track on a view
26  * @param track the track to be projected on a view
27  * @param view the view to project the track on
28  * @return length of the projection, in centimetres
29  *
30  *
31  * @todo CAREFUL: using view to determine projected length does not work for DUNE.
32  * Need to think more about this.
33  *
34  */
36 
37 
38  /**
39  * @brief Returns the projected length of track on a wire pitch step [cm]
40  * @param track the track to be projected on a view
41  * @param view the view for track projection
42  * @param trajectory_point at which point of the track to look for the pitch (default: `0`)
43  * @return wire pitch along the track direction at its specified point [cm]
44  * @throw cet::exception (category `"TrackPitchInView"`) if the
45  * `trajectory_point` index is not valid in `track`
46  * @throw cet::exception (category `"Geometry"`) if the point is in no TPC
47  * @throw cet::exception (category `"TPCGeo"`) if the `view` is
48  * unknown, not available or otherwise invalid
49  * @throw cet::exception (category `"Track"`) if the track projection on
50  * the wire plane is parallel to the wires (< 0.01%)
51  *
52  * This function returns the distance covered by the track between two
53  * wires, projected on the wire plane.
54  * The direction of the track is the one at the specified trajectory point
55  * (the first one by default). That direction is projected on the wire
56  * plane with the specified `view` within the TPC that contains that
57  * point.
58  *
59  * The returned value is the distance, in centimeters, between two
60  * consecutive wires on that projected direction. This is always a
61  * positive number, regardless the direction of the track, and never
62  * smaller than the wire pitch on the projection wire plane.
63  */
64  double TrackPitchInView
65  (recob::Track const& track, geo::View_t view, size_t trajectory_point = 0U);
66 
67 
68 } // namespace lar::util
69 
70 
71 #endif // LARDATA_ARTDATAHELPER_TRACKUTILS_H
enum geo::_plane_proj View_t
Enumerate the possible plane projections.
double TrackProjectedLength(recob::Track const &track, geo::View_t view)
Returns the length of the projection of a track on a view.
Definition: TrackUtils.cxx:35
process_name use argoneut_mc_hitfinder track
Definition: Data.h:7
Definition of data types for geometry description.
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].
Definition: TrackUtils.cxx:79
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a &quot;fitted&quot; track: