Class Acts::TrackProxy

template<typename track_container_t, typename trajectory_t, template<typename> class holder_t, bool read_only = true>
class TrackProxy

Proxy class representing a single track.

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

Public Types

using ConstCovariance = typename detail_lt::Types<eBoundSize, true>::CovarianceMap
using ConstParameters = typename detail_lt::Types<eBoundSize, true>::CoefficientsMap
using ConstTrackProxy = TrackProxy<track_container_t, trajectory_t, holder_t, true>
using ConstTrackStateProxy = typename Trajectory::ConstTrackStateProxy
using Container = track_container_t
using Covariance = typename detail_lt::Types<eBoundSize, false>::CovarianceMap
using IndexType = typename Container::IndexType
using MutableTrackProxy = TrackProxy<track_container_t, trajectory_t, holder_t, false>
using Parameters = typename detail_lt::Types<eBoundSize, false>::CoefficientsMap
using TrackStateProxy = typename Trajectory::TrackStateProxy
using Trajectory = trajectory_t

Public Functions

inline TrackProxy(const MutableTrackProxy &other)

Copy constructor from a mutable track proxy.

This is always valid, either mutable to mutable or mutable to const

Parameters

other – the other track state proxy

inline ActsScalar absoluteMomentum() const

Get the absolute momentum of the tack.

Returns

The absolute track momentum

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline auto appendTrackState(TrackStatePropMask mask = TrackStatePropMask::All)

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.

Parameters

mask – The allocation prop mask for the new track state

Returns

The newly added track state

inline ActsScalar charge() const
template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline float &chi2()

Return a mutable reference to the chi squared Mutable version.

Returns

The chi squared

inline float chi2() const

Return the chi squared for the track.

Const version

Returns

The chi squared

template<typename T, HashedString key, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr T &component()

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, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr T &component(HashedString key)

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, bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline constexpr T &component(std::string_view key)

Retrieve a mutable reference to a component.

Note

This might hash the key at 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 key at 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

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

Return a reference to the track container backend, mutable version.

Returns

reference to the track container backend

inline const auto &container() const

Return a reference to the track container backend, const version.

Returns

reference to the track container backend

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

Copy the content of another track proxy into this one.

Template Parameters

track_proxy_t – the other track proxy’s type

Parameters

other – The the track proxy

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

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

Get the covariance of the track at the reference surface (e.g.

perigee). Mutable version

Returns

Proxy matrix for the covariance

inline bool hasReferenceSurface() const

Return whether a reference surface is associated to this track.

Returns

whether a surface exists or not

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 ActsScalar loc0() const

Access the loc0 parameter of the track at the reference surface.

Returns

The loc0 parameter

inline ActsScalar 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

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline unsigned int &nDoF()

Return a mutable reference to the number of degrees of freedom for the track.

Mutable version

Returns

The the number of degrees of freedom

inline unsigned int nDoF() const

Return the number of degrees of freedom for the track.

Const version

Returns

The number of degrees of freedom

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline unsigned int &nHoles()

Return a mutable reference to the number of holes for the track.

Mutable version

Returns

The number of holes

inline unsigned int nHoles() const

Return the number of measurements for the track.

Const version

Returns

The number of measurements

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline unsigned int &nMeasurements()

Return the number of measurements for the track.

Const version

Returns

The number of measurements

inline unsigned int nMeasurements() const

Return a mutable reference to the number of measurements for the track.

Mutable version

Returns

The number of measurements

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline unsigned int &nOutliers()

Return a mutable reference to the number of outliers for the track.

Mutable version

Returns

The number of outliers

inline unsigned int nOutliers() const

Return the number of outliers for the track.

Const version

Returns

The number of outliers

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline unsigned int &nSharedHits()

Return a mutable reference to the number of shared hits for the track.

Mutable version

Returns

The number of shared hits

inline unsigned int nSharedHits() const

Return the number of shared hits for the track.

Const version

Returns

The number of shared hits

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 TrackProxy &operator=(const MutableTrackProxy &other)

Copy assignment operator from mutable track proxy.

This is always valid, either mutable to mutable or mutable to const

Parameters

other – the other track state proxy

inline bool operator==(const TrackProxy &other) const

Equality operator with another track proxy Checks the container identity and the track index.

Returns

True if the track proxies refer to the same track

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

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

Get the parameters of the track at the reference surface (e.g.

perigee). Mutable version

Returns

Proxy vector for the parameters

inline ActsScalar phi() const

Access the phi parameter of the track at the reference surface.

Returns

The phi parameter

inline ActsScalar qOverP() const

Access the q/p (curvature) parameter of the track at the reference surface.

Returns

The q/p parameter

inline const Surface &referenceSurface() const

Get the reference surface of the track (e.g.

the perigee)

Returns

the reference surface

template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline void setReferenceSurface(std::shared_ptr<const Surface> srf)

Set a new reference surface for this track.

Parameters

srf – The surface to set

inline ActsScalar theta() const

Access the theta parameter of the track at the reference surface.

Returns

The theta parameter

inline ActsScalar 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 by value

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

Get a mutable reference to the tip index, i.e.

the entry point into the track container

Returns

mutable reference to the tip index

inline auto trackStates() const

Get a range over the track states of this track.

Return value is compatible with range based for loop. Const version

Returns

Track state range to iterate over

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

Get a range over the track states of this track.

Return value is compatible with range based for loop. Mutable version

Returns

Track state range to iterate over

inline ActsScalar transverseMomentum() const

Get the transverse momentum of the track.

Returns

The track transverse momentum value

inline Vector3 unitDirection() const

Get a unit vector along the track direction at the reference surface.

Returns

The direction unit vector

Public Static Attributes

static constexpr IndexType kInvalid = Container::kInvalid
static constexpr bool ReadOnly = read_only

Friends

friend class TrackProxy