Class for track proxy elements. More...
#include <Track.h>
Public Types | |
using | base_t = CollectionProxyElement< CollProxy > |
Base type. More... | |
using | track_proxy_t = TrackCollectionProxyElement< CollProxy > |
This type. More... | |
using | point_iterator = TrackPointIterator< track_proxy_t > |
Iterator for trajectory point information. More... | |
Public Types inherited from proxy::CollectionProxyElement< CollProxy > | |
using | collection_proxy_t = CollProxy |
using | main_element_t = typename collection_proxy_t::main_element_t |
using | aux_elements_t = typename details::SubstituteWithAuxList< typename collection_proxy_t::aux_collections_t >::type |
Tuple of elements (expected to be tagged types). More... | |
Public Member Functions | |
recob::Track const & | track () const |
Returns the pointed track. More... | |
recob::TrackTrajectory const * | operator() (proxy::Tracks::TrackType_t type) const noexcept |
Returns the requested trajectory from the proxy. More... | |
recob::TrackFitHitInfo const * | fitInfoAtPoint (std::size_t index) const |
Returns fit info for the specified point (nullptr if not available). More... | |
Direct hit interface. | |
The track prescription requires one hit per trajectory point.
The interface at track proxy level allows for both access to the whole sequence of hits, or to the hit of a specific point: | |
auto | hits () const -> decltype(auto) |
Returns a collection-like range of hits of this track, at point order. More... | |
auto | hitAtPoint (std::size_t index) const -> decltype(auto) |
Returns an art pointer to the hit associated with the specified point. More... | |
std::size_t | nHits () const |
Returns the number of hits associated with this track. More... | |
Direct track trajectory interface | |
The interface allows to check if this track has a trajectory associated with it, and to obtain a reference to it or its art pointer. bool hasTraj = proxy.hasOriginalTrajectory();
if (hasTraj) {
recob::TrackTrajectory const& trajectory = proxy.originalTrajectory();
// ...
}
art::Ptr<recob::TrackTrajectory> const& trajectoryPtr
= proxy.originalTrajectoryPtr();
if (!trajectoryPtr.isNull()) {
recob::TrackTrajectory const& trajectory = *trajectoryPtr;
// ...
}
| |
bool | hasOriginalTrajectory () const |
Returns whether this track is associated to a trajectory. More... | |
art::Ptr < recob::TrackTrajectory > const & | originalTrajectoryPtr () const |
recob::TrackTrajectory const & | originalTrajectory () const |
Returns a reference to the associated trajectory. More... | |
Point-by-point iteration interface | |
The points on track can be accessed individually with a special, non-extensible proxy. In this example, points are accessed via iteration: unsigned int nValidHits = 0;
}
unsigned int nValidPoints = std::count_if
Random (index-based) access is also available: | |
auto | points () const |
Returns an iterable range with point-by-point information. More... | |
template<typename Pred > | |
auto | selectPoints (Pred &&pred) const |
Returns an iterable range with only points matching the mask . More... | |
auto | pointsWithFlags (recob::TrackTrajectory::PointFlags_t::Mask_t mask) const |
Returns an iterable range with only points matching the mask . More... | |
std::size_t | nPoints () const |
Returns the number of trajectory points in the track. More... | |
point_iterator | beginPoint () const |
Returns the iterator to the data of the first point. More... | |
point_iterator | endPoint () const |
Returns the iterator past the last point. More... | |
TrackPoint | point (std::size_t index) const |
TrackPoint | operator[] (std::size_t index) const |
Public Member Functions inherited from proxy::CollectionProxyElement< CollProxy > | |
CollectionProxyElement (std::size_t index, main_element_t const &main, aux_elements_t &&auxData) | |
main_element_t const * | operator-> () const |
Returns a pointer to the main element. More... | |
main_element_t const & | operator* () const |
Returns a reference to the main element. More... | |
std::size_t | index () const |
Returns the index of this element in the collection. More... | |
template<typename Tag > | |
auto | get () const -> decltype(auto) |
Returns the auxiliary data specified by type (Tag ). More... | |
template<typename Tag , typename T = Tag const&> | |
auto | getIf () const -> decltype(auto) |
Returns the auxiliary data specified by type (Tag ). More... | |
Private Member Functions | |
recob::TrackTrajectory const * | originalTrajectoryCPtr () const noexcept |
Additional Inherited Members | |
Static Public Member Functions inherited from proxy::CollectionProxyElement< CollProxy > | |
template<typename Tag > | |
static constexpr bool | has () |
Returns whether this class knowns about the specified type (Tag ). More... | |
Class for track proxy elements.
CollProxy | type of track proxy collection to get data from |
For details on the track point interface see proxy::TrackPoint
.
Definition at line 731 of file lardata/RecoBaseProxy/Track.h.
using proxy::TrackCollectionProxyElement< CollProxy >::base_t = CollectionProxyElement<CollProxy> |
Base type.
Definition at line 734 of file lardata/RecoBaseProxy/Track.h.
using proxy::TrackCollectionProxyElement< CollProxy >::point_iterator = TrackPointIterator<track_proxy_t> |
Iterator for trajectory point information.
Definition at line 742 of file lardata/RecoBaseProxy/Track.h.
using proxy::TrackCollectionProxyElement< CollProxy >::track_proxy_t = TrackCollectionProxyElement<CollProxy> |
This type.
Definition at line 738 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns the iterator to the data of the first point.
Definition at line 988 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns the iterator past the last point.
Definition at line 991 of file lardata/RecoBaseProxy/Track.h.
recob::TrackFitHitInfo const * proxy::TrackCollectionProxyElement< CollProxy >::fitInfoAtPoint | ( | std::size_t | index | ) | const |
Returns fit info for the specified point (nullptr
if not available).
Definition at line 1410 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns whether this track is associated to a trajectory.
Definition at line 838 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns an art pointer to the hit associated with the specified point.
Definition at line 796 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns a collection-like range of hits of this track, at point order.
One hit is expected per trajectory point. Hits can be missing, in which case the art pointer will have isNull()
as true
.
Definition at line 792 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns the number of hits associated with this track.
Definition at line 800 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns the number of trajectory points in the track.
Definition at line 985 of file lardata/RecoBaseProxy/Track.h.
|
noexcept |
Returns the requested trajectory from the proxy.
type | type of the track trajectory to be returned |
Definition at line 1393 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Definition at line 998 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns a reference to the associated trajectory.
If the track is not associated to any trajectory, the return value is undefined. This condition should be checked beforehand, e.g. with hasTrajectory()
.
Definition at line 855 of file lardata/RecoBaseProxy/Track.h.
|
inlineprivatenoexcept |
Definition at line 1014 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns an art pointer to the associated trajectory.
isNull()
true
if none) Definition at line 843 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Extracts information from the specified point.
Definition at line 995 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns an iterable range with point-by-point information.
The interface of the elements is documented in TrackPointWrapper
. Example:
will iterate through all points (including the invalid ones, hence the check).
Definition at line 909 of file lardata/RecoBaseProxy/Track.h.
auto proxy::TrackCollectionProxyElement< CollProxy >::pointsWithFlags | ( | recob::TrackTrajectory::PointFlags_t::Mask_t | mask | ) | const |
Returns an iterable range with only points matching the mask
.
mask | point flag mask to be matched |
points()
, util::flags::BitMask::match()
This methods is used in a way similar to points()
, with the addition of specifying a mask
of flags. The iteration will happen only through the points which match the mask. that is for which pointInfo.flags().match(mask)
is true
.
The interface of the elements is documented in TrackPointWrapper
. Example:
will iterate through only the points which do not have the NoPoint
flag set (which have in fact a valid position).
Definition at line 1430 of file lardata/RecoBaseProxy/Track.h.
auto proxy::TrackCollectionProxyElement< CollProxy >::selectPoints | ( | Pred && | pred | ) | const |
Returns an iterable range with only points matching the mask
.
Pred | type of predicate to test on points |
pred | predicate to be fulfilled by the points |
points()
, pointsWithFlags()
This methods is used in a way similar to points()
, with the addition of specifying a criterium (predicate) defining the selected points. The iteration will happen only through the points which fulfil the predicate.
The interface of the elements is documented in TrackPointWrapper
. Example:
will iterate through all points which are valid and whose position is at z absolute coordinate larger than 50 centimeters (whatever it means).
Pred
is a unary function object which can accept a TrackPoint
object as its sole argument and which returns a value convertible to bool
Definition at line 1423 of file lardata/RecoBaseProxy/Track.h.
|
inline |
Returns the pointed track.
Definition at line 745 of file lardata/RecoBaseProxy/Track.h.