Class Acts::TrackContainer

template<typename track_container_t, typename traj_t, template<typename> class holder_t = detail::RefHolder>
class TrackContainer

Track container interface class.

This type represents a collections of tracks. It uses a backend to store bothe 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

Public Types

using ConstTrackProxy = Acts::TrackProxy<track_container_t, traj_t, holder_t, true>
using IndexType = MultiTrajectoryTraits::IndexType
using TrackProxy = Acts::TrackProxy<track_container_t, traj_t, holder_t, false>

Public Functions

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

template<template<typename> class H = holder_t, typename = std::enable_if_t<detail::is_same_template<H, detail::RefHolder>::value>>
inline TrackContainer(track_container_t &container, traj_t &traj)

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

template<template<typename> class H = holder_t, bool RO = (IsReadOnlyTrackContainer<track_container_t>::value && IsReadOnlyMultiTrajectory<traj_t>::value), typename = std::enable_if_t<detail::is_same_template<H, detail::ConstRefHolder>::value && RO>>
inline TrackContainer(const track_container_t &container, const traj_t &traj)

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

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

Add a dymanic column to the track container.

Parameters

key – the name of the column to be added

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

Add a track to the container.

Note this only creates the logical track and allocates memory. You can combine this with getTrack to obtain a track proxy

Returns

the index to the newly added track

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

Get a mutable iterator to the first track in the container.

Returns

a mutable iterator to the first track

inline auto begin() const

Get an const iterator to the first track in the container.

Returns

a const iterator to the first track

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline auto &container()

Get a mutable reference to the track container backend.

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

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

Get a past-the-end iterator for this container.

Returns

a past-the-end iterator

inline auto end() const

Get a past-the-end iterator for this container.

Returns

a past-the-end iterator

template<typename other_track_container_t, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline void ensureDynamicColumns(const other_track_container_t &other)

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

Template Parameters

other_track_container_t – Type of the other track container

Parameters

other – The other track 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

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline TrackProxy getTrack(IndexType itrack)

Get a mutable track proxy for a track index.

Parameters

itrack – the track index in the container

Returns

A mutable track proxy for the index

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

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

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline void removeTrack(IndexType itrack)

Remove a track at index itrack from the container.

Note

This invalidates all track proxies!

Parameters

itrack – The index of the track to remmove

inline constexpr IndexType size() const

Get the size of the track container.

Returns

the sixe

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline auto &trackStateContainer()

Get a mutable reference to the track state container backend.

Returns

a mutable reference to the backend

inline const auto &trackStateContainer() const

Get a const reference to the track state container backend.

Returns

a const reference to the backend

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline auto &trackStateContainerHolder()

Retrieve the holder of the track state container.

Returns

The track state container including it’s holder

inline const auto &trackStateContainerHolder() const

Retrieve the holder of the track state container.

Returns

The track state container including it’s holder

Public Static Attributes

static constexpr IndexType kInvalid = MultiTrajectoryTraits::kInvalid
static constexpr bool ReadOnly = IsReadOnlyTrackContainer<track_container_t>::value
static constexpr bool TrackStateReadOnly = IsReadOnlyMultiTrajectory<traj_t>::value