File TrackProxy.hpp
-
namespace Acts
Note
This file is foreseen for the
Geometry
module to replaceExtent
-
template<typename track_container_t, typename trajectory_t, template<typename> class holder_t, bool read_only = true>
class TrackProxy - #include <Acts/EventData/TrackProxy.hpp>
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
Get the charge of the tack.
Note
this depends on the charge hypothesis
- Returns
The absolute track momentum
-
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, 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, 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>
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, 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>
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, bool copyTrackStates = true) 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
copyTrackStates – Copy the track state sequence from
other
-
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 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 Vector3 direction() const
Get a unit vector along the track direction at the reference surface.
- Returns
The direction unit vector
-
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
Return a mutable reference to the number of shared hits for the track.
Mutable version
- Returns
The number of shared hits
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
-
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 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 ParticleHypothesis particleHypothesis() const
Get the particle hypothesis.
- Returns
the particle hypothesis
-
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 reverseTrackStates() 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
This is dangerous with branching track state sequences, as it will break them
-
template<bool RO = ReadOnly, typename = std::enable_if_t<!RO>>
inline void setParticleHypothesis(const ParticleHypothesis &particleHypothesis) Set a new particle hypothesis for this track.
- Parameters
particleHypothesis – The particle hypothesis to set
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
-
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 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 auto trackStatesReversed() 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 auto trackStatesReversed() 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
-
inline ActsScalar transverseMomentum() const
Get the transverse momentum of the track.
- Returns
The track transverse momentum value
Public Static Attributes
-
static constexpr bool ReadOnly = read_only
Private Functions
-
inline TrackProxy(detail_tc::ConstIf<TrackContainer<Container, Trajectory, holder_t>, ReadOnly> &container, IndexType itrack)
Private Members
-
detail_lt::TransitiveConstPointer<detail_tc::ConstIf<TrackContainer<Container, Trajectory, holder_t>, ReadOnly>> m_container
Friends
- friend class TrackProxy
-
template<typename track_container_t, typename trajectory_t, template<typename> class holder_t, bool read_only = true>