File MultiTrajectory.hpp¶
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
Typedefs
-
using ProjectorBitset = uint64_t¶
Enums
-
class ConstTrackStateType
- #include <Acts/EventData/MultiTrajectory.hpp>
View type over a bitset stored in a 64 bit integer This view does not allow modifications.
Public Types
-
using raw_type = std::uint64_t
Public Functions
-
inline ConstTrackStateType(const raw_type &raw)
Constructor from a reference to the underlying value container.
- Parameters
raw – the value container
-
inline bool test(std::size_t pos) const
Return if the bit at position
pos
is 1.- Parameters
pos – the bit position
- Returns
if the bit at
pos
is one or not
Friends
- friend class TrackStateType
-
using raw_type = std::uint64_t
-
template<typename T>
struct IsReadOnlyMultiTrajectory¶ - #include <Acts/EventData/MultiTrajectory.hpp>
-
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, 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
Public Static Attributes
-
static constexpr IndexType kInvalid = TrackStateProxy::kInvalid
-
static constexpr unsigned int MeasurementSizeMax = MultiTrajectoryTraits::MeasurementSizeMax
-
static constexpr bool ReadOnly = IsReadOnlyMultiTrajectory<Derived>::value
Protected Functions
-
MultiTrajectory() = default¶
-
inline void allocateCalibrated(IndexType istate, size_t measdim)¶
Allocate storage for a calibrated measurement of specified dimension.
Note
Is a noop if the track state already has an allocation an the dimension is the same.
- Parameters
istate – The track state to store for
measdim – the dimension of the measurement to store
-
inline IndexType calibratedSize(IndexType istate) const¶
Get the calibrated measurement size for a track state.
- Parameters
istate – The track state
- Returns
the calibrated size
-
template<typename T, HashedString key, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
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, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
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 const 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 const 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
-
template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
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 SourceLink getUncalibratedSourceLink(IndexType istate) const¶
-
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
-
template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
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
-
template<size_t measdim, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr TrackStateProxy::template Measurement<measdim> measurement(IndexType measIdx)¶ Retrieve a measurement proxy instance for a measurement at a given index.
- Template Parameters
measdim – the measurement dimension
- Parameters
measIdx – Index into the measurement column
- Returns
Mutable proxy
-
template<size_t measdim>
inline constexpr ConstTrackStateProxy::template Measurement<measdim> measurement(IndexType measIdx) const¶ Retrieve a measurement proxy instance for a measurement at a given index.
- Template Parameters
measdim – the measurement dimension
- Parameters
measIdx – Index into the measurement column
- Returns
Const proxy
-
template<size_t measdim, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr TrackStateProxy::template MeasurementCovariance<measdim> measurementCovariance(IndexType covIdx)¶ Retrieve a measurement covariance proxy instance for a measurement at a given index.
- Template Parameters
measdim – the measurement dimension
- Parameters
covIdx – Index into the measurement covariance column
- Returns
Mutable proxy
-
template<size_t measdim>
inline constexpr ConstTrackStateProxy::template MeasurementCovariance<measdim> 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
-
template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
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
-
template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline void setUncalibratedSourceLink(IndexType istate, SourceLink sourceLink)¶
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.
-
template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
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 Parameters = typename detail_lt::Types<eBoundSize, ReadOnly>::CoefficientsMap¶
-
using Projector = Eigen::Matrix<typename Covariance::Scalar, M, eBoundSize, ProjectorFlags>¶
Public Static Attributes
-
static constexpr auto ProjectorFlags = Eigen::RowMajor | Eigen::AutoAlign¶
-
using Covariance = typename detail_lt::Types<eBoundSize, ReadOnly>::CovarianceMap¶
-
class TrackStateType
- #include <Acts/EventData/MultiTrajectory.hpp>
View type over a bitset stored in a 64 bit integer This view allows modifications.
Public Types
-
using raw_type = std::uint64_t
Public Functions
-
inline TrackStateType(raw_type &raw)
Constructor from a reference to the underlying value container.
- Parameters
raw – the value container
-
inline TrackStateType &operator=(const TrackStateType &other)
Assign the value from another set of flags.
- Parameters
other – the other set of flags to assign
- Returns
this object
-
inline TrackStateType &operator=(const ConstTrackStateType &other)
Assign the value from another set of flags.
- Parameters
other – the other set of flags to assign
- Returns
this object
-
inline void reset(std::size_t pos)
Change the value of the bit at position at
pos
tofalse
.- Parameters
pos – the position of the bit to change
-
inline void set(std::size_t pos, bool value = true)
Change the value of the bit at position
pos
tovalue
.- Parameters
pos – the position of the bit to change
value – the value to change the bit to
-
inline bool test(std::size_t pos) const
Return if the bit at position
pos
is 1.- Parameters
pos – the bit position
- Returns
if the bit at
pos
is one or not
-
using raw_type = std::uint64_t
-
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 = TrackIndexType¶
Variables
-
constexpr IndexType kInvalid = kTrackIndexInvalid¶
-
constexpr unsigned int MeasurementSizeMax = eBoundSize¶
-
using IndexType = TrackIndexType¶
-
using ProjectorBitset = uint64_t¶