Namespace Acts::Concepts

namespace Acts::Concepts

Typedefs

using detected_or = detail::detector<Default, void, Op, Args...>

Helper which invokes the detector with a default type, and resolves to the type.

Template Parameters
  • Default – The type to resolve to if Op<Args...> does not resolve.

  • Op – The operation

  • Args – The argument to the operation

using detected_t = typename detail::detector<detail::nonesuch, void, Op, Args...>::type

This type calls into the detector (same as is_detected) but it extracts the return type of Op<Args...>.

Template Parameters
  • Op – The operation

  • Args – The arguments to the operation

using is_detected = typename detail::detector<detail::nonesuch, void, Op, Args...>::value_t

This type ties together the detection idiom.

It instantiates the detector template with the Op and Args and resolves to the exact value type. In essence, if Op<Args...> succeeds, this will evaluate to std::true_type, and if not, it will evaluate to std::false_type.

Template Parameters
  • Op – The operation to test

  • Args – The arguments to the operation

using is_detected_convertible = std::is_convertible<detected_t<Op, Args...>, To>

This evaluates Op inside the detector, and checks whether the resolved type is convertible to To.

Template Parameters
  • To – The type to check convertibility to.

  • Op – The operation

  • Args – The arguments to the operation

using is_detected_exact = std::is_same<Expected, detected_t<Op, Args...>>

This invokes detected_t, and checks whether its result matches Expected.

Template Parameters
  • Expected – The expected result of the operation.

  • Op – The operation

  • Args – The arguments to the operation

using ReturnTypeAbsoluteMomentum = decltype(std::declval<T>().absoluteMomentum())
using ReturnTypeCharge = decltype(std::declval<T>().charge())
using ReturnTypeCovariance = decltype(std::declval<T>().covariance())
using ReturnTypeFourPosition = decltype(std::declval<T>().fourPosition())
using ReturnTypeFourPositionFromContext = decltype(std::declval<T>().fourPosition(std::declval<GeometryContext>()))
using ReturnTypeParameters = decltype(std::declval<T>().parameters())
using ReturnTypePosition = decltype(std::declval<T>().position())
using ReturnTypePositionFromContext = decltype(std::declval<T>().position(std::declval<GeometryContext>()))
using ReturnTypeReferenceSurface = decltype(std::declval<T>().referenceSurface())
using ReturnTypeTime = decltype(std::declval<T>().time())
using ReturnTypeUnitDirection = decltype(std::declval<T>().unitDirection())
using TypeCovarianceMatrix = typename T::CovarianceMatrix
using TypeParametersVector = typename T::ParametersVector
using TypeScalar = typename T::Scalar

Variables

template<typename parameters_t>
constexpr bool BoundTrackParametersConcept = BoundTrackParametersConceptImpl<parameters_t>::value
template<class To, template<class...> class Op, class ...Args>
constexpr bool converts_to = is_detected_convertible<To, Op, Args...>::value

Alias to conversion check, which also extracts the constexpr boolean value.

Template Parameters
  • To – The type to check convertibility to.

  • Op – The operation

  • Args – The arguments to the operation.

template<bool... Bs>
constexpr bool disallow = not require<Bs...>

Alias for the negation of a require.

This is essentially a NOT ANY test.

Template Parameters

Bs – The booleans.

template<bool... Bs>
constexpr bool either = std::disjunction<std::bool_constant<Bs>...>::value

Helper which forms the logical OR of its arguments.

Converts to std::bool_constant.

Template Parameters

Bs – The booleans to combine.

template<template<class...> class Op, class ...Args>
constexpr bool exists = is_detected<Op, Args...>::value

Alias to is_detected which unpacks the constexpr boolean value.

Template Parameters
  • Op – The operation

  • Args – The arguments to the operation.

template<typename parameters_t>
constexpr bool FreeTrackParametersConcept = FreeTrackParametersConceptImpl<parameters_t>::value
template<typename T, template<class...> class M, typename V>
constexpr bool has_member = identical_to<V, M, T>

Helper to assert if a member of a given type exists.

Basically only calls into identical_to but is nicer to read.

Template Parameters
  • T – The type to check existence of member on.

  • M – The member type trait

  • V – The type that the member is supposed to have.

template<typename T, typename R, template<class...> class M, typename ...Arguments>
constexpr bool has_method = M<T, R, Arguments...>::template tv<T>::value

Helper which evaluates whether the type T has a method with a given signature.

Template Parameters
  • T – The type to check on. This can contain a const qualifier if you want to check on that.

  • R – The return type

  • M – The method trait, as generated by METHOD_TRAIT

  • Arguments – The argument types that make up the signature.

template<class Exact, template<class...> class Op, class ...Args>
constexpr bool identical_to = is_detected_exact<Exact, Op, Args...>::value

Unpacks the constexpr boolean value from is_detected_exact

Template Parameters
  • Exact – The type to check identity against

  • Op – The operation

  • Args – The arguments to the operation.

template<bool... Bs>
constexpr bool require = std::conjunction<std::bool_constant<Bs>...>::value

Define some sort of “Domain Specific Language” to declare concepts a little more naturally.

These are taken from https://izzys.casa/2016/09/implementing-concepts-in-cxx/ Helper which combines a set of predicates (constexpr bools) with a logical AND. Converts to std::bool_constant.

Template Parameters

Bs – The booleans to combine

template<typename T>
struct BoundTrackParametersConceptImpl
#include <Acts/EventData/TrackParametersConcept.hpp>

Public Static Attributes

static constexpr bool hasMethodAbsoluteMomentum = identical_to<TypeScalar<T>, ReturnTypeAbsoluteMomentum, const T>
static constexpr bool hasMethodCharge = identical_to<TypeScalar<T>, ReturnTypeCharge, const T>
static constexpr bool hasMethodCovariance = std::is_convertible_v<ReturnTypeCovariance<T>, std::optional<BoundSymMatrix>>
static constexpr bool hasMethodFourPositionFromContext = identical_to<Vector4, ReturnTypeFourPositionFromContext, const T>
static constexpr bool hasMethodParameters = std::is_convertible_v<ReturnTypeParameters<T>, BoundVector>
static constexpr bool hasMethodPositionFromContext = identical_to<Vector3, ReturnTypePositionFromContext, const T>
static constexpr bool hasMethodReferenceSurface = identical_to<const Surface&, ReturnTypeReferenceSurface, const T>
static constexpr bool hasMethodTime = identical_to<TypeScalar<T>, ReturnTypeTime, const T>
static constexpr bool hasMethodUnitDirection = identical_to<Vector3, ReturnTypeUnitDirection, const T>
static constexpr bool hasTypeCovarianceMatrix = exists<TypeCovarianceMatrix, const T>
static constexpr bool hasTypeParametersVector = exists<TypeParametersVector, const T>
static constexpr bool hasTypeScalar = exists<TypeScalar, const T>
static constexpr bool value = require<hasTypeScalar, hasTypeParametersVector, hasTypeCovarianceMatrix, hasMethodParameters, hasMethodCovariance, hasMethodFourPositionFromContext, hasMethodPositionFromContext, hasMethodTime, hasMethodUnitDirection, hasMethodAbsoluteMomentum, hasMethodCharge, hasMethodReferenceSurface>
template<typename T>
struct FreeTrackParametersConceptImpl
#include <Acts/EventData/TrackParametersConcept.hpp>

Public Static Attributes

static constexpr bool hasMethodAbsoluteMomentum = identical_to<TypeScalar<T>, ReturnTypeAbsoluteMomentum, const T>
static constexpr bool hasMethodCharge = identical_to<TypeScalar<T>, ReturnTypeCharge, const T>
static constexpr bool hasMethodCovariance = std::is_convertible_v<ReturnTypeCovariance<T>, std::optional<FreeSymMatrix>>
static constexpr bool hasMethodFourPosition = identical_to<Vector4, ReturnTypeFourPosition, const T>
static constexpr bool hasMethodParameters = std::is_convertible_v<ReturnTypeParameters<T>, FreeVector>
static constexpr bool hasMethodPosition = identical_to<Vector3, ReturnTypePosition, const T>
static constexpr bool hasMethodTime = identical_to<TypeScalar<T>, ReturnTypeTime, const T>
static constexpr bool hasMethodUnitDirection = identical_to<Vector3, ReturnTypeUnitDirection, const T>
static constexpr bool hasTypeCovarianceMatrix = exists<TypeCovarianceMatrix, const T>
static constexpr bool hasTypeParametersVector = exists<TypeParametersVector, const T>
static constexpr bool hasTypeScalar = exists<TypeScalar, const T>
static constexpr bool value = require<hasTypeScalar, hasTypeParametersVector, hasTypeCovarianceMatrix, hasMethodParameters, hasMethodCovariance, hasMethodFourPosition, hasMethodPosition, hasMethodTime, hasMethodUnitDirection, hasMethodAbsoluteMomentum, hasMethodCharge>
namespace Linearizer

Typedefs

using propagator_t = typename T::Propagator_t
using state_t = typename T::State

Functions

METHOD_TRAIT(linTrack_t, linearizeTrack)
template<typename S>
struct LinearizerConcept
#include <Acts/Vertexing/LinearizerConcept.hpp>

Public Static Attributes

static constexpr bool linTrack_exists = has_method<const S, Result<LinearizedTrack>, linTrack_t, constBoundTrackParameters&, constVector4&, constActs::GeometryContext&, constActs::MagneticFieldContext&, typename S::State&>
static constexpr bool propagator_exists = exists<propagator_t, S>
static constexpr bool state_exists = exists<state_t, S>
static constexpr bool value = require<linTrack_exists, propagator_exists, state_exists>
namespace SourceLinkAccessor

Typedefs

using container_t = typename T::Container
using iterator_t = typename T::Iterator
using key_t = typename T::Key
using value_t = typename T::Value

Functions

METHOD_TRAIT(count_t, count)
METHOD_TRAIT(range_t, range)
METHOD_TRAIT(at_t, at)
template<typename S>
struct SourceLinkAccessorConcept
#include <Acts/TrackFinding/SourceLinkAccessorConcept.hpp>

Public Static Attributes

static constexpr bool at_exists = has_method<const S, const typename S::Value&, at_t, const typename S::Iterator&>
static constexpr bool container_exists = exists<container_t, S>
static constexpr bool container_pointer_exists = std::is_same_v<std::decay_t<decltype(*(std::declval<S>().container))>, container_t<S>>
static constexpr bool count_exists = has_method<const S, size_t, count_t, const typename S::Key&>
static constexpr bool iterator_exists = exists<iterator_t, S>
static constexpr bool key_exists = exists<key_t, S>
static constexpr bool range_exists = has_method<const S, std::pair<typename S::Iterator, typename S::Iterator>, range_t, const typename S::Key&>
static constexpr bool value = require<container_exists, key_exists, value_exists, container_pointer_exists, iterator_exists, count_exists, range_exists, at_exists>
static constexpr bool value_exists = exists<value_t, S>
namespace Stepper

Typedefs

using bound_state_t = typename T::BoundState
using cov_t = decltype(std::declval<T>().cov)
using cov_transport_t = decltype(std::declval<T>().covTransport)
using covariance_t = typename T::Covariance
using curvilinear_state_t = typename T::CurvilinearState
using jacobian_t = typename T::Jacobian
using nav_dir_t = decltype(std::declval<T>().navDir)
using path_accumulated_t = decltype(std::declval<T>().pathAccumulated)
using state_t = typename T::State
using step_size_t = decltype(std::declval<T>().stepSize)

Functions

METHOD_TRAIT(reset_state_t, resetState)
METHOD_TRAIT(get_field_t, getField)
METHOD_TRAIT(position_t, position)
METHOD_TRAIT(direction_t, direction)
METHOD_TRAIT(momentum_t, momentum)
METHOD_TRAIT(charge_t, charge)
METHOD_TRAIT(time_t, time)
METHOD_TRAIT(overstep_t, overstepLimit)
METHOD_TRAIT(bound_state_method_t, boundState)
METHOD_TRAIT(curvilinear_state_method_t, curvilinearState)
METHOD_TRAIT(update_t, update)
METHOD_TRAIT(covariance_transport_bound_t, transportCovarianceToBound)
METHOD_TRAIT(covariance_transport_curvilinear_t, transportCovarianceToCurvilinear)
METHOD_TRAIT(step_t, step)
METHOD_TRAIT(update_surface_status_t, updateSurfaceStatus)
METHOD_TRAIT(set_step_size_t, setStepSize)
METHOD_TRAIT(get_step_size_t, getStepSize)
METHOD_TRAIT(release_step_size_t, releaseStepSize)
METHOD_TRAIT(output_step_size_t, outputStepSize)

Variables

template<typename S>
constexpr bool StepperStateConcept = require<has_member<S, cov_transport_t, bool>, has_member<S, cov_t, BoundSymMatrix>, has_member<S, nav_dir_t, NavigationDirection>, has_member<S, path_accumulated_t, double>>
template<typename S, typename state = typename S::State>
struct StepperConcept
#include <Acts/Propagator/StepperConcept.hpp>

Public Static Attributes

static constexpr bool bound_state_exists = exists<bound_state_t, S>
static constexpr bool bound_state_method_exists = has_method<const S, Result<typename S::BoundState>, bound_state_method_t, state&, const Surface&, bool>
static constexpr bool charge_exists = has_method<const S, double, charge_t, const state&>
static constexpr bool covariance_exists = exists<covariance_t, S>
static constexpr bool covariance_transport_exists = require<has_method<const S, void, covariance_transport_curvilinear_t, state&>, has_method<const S, void, covariance_transport_bound_t, state&, const Surface&>>
static constexpr bool curvilinear_state_exists = exists<curvilinear_state_t, S>
static constexpr bool curvilinear_state_method_exists = has_method<const S, typename S::CurvilinearState, curvilinear_state_method_t, state&, bool>
static constexpr bool direction_exists = has_method<const S, Vector3, direction_t, const state&>
static constexpr bool get_field_exists = has_method<const S, Result<Vector3>, get_field_t, state&, const Vector3&>
static constexpr bool get_step_size_exists = has_method<const S, double, get_step_size_t, const state&, ConstrainedStep::Type>
static constexpr bool jacobian_exists = exists<jacobian_t, S>
static constexpr bool momentum_exists = has_method<const S, double, momentum_t, const state&>
static constexpr bool output_step_size_exists = has_method<const S, std::string, output_step_size_t, const state&>
static constexpr bool overstep_exists = has_method<const S, double, overstep_t, const state&>
static constexpr bool position_exists = has_method<const S, Vector3, position_t, const state&>
static constexpr bool release_step_size_exists = has_method<const S, void, release_step_size_t, state&>
static constexpr bool reset_state_exists = has_method<const S, void, reset_state_t, state&, const BoundVector&, const BoundSymMatrix&, const Surface&, const NavigationDirection, const double>
static constexpr bool set_step_size_exists = has_method<const S, void, set_step_size_t, state&, double, ConstrainedStep::Type, bool>
static constexpr bool state_exists = exists<state_t, S>
static constexpr bool time_exists = has_method<const S, double, time_t, const state&>
static constexpr bool update_method_exists = require<has_method<const S, void, update_t, state&, const FreeVector&, const BoundVector&, const BoundSymMatrix&, const Surface&>, has_method<const S, void, update_t, state&, const Vector3&, const Vector3&, double, double>>
static constexpr bool update_surface_exists = has_method<const S, Intersection3D::Status, update_surface_status_t, state&, const Surface&, const BoundaryCheck&, LoggerWrapper>
static constexpr bool value = require<state_exists, jacobian_exists, covariance_exists, bound_state_exists, curvilinear_state_exists, get_field_exists, position_exists, direction_exists, momentum_exists, charge_exists, time_exists, bound_state_method_exists, curvilinear_state_method_exists, update_method_exists, covariance_transport_exists, update_surface_exists, set_step_size_exists, release_step_size_exists, output_step_size_exists>
namespace VertexFinder

Typedefs

using state_t = typename T::State

Functions

METHOD_TRAIT(find_t, find)
template<typename S>
struct VertexFinderConcept
#include <Acts/Vertexing/VertexFinderConcept.hpp>

Public Static Attributes

static constexpr bool find_exists = has_method<const S, Result<std::vector<Vertex<typename S::InputTrack_t>>>, find_t, const std::vector<const typename S::InputTrack_t*>&, constVertexingOptions<typename S::InputTrack_t>&, typename S::State&>
static constexpr bool state_exists = exists<state_t, S>
static constexpr bool value = require<state_exists, find_exists>
namespace VertexFitter

Typedefs

using linearizer_t = typename T::Linearizer_t
using propagator_t = typename T::Propagator_t
using state_t = typename T::State
using track_t = typename T::InputTrack_t

Functions

METHOD_TRAIT(fit_t, fit)
template<typename S>
struct VertexFitterConcept
#include <Acts/Vertexing/VertexFitterConcept.hpp>

Public Static Attributes

static constexpr bool fit_exists = has_method<const S, Result<Vertex<typename S::InputTrack_t>>, fit_t, const std::vector<const typename S::InputTrack_t*>&, const typename S::Linearizer_t&, constVertexingOptions<typename S::InputTrack_t>&, typename S::State&>
static constexpr bool linearizer_exists = exists<linearizer_t, S>
static constexpr bool propagator_exists = exists<propagator_t, S>
static constexpr bool state_exists = exists<state_t, S>
static constexpr bool track_exists = exists<track_t, S>
static constexpr bool value = require<fit_exists, track_exists, propagator_exists, linearizer_exists, state_exists>