LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 587 of file Track.h.

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

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

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

664  { 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 635 of file Track.h.

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

Definition at line 603 of file Track.h.

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

671  { 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:652
auto get() const -> decltype(auto)
Definition: Track.h:603
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 652 of file Track.h.

652 { 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 667 of file Track.h.

667 { 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 644 of file Track.h.

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

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

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

Returns the track this point belongs to.

Definition at line 615 of file Track.h.

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

Member Data Documentation

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

Definition at line 592 of file Track.h.

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

Definition at line 591 of file Track.h.

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

Definition at line 593 of file Track.h.

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

Definition at line 594 of file Track.h.

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

Definition at line 590 of file Track.h.


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