File MultiTrajectory.hpp¶
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
Typedefs
-
using ProjectorBitset = std::bitset<eBoundSize * eBoundSize>¶
-
using TrackStateType = std::bitset<TrackStateFlag::NumTrackStateFlags>¶
Enums
-
template<typename derived_t>
class MultiTrajectory - #include <Acts/EventData/MultiTrajectory.hpp>
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>
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
-
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>
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
-
inline constexpr void clear()
Clear the
MultiTrajectory
. Leaves the underlying storage untouched.
-
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
-
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.
Public Static Attributes
-
static constexpr IndexType kInvalid = TrackStateProxy::kInvalid
-
static constexpr unsigned int MeasurementSizeMax = MultiTrajectoryTraits::MeasurementSizeMax
Protected Functions
-
MultiTrajectory() = default¶
-
template<typename T, HashedString key>
inline constexpr T &component(IndexType istate)¶ Retrieve a mutable reference to a component.
- Template Parameters
T – The type of the component to access
key – String key for the component to access
- Parameters
istate – The track state index to operate on
- Returns
Mutable reference to the component given by
key
-
template<typename T>
inline constexpr T &component(HashedString key, IndexType istate)¶ Retrieve a mutable reference to a component.
- Template Parameters
T – The type of the component to access
- Parameters
key – String key for the component to access
istate – The track state index to operate on
- Returns
Mutable reference to the component given by
key
-
template<typename T, HashedString key>
inline constexpr const T &component(IndexType istate) const¶ Retrieve a mutable reference to a component.
- Template Parameters
T – The type of the component to access
key – String key for the component to access
- Parameters
istate – The track state index to operate on
- Returns
Const reference to the component given by
key
-
template<typename T>
inline constexpr const T &component(HashedString key, IndexType istate) const¶ Retrieve a mutable reference to a component.
- Template Parameters
T – The type of the component to access
- Parameters
key – String key for the component to access
istate – The track state index to operate on
- Returns
Const reference to the component given by
key
-
inline constexpr TrackStateProxy::Covariance covariance(IndexType covIdx)¶
Retrieve a covariance proxy instance for a covariance at a given index.
- Parameters
covIdx – Index into the covariance column
- Returns
Mutable proxy
-
inline constexpr ConstTrackStateProxy::Covariance covariance(IndexType covIdx) const¶
Retrieve a covariance proxy instance for a covariance at a given index.
- Parameters
covIdx – Index into the covariance column
- Returns
Const proxy
-
inline constexpr bool has(HashedString key, IndexType istate) const¶
Check for component existence of
key
in track satetistate
.- Parameters
key – The key for which to check
istate – The track state index to check
- Returns
True if the component exists, false if not
-
template<HashedString key>
inline constexpr bool has(IndexType istate) const¶ Check for component existence of
key
in track satetistate
.- Template Parameters
key – The key for which to check
- Parameters
istate – The track state index to check
- Returns
True if the component exists, false if not
-
inline constexpr TrackStateProxy::Covariance jacobian(IndexType jacIdx)¶
Retrieve a jacobian proxy instance for a jacobian at a given index.
- Parameters
jacIdx – Index into the jacobian column
- Returns
Mutable proxy
-
inline constexpr ConstTrackStateProxy::Covariance jacobian(IndexType jacIdx) const¶
Retrieve a jacobian proxy instance for a jacobian at a given index.
- Parameters
jacIdx – Index into the jacobian column
- Returns
Const proxy
-
inline constexpr TrackStateProxy::Measurement measurement(IndexType measIdx)¶
Retrieve a measurement proxy instance for a measurement at a given index.
- Parameters
measIdx – Index into the measurement column
- Returns
Mutable proxy
-
inline constexpr ConstTrackStateProxy::Measurement measurement(IndexType measIdx) const¶
Retrieve a measurement proxy instance for a measurement at a given index.
- Parameters
measIdx – Index into the measurement column
- Returns
Const proxy
-
inline constexpr TrackStateProxy::MeasurementCovariance measurementCovariance(IndexType covIdx)¶
Retrieve a measurement covariance proxy instance for a measurement at a given index.
- Parameters
covIdx – Index into the measurement covariance column
- Returns
Mutable proxy
-
inline constexpr ConstTrackStateProxy::MeasurementCovariance measurementCovariance(IndexType covIdx) const¶
Retrieve a measurement covariance proxy instance for a measurement at a given index.
- Parameters
covIdx – Index into the measurement covariance column
- Returns
Const proxy
-
inline constexpr TrackStateProxy::Parameters parameters(IndexType parIdx)¶
Retrieve a parameter proxy instance for parameters at a given index.
- Parameters
parIdx – Index into the parameter column
- Returns
Mutable proxy
-
inline constexpr ConstTrackStateProxy::Parameters parameters(IndexType parIdx) const¶
Retrieve a parameter proxy instance for parameters at a given index.
- Parameters
parIdx – Index into the parameter column
- Returns
Const proxy
Share a shareable component from between track state.
Note
Shareable components are predicted, filtered, smoothed, calibrated, jacobian, or projector. See
TrackStatePropMask
.Note
The track states both need to be stored in the same
MultiTrajectory
instance- Parameters
iself – The track state index to share “into”
iother – The track state index to share from
shareSource – Which component to share from
shareTarget – Which component to share as. This doesn’t have to be the same as
shareSource
, e.g. predicted can be shared as filtered.
-
inline constexpr void unset(TrackStatePropMask target, IndexType istate)¶
Unset an optional track state component.
- Parameters
target – The component to unset
istate – The track state index to operate on
Private Functions
-
inline constexpr bool checkOptional(HashedString key, IndexType istate) const¶
Helper function to check if a component exists IF it is an optional one.
Used in assertions
Friends
- friend class detail_lt::TrackStateProxy< Derived, MeasurementSizeMax, false >
- friend class detail_lt::TrackStateProxy< Derived, MeasurementSizeMax, true >
-
using ConstTrackStateProxy = detail_lt::TrackStateProxy<Derived, MeasurementSizeMax, true>
-
template<size_t M, bool ReadOnly = true>
struct TrackStateTraits¶ - #include <Acts/EventData/MultiTrajectory.hpp>
Public Types
-
using Covariance = typename detail_lt::Types<eBoundSize, ReadOnly>::CovarianceMap¶
-
using IndexType = std::uint32_t¶
-
using Parameters = typename detail_lt::Types<eBoundSize, ReadOnly>::CoefficientsMap¶
-
using Projector = Eigen::Matrix<typename Covariance::Scalar, M, eBoundSize, ProjectorFlags>¶
-
using Covariance = typename detail_lt::Types<eBoundSize, ReadOnly>::CovarianceMap¶
-
namespace MultiTrajectoryTraits¶
This namespace contains typedefs and constant values that are used by other parts of the
MultiTrajectory
implementation.It extracts these from
TrackStateTraits
using the default maximum measurement dimension.Typedefs
-
using IndexType = TrackStateTraits<MeasurementSizeMax, true>::IndexType¶
Variables
-
constexpr IndexType kInvalid = TrackStateTraits<MeasurementSizeMax, true>::kInvalid¶
-
constexpr unsigned int MeasurementSizeMax = eBoundSize¶
-
using IndexType = TrackStateTraits<MeasurementSizeMax, true>::IndexType¶
-
using ProjectorBitset = std::bitset<eBoundSize * eBoundSize>¶