Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Static Private Attributes | List of all members
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 256 of file Track.h.

Member Typedef Documentation

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

Definition at line 588 of file Track.h.

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

Definition at line 589 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 600 of file Track.h.

601  { return reinterpret_cast<Wrapped_t const&>(*this); }
std::add_const_t< Data > Wrapped_t
Definition: Track.h:589
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 664 of file Track.h.

665  { 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 636 of file Track.h.

637  { return track().Trajectory().FlagsAtPoint(index()); }
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:98
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:668
recob::Track const & track() const
Returns the track this point belongs to.
Definition: Track.h:616
template<typename Data>
template<std::size_t N>
auto proxy::TrackPointWrapper< Data >::get ( ) const -> decltype(auto)
inlineprivate

Definition at line 604 of file Track.h.

604 { return std::get<N>(base()); }
Wrapped_t const & base() const
Definition: Track.h:600
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 671 of file Track.h.

672  { decltype(auto) ptr = hitPtr(); return ptr? ptr.get(): nullptr; }
art::Ptr< recob::Hit > hitPtr() const
Returns the hit associated with the trajectory point.
Definition: Track.h:653
auto get() const -> decltype(auto)
Definition: Track.h:604
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 653 of file Track.h.

653 { 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 668 of file Track.h.

668 { 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 645 of file Track.h.

645 { return flags().isPointValid(); }
auto flags() const -> decltype(auto)
Definition: Track.h:636
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 626 of file Track.h.

627  { return track().Trajectory().MomentumVectorAtPoint(index()); }
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:98
auto index() const -> decltype(auto)
Returns the index of this point in the trajectory.
Definition: Track.h:668
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:616
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 621 of file Track.h.

622  { return track().Trajectory().LocationAtPoint(index()); }
const recob::TrackTrajectory & Trajectory() const
Access to the stored recob::TrackTrajectory.
Definition: Track.h:98
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:668
recob::Track const & track() const
Returns the track this point belongs to.
Definition: Track.h:616
template<typename Data>
recob::Track const& proxy::TrackPointWrapper< Data >::track ( ) const
inline

Returns the track this point belongs to.

Definition at line 616 of file Track.h.

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

Member Data Documentation

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

Definition at line 593 of file Track.h.

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

Definition at line 592 of file Track.h.

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

Definition at line 594 of file Track.h.

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

Definition at line 595 of file Track.h.

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

Definition at line 591 of file Track.h.


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