High-level Track Event Data Model
Track information in ACTS can be divided into two parts: track-level information and track state-level information.
Track-level information are properties that relate to the full track. This includes the fitted track parameters with respect to some reference point, often the origin of the detector or the beamspot. It can also include summary information from the track finding stage, like the overall number of clusters that were used in the creation of the track, or the fit quality from the track fit.
Tracks are built-up from track states, where each track state corresponds to a discrete state determining the track properties. This mainly includes measurements states, expected intersections with sensors where no measurement was found (holes), and intersections with known passive material. The EDM allows building up a track from these track states iteratively. For example, the Kalman Filter will append track states to the sequence whenever it encounters a sensitive detector layer. The content of the track states is defined such that the fitter can store all relevant information, with as little need for extra information as possible. It is also designed to be flexible enough to support different fitters, which might require different information to be stored, as well as the Combinatorial Kalman Filter, which produces a tree of track states, instead of a fully linear sequence.
Ultimately, each output track is associated with a well-defined sequence of track states, allowing downstream consumers of the EDM to access the fully detailed information produced during track reconstruction.
This section will first discuss the architecture and general implementation of the Track EDM in Conceptual, and then report on the API of the involved classes in Track API.
Conceptual
Architecture
The Track EDM is structured such that the memory-layout can be SoA, while presenting an object-oriented interface for convenient usage.
Fig. 19 shows this object-oriented access model for the example of the track container and track proxy object. The track container holds vectors of the various pieces of information, and has methods to add a track, and to allow iteration over all tracks. This iteration, or index based access, yields a track proxy object, which exposes the properties as methods returning references, while internally only holding a pointer to and an index into the track container. The types are built in a way that preserves const-correctness, i.e. even though a track proxy is a value type which can be copied, it will not allow modification of the underlying track container if it is immutable:
auto mutableTrackContainer = /*...*/;
auto trackProxy = mutableTrackContainer.getTrack(5); // is mutable
const auto& constTrackProxy = trackProxy; // is const
// ...
auto constTrackContainer = /*...*/;
auto trackProxy = trackContainer.getTrack(5); // is const, even as an lvalue
Fig. 19 Illustration of the proxy pattern used in the track EDM. The track proxy logically represents a single track, and points to the data stored in the track container.
The track EDM is fully agnostic to the concrete persistency framework of an experiment. This avoids having to convert the data between different representations, if implemented correctly.
Implementation
To make the EDM implementation independent of an experiment persistency framework, it is separated into a frontend layer and a backend layer. The frontend layer contains user-facing getters and setters, as well as convenience methods that can be helpful. These methods are located either in the proxy objects or in the containers, depending on whether they operate on a single element or the entire container.
Overall, there are four main classes that make up the frontend layer:
Acts::TrackProxy, Acts::TrackContainer,
Acts::TrackStateProxy and Acts::MultiTrajectory. The latter
serves as the track state container, where the name indicates that it is able
to handle a branching tree structure of track states. TrackProxy and
TrackStateProxy expose methods to get the local track parameters and
covariance, corresponding reference surface, and also includes global
statistics like the total number of measurements, outliers or
holes in case of TrackProxy. TrackProxy also has a method to
conveniently iterate over the associated track states from the last track state
to the first one yielding TrackStateProxy objects from the track state
container. In the common case of a track from the center of a cylindrical
detector going outward, the default iteration order is from the outside
inwards.
In case of TrackStateProxy, functionality is exposed in the frontend
layer to allocate optional components, with the goal of reduced memory
footprint. There are two main use cases of this: track parameters and measurements.
The track-state EDM supports storing up to three sets of local track parameters
and covariance matrices, modeled after the information the Kalman Filter
formalism needs to store:
predicted parameter vector and covariance matrix
filtered parameter vector and covariance matrix
smoothed parameter vector and covariance matrix
In case of combinatorial track finding (see Track Finding, specifically Fig. 16), track hypothesis can start out with a common sequence of track states, and then branch out when multiple compatible measurements are encountered, as seen in Fig. 21.
The track state EDM allows allocating only the track parameters that are needed, and also allows sharing the same track parameters between multiple track states, so that branching track states can share for example the same predicted parameters. How this is achieved exactly is left to the backend layer. Measurements are handled in a similar way, where the track finding decides how much storage is needed based on the number of dimensions of an incoming measurement. It then instructs the EDM through the frontend layer to ensure enough memory is available, where the specifics are again left up to the backend layer.
The backend layer exposes an interface that is used by the frontend layer to store and retrieve information. It uses dedicated methods where needed, such as for storing reference surfaces or source-link objects, which are lightweight container objects for experiment-specific measurements. For the majority of components, the frontend communicates with the backend through a single method to obtain references to the underlying data. Components are accessed via hashes of the component name, where the hashes are calculated at compile-time wherever possible. The backend can then use the hashed component name to retrieve the relevant memory. To allow directly manipulating the backing memory, the frontend expects the backend to return references into the backing storage.
TrackProxy provides a method to copy a track between different track
containers, and only uses the frontend layer to accomplish this. This means that
copying tracks between different backend implementations is trivial.
Fig. 20 Diagram of the EDM architecture. The frontend layer is used by other ACTS components, and downstream clients. It is separated from the backend layer by an interface. Conversion to and from EDM4hep is possible. Examples of direct backend implementations are shown.
Fig. 20 shows a diagram of the EDM architecture. At the center
are the TrackProxy and TrackContainer. These classes are
produced by the track finding and track fitting components, and are the main
interface point with the clients of tracking. In ACTS itself, all of the
performance monitoring and downstream reconstruction is either directly built on
top of these objects, or converts them into an internal EDM on the use
case. Behind the backend interface, the track container coordinates with both a
track state and a track backend, where a few examples are shown, and will be
discussed below.
Track API
-
template<typename track_container_t, typename trajectory_t, template<typename> class holder_t, bool read_only = true>
class TrackProxy : public Acts::TrackProxyCommon<TrackProxy<track_container_t, trajectory_t, holder_t, true>, track_container_t::IndexType, true> Proxy class representing a single track.
This class provides a view into an associated TrackContainer, and has reference semantics. You can think of it as a pointer to a vector of tracks, which exposes an object-oriented interface for accessing the track properties.
- Template Parameters:
track_container_t – the container backend
trajectory_t – the track state container backend
holder_t – ownership management class for the backend
read_only – true if this track container is not mutable
Constructors and assignment operator
Public constructors and assignment operators for
TrackProxyonly allow construction from anotherTrackProxy. You should generally not have to constructTrackProxymanually.-
TrackProxy(const TrackProxy &other) = default
Copy constructor: const to const or mutable to mutable.
- Parameters:
other – the other track proxy
-
TrackProxy &operator=(const TrackProxy &other) = default
Copy assignment operator: const to const or mutable to mutable.
- Parameters:
other – the other track proxy
- Returns:
reference to this track proxy
-
inline explicit TrackProxy(const MutableTrackProxy &other)
requires ReadOnly Constructor from mutable track proxy.
Note
Only available if the track proxy is read-only
- Parameters:
other – the other track proxy
-
inline TrackProxy &operator=(const MutableTrackProxy &other)
requires ReadOnly Copy assignment operator from mutable track proxy.
Note
Only available if the track proxy is read-only
- Parameters:
other – the other track proxy
- Returns:
reference to this track proxy
TrackProxy properties
Methods that give access to the properties of a track represented by
TrackProxy.Many of these methods come in a
constand a non-constversion. The non-constversion is only available if you have an instance ofTrackProxythat does not have theread_onlytemplate parameter set totrue, even if you hold it as an lvalue.-
inline const Surface &referenceSurface() const
Get the reference surface of the track (e.g.
the perigee)
- Returns:
the reference surface
Set a new reference surface for this track.
- Parameters:
srf – The surface to set
-
inline bool hasReferenceSurface() const
Returns whether the track has a reference surface or not.
- Returns:
whether a surface exists or not
-
inline ConstParameters parameters() const
Get the parameters of the track at the reference surface (e.g.
perigee). Const version
- Returns:
Proxy vector for the parameters
-
inline ConstCovariance covariance() const
Get the covariance of the track at the reference surface (e.g.
perigee). Const version
- Returns:
Proxy matrix for the covariance
-
inline Parameters parameters()
requires (!ReadOnly) Get the parameters of the track at the reference surface (e.g.
perigee). Mutable version
Note
Only available if the track proxy is not read-only
- Returns:
Proxy vector for the parameters
-
inline Covariance covariance()
requires (!ReadOnly) Get the covariance of the track at the reference surface (e.g.
perigee). Mutable version
Note
Only available if the track proxy is not read-only
- Returns:
Proxy matrix for the covariance
-
inline ParticleHypothesis particleHypothesis() const
Get the particle hypothesis.
- Returns:
the particle hypothesis
-
inline void setParticleHypothesis(const ParticleHypothesis &particleHypothesis)
requires (!ReadOnly) Set a new particle hypothesis for this track.
Note
Only available if the track proxy is not read-only
- Parameters:
particleHypothesis – The particle hypothesis to set
-
inline unsigned int nTrackStates() const
Return the number of track states associated to this track.
Note
This is calculated by iterating over the track states which is somewhat expensive. Consider caching this value if you need It more than once.
- Returns:
The number of track states
-
inline IndexType index() const
Return the index of this track in the track container.
Note
This is separate from the tip index
- Returns:
the track index
-
inline double absoluteMomentum() const
Get the absolute momentum.
- Returns:
The absolute momentum value
-
inline double charge() const
Get the charge.
- Returns:
The charge value
-
inline float chi2() const
Return the local chi-squared contribution.
- Returns:
The chi-squared value
-
inline float &chi2()
requires (!read_only) Return a mutable reference to the local chi-squared contribution.
- Returns:
Mutable reference to the chi-squared value
-
inline Vector3 direction() const
Get a unit vector along the track direction at the reference surface.
- Returns:
The direction unit vector
-
inline Vector4 fourMomentum() const
Get the four-momentum vector: (px, py, pz, e)
- Returns:
the four-momentum vector
-
inline bool isForwardLinked() const
Return whether the track is forward-linked, i.e.
whether each track state has a valid next-state index. Forward-linking is required to use the inside-out
trackStates()range.- Returns:
True if the track is forward-linked
-
inline double loc0() const
Access the loc0 parameter of the track at the reference surface.
- Returns:
The loc0 parameter
-
inline double loc1() const
Access the loc1 parameter of the track at the reference surface.
- Returns:
The loc1 parameter
-
inline Vector3 momentum() const
Get the global momentum vector.
- Returns:
the global momentum vector
-
inline unsigned int nDoF() const
Return the number of degrees of freedom.
- Returns:
The number of degrees of freedom
-
inline unsigned int &nDoF()
requires (!read_only) Return a mutable reference to the number of degrees of freedom.
- Returns:
Mutable reference to the number of degrees of freedom
-
inline unsigned int nHoles() const
Return the number of holes on this track.
- Returns:
The number of holes
-
inline unsigned int &nHoles()
requires (!read_only) Return a mutable reference to the number of holes.
- Returns:
Mutable reference to the number of holes
-
inline unsigned int nMeasurements() const
Return the number of measurements assigned to this track.
- Returns:
The number of measurements
-
inline unsigned int &nMeasurements()
requires (!read_only) Return a mutable reference to the number of measurements.
- Returns:
Mutable reference to the number of measurements
-
inline unsigned int nOutliers() const
Return the number of outliers for this track.
- Returns:
The number of outliers
-
inline unsigned int &nOutliers()
requires (!read_only) Return a mutable reference to the number of outliers.
- Returns:
Mutable reference to the number of outliers
Return the number of shared hits for this track.
- Returns:
The number of shared hits
Return a mutable reference to the number of shared hits.
- Returns:
Mutable reference to the number of shared hits
-
inline double phi() const
Access the phi parameter of the track at the reference surface.
- Returns:
The phi parameter
-
inline double qOverP() const
Access the q/p (curvature) parameter of the track at the reference surface.
- Returns:
The q/p parameter
-
inline IndexType stemIndex() const
Get the stem index, i.e.
the innermost track state in the track.
- Returns:
The stem index
-
inline IndexType &stemIndex()
requires (!read_only) Get a mutable reference to the stem index.
- Returns:
Mutable reference to the stem index
-
inline double theta() const
Access the theta parameter of the track at the reference surface.
- Returns:
The theta parameter
-
inline double time() const
Access the time parameter of the track at the reference surface.
- Returns:
The time parameter
-
inline IndexType tipIndex() const
Get the tip index, i.e.
the entry point into the track state container.
- Returns:
The tip index
-
inline IndexType &tipIndex()
requires (!read_only) Get a mutable reference to the tip index.
- Returns:
Mutable reference to the tip index
-
inline double transverseMomentum() const
Get the transverse momentum.
- Returns:
The transverse momentum value
TrackProxy track state access
Methods that give access to the track states of a track represented by
TrackProxy.-
inline ConstTrackStateProxy outermostTrackState() const
Return a const track state proxy to the outermost track state.
- Returns:
The outermost track state proxy
-
inline TrackStateProxy outermostTrackState()
requires (!ReadOnly) Return a mutable track state proxy to the outermost track state.
- Returns:
The outermost track state proxy
-
inline auto innermostTrackState() const
Return a const track state proxy to the innermost track state.
Note
This is only available, if the track is forward linked
- Returns:
The innermost track state proxy
-
inline auto innermostTrackState()
requires (!ReadOnly) Return a mutable track state proxy to the innermost track state.
Note
This is only available, if the track is forward linked
Note
Only available if the track proxy is not read-only
- Returns:
The innermost track state proxy
-
inline auto trackStatesReversed() const
Get a range over the track states of this track.
Return value is compatible with range based for loop. Const version
Note
This range is from the outside inwards!
- Returns:
Track state range to iterate over
-
inline auto trackStatesReversed()
requires (!ReadOnly) Get a range over the track states of this track.
Return value is compatible with range based for loop. Mutable version
Note
Only available if the track proxy is not read-only
Note
This range is from the outside inwards!
- Returns:
Track state range to iterate over
-
inline auto trackStates() const
Get a range over the track states of this track.
Return value is compatible with range based for loop. This overload returns a const-only track state range, which means you cannot modify the track states obtained in the iteration.
Note
This range is from the inside out!
Warning
This access direction is only possible if the track states are forward-linked.
- Returns:
Track state range to iterate over
-
inline auto trackStates()
requires (!ReadOnly) Get a range over the track states of this track.
Return value is compatible with range based for loop. This overload returns a mutable track state range, which means you can modify the track states obtained in the iteration.
Note
Only available if the track proxy is not read-only
Note
This range is from the inside out!
Warning
This access direction is only possible if the track states are forward-linked.
- Returns:
Track state range to iterate over
TrackProxy track state manipulation
Methods that manipulate the track states of a track represented by
TrackProxy.Copy Methods Overview:
Three main copy methods are available with different behaviors:
copyFrom(): Deep copy including all track states (creates new track states)copyFromWithoutStates(): Copy only track properties, invalidate track state indicescopyFromShallow(): Shallow copy sharing the same track states (copy indices only)
Choose based on your needs:
Use
copyFrom()for independent track copies with separate track statesUse
copyFromWithoutStates()to update track metadata without affecting trajectoriesUse
copyFromShallow()for lightweight copies when track states can be shared
-
inline void linkForward()
requires (!ReadOnly) Forward connect a track.
This means setting indices from the inside out on all track states.
Note
Only available if the track proxy is not read-only
-
inline auto appendTrackState(TrackStatePropMask mask = TrackStatePropMask::All)
requires (!ReadOnly) Append a track state to this track.
This will modify the tip index to point at the newly created track state, which will be directly after the previous track state at tip index.
Note
Only available if the track proxy is not read-only
- Parameters:
mask – The allocation prop mask for the new track state
- Returns:
The newly added track state
-
template<TrackProxyConcept track_proxy_t>
inline void copyFrom(const track_proxy_t &other)
requires (!ReadOnly) Create a complete deep copy of another track, including all track states.
This creates new track states in the destination trajectory and copies all data from the source track states. The track state sequence order is preserved.
Implementation details:
Track states are initially copied in reversed order for efficiency
The track state links are then updated using reverseTrackStates()
As a consequence, the resulting track is forward-linked
What gets copied:
All track-level properties (parameters, covariance, particle hypothesis, etc.)
Reference surface (shared pointer is copied)
Track summary data (nMeasurements, nHoles, chi2, etc.)
All dynamic track columns
Complete sequence of track states with all their data
All dynamic track state columns
Result:
The destination track will have newly created track states
tipIndex() and stemIndex() will point to the new track states
Track state indices will be different from the source
All track state data will be identical to the source
The track will be forward-linked (stemIndex() will be valid)
Note
Only available if the track proxy is not read-only
Note
Both track containers must have compatible dynamic columns
- Template Parameters:
track_proxy_t – the other track proxy’s type
- Parameters:
other – The source track proxy to copy from
-
template<TrackProxyConcept track_proxy_t>
inline void copyFromWithoutStates(const track_proxy_t &other)
requires (!ReadOnly) Copy track-level properties from another track, but not the track states.
This copies all track metadata and properties but leaves the track state sequence unchanged. Useful when you want to copy track properties to an existing track that may already have track states.
What gets copied:
Track parameters at reference surface
Covariance matrix at reference surface
Particle hypothesis
Reference surface (shared pointer is copied)
Track summary data (nMeasurements, nHoles, nOutliers, nSharedHits, chi2, nDoF)
All dynamic track columns
What does NOT get copied:
Track states (existing track states remain unchanged in the container)
Result:
All track-level properties are updated to match the source
tipIndex() and stemIndex() are set to kInvalid (track states become inaccessible)
Existing track states remain in the container but are no longer linked to this track
nTrackStates() will return 0 due to invalid indices
Note
Only available if the track proxy is not read-only
Note
Both track containers must have compatible dynamic columns
- Template Parameters:
track_proxy_t – the other track proxy’s type
- Parameters:
other – The source track proxy to copy properties from
-
template<TrackProxyConcept track_proxy_t>
inline void copyFromShallow(const track_proxy_t &other)
requires (!ReadOnly) Create a shallow copy from another track, sharing the same track states.
This copies all track-level properties and makes the destination track point to the same track state sequence as the source. The track states themselves are not duplicated - both tracks will reference the same track state objects in memory.
What gets copied:
All track-level properties (parameters, covariance, particle hypothesis, etc.)
Reference surface (shared pointer is copied)
Track summary data (nMeasurements, nHoles, chi2, etc.)
All dynamic track columns
tipIndex() and stemIndex() (track state linking information)
What gets shared (not duplicated):
Track states (both tracks reference the same track state objects)
Result:
The destination track will have the same nTrackStates() as the source
Both tracks will iterate over the same track state sequence
Modifications to track states will be visible in both tracks
Track state indices will be identical between tracks
The destination track will have a different track index than the source
Note
Only available if the track proxy is not read-only
Note
Both track containers must have compatible dynamic columns
Warning
Modifying track states through either track will affect both tracks since they share the same track state objects
Warning
It is the user’s responsibility to ensure that the tip and stem indices from the source track are valid in the destination track’s track state container. No validation is performed - invalid indices will lead to undefined behavior when accessing track states
- Template Parameters:
track_proxy_t – the other track proxy’s type
- Parameters:
other – The source track proxy to create a shallow copy from
-
inline void reverseTrackStates(bool invertJacobians = false)
requires (!ReadOnly) Reverse the ordering of track states for this track Afterwards, the previous endpoint of the track state sequence will be the “innermost” track state.
Note
Only available if the track proxy is not read-only
Note
This is dangerous with branching track state sequences, as it will break them
Note
This also automatically forward-links the track!
- Parameters:
invertJacobians – Whether to invert the Jacobians of the track states
TrackProxy generic component access
Methods that give access to generic components of a track represented by
TrackProxy.Internally, a compile-time hash of the component name is used to identify which component is being requested. Most of the named methods in TrackProxy properties use these methods to retrieve the actual data.
A number of overloads exist, where you can either supply the HashedString
keyas a template parameter or a runtime argument. The former has the advantage of being guaranteed to be evaluated at compile-time.-
template<typename T, HashedString key>
inline constexpr T &component()
requires (!ReadOnly) 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
- Returns:
Mutable reference to the component given by
key
-
template<typename T>
inline constexpr T &component(HashedString key)
requires (!ReadOnly) 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
- Returns:
Mutable reference to the component given by
key
-
template<typename T>
inline constexpr T &component(std::string_view key)
requires (!ReadOnly) Retrieve a mutable reference to a component.
Note
This might hash the
keyat runtime instead of compile-time- Template Parameters:
T – The type of the component to access
- Parameters:
key – String key for the component to access
- Returns:
Mutable reference to the component given by
key
-
template<typename T, HashedString key>
inline constexpr const T &component() 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
- Returns:
Const reference to the component given by
key
-
inline bool hasColumn(HashedString key) const
Check whether a dynamic column exists.
- Parameters:
key – String key for the component to check
- Returns:
whether the column exists
-
template<typename T>
inline constexpr const T &component(HashedString key) 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
- Returns:
Const reference to the component given by
key
-
template<typename T>
inline constexpr const T &component(std::string_view key) const Retrieve a const reference to a component.
Note
This might hash the
keyat runtime instead of compile-time- Template Parameters:
T – The type of the component to access
- Parameters:
key – String key for the component to access
- Returns:
Const reference to the component given by
key
Public Types
-
using ConstCovariance = typename detail_tsp::FixedSizeTypes<eBoundSize, true>::CovarianceMap
Same as Covariance, but with const semantics.
-
using ConstParameters = typename detail_tsp::FixedSizeTypes<eBoundSize, true>::CoefficientsMap
Same as Parameters, but with const semantics.
-
using ConstProxyType = ConstTrackProxy
Alias for an associated const track proxy, with the same backends.
-
using ConstTrackProxy = TrackProxy<track_container_t, trajectory_t, holder_t, true>
Alias for the const version of this track proxy, with the same backends.
-
using ConstTrackStateProxy = typename Trajectory::ConstTrackStateProxy
Alias for an associated const track state proxy, with the same backends.
-
using Container = track_container_t
The track container backend given as a template parameter.
-
using Covariance = typename detail_tsp::FixedSizeTypes<eBoundSize, false>::CovarianceMap
Map-type for a bound covariance.
This has reference semantics, i.e. points at a matrix by an internal pointer.
-
using IndexType = TrackIndexType
The index type of the track container.
-
using MutableTrackProxy = TrackProxy<track_container_t, trajectory_t, holder_t, false>
Alias for the mutable version of this track proxy, with the same backends.
-
using Parameters = typename detail_tsp::FixedSizeTypes<eBoundSize, false>::CoefficientsMap
Map-type for a bound parameter vector.
This has reference semantics, i.e. points at a matrix by an internal pointer.
-
using TrackStateProxy = typename Trajectory::TrackStateProxy
Alias for an associated mutable track state proxy, with the same backends.
-
using Trajectory = trajectory_t
The track state container backend given as a template parameter.
Public Functions
-
inline const auto &container() const
Return a reference to the track container backend, const version.
- Returns:
reference to the track container backend
-
inline auto &container()
requires (!ReadOnly) Return a reference to the track container backend, mutable version.
Note
Only available if the track proxy is not read-only
- Returns:
reference to the track container backend
-
inline BoundTrackParameters createParametersAtReference() const
Return the track parameters at the reference surface.
Note
The parameters are created on the fly
- Returns:
the track parameters
-
inline BoundTrackParameters createParametersFromState(const ConstTrackStateProxy &trackState) const
Convert a track state into track parameters.
Note
The parameters are created on the fly
- Parameters:
trackState – Track state to convert to parameters
- Returns:
the track parameters
-
inline bool operator==(const TrackProxy &other) const
Equality operator with another track proxy Checks the container identity and the track index.
- Parameters:
other – Other track proxy to compare with
- Returns:
True if the track proxies refer to the same track
-
template<TrackContainerBackend track_container_t, CommonMultiTrajectoryBackend traj_t, template<typename> class holder_t = RefHolder>
class TrackContainer Track container interface class.
This type represents a collections of tracks. It uses a backend to store both the actual tracks and the associated track states.
- Template Parameters:
track_container_t – the track container backend
traj_t – the track state container backend
holder_t – ownership management class for the backend
TrackContainer construction
Constructors for the track container by using a set of backends (track + track state). The container can either take ownership of the backends or just hold references to them. This is driven by the
holder_ttemplate parameter, where you can also supply a custom holder type. Template deduction is used to try to guess the correct holder type.-
inline TrackContainer(holder_t<track_container_t> container, holder_t<traj_t> traj)
Constructor from a track container backend and a track state container backend.
- Parameters:
container – the track container backend
traj – the track state container backend
- inline TrackContainer (auto &container, auto &traj) requires(std
Constructor from references to a track container backend and to a track state container backend.
Note
The track container will not assume ownership over the backends in this case. You need to ensure suitable lifetime
- Parameters:
container – the track container backend
traj – the track state container backend
- inline TrackContainer (const auto &container, const auto &traj) requires(std
Constructor from const references to a track container backend and to a track state container backend.
Note
The track container will not assume ownership over the backends in this case. You need to ensure suitable lifetime
- Parameters:
container – the track container backend
traj – the track state container backend
TrackContainer track (proxy) access and manipulation
These methods allow accessing tracks, i.e. adding or retrieving a track proxy that points at a specific track in the container.
-
inline ConstTrackProxy getTrack(IndexType itrack) const
Get a const track proxy for a track index.
- Parameters:
itrack – the track index in the container
- Returns:
A const track proxy for the index
-
inline TrackProxy getTrack(IndexType itrack)
requires (!ReadOnly) Get a mutable track proxy for a track index.
Note
Only available if the track container is not read-only
- Parameters:
itrack – the track index in the container
- Returns:
A mutable track proxy for the index
-
inline ConstTrackProxy at(IndexType itrack) const
Get a const track proxy for a track index.
- Parameters:
itrack – the track index in the container
- Returns:
A const track proxy for the index
-
inline TrackProxy at(IndexType itrack)
requires (!ReadOnly) Get a mutable track proxy for a track index.
Note
Only available if the track container is not read-only
- Parameters:
itrack – the track index in the container
- Returns:
A mutable track proxy for the index
-
inline IndexType addTrack()
requires (!ReadOnly) Add a track to the container.
Note this only creates the logical track and allocates memory. You can combine this with
getTrackto obtain a track proxyNote
Only available if the track container is not read-only
- Returns:
the index to the newly added track
-
inline TrackProxy makeTrack()
requires (!ReadOnly) Add a track to the container and return a track proxy to it This effectively calls
addTrackandgetTrack.Note
Only available if the track container is not read-only
- Returns:
a track proxy to the newly added track
-
inline void removeTrack(IndexType itrack)
requires (!ReadOnly) Remove a track at index
itrackfrom the container.Note
Only available if the track container is not read-only
Note
This invalidates track proxies that point to tracks with larger indices than
itrack!- Parameters:
itrack – The index of the track to remove
-
inline iterator begin()
requires (!ReadOnly) Get a mutable iterator to the first track in the container.
Note
Only available if the track container is not read-only
- Returns:
a mutable iterator to the first track
-
inline iterator end()
requires (!ReadOnly) Get a past-the-end iterator for this container.
Note
Only available if the track container is not read-only
- Returns:
a past-the-end iterator
-
inline const_iterator begin() const
Get an const iterator to the first track in the container.
- Returns:
a const iterator to the first track
-
inline const_iterator end() const
Get a past-the-end iterator for this container.
- Returns:
a past-the-end iterator
TrackContainer column management
TrackContainer can manage a set of common static columns, and dynamic columns that can be added at runtime.
This set of methods allows you to manage the dynamic columns.
-
template<typename T>
inline constexpr void addColumn(std::string_view key)
requires (!ReadOnly) Add a dynamic column to the track container.
Note
Only available if the track container is not read-only
- Parameters:
key – the name of the column to be added
-
inline constexpr bool hasColumn(const std::string &key) const
Check if this track container has a specific dynamic column.
- Parameters:
key – the key to check for
- Returns:
true if the column exists
-
inline constexpr bool hasColumn(HashedString key) const
Check if a this track container has a specific dynamic column.
- Parameters:
key – the key to check for
- Returns:
true if the column exists
-
template<typename other_track_container_t>
inline void ensureDynamicColumns(const other_track_container_t &other)
requires (!ReadOnly) Helper function to make this track container match the dynamic columns of another one.
This will only work if the track container supports this source, and depends on the implementation details of the dynamic columns of the container
Note
Only available if the track container is not read-only
- Template Parameters:
other_track_container_t – Type of the other track container
- Parameters:
other – The other track container
TrackContainer backend access
These methods allow accessing the backend of the track container.
In most cases, this is not necessary for interacting with the container.
-
inline auto &container()
requires (!ReadOnly) Get a mutable reference to the track container backend.
Note
Only available if the track container is not read-only
- Returns:
a mutable reference to the backend
-
inline const auto &container() const
Get a const reference to the track container backend.
- Returns:
a const reference to the backend
-
inline auto &trackStateContainer()
requires (!ReadOnly) Get a mutable reference to the track state container backend.
Note
Only available if the track container is not read-only
- Returns:
a mutable reference to the backend
-
inline auto &trackStateContainerHolder()
requires (!ReadOnly) Retrieve the holder of the track state container.
Note
Only available if the track container is not read-only
- Returns:
The track state container including it’s holder
-
inline const auto &trackStateContainer() const
Get a const reference to the track state container backend.
- Returns:
a const reference to the backend
-
inline const auto &trackStateContainerHolder() const
Retrieve the holder of the track state container.
- Returns:
The track state container including it’s holder
Public Types
-
using const_iterator = detail::ContainerIterator<TrackContainer, ConstTrackProxy, IndexType, true>
Type alias for const iterator over tracks in container.
-
using ConstTrackProxy = Acts::TrackProxy<track_container_t, traj_t, holder_t, true>
Alias for the const version of a track proxy, with the same backends as this container.
-
using ConstTrackStateProxy = typename MultiTrajectory<traj_t>::ConstTrackStateProxy
Type alias for const track state proxy from multi-trajectory.
-
using IndexType = TrackIndexType
The index type of the track container, taken from the container backend.
-
using iterator = detail::ContainerIterator<TrackContainer, TrackProxy, IndexType, false>
Type alias for mutable iterator over tracks in container.
-
using size_type = IndexType
Type alias for size type of track container.
-
using TrackContainerBackend = track_container_t
Type alias for track container backend type.
-
using TrackProxy = Acts::TrackProxy<track_container_t, traj_t, holder_t, false>
Alias for the mutable version of a track proxy, with the same backends as this container.
-
using TrackStateContainerBackend = traj_t
Type alias for track state container backend type.
-
using TrackStateProxy = typename MultiTrajectory<traj_t>::TrackStateProxy
Type alias for mutable track state proxy from multi-trajectory.
Public Functions
-
inline void clear()
requires (!ReadOnly) Clear the content of the track container.
Note
Only available if the track container is not read-only
-
inline constexpr IndexType size() const
Get the size (number of tracks) of the track container.
- Returns:
the sixe
Public Static Attributes
-
static constexpr IndexType kInvalid = kTrackIndexInvalid
Sentinel value that indicates an invalid index.
-
static constexpr bool ReadOnly = IsReadOnlyTrackContainer<track_container_t>::value
Indicates if this track container is read-only, or if it can be modified.
-
static constexpr bool TrackStateReadOnly = IsReadOnlyMultiTrajectory<traj_t>::value
Indicates if the track state container is read-only, or if it can be modified.
Track state iteration and forward linking
By default, track states are connected as a one-directional linked list, where each track state knows its previous track state. Fig. 21 shows an example of a track state tree, like it is constructed by the combinatorial track finding.
In Fig. 21 states \(S_7\) and \(S_6\) are the two tip states of the track state tree, while \(S_1\) is the single stem state. In the case of combinatorial track finding starting from e.g. a seed, it could be the location of the innermost space point.
Fig. 21 Illustration of a branching multi-trajectory that is created during combinatorial track finding.
Each track object points at a single tip state to define its track state sequence.
The Acts::TrackProxy class has various methods to access the track state sequence:
auto track = getTrackFromSomewhere();
for(const auto trackState : track.trackStatesReversed()) {
// do something with track state
}
Note that Acts::TrackProxy::trackStatesReversed() iterates from the tip state to
the stem state, i.e. from the outside in.
Attention
By-default, it is not possible to iterate forward through the track states on a track! The track’s track states need to be forward-linked for this to be possible.
The reason for this is: As the trajectory branches at the second sensor into \(S_2\)/\(S_3\), it is not possible to connect the states forward, i.e. store in \(S_1\) what the next state is going to be: it is ambiguous!
However, when track finding has concluded, and the trajectories identified by
tip states \(S_7\) and \(S_8\) have been discarded or are being
copied into an output container, it is possible to forward link the track
state sequences. This is possible if the trajectory does not branch
anymore! Acts::TrackProxy::copyFrom() will implicitly forward link the
track states, as it is guaranteed to not branch after copying.
You can manually add forward-linking to a track by calling
Acts::TrackProxy::linkForward() or
Acts::TrackProxy::reverseTrackStates().
Warning
Calling either Acts::TrackProxy::linkForward() or
Acts::TrackProxy::reverseTrackStates() on a track state sequence which
has branching will break the branching! If you have other tracks pointing at a
tip state that branches from the sequence you’re trying to
forward-link, it will be corrupted!
In this example, before any forward linking, the sequence looks like this:
digraph { rankdir="LR"; S2 -> S1; S3 -> S1; S7 -> S5 -> S4 -> S2; S6 -> S3; }After a copy operation of \(S_6\) and \(S_7\) the resultig track state sequences will look like this:
digraph { rankdir="LR"; S11[label="S1 (copy)"]; S12[label="S1 (copy)"]; S7 -> S5 -> S4 -> S11; S11 -> S4 -> S5 -> S7; S6 -> S3 -> S12; S12 -> S3 -> S6; }This now includes both forward and backward links, which allows iteration from \(S_1\)/\(S_2\) to \(S_6\)/\(S_7\) and the other way around.
Forward iteration can then be achieved like this:
auto track = getTrackFromSomewhere();
for(const auto trackState : track.trackStates()) {
// iterate forward
// do something with track state
}
and the innermost track state becomes directly accessible via
Acts::TrackProxy::innermostTrackState().
Attention
If the track container has branching track state sequences, running a smoothing step in-place on branching tracks is problematic: if tracks are smoothed one by one, the last track of each shared track state (i.e. the track state where branching occurs) will overwrite the smoothing result of all previous tracks.
Consider again the track states in Fig. 21. \(S_1\) is the common ancestor for \(S_2\) and \(S_3\), and has a single slot to store smoothed parameters. If smoothing happens for the track ending in \(S_6\), then smoothing the track ending in \(S_7\) only the values written by the final smoothing of \(S_37 will survive in \)S_1$’s storage. This can be unexpected!
Track State API
-
template<typename trajectory_t, std::size_t M, bool read_only = true>
class TrackStateProxy : public Acts::TrackStateProxyCommon<TrackStateProxy<trajectory_t, M, true>, true> Proxy object to access a single point on the trajectory.
- Template Parameters:
SourceLink – Type to link back to an original measurement
M – Maximum number of measurement dimensions
read_only – true for read-only access to underlying storage
Constructors and assignment operator
Public constructors and assignment operators for
TrackStateProxyonly allow construction from anotherTrackStateProxy. You should generally not have to constructTrackStateProxymanually.-
TrackStateProxy(const TrackStateProxy &other) = default
Copy constructor: const to const or mutable to mutable.
- Parameters:
other – The other TrackStateProxy to construct from
-
TrackStateProxy &operator=(const TrackStateProxy &other) = default
Copy assignment operator: const to const or mutable to mutable.
- Parameters:
other – The other TrackStateProxy to assign from
- Returns:
Reference to this TrackStateProxy
-
inline explicit TrackStateProxy(const TrackStateProxy<Trajectory, M, false> &other)
requires ReadOnly Constructor from mutable TrackStateProxy.
Note
Only available if the track state proxy is read-only
- Parameters:
other – The other TrackStateProxy to construct from
-
inline TrackStateProxy &operator=(const TrackStateProxy<Trajectory, M, false> &other)
requires ReadOnly Assignment operator to from mutable
TrackStateProxy.Note
Only available if the track state proxy is read-only
- Parameters:
other – The other TrackStateProxy to assign from
- Returns:
Reference to this TrackStateProxy
Track state properties
Properties of the track state represented by
TrackStateProxy.Many of these methods come in a
constand a non-constversion. The non-constversion is only available if you have an instance ofTrackStateProxythat does not have theread_onlytemplate parameter set totrue, even if you hold it as an lvalue.The track states each have an index in the track state container. The sequence of track states is implemented as a one or two-way linked list, which uses indices into the same container.
Each track state has a
previousindex, which points at the track state immediately preceding. A track state with apreviousindex ofkInvalidis the first (innermost) track state in a track or track candidate. This is also referred to as a stem at the track level.During track finding and fitting, track states are usually appended to the sequence, populating the
previousindex of the new track state. Combinatorial track finding can produce track states which fork in this way, by having more than one track state with the samepreviousindex.The track states have static, optional and dynamic properties. Static properties are always present, and can always be retrieved. Optional components use an extra indirection mechanism that coordinates with the backend to allow both not having the component set, or sharing it with other track states. An example is a branching trajectory from track finding which shares the same predicted parameter vector and associated covariance.
Optional components are
predicted parameters and covariance
filtered parameters and covariance
smoothed parameters and covariance
jacobian
calibrated measurement info including projector
They can be unset via unset, getMask can be used to check which components are present. The first four are shareable between track states via shareFrom.
-
inline IndexType index() const
Index within the trajectory.
- Returns:
the index
-
inline void unset(TrackStatePropMask target)
requires (!ReadOnly) Unset an optional track state component.
Note
Only available if the track state proxy is not read-only
- Parameters:
target – The component to unset
-
inline void addComponents(TrackStatePropMask mask)
requires (!ReadOnly) Add additional components to the track state.
Note
Only available if the track state proxy is not read-only
- Parameters:
mask – The bitmask that instructs which components to allocate
-
inline const Surface &referenceSurface() const
Reference surface.
- Returns:
the reference surface
-
inline bool hasReferenceSurface() const
Returns if the track state has a non nullptr surface associated.
- Returns:
whether a surface exists or not
Set the reference surface to a given value.
Note
This overload is only present in case
ReadOnlyis false.- Parameters:
srf – Shared pointer to the surface to set
Track state measurement properties
Properties of the measurement associated with the track state represented. This consists of a vector and an associated square matrix of a measurement dimension which is between one and the size of the track parametrization. The measurement coordinate frame is required to be a strict subset of the bound track parametrization on the local geometry coordinate frame, i.e. using a pure projector matrix to convert from the bound parametrization to the measurement frame is possible.
The track state stores the parameter vector and covariance, and the backend is given the possibility to do so in a jagged way, i.e. only storing the number of values needed. This requires calling allocateCalibrated before storing the measurements (even if it might be a no-op).
The projector matrix is packed as a bitset, which is converted to a matrix on-demand (and therefore returned by value).
The track state also includes a SourceLink which acts as a proxy to the original uncalibrated measurement that the calibrated measurement was derived from. It is set and returned by value, to allow unpacking / repacking by the backend, if needed.
-
SourceLink getUncalibratedSourceLink() const
Uncalibrated measurement in the form of a source link.
Const version
- Returns:
The uncalibrated measurement source link
-
inline void setUncalibratedSourceLink(SourceLink &&sourceLink)
requires (!ReadOnly) Set an uncalibrated source link.
- Parameters:
sourceLink – The uncalibrated source link to set
-
inline IndexType calibratedSize() const
Return the (dynamic) number of dimensions stored for this measurement.
Note
Depending on the backend, this size is used to determine the memory range of the measurement vector and covariance.
- Returns:
The number of dimensions
-
inline void allocateCalibrated(std::size_t measdim)
requires (!ReadOnly) Allocate storage to be able to store a measurement of size
measdim.This must be called before setting the measurement content.
Note
This does not allocate if an allocation of the same size already exists
Note
This will zero-initialize the allocated storage
Note
This is an error if an existing allocation has different size
- Parameters:
measdim – Number of measurement dimensions to allocate
Sharing and copying
Methods to share and copy track state components. Sharing means setting up more than one track state to point to the same component.
Shareable components are
predicted parameters and covariance
filtered parameters and covariance
smoothed parameters and covariance
jacobian
See TrackStatePropMask.
Share a shareable component within this track state.
- Parameters:
shareSource – Which component to share from
shareTarget – Which component to share as. This should be different from as
shareSource, e.g. predicted can be shared as filtered.
Share a shareable component from another track state.
Note
The track states both need to be stored in the same
MultiTrajectoryinstance- Parameters:
other – Track state proxy to share component from
component – Which component to share.
Share a shareable component from another track state.
Note
Shareable components are predicted, filtered, smoothed, calibrated, jacobian, or projector. See
TrackStatePropMask.- Parameters:
other – Track state proxy to share component(s) from
shareSource – Which component to share from
shareTarget – Which component to share as. This can be be different from as
shareSource, e.g. predicted can be shared as filtered.
-
template<TrackStateProxyConcept track_state_proxy_t>
inline void copyFrom(const track_state_proxy_t &other, TrackStatePropMask mask = TrackStatePropMask::All, bool onlyAllocated = true)
requires (!ReadOnly) Copy the contents of another track state proxy into this one.
Note
If the this track state proxy does not have compatible allocations with the source track state proxy, and
onlyAllocatedis false, an exception is thrown.Note
The mask parameter will not cause a copy of components that are not allocated in the source track state proxy.
- Parameters:
other – The other track state to copy from
mask – An optional mask to determine what to copy from
onlyAllocated – Whether to only copy allocated components
Track state proxy Generic component access
-
template<HashedString key>
inline constexpr bool has() const Check if a component is set.
- Template Parameters:
key – Hashed string key to check for
- Returns:
true if the component exists, false if not
-
inline constexpr bool has(HashedString key) const
Check if a component is set.
- Parameters:
key – Hashed string key to check for
- Returns:
true if the component exists, false if not
-
inline constexpr bool has(std::string_view key) const
Check if a component is set.
Note
This might hash the
keyat runtime instead of compile-time- Parameters:
key – String key to check for
- Returns:
true if the component exists, false if not
-
template<typename T, HashedString key>
inline constexpr T &component()
requires (!ReadOnly) 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
- Returns:
Mutable reference to the component given by
key
-
template<typename T>
inline constexpr T &component(HashedString key)
requires (!ReadOnly) 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
- Returns:
Mutable reference to the component given by
key
-
template<typename T>
inline constexpr T &component(std::string_view key)
requires (!ReadOnly) Retrieve a mutable reference to a component.
Note
This might hash the
keyat runtime instead of compile-time- Template Parameters:
T – The type of the component to access
- Parameters:
key – String key for the component to access
- Returns:
Mutable reference to the component given by
key
-
template<typename T, HashedString key>
inline constexpr const T &component() 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
- Returns:
Const reference to the component given by
key
-
template<typename T>
inline constexpr const T &component(HashedString key) 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
- Returns:
Const reference to the component given by
key
-
template<typename T>
inline constexpr const T &component(std::string_view key) const Retrieve a const reference to a component.
Note
This might hash the
keyat runtime instead of compile-time- Template Parameters:
T – The type of the component to access
- Parameters:
key – String key for the component to access
- Returns:
Const reference to the component given by
key
Public Types
-
template<std::size_t N>
using Calibrated = typename TrackStateTraits<N, false>::Calibrated Map-type for a calibrated measurement vector, where the local measurement dimension is variable.
-
template<std::size_t N>
using CalibratedCovariance = typename TrackStateTraits<N, false>::CalibratedCovariance Map-type for a calibrated measurement covariance matrix, where the local measurement dimension is variable.
-
template<std::size_t N>
using ConstCalibrated = typename TrackStateTraits<N, true>::Calibrated Same as
Calibrated, but with const semantics.
-
template<std::size_t N>
using ConstCalibratedCovariance = typename TrackStateTraits<N, true>::CalibratedCovariance Same as CalibratedCovariance, but with const semantics.
-
using ConstCovariance = typename TrackStateTraits<M, true>::Covariance
Same as Covariance, but with const semantics.
-
using ConstEffectiveCalibrated = typename TrackStateTraits<M, true>::EffectiveCalibrated
Same as
EffectiveCalibrated, but with const semantics.
-
using ConstEffectiveCalibratedCovariance = typename TrackStateTraits<M, true>::EffectiveCalibratedCovariance
Same as EffectiveCalibratedCovariance, but with const semantics.
-
using ConstJacobian = typename TrackStateTraits<M, true>::Covariance
Jacobian shape is identical to Covariance.
-
using ConstParameters = typename TrackStateTraits<M, true>::Parameters
Same as Parameters, but with const semantics.
-
using ConstProxyType = TrackStateProxy<trajectory_t, M, true>
Alias for an associated const track state proxy, with the same backends.
-
using Covariance = typename TrackStateTraits<M, false>::Covariance
Map-type for a bound covariance.
This has reference semantics, i.e. points at a matrix by an internal pointer.
-
using EffectiveCalibrated = typename TrackStateTraits<M, false>::EffectiveCalibrated
Map-type for a measurement vector, where the local measurement dimension is variable.
-
using EffectiveCalibratedCovariance = typename TrackStateTraits<M, false>::EffectiveCalibratedCovariance
Map-type for a measurement covariance matrix, where the local measurement dimension is variable.
-
using IndexType = TrackIndexType
The index type of the track state container.
-
using Jacobian = typename TrackStateTraits<M, false>::Covariance
Jacobian shape is identical to Covariance.
-
using Parameters = typename TrackStateTraits<M, false>::Parameters
Map-type for a bound parameter vector.
This has reference semantics, i.e. points at a matrix by an internal pointer.
-
using Trajectory = trajectory_t
The track state container backend given as a template parameter.
Public Functions
- template<typename val_t, typename cov_t> inline void allocateCalibrated (const Eigen::DenseBase< val_t > &val, const Eigen::DenseBase< cov_t > &cov) requires(!read_only &&Concepts
Allocate and initialize calibrated data from static-size Eigen objects.
- Template Parameters:
val_t – Eigen vector type holding calibrated values.
cov_t – Eigen matrix type holding the covariance.
- Parameters:
val – Vector to copy into the calibrated storage.
cov – Covariance matrix to copy into the calibrated storage.
-
template<std::size_t measdim>
inline TrackStateTraits<measdim, true>::Calibrated calibrated() const Access calibrated measurement data with compile-time dimension.
- Template Parameters:
measdim – Measurement dimension.
- Returns:
Eigen map referencing the calibrated measurement vector.
-
template<std::size_t measdim>
inline TrackStateTraits<measdim, false>::Calibrated calibrated()
requires (!read_only) Access calibrated measurement data with compile-time dimension.
- Template Parameters:
measdim – Measurement dimension.
- Returns:
Mutable Eigen map referencing the calibrated measurement vector.
-
template<std::size_t measdim>
inline TrackStateTraits<measdim, true>::CalibratedCovariance calibratedCovariance() const Access calibrated covariance data with compile-time dimension.
- Template Parameters:
measdim – Measurement dimension.
- Returns:
Eigen map referencing the covariance matrix.
-
template<std::size_t measdim>
inline TrackStateTraits<measdim, false>::CalibratedCovariance calibratedCovariance()
requires (!read_only) Access calibrated covariance data with compile-time dimension.
- Template Parameters:
measdim – Measurement dimension.
- Returns:
Mutable Eigen map referencing the covariance matrix.
-
inline float chi2() const
Retrieve the local chi2 contribution.
- Returns:
Chi2 value associated with this state.
-
inline float &chi2()
requires (!read_only) Retrieve a mutable reference to the local chi2 contribution.
- Returns:
Mutable chi2 value.
-
inline const auto &container() const
Get a const reference to the track state container backend.
- Returns:
a const reference to the backend
-
inline auto &container()
requires (!ReadOnly) Get a mutable reference to the track state container backend.
- Returns:
a mutable reference to the backend
-
inline ConstCovarianceMap covariance() const
Access the best available covariance (smoothed, filtered, or predicted).
- Returns:
Bound covariance map for the state.
-
inline ConstEffectiveCalibratedMap effectiveCalibrated() const
Access the calibrated measurement values with runtime dimension.
- Returns:
Eigen map referencing the calibrated measurement vector.
-
inline EffectiveCalibratedMap effectiveCalibrated()
requires (!read_only) Access mutable calibrated measurement values with runtime dimension.
- Returns:
Eigen map referencing the calibrated measurement vector.
-
inline ConstEffectiveCalibratedCovarianceMap effectiveCalibratedCovariance() const
Access the calibrated covariance with runtime dimension.
- Returns:
Eigen map referencing the measurement covariance matrix.
-
inline EffectiveCalibratedCovarianceMap effectiveCalibratedCovariance()
requires (!read_only) Access mutable calibrated covariance with runtime dimension.
- Returns:
Eigen map referencing the measurement covariance matrix.
-
inline ConstParametersMap filtered() const
Access the filtered parameter vector.
- Returns:
Bound parameter map for the filtered state.
-
inline ParametersMap filtered()
requires (!read_only) Access the filtered parameter vector.
- Returns:
Mutable bound parameter map for the filtered state.
-
inline ConstCovarianceMap filteredCovariance() const
Access the filtered covariance matrix.
- Returns:
Bound covariance map for the filtered state.
-
inline CovarianceMap filteredCovariance()
requires (!read_only) Access the filtered covariance matrix.
- Returns:
Mutable bound covariance map for the filtered state.
-
inline TrackStatePropMask getMask() const
Compute the property mask describing which components are present.
- Returns:
Bit mask of available properties.
-
inline bool hasCalibrated() const
Check for presence of calibrated measurement data.
- Returns:
True if calibrated measurements exist.
-
inline bool hasColumn(HashedString key) const
Check if the track state has a specific dynamic column.
- Parameters:
key – The hashed column key
- Returns:
true if the column exists
-
inline bool hasFiltered() const
Check for presence of filtered track parameters.
- Returns:
True if the filtered component exists.
-
inline bool hasJacobian() const
Check for presence of a transport Jacobian.
- Returns:
True if a Jacobian is stored.
-
inline bool hasPredicted() const
Check for presence of predicted track parameters.
- Returns:
True if the predicted component exists.
-
inline bool hasPrevious() const
Check whether this state links to a previous state.
- Returns:
True if the previous index is valid.
-
inline bool hasProjector() const
Check for presence of a measurement projector.
- Returns:
True if projector indices are stored.
-
inline bool hasSmoothed() const
Check for presence of smoothed track parameters.
- Returns:
True if the smoothed component exists.
-
inline ConstCovariance jacobian() const
Returns the jacobian from the previous trackstate to this one.
Note
Const version
- Returns:
The jacobian matrix
-
inline Covariance jacobian()
requires (!ReadOnly) Returns the jacobian from the previous trackstate to this one.
Note
Mutable version
- Returns:
The jacobian matrix
-
inline ConstParametersMap parameters() const
Access the best available parameters (smoothed, filtered, or predicted).
- Returns:
Bound parameter map for the state.
-
inline double pathLength() const
Retrieve the accumulated path length.
- Returns:
Path length stored on the state.
-
inline double &pathLength()
requires (!read_only) Retrieve a mutable reference to the accumulated path length.
- Returns:
Mutable path length.
-
inline ConstParametersMap predicted() const
Access the predicted parameter vector.
- Returns:
Bound parameter map for the predicted state.
-
inline ParametersMap predicted()
requires (!read_only) Access the predicted parameter vector.
- Returns:
Mutable bound parameter map for the predicted state.
-
inline ConstCovarianceMap predictedCovariance() const
Access the predicted covariance matrix.
- Returns:
Bound covariance map for the predicted state.
-
inline CovarianceMap predictedCovariance()
requires (!read_only) Access the predicted covariance matrix.
- Returns:
Mutable bound covariance map for the predicted state.
-
inline TrackIndexType previous() const
Retrieve the previous track state index in the linked trajectory.
- Returns:
Index of the previous state or
kTrackIndexInvalid.
-
inline TrackIndexType &previous()
requires (!read_only) Retrieve a mutable reference to the previous track state index.
- Returns:
Mutable index of the previous state.
-
template<std::size_t measdim>
inline FixedBoundSubspaceHelper<measdim> projectorSubspaceHelper() const Creates a fixed size subspace helper.
- Returns:
The subspace helper
-
inline VariableBoundSubspaceHelper projectorSubspaceHelper() const
Creates a variable size subspace helper.
- Returns:
The subspace helper
-
template<std::size_t measdim>
inline SubspaceIndices<measdim> projectorSubspaceIndices() const Returns the projector subspace indices.
- Returns:
The projector subspace indices
-
inline BoundSubspaceIndices projectorSubspaceIndices() const
Decode the measurement projector indices.
- Returns:
Bound parameter indices used for projection.
- template<std::ranges::sized_range index_range_t> inline void setProjectorSubspaceIndices (const index_range_t &subspaceIndices) requires(!read_only &&std
Store subspace indices describing the measurement projector.
- Template Parameters:
index_range_t – Range of indices to encode.
- Parameters:
subspaceIndices – Collection of bound indices forming the projector rows.
-
inline ConstParametersMap smoothed() const
Access the smoothed parameter vector.
- Returns:
Bound parameter map for the smoothed state.
-
inline ParametersMap smoothed()
requires (!read_only) Access the smoothed parameter vector.
- Returns:
Mutable bound parameter map for the smoothed state.
-
inline ConstCovarianceMap smoothedCovariance() const
Access the smoothed covariance matrix.
- Returns:
Bound covariance map for the smoothed state.
-
inline CovarianceMap smoothedCovariance()
requires (!read_only) Access the smoothed covariance matrix.
- Returns:
Mutable bound covariance map for the smoothed state.
-
inline const MultiTrajectory<Trajectory> &trajectory() const
Return a const reference to the underlying backend container.
- Returns:
A const reference to the backend container
-
inline MultiTrajectory<Trajectory> &trajectory()
requires (!ReadOnly) Return a mutable reference to the underlying backend container.
- Returns:
A reference to the backend container
-
inline ConstTrackStateTypeMap typeFlags() const
Retrieve the track-state type flags.
- Returns:
Bit mask describing the state type.
-
inline MutableTrackStateTypeMap typeFlags()
requires (!read_only) Retrieve mutable track-state type flags.
- Returns:
Mutable bit mask describing the state type.
Public Static Attributes
-
static constexpr IndexType kInvalid = kTrackIndexInvalid
Sentinel value that indicates an invalid index.
-
static constexpr bool ReadOnly = read_only
Indicates whether this track state proxy is read-only or if it can be modified.
Friends
- friend class Acts::MultiTrajectory< Trajectory >
-
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.
MultiTrajectory track state iteration
- template<typename F> void visitBackwards(IndexType iendpoint, F &&callable) const requires detail_lt void applyBackwards (IndexType iendpoint, F &&callable) requires(!ReadOnly) &&detail_lt
Visit all previous states starting at a given endpoint.
Note
Only available if the MultiTrajectory is not read-only Range for the track states from
iendpointto the trajectory startNote
Const version Range for the track states from
iendpointto the trajectory start, i.e from the outside in.Note
Only available if the MultiTrajectory is not read-only
Note
Mutable version
Warning
If the trajectory contains multiple components with common points, this can have an impact on the other components.
- Param iendpoint:
index of the last state
- Param callable:
non-modifying functor to be called with each point Apply a function to all previous states starting at a given endpoint.
- Param iendpoint:
index of the last state
- Param callable:
modifying functor to be called with each point
- Param iendpoint:
Trajectory entry point to start from
- Param iendpoint:
Trajectory entry point to start from
- Return:
Iterator pair to iterate over
- Return:
Iterator pair to iterate over
-
inline auto forwardTrackStateRange(IndexType istartpoint) const
Range for the track states from
istartpointto the trajectory end, i.e from inside out.Note
Const version
- Parameters:
istartpoint – Trajectory state index for the innermost track state to start from
- Returns:
Iterator pair to iterate over
-
inline auto forwardTrackStateRange(IndexType istartpoint)
requires (!ReadOnly) Range for the track states from
istartpointto the trajectory end, i.e from inside out.Note
Only available if the MultiTrajectory is not read-only
- Parameters:
istartpoint – Trajectory state index for the innermost track state to start from
- Returns:
Iterator pair to iterate over
MultiTrajectory track state (proxy) access and manipulation
These methods allow accessing track states, i.e. adding or retrieving a track state proxy that points at a specific track state in the container.
-
inline ConstTrackStateProxy getTrackState(IndexType istate) const
Access a read-only point on the trajectory by index.
Note
Only available if the MultiTrajectory is not read-only
- Parameters:
istate – The index to access
- Returns:
Read only proxy to the stored track state
-
inline TrackStateProxy getTrackState(IndexType istate)
requires (!ReadOnly) Access a writable point on the trajectory by index.
Note
Only available if the MultiTrajectory is not read-only
- Parameters:
istate – The index to access
- Returns:
Read-write proxy to the stored track state
-
inline IndexType addTrackState(TrackStatePropMask mask = TrackStatePropMask::All, IndexType iprevious = kInvalid)
requires (!ReadOnly) Add a track state without providing explicit information.
Which components of the track state are initialized/allocated can be controlled via
maskNote
Only available if the MultiTrajectory is not read-only
- 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
-
inline TrackStateProxy makeTrackState(TrackStatePropMask mask = TrackStatePropMask::All, IndexType iprevious = kInvalid)
requires (!ReadOnly) Add a track state to the container and return a track state proxy to it This effectively calls
addTrackStateandgetTrackState.Note
Only available if the track state container is not read-only
- Parameters:
mask – Mask indicating which track state components to allocate
iprevious – Index of the previous track state for linking
- Returns:
a track state proxy to the newly added track state
MultiTrajectory column management
MultiTrajectory can manage a set of common static columns, and dynamic columns that can be added at runtime.
This set of methods allows you to manage the dynamic columns.
-
template<typename T>
inline void addColumn(std::string_view key)
requires (!ReadOnly) Add a column to the
MultiTrajectory.Note
This takes a string argument rather than a hashed string to maintain compatibility with backends.
Note
Only available if the MultiTrajectory is not read-only
- Template Parameters:
T – Type of the column values to add
- Parameters:
key – the name of the column to be added
-
inline bool hasColumn(HashedString key) const
Check if a column with a key
keyexists.- Parameters:
key – Key to check for a column with
- Returns:
True if the column exists, false if not.
Public Types
-
using ConstTrackStateProxy = Acts::TrackStateProxy<Derived, MeasurementSizeMax, true>
Alias for the const version of a track state proxy, with the same backends as this container.
-
using Derived = derived_t
Type alias for derived multi-trajectory implementation.
-
using IndexType = TrackIndexType
The index type of the track state container.
-
using TrackStateProxy = Acts::TrackStateProxy<Derived, MeasurementSizeMax, false>
Alias for the mutable version of a track state proxy, with the same backends as this container.
Public Functions
-
inline void clear()
requires (!ReadOnly) Clear the
MultiTrajectory.Leaves the underlying storage untouched
Note
Only available if the MultiTrajectory is not read-only
-
inline IndexType size() const
Returns the number of track states contained.
- Returns:
The number of track states
Public Static Attributes
-
static constexpr IndexType kInvalid = kTrackIndexInvalid
Sentinel value that indicates an invalid index.
-
static constexpr unsigned int MeasurementSizeMax = kMeasurementSizeMax
Maximum number of measurement dimensions supported by this trajectory.
-
static constexpr bool ReadOnly = IsReadOnlyMultiTrajectory<Derived>::value
Flag indicating whether this multi-trajectory is read-only.
Friends
- friend class MultiTrajectory
- friend class AnyTrackStateProxy
- friend class detail_anytstate::TrackStateHandler
- friend class TrackStateProxy< Derived, MeasurementSizeMax, false >
- friend class TrackStateProxy< Derived, MeasurementSizeMax, true >
Component sharing
Acts::MultiTrajectory is designed so that components can be shared
between track states. This can be achieved using the
Acts::TrackStateProxy::shareFrom() can be used to set this up.
Shareable components are
predicted parameters and covariance
filtered parameters and covariance
smoothed parameters and covariance
jacobian
To illustrate why this can be useful, consider again Fig. 21, where \(S_2\) and \(S_3\) branch out from a shared \(S_1\). In this case, the predicted parameter vector and covariance, as well as the jacobian from \(S_1\to S_2\) and \(S_1 \to S_3\) will be identical. In this case, the combinatorial track finding will use the sharing functionality to share these components.
Attention
Sharing these components introduces cross-talk between track states, and this is intentional. If e.g. the predicted covariance is modified through either of the track states, the changes will be visible when accessed from the other track state as well.
Dynamic columns
Aside from the static properties that both the track states and the track have,
the EDM supports adding almost arbitrary additional information as
dynamic columns. The implementation of the dynamic column mechanism is given
by the backend, where the interface layer classes
Acts::MultiTrajectory and Acts::TrackContainer and associated
proxies only coordinate the creation, access and copying of dynamic columns.
The following illustrates the
usage of dynamic columns for Acts::TrackContainer, but usage on
Acts::MultiTrajectory is identical.
Assume you create a track container using some combination of backends (see Backends shipped with ACTS for information on the backends shipped with ACTS).
Acts::TrackContainer tc{/*...*/};
// add dynamic columns programmatically
tc.addColumn<float>("col_a");
tc.addColumn<uint8_t>("col_b");
Adding columns is only supported on mutable track containers, const track containers should contain the original dynamic columns from when they were created. It is up to the backend to implement recovering dynamic columns from e.g. input files.
Note
Which types are supported depends on the backend being used. See Backends shipped with ACTS for information on the backends shipped with ACTS, and which types they support.
With these dynamic columns registered, it is now possible to set and get values for these columns on tracks.
using namespace Acts::HashedStringLiterals;
auto track = tc.makeTrack();
// these two are equivalent
track.component<float, "col_a"_hash>() = 42.42;
track.component<float>("col_a"_hash) = 52.52;
std::cout << track.component<float, "col_a"_hash>() << std::endl; // prints: 52.52
Tip
The expression "col_a"_hash is a user-defined literal that internally calls
Acts::hashedString("col_a");
This literal is only available after
using namespace Acts::HashedStringLiterals;
The components are accessed by a hash of the name of the component. This hash
can be calculated from a string at compile-time, if the string is known at
compile time. The difference between the two component access signatures is
that in the first case, the hash of the component is guaranteed to be evaluated
at compile-time, since it is given to the component function as a template
argument. A third option is available to access components: see
Accessors.
Accessors
It can be inconvenient to have to write the full component access signature, especially if you want to access the same components repeatedly. An alternative are accessors. They encapsulate the type of the component, and the component name hash into an object:
// definition of the accessor with a type and the name of the component
Acts::ProxyAccessor<float> extra("extra");
// component access by calling it on a proxy
extra(track) = 42.2;
std::cout << extra(track) << std::endl; // prints 42.2
Tip
The same accessor also works for Acts::TrackStateProxy objects, as it shares
the same component access mechanism with Acts::TrackProxy.
The above accessor is a mutable accessor, meaning it can only be used with mutable proxy objects!
ConstTrackProxy<...> constTrack = /*...*/;
extra(constTrack); // this will give a compile error!
To access properties on const proxy objects, you need to use a dedicated accessor type:
Acts::ConstProxyAccessor<float> extraConst("extra");
std::cout << extraConst(constTrack) << std::endl; // prints 42.2
// using the const accessor on a mutable proxy also works
std::cout << extraConst(track) << std::endl; // prints 42.2
For both const and mutable proxy accessors you do not actually need a mutable reference, as the internal accessor state is not mutated after construction. You can safely use a static instance of these accessors to avoid constructing them over and over again:
template<TrackProxyConcept track_proxy_t>
void doSomething(track_proxy_t track, float value) {
// only created once, never changed
static const Acts::ProxyAccessor<float> extra("extra");
extra(track) = value;
}
Holders
The Acts::TrackContainer implements a mechanism to optionally own the
backends that it is constructed with. This is implemented using a holder
type, which is passed either as a template parameter, or deduced automatically.
Available default holders are:
Acts::detail::RefHolderwhich does not own the backendsActs::detail::ConstRefHolderwhich does not own the backends and does not permit mutations.Acts::detail::ValueHolderwhich owns the backends by value. This is auto-deduced if the backends are given as values or rvalue-references.
Other user-specified holders can also be used, for example, it is possible to use std::shared_ptr as a holder directly, like:
std::shared_ptr<Acts::VectorTrackContainer> vtc{
std::make_shared<Acts::VectorTrackContainer>()};
std::shared_ptr<Acts::VectorMultiTrajectory> mtj{
std::make_shared<Acts::VectorMultiTrajectory>()};
Acts::TrackContainer<Acts::VectorTrackContainer, Acts::VectorMultiTrajectory, std::shared_ptr>
tc{vtc, mtj};
How to create a track from scratch
Tracks can be created directly from the EDM interface. You start by creating or obtaining a mutable track container:
Acts::TrackContainer tc{Acts::VectorTrackContainer{}, Acts::VectorMutiTrajectory{}};
A single track can be added like this:
auto track = tc.makeTrack();
// set some properties
track.parameters() << 0.1_mm, 3_mm, 1/20_GeV, 0.2, 0.4, 25_mm;
track.setReferenceSurface(
Acts::Surface::makeSurface<Acts::PerigeeSurface>(Acts::Vector3::Zero()));
The track is still lacking track states. You can append track states to the track, which means that a track state is attached behind the outermost track state currently assigned.
auto ts1 = track.appendTrackState();
ts1.smoothed() << 0.4_um, 1_mm, 1/19_GeV, 0.21, 0.37, 40_ns;
//...
auto ts2 = track.appendTrackState();
ts2.smoothed() << 0.4_um, 1_mm, 1/19_GeV, 0.21, 0.37, 40_ns;
Note that this means that you have to create track state from the inside out! If you have to add track states from the outside in, you can still append them and reverse the track at the very end.
track.reverseTrackStates();
Track EDM backends
Backends shipped with ACTS
Transient vector backend
The transient vector backend implements the reference backend for the track EDM. It does not implement any persistency directly. The implementation of this backend for both track and track state containers uses separate classes for the mutable and const versions, in order to fully comply with const correctness. It also uses a common base class internally, which is however an implementation detail.
To build a track container with this backend, you can write
Acts::VectorMultiTrajectory mtj{};
Acts::VectorTrackContainer vtc{};
Acts::TrackContainer tc{vtc, mtj};
or
Acts::ConstVectorTrackContainer vtc{/* ... */};
Acts::ConstVectorMultiTrajectory mtj{/* ... */};
Acts::TrackContainer ctc{vtc, mtj};
Note
There are currently no restrictions on types that can be used as dynamic columns. Any type can be stored and retrieved back from the backend.
Keep in mind that the transient vector backend does not support persistency, meaning that there is no mechanism to serialize dynamic columns (or static columns for that matter) to disk and read them back in.
PODIO backend
The PODIO track EDM backend shipped with the library uses a custom PODIO-EDM
defined in edm.yml in the ACTS core repository.
The working model is this:
Mutable PODIO track and track state backends are created with a helper
Acts::MutablePodioTrackStateContainer tsc{helper}; Acts::MutablePodioTrackContainer ptc{helper};
A track container is built using these PODIO backend instances
Acts::TrackContainer tc{ptc, tsc};
The track container is used by some algorithm
tc.makeTrack(); // ...
The mutable backends released into a
podio::Framefor writing.ptc.releaseInto(frame); tsc.releaseInto(frame); // write frame
When reading, const track state and track PODIO backends are created from a
podio::Frameauto frame = /* read frame */; Acts::ConstPodioTrackStateContainer tsc{helper, frame}; Acts::ConstPodioTrackContainer ptc{helper, frame};
Note
The PODIO backend currently supports all types that can be written to a
podio::UserDataCollection for dynamic columns. At the time of writing these
are: float, double, int8_t, int16_t, int32_t, int64_t, uint8_t,
uint16_t, uint32_t, uint64_t.
In particular, it is not possible to write bool values directly. A workaround
is using uint8_t and making boolean expressions explicit.
Helper for Surfaces and SourceLinks
PODIO cannot directly store Surfaces and SourceLinks. The PODIO backends rely on a helper class
that implements the following interface:
-
class ConversionHelper
Helper interface for converting between ACTS and PODIO types.
Public Functions
-
virtual ~ConversionHelper() = default
-
inline virtual std::optional<Acts::SourceLink> identifierToSourceLink([[maybe_unused]] Identifier identifier) const
Convert identifier to source link.
- Parameters:
identifier – The identifier to convert
- Returns:
Source link for the identifier, or nullopt if not supported
-
virtual const Acts::Surface *identifierToSurface(Identifier identifier) const = 0
Convert identifier to surface.
- Parameters:
identifier – The identifier to convert
- Returns:
Pointer to the surface
-
inline virtual std::optional<Identifier> sourceLinkToIdentifier([[maybe_unused]] const Acts::SourceLink &sl) const
Convert source link to identifier.
- Parameters:
sl – The source link to convert
- Returns:
Identifier for the source link, or nullopt if not supported
-
inline virtual std::optional<ActsPodioEdm::TrackerHitLocal> sourceLinkToTrackerHitLocal([[maybe_unused]] const Acts::SourceLink &sourceLink) const
Convert source link to TrackerHitLocal.
- Parameters:
sourceLink – The source link to convert
- Returns:
TrackerHitLocal for the source link, or nullopt if not supported
-
virtual ~ConversionHelper() = default
Specifically, the PODIO backends will, before persisting and after reading,
consult the helper object to convert between an in-memory Surface and an
optional identifier. The identifier a 64-bit integer whose interpretation can
depend on the experiment, it could be a sensor index (hash in ATLAS) for
example.
If no identifier is returned, that means the surface is not expressible as an identifier, and it needs to be persisted directly, which is implemented centrally. In that case, the defining parameters of the surface are saved, and the object is rebuilt when reading. An example of this is in the case of a reference surface like a perigee surface that represents the beam axis, which is not commonly identified in the experiment geometry.
A similar mechanism is used for source links. Remember that
Acts::SourceLink is type-erased proxy object that stands for an
experiment-specific uncalibrated measurement. As such, the PODIO backend
cannot directly store these. For use with the PODIO backends, source links need
to be convertible to and from 64-bit integers, with the help of the helper
object, that can communicate with the experiment infrastructure.
How to build a backend
Both track and track state backends need to conform to respective concepts. Effectively, the backend has to allow for collection functionality, like getting the current size etc.
Further, the backend needs to respond to queries for properties of the elements, where the element is identified by an index.
The backend needs to flag itself as mutable or const, by specializing
template <typename T>
struct IsReadOnlyMultiTrajectory;
// or
template <typename T>
struct IsReadOnlyTrackContainer;
This informs the interface layer to permit or prevent mutable access.
Common between both track and track state backends is the component access. Here, the component is identified by a compile-time string hash of the component name, which the backend responds to by a type-erased mutable or const pointer. There is a hard requirement for the backend to return stable pointers here, as the interface layer expects this and exposes this in the API.
This can be accomplished like in the transient backend with a switch-statements like:
switch (key) {
case "previous"_hash:
return &m_previous[istate];
case "next"_hash:
return &m_next[istate];
case "predicted"_hash:
return &m_index[istate].ipredicted;
case "filtered"_hash:
return &m_index[istate].ifiltered;
case "smoothed"_hash:
return &m_index[istate].ismoothed;
case "projector"_hash:
return &m_projectors[instance.m_index[istate].iprojector];
case "measdim"_hash:
return &m_index[istate].measdim;
case "chi2"_hash:
return &m_index[istate].chi2;
case "pathLength"_hash:
return &m_index[istate].pathLength;
case "typeFlags"_hash:
return &m_index[istate].typeFlags;
default:
// handle dynamic columns
}
The default statement deals with Dynamic columns. For support
of dynamic columns, the backend needs to implement hasColumn_impl to return
if a column exists, mutable backends need to implement addColumn_impl which
adds a column with a type and a string name. copyDynamicFrom_impl and
ensureDynamicColumn_impl on mutable backends allows copying dynamic content
between container backends. dynamicKeys_impl returns an iterator pair that
informs the caller of which dynamic keys are registered. This is also used in
dynamic column copies.
Both backend types return parameter vectors and covariance matrices. This is
always done as Eigen maps, which have reference semantics into the backing
storage.
TrackContainer backend
Mutable & const
Get size
Reference parameter vector and covariance matrix access
Get if column exists
Get reference surface (returns
const Surface*)Get particle hypothesis (returns by-value, so allows on-the-fly creation)
Get dynamic keys
Type-erased component access
Mutable
Add and remove a track
Add column
Ensure dynamic columns, copy dynamic columns
Reserve number of entries
Set reference surface
Set particle hypothesis
Clear the container
MultiTrajectory (track state) backend
The track state container can share components.
This is implemented for the shareable components by the interface layer looking
up a component that stores an index into a separate
shareable-component-container. Then, functions exists which return Eigen maps
into the relevant backend storage based on the index looked up as a component
before.
The track state container also handles calibrated measurement in a packed
way. This is to say, that for \(N\) dimensional measurement, the backend can
store only the dimension \(N\) and then \(N\) numbers representing the measurement
vector and \(N\times N\) numbers for the associated covariance matrix. To enable
this, a mutable backend exposes allocateCalibrated_impl which accepts a track
state index and the measurement size, and ensures storage is available to hand
out a reference into associated backing storage. An example is the transient
vector backend, which stores the offset into measurement and covariance matrix
vector, and ensures its size is consistent.
In both cases above, the absence of the value can be indicated by setting the
indices to the sentinel value kInvalid. The backend also has query methods
that test if the index is invalid and return a boolean.
The track state container also stores SourceLinks, which are assigned by
value and returned by value, which allows the backend to unpack assigned source
links and repackage uncalibrated measurement references back into a source link
when returning.
Mutable & const
Get the calibrated measurement dimension (size)
Get uncalibrated source link
Get reference surface
Get parameter from parameter index
Get covariance from covariance index
Get jacobian from jacobian index
Get measurement vector given compile-time measurement dimension
Get measurement covariance matrix given compile-time measurement dimension
Check if an optional component is set
Get the container size
Type-erased component access
Get if column exists
Get dynamic keys
Mutable
Add a track state
Share track state components from another track state of the same container (otherwise no sharing is supported)
Unset an optional component
Clear the container
Add column
Ensure dynamic columns, copy dynamic columns
Set an uncalibrated source link that is passed by value
Set the reference surface
Glossary
- tip state
The state at the tip of a trajectory, usually the outermost track state, on the opposite end of the stem state.
- stem state
The state at the stem of a trajectory, meaning the innermost track state. The opposite end is the tip state.