Class Acts::MultiTrajectory

template<typename derived_t>
class MultiTrajectory

Store a trajectory of track states with multiple components.

This container supports both simple, sequential trajectories as well as combinatorial or multi-component trajectories. Each point can store a parent point such that the trajectory forms a directed, acyclic graph of sub-trajectories. From a set of endpoints, all possible sub-components can be easily identified. Some functionality is provided to simplify iterating over specific sub-components.

Public Types

using ConstTrackStateProxy = detail_lt::TrackStateProxy<Derived, MeasurementSizeMax, true>
using Derived = derived_t
using IndexType = typename TrackStateProxy::IndexType
using TrackStateProxy = detail_lt::TrackStateProxy<Derived, MeasurementSizeMax, false>

Public Functions

template<typename T, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr void addColumn(const std::string &key)

Add a column to the MultiTrajectory.

Note

This takes a string argument rather than a hashed string to maintain compatibility with backends.

Template Parameters

T – Type of the column values to add

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr IndexType addTrackState(TrackStatePropMask mask = TrackStatePropMask::All, IndexType iprevious = kInvalid)

Add a track state without providing explicit information.

Which components of the track state are initialized/allocated can be controlled via mask

Parameters
  • mask – The bitmask that instructs which components to allocate and which to leave invalid

  • iprevious – index of the previous state, kInvalid if first

Returns

Index of the newly added track state

template<typename F, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline void applyBackwards(IndexType iendpoint, F &&callable)

Apply a function to all previous states starting at a given endpoint.

Warning

If the trajectory contains multiple components with common points, this can have an impact on the other components.

Parameters
  • iendpoint – index of the last state

  • callable – modifying functor to be called with each point

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr void clear()

Clear the MultiTrajectory. Leaves the underlying storage untouched.

inline auto &&convertToReadOnly() const
inline ConstTrackStateProxy getTrackState(IndexType istate) const

Access a read-only point on the trajectory by index.

Parameters

istate – The index to access

Returns

Read only proxy to the stored track state

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline TrackStateProxy getTrackState(IndexType istate)

Access a writable point on the trajectory by index.

Parameters

istate – The index to access

Returns

Read-write proxy to the stored track state

inline constexpr bool hasColumn(HashedString key) const

Check if a column with a key key exists.

Parameters

key – Key to check for a column with

Returns

True if the column exists, false if not.

inline constexpr IndexType size() const

Returns the number of track states contained.

inline auto trackStateRange(IndexType iendpoint) const

Range for the track states from iendpoint to the trajectory start.

Note

Const version

Parameters

iendpoint – Trajectory entry point to start from

Returns

Iterator pair to iterate over

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline auto trackStateRange(IndexType iendpoint)

Range for the track states from iendpoint to the trajectory start.

Note

Mutable version

Parameters

iendpoint – Trajectory entry point to start from

Returns

Iterator pair to iterate over

template<typename F>
void visitBackwards(IndexType iendpoint, F &&callable) const

Visit all previous states starting at a given endpoint.

Parameters
  • iendpoint – index of the last state

  • callable – non-modifying functor to be called with each point

Public Static Attributes

static constexpr IndexType kInvalid = TrackStateProxy::kInvalid
static constexpr unsigned int MeasurementSizeMax = MultiTrajectoryTraits::MeasurementSizeMax
static constexpr bool ReadOnly = IsReadOnlyMultiTrajectory<Derived>::value

Friends

friend class detail_lt::TrackStateProxy< Derived, MeasurementSizeMax, false >
friend class detail_lt::TrackStateProxy< Derived, MeasurementSizeMax, true >