LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
proxy::TrackPointWrapper< Data > Class Template Reference

Wrapper for a track data proxy. More...

#include "Track.h"

Public Member Functions

recob::Track const & track () const
 Returns the track this point belongs to. More...
 
auto position () const -> decltype(auto)
 
auto momentum () const -> decltype(auto)
 
art::Ptr< recob::HithitPtr () const
 Returns the hit associated with the trajectory point. More...
 
recob::TrackFitHitInfo const * fitInfoPtr () const
 Returns fit info associated with the trajectory point. More...
 
auto index () const -> decltype(auto)
 Returns the index of this point in the trajectory. More...
 
recob::Hit const * hit () const
 Returns a pointer to the hit on the trajectory point, if any. More...
 
Flags interface
auto flags () const -> decltype(auto)
 
bool isPointValid () const
 Returns whether the trajectory point is valid. More...
 

Protected Member Functions

 TrackPointWrapper ()=default
 
 TrackPointWrapper (TrackPointWrapper const &)=default
 
 TrackPointWrapper (TrackPointWrapper &&)=default
 
TrackPointWrapperoperator= (TrackPointWrapper const &)=default
 
TrackPointWrapperoperator= (TrackPointWrapper &&)=default
 

Private Types

using This_t = TrackPointWrapper< Data >
 
using Wrapped_t = std::add_const_t< Data >
 

Private Member Functions

Wrapped_t const & base () const
 
template<std::size_t N>
auto get () const -> decltype(auto)
 

Static Private Attributes

static constexpr std::size_t TrackIndex = 0
 
static constexpr std::size_t HitIndex = 1
 
static constexpr std::size_t FitHitInfoIndex = 2
 
static constexpr std::size_t IndexIndex = 3
 
static constexpr std::size_t NIndices = 4
 

Detailed Description

template<typename Data>
class proxy::TrackPointWrapper< Data >

Wrapper for a track data proxy.

Template Parameters
Datathe point data type; requirements are described below

This class provides a user interface to data pertaining a single trajectory point of a recob::Track.

Implementation details

This type wraps a generic data structure with tuple interface. It is expected that the following information is returned:

The "pointers" can be any object returning the required type when dereferenced.

Definition at line 255 of file Track.h.

Member Typedef Documentation

template<typename Data>
using proxy::TrackPointWrapper< Data >::This_t = TrackPointWrapper<Data>
private

Definition at line 565 of file Track.h.

template<typename Data>
using proxy::TrackPointWrapper< Data >::Wrapped_t = std::add_const_t<Data>
private

Definition at line 566 of file Track.h.

Constructor & Destructor Documentation

template<typename Data>
proxy::TrackPointWrapper< Data >::TrackPointWrapper ( )
protecteddefault
template<typename Data>
proxy::TrackPointWrapper< Data >::TrackPointWrapper ( TrackPointWrapper< Data > const &  )
protecteddefault
template<typename Data>
proxy::TrackPointWrapper< Data >::TrackPointWrapper ( TrackPointWrapper< Data > &&  )
protecteddefault

Member Function Documentation

template<typename Data>
Wrapped_t const& proxy::TrackPointWrapper< Data >::base ( ) const
inlineprivate

Definition at line 576 of file Track.h.

576 { return reinterpret_cast<Wrapped_t const&>(*this); }
std::add_const_t< Data > Wrapped_t
Definition: Track.h:566
template<typename Data>
recob::TrackFitHitInfo const* proxy::TrackPointWrapper< Data >::fitInfoPtr ( ) const
inline

Returns fit info associated with the trajectory point.

Returns
a pointer to the fit info, or nullptr if not merged in proxy

If the track proxy this point comes from had no fit information, nullptr is returned. The fit information is extracted using the tag in proxy::Tracks::TrackFitHitInfoTag.

Definition at line 643 of file Track.h.

643 { return get<FitHitInfoIndex>(); }
template<typename Data>
auto proxy::TrackPointWrapper< Data >::flags ( ) const -> decltype(auto)
inline

Returns the flags associated with the trajectory point.

See also
recob::Track::FlagsAtPoint()

Definition at line 616 of file Track.h.

616 { return track().Trajectory().FlagsAtPoint(index()); }
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:132
PointFlags_t const & FlagsAtPoint(size_t i) const
Returns the flags for the specified trajectory point.
auto index() const -> decltype(auto)
Returns the index of this point in the trajectory.
Definition: Track.h:646
recob::Track const & track() const
Returns the track this point belongs to.
Definition: Track.h:593
template<typename Data>
template<std::size_t N>
auto proxy::TrackPointWrapper< Data >::get ( ) const -> decltype(auto)
inlineprivate

Definition at line 579 of file Track.h.

580  {
581  return std::get<N>(base());
582  }
Wrapped_t const & base() const
Definition: Track.h:576
template<typename Data>
recob::Hit const* proxy::TrackPointWrapper< Data >::hit ( ) const
inline

Returns a pointer to the hit on the trajectory point, if any.

Definition at line 649 of file Track.h.

650  {
651  decltype(auto) ptr = hitPtr();
652  return ptr ? ptr.get() : nullptr;
653  }
art::Ptr< recob::Hit > hitPtr() const
Returns the hit associated with the trajectory point.
Definition: Track.h:632
auto get() const -> decltype(auto)
Definition: Track.h:579
template<typename Data>
art::Ptr<recob::Hit> proxy::TrackPointWrapper< Data >::hitPtr ( ) const
inline

Returns the hit associated with the trajectory point.

Returns
an art pointer to the hit associated to this point

Definition at line 632 of file Track.h.

632 { return get<HitIndex>(); }
template<typename Data>
auto proxy::TrackPointWrapper< Data >::index ( ) const -> decltype(auto)
inline

Returns the index of this point in the trajectory.

Definition at line 646 of file Track.h.

646 { return get<IndexIndex>(); }
template<typename Data>
bool proxy::TrackPointWrapper< Data >::isPointValid ( ) const
inline

Returns whether the trajectory point is valid.

Even if the trajectory point (position and momentum) are not valid, the hit is still associated to the track/tracjectory.

Definition at line 624 of file Track.h.

624 { return flags().isPointValid(); }
auto flags() const -> decltype(auto)
Definition: Track.h:616
template<typename Data>
auto proxy::TrackPointWrapper< Data >::momentum ( ) const -> decltype(auto)
inline

Returns the momentum vector of the trajectory point.

See also
recob::Track::MomentumVectorAtPoint()

Definition at line 604 of file Track.h.

605  {
607  }
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:132
auto index() const -> decltype(auto)
Returns the index of this point in the trajectory.
Definition: Track.h:646
T MomentumVectorAtPoint(unsigned int p) const
Momentum vector at point p. Use e.g. as:
recob::Track const & track() const
Returns the track this point belongs to.
Definition: Track.h:593
template<typename Data>
TrackPointWrapper& proxy::TrackPointWrapper< Data >::operator= ( TrackPointWrapper< Data > const &  )
protecteddefault
template<typename Data>
TrackPointWrapper& proxy::TrackPointWrapper< Data >::operator= ( TrackPointWrapper< Data > &&  )
protecteddefault
template<typename Data>
auto proxy::TrackPointWrapper< Data >::position ( ) const -> decltype(auto)
inline

Returns the position of the trajectory point.

See also
recob::Track::LocationAtPoint()

Definition at line 597 of file Track.h.

598  {
599  return track().Trajectory().LocationAtPoint(index());
600  }
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:132
T LocationAtPoint(unsigned int p) const
Position at point p. Use e.g. as:
auto index() const -> decltype(auto)
Returns the index of this point in the trajectory.
Definition: Track.h:646
recob::Track const & track() const
Returns the track this point belongs to.
Definition: Track.h:593
template<typename Data>
recob::Track const& proxy::TrackPointWrapper< Data >::track ( ) const
inline

Returns the track this point belongs to.

Definition at line 593 of file Track.h.

593 { return *get<TrackIndex>(); }

Member Data Documentation

template<typename Data>
constexpr std::size_t proxy::TrackPointWrapper< Data >::FitHitInfoIndex = 2
staticprivate

Definition at line 570 of file Track.h.

template<typename Data>
constexpr std::size_t proxy::TrackPointWrapper< Data >::HitIndex = 1
staticprivate

Definition at line 569 of file Track.h.

template<typename Data>
constexpr std::size_t proxy::TrackPointWrapper< Data >::IndexIndex = 3
staticprivate

Definition at line 571 of file Track.h.

template<typename Data>
constexpr std::size_t proxy::TrackPointWrapper< Data >::NIndices = 4
staticprivate

Definition at line 572 of file Track.h.

template<typename Data>
constexpr std::size_t proxy::TrackPointWrapper< Data >::TrackIndex = 0
staticprivate

Definition at line 568 of file Track.h.


The documentation for this class was generated from the following file: