229 #ifndef LARDATA_RECOBASEPROXY_TRACK_H 230 #define LARDATA_RECOBASEPROXY_TRACK_H 251 template <
typename TrackProxy>
254 template <
typename Data>
260 template <
typename CollProxy>
263 template <
typename T>
266 template <
typename Obj>
269 template <
typename Data>
273 static_assert(
sizeof(
Wrapper_t) == 1U,
"Wrapper carries data!");
275 static_assert(std::is_same<std::decay_t<decltype(std::declval<Wrapper_t>().position())>,
277 "position() is not a recob::Track::Point_t");
278 static_assert(std::is_same<std::decay_t<decltype(std::declval<Wrapper_t>().momentum())>,
280 "momentum() is not a recob::Track::Vector_t");
281 static_assert(std::is_same<std::decay_t<decltype(std::declval<Wrapper_t>().flags())>,
283 "flags() is not a recob::Track::PointFlags_t");
284 static_assert(std::is_same<std::decay_t<decltype(std::declval<Wrapper_t>().hitPtr())>,
286 "hit() is not a art::Ptr<recob::Hit>");
288 std::is_same<std::decay_t<decltype(std::declval<Wrapper_t>().index())>, std::size_t>(),
289 "index() is not a std::size_t");
563 template <
typename Data>
568 static constexpr std::size_t TrackIndex = 0;
569 static constexpr std::size_t HitIndex = 1;
570 static constexpr std::size_t FitHitInfoIndex = 2;
571 static constexpr std::size_t IndexIndex = 3;
572 static constexpr std::size_t NIndices = 4;
578 template <std::
size_t N>
579 auto get()
const -> decltype(
auto)
581 return std::get<N>(base());
599 return track().Trajectory().LocationAtPoint(index());
606 return track().Trajectory().MomentumVectorAtPoint(index());
614 auto flags()
const -> decltype(
auto) {
return track().Trajectory().FlagsAtPoint(index()); }
643 recob::TrackFitHitInfo
const*
fitInfoPtr()
const {
return get<FitHitInfoIndex>(); }
646 auto index() const -> decltype(auto) {
return get<IndexIndex>(); }
651 decltype(
auto) ptr = hitPtr();
652 return ptr ? ptr.get() :
nullptr;
670 static constexpr
bool asserts =
683 template <
typename TrackProxy>
687 return {&(track.track()), track.hitAtPoint(index), track.fitInfoAtPoint(index), index};
699 template <
typename CollProxy>
702 using base_t::base_t;
758 auto hits() const -> decltype(auto) {
return base_t::template get<Tracks::HitTag>(); }
761 auto hitAtPoint(std::size_t index)
const -> decltype(
auto) {
return hits()[index]; }
770 recob::TrackFitHitInfo
const* fitInfoAtPoint(std::size_t index)
const;
806 return base_t::template get<Tracks::TrackTrajectoryTag>();
910 template <
typename Pred>
911 auto selectPoints(Pred&& pred)
const;
971 return hasOriginalTrajectory() ? &originalTrajectory() :
nullptr;
991 template <
typename TrackCollProxy>
1020 return proxy::withZeroOrOneAs<recob::TrackTrajectory, Tracks::TrackTrajectoryTag>(inputTag);
1070 return proxy::withZeroOrOneAs<recob::TrackTrajectory, Tracks::TrackTrajectoryTag>();
1087 return proxy::withParallelDataAs<std::vector<recob::TrackFitHitInfo>,
1144 return proxy::withParallelDataAs<std::vector<recob::TrackFitHitInfo>,
1157 template <
typename MainColl,
typename... AuxColl>
1184 template <
typename Event,
typename... WithArgs>
1198 withAssociatedAs<recob::Hit, Tracks::HitTag>(),
1199 std::forward<WithArgs>(withArgs)...);
1205 template <
typename Data>
1214 template <
typename TrackProxy>
1253 std::size_t index = std::numeric_limits<std::size_t>::max();
1292 return (index == other.
index) && (track == other.
track);
1297 return (index != other.
index) || (track != other.
track);
1310 template <
typename T>
1311 struct isTrackProxy :
public std::false_type {};
1313 template <
typename TrackCollProxy>
1318 template <
typename CollProxy>
1339 template <
typename CollProxy>
1346 default:
return nullptr;
1351 template <
typename CollProxy>
1353 std::size_t index)
const 1355 if constexpr (base_t::template has<Tracks::TrackFitHitInfoTag>()) {
1356 auto const& fitInfo = base_t::template get<Tracks::TrackFitHitInfoTag>();
1357 return &(fitInfo[index]);
1364 template <
typename CollProxy>
1365 template <
typename Pred>
1372 template <
typename CollProxy>
1376 return selectPoints([mask](
auto&& point) {
return point.flags().match(mask); });
1383 #endif // LARDATA_RECOBASEPROXY_TRACK_H TrackPointIterator operator++(int)
auto withOriginalTrajectory(art::InputTag const &inputTag)
Adds recob::TrackTrajectory information to the proxy.
std::size_t nPoints() const
Returns the number of trajectory points in the track.
Collection of data type definitions for collection proxies.
const_iterator begin() const
auto selectPoints(Pred &&pred) const
Returns an iterable range with only points matching the mask.
auto position() const -> decltype(auto)
std::vector< recob::Track > TrackDataProduct_t
Type of the main collection.
std::ptrdiff_t difference_type
art::Ptr< recob::TrackTrajectory > const & originalTrajectoryPtr() const
art::Ptr< recob::Hit > hitPtr() const
Returns the hit associated with the trajectory point.
Class to assemble the required proxy.
std::input_iterator_tag iterator_category
recob::TrackFitHitInfo const * fitInfoAtPoint(std::size_t index) const
Returns fit info for the specified point (nullptr if not available).
auto hitAtPoint(std::size_t index) const -> decltype(auto)
Returns an art pointer to the hit associated with the specified point.
Declaration of signal hit object.
Proxy tag for a recob::Track collection proxy.
bool isPointValid() const
Returns whether the trajectory point is valid.
Structure for range-for iteration.
auto filterRangeFor(Range &&range, Pred &&pred) -> decltype(auto)
Provides iteration only through elements passing a condition.
Base utilities for the implementation of data product facades.
bool operator==(TrackPointIterator const &other) const
Class for track proxy elements.
Base representation of a collection of proxied objects.
TrackPointData makeTrackPointData(TrackProxy const &track, std::size_t index)
Returns an object with information about the specified track point.
tracking::Vector_t Vector_t
Type of track point information.
A class containing a set of flags.
Wrapper for a track data proxy.
TrackPointIteratorBox(track_proxy_t const &track)
TrackPoint(TrackPointData const &data)
TrackPointIterator(track_proxy_t const &track, std::size_t index)
recob::TrackTrajectory const * originalTrajectoryCPtr() const noexcept
A trajectory in space reconstructed from hits.
Object storing per-hit information from a track fit.
TrackPoint(TrackPointData &&data)
const_iterator end() const
std::add_const_t< TrackPointData > Wrapped_t
Class to assemble the required proxy.
TrackPoint operator[](std::size_t index) const
Returns an iterable range with point-by-point information.
auto wrapTrackPoint(Data const &wrappedData)
"Converts" point data into a proxy::TrackPointWrapper.
Encloses LArSoft data product proxy objects and utilities.See this doxygen module for an introduction...
Provides recob::Track data product.
Data product for reconstructed trajectory in space.
recob::TrackTrajectory const * operator()(proxy::Tracks::TrackType_t type) const noexcept
Returns the requested trajectory from the proxy.
std::tuple< recob::Track const *, art::Ptr< recob::Hit >, recob::TrackFitHitInfo const *, std::size_t > TrackPointData
Container of track point information.
auto index() const -> decltype(auto)
Returns the index of this point in the trajectory.
std::size_t nHits() const
Returns the number of hits associated with this track.
auto hits() const -> decltype(auto)
Returns a collection-like range of hits of this track, at point order.
point_iterator endPoint() const
Returns the iterator past the last point.
value_type operator*() const
An element of a collection proxy.
recob::TrackFitHitInfo const * fitInfoPtr() const
Returns fit info associated with the trajectory point.
TrackPoint point(std::size_t index) const
recob::Hit const * hit() const
Returns a pointer to the hit on the trajectory point, if any.
auto pointsWithFlags(recob::TrackTrajectory::PointFlags_t::Mask_t mask) const
Returns an iterable range with only points matching the mask.
typename track_proxy_t::point_iterator const_iterator
Represents a track trajectory before the final fit.
track_proxy_t const * track
tracking::Point_t Point_t
TrackType_t
Types of tracks and trajectories.
Utilities to manipulate range for loops.
auto withFitHitInfo(art::InputTag const &inputTag)
Adds recob::TrackFitHitInfo information to the proxy.
point_iterator beginPoint() const
Returns the iterator to the data of the first point.
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
bool hasOriginalTrajectory() const
Returns whether this track is associated to a trajectory.
2D representation of charge deposited in the TDC/wire plane
recob::TrackTrajectory const & originalTrajectory() const
Returns a reference to the associated trajectory.
Represents a track trajectory from the final fit.
auto momentum() const -> decltype(auto)
auto points() const
Returns an iterable range with point-by-point information.
QuadExpr operator*(double v, const QuadExpr &e)
TrackPoint const * pointer
recob::Track const & track() const
Returns the track this point belongs to.
bool operator!=(TrackPointIterator const &other) const
Wrapped_t const & base() const
static auto make(Event const &event, art::InputTag const &tag, WithArgs &&...withArgs)
Creates and returns a collection proxy for recob::Track based on proxy::Tracks tag and with the reque...
Set of flags pertaining a point of the track.
TrackPointIterator & operator++()
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Event finding and building.
recob::Track const & track() const
Returns the pointed track.