File CombinatorialKalmanFilter.hpp¶
-
namespace Acts
Set the Geometry Context PLUGIN.
Set the Calibration Context PLUGIN.
Convenience functions to ease creation of and Acts::InterpolatedMaterialMap and to avoid code duplication.
Set the Mangetic Field Context PLUGIN.
Convenience functions to ease creation of and Acts::InterpolatedBFieldMap and to avoid code duplication.
Currently implemented for the two most common formats: rz and xyz.
-
template<typename propagator_t>
class CombinatorialKalmanFilter - #include <Acts/TrackFinding/CombinatorialKalmanFilter.hpp>
Combinatorial Kalman filter to find tracks.
The CombinatorialKalmanFilter contains an Actor and a Sequencer sub-class. The Sequencer has to be part of the Navigator of the Propagator in order to initialize and provide the measurement surfaces.
- tparam propagator_t
Type of the propagator
The Actor is part of the Propagation call and does the Kalman update and eventually the smoothing. Updater, Smoother and Calibrator are given to the Actor for further use:
The Updater is the implemented kalman updater formalism, it runs via a visitor pattern through the measurements.
The Smoother is called at the end of the filtering (track finding) by the Actor.
Measurements are not required to be ordered for the CombinatorialKalmanFilter, measurement ordering needs to be figured out by the navigation of the propagator.
The void components are provided mainly for unit testing.
Public Functions
-
CombinatorialKalmanFilter() = delete
Default constructor is deleted.
-
inline CombinatorialKalmanFilter(propagator_t pPropagator)
Constructor from arguments.
-
template<typename source_link_accessor_t, typename start_parameters_container_t, typename parameters_t = BoundTrackParameters>
inline std::vector<Result<CombinatorialKalmanFilterResult>> findTracks(const typename source_link_accessor_t::Container &sourcelinks, const start_parameters_container_t &initialParameters, const CombinatorialKalmanFilterOptions<source_link_accessor_t> &tfOptions) const Combinatorial Kalman Filter implementation, calls the the Kalman filter and smoother.
Note
The input measurements are given in the form of
SourceLinks
. It’scalibrator_t's
job to turn them into calibrated measurements used in the track finding.- Template Parameters
source_link_accessor_t – Type of the source link accessor
start_parameters_container_t – Type of the initial parameters container
calibrator_t – Type of the source link calibrator
measurement_selector_t – Type of the measurement selector
parameters_t – Type of parameters used for local parameters
- Parameters
sourcelinks – The fittable uncalibrated measurements
initialParameters – The initial track parameters
tfOptions – CombinatorialKalmanFilterOptions steering the track finding
- Returns
a container of track finding result for all the initial track parameters
Private Types
Private Members
-
propagator_t m_propagator¶
The propgator for the transport and material update.
-
template<typename source_link_accessor_t, typename parameters_t>
class Aborter¶ Public Types
-
using action_type = Actor<source_link_accessor_t, parameters_t>¶
Broadcast the result_type.
Public Functions
-
template<typename propagator_state_t, typename stepper_t, typename result_t>
inline bool operator()(propagator_state_t&, const stepper_t&, const result_t &result) const¶
-
using action_type = Actor<source_link_accessor_t, parameters_t>¶
-
template<typename source_link_accessor_t, typename parameters_t>
class Actor¶ Propagator Actor plugin for the CombinatorialKalmanFilter.
The CombinatorialKalmanFilter Actor does not rely on the measurements to be sorted along the track.
- tparam source_link_accessor_t
The type of source link accessor
- tparam parameters_t
The type of parameters used for “local” paremeters.
Public Types
-
using BoundState = std::tuple<parameters_t, BoundMatrix, double>¶
-
using CurvilinearState = std::tuple<CurvilinearTrackParameters, BoundMatrix, double>¶
-
using result_type = CombinatorialKalmanFilterResult¶
Broadcast the result_type.
-
using SourceLinkContainer = typename source_link_accessor_t::Container¶
-
using TipState = CombinatorialKalmanFilterTipState¶
Public Functions
-
inline size_t addNonSourcelinkState(const TrackStatePropMask &stateMask, const BoundState &boundState, result_type &result, bool isSensitive, size_t prevTip = SIZE_MAX, LoggerWrapper logger = getDummyLogger()) const¶
CombinatorialKalmanFilter actor operation : add hole or material track state.
- Parameters
stateMask – The bitmask that instructs which components to allocate
boundState – The bound state on current surface
result – is the mutable result state object and which to leave invalid
isSensitive – The surface is sensitive or passive
prevTip – The index of the previous state
logger – The logger wrapper
- Returns
The tip of added state
-
inline void createSourceLinkTrackStates(const Acts::GeometryContext &gctx, const Surface *surface, result_type &result, const BoundState &boundState, size_t prevTip) const¶
Create and fill track states for all source links.
- Parameters
gctx – The current geometry context
surface – The surface currently being processed
result – Reference to the result struct of the actor
boundState – Bound state from the propagation on this surface
prevTip – Index pointing at previous trajectory state (i.e. tip)
-
template<typename propagator_state_t, typename stepper_t>
inline Result<void> filter(const Surface *surface, propagator_state_t &state, const stepper_t &stepper, result_type &result) const¶ CombinatorialKalmanFilter actor operation :
filtering for all measurement(s) on surface
store selected track states in multiTrajectory
update propagator state to the (last) selected track state
- Template Parameters
propagator_state_t – Type of the Propagagor state
stepper_t – Type of the stepper
- Parameters
surface – The surface where the update happens
state – The mutable propagator state object
stepper – The stepper in use
result – The mutable result state object
-
template<typename propagator_state_t, typename stepper_t>
inline Result<void> finalize(propagator_state_t &state, const stepper_t &stepper, result_type &result) const¶ Kalman actor operation : finalize.
- Template Parameters
propagator_state_t – is the type of Propagagor state
stepper_t – Type of the stepper
- Parameters
state – is the mutable propagator state object
stepper – The stepper in use
result – is the mutable result state object
-
template<typename propagator_state_t, typename stepper_t>
inline void materialInteractor(const Surface *surface, propagator_state_t &state, stepper_t &stepper, const MaterialUpdateStage &updateStage = fullUpdate) const¶ CombinatorialKalmanFilter actor operation : material interaction.
- Template Parameters
propagator_state_t – is the type of Propagagor state
stepper_t – Type of the stepper
- Parameters
surface – The surface where the material interaction happens
state – The mutable propagator state object
stepper – The stepper in use
updateStage – The materal update stage
-
template<typename propagator_state_t, typename stepper_t>
inline void operator()(propagator_state_t &state, const stepper_t &stepper, result_type &result) const¶ CombinatorialKalmanFilter actor operation.
- Template Parameters
propagator_state_t – Type of the Propagagor state
stepper_t – Type of the stepper
- Parameters
state – is the mutable propagator state object
stepper – is the stepper in use
result – is the mutable result state object
-
inline Result<void> processSelectedTrackStates(const Acts::GeometryContext &gctx, std::vector<MultiTrajectory::TrackStateProxy>::const_iterator begin, std::vector<MultiTrajectory::TrackStateProxy>::const_iterator end, result_type &result, bool isOutlier, const TipState &prevTipState, size_t &nBranchesOnSurface, LoggerWrapper logger) const¶
Handle the list of selected track states.
- Parameters
gctx – The current geometry context
begin – The start iterator for selected track states
end – The end iterator for selected track states
result – Reference to the actor result struct
isOutlier – If this track state is a single outlier one
prevTipState – Tip state prior to this surface
nBranchesOnSurface – [inout] Number of branches on surface, will be updated
logger – A logging instance
-
template<typename propagator_state_t, typename stepper_t>
inline void reset(propagator_state_t &state, stepper_t &stepper, result_type &result) const¶ Kalman actor operation : reset propagation.
- Template Parameters
propagator_state_t – Type of Propagagor state
stepper_t – Type of the stepper
- Parameters
state – is the mutable propagator state object
stepper – is the stepper in use
result – is the mutable result state object
Public Members
-
bool energyLoss = true¶
Whether to consider energy loss.
-
CombinatorialKalmanFilterExtensions m_extensions¶
-
source_link_accessor_t m_sourcelinkAccessor¶
The source link accesor.
-
bool multipleScattering = true¶
Whether to consider multiple scattering.
-
bool smoothing = true¶
Whether to run smoothing to get fitted parameter.
-
SurfaceReached targetReached¶
The Surface being targeted.
-
struct CombinatorialKalmanFilterExtensions¶
- #include <Acts/TrackFinding/CombinatorialKalmanFilter.hpp>
Extension struct which holds the delegates to customize the CKF behavior.
Public Types
-
using BranchStopper = Delegate<bool(const CombinatorialKalmanFilterTipState&)>¶
-
using candidate_container_t = std::vector<MultiTrajectory::TrackStateProxy>¶
-
using MeasurementSelector = Delegate<Result<std::pair<candidate_container_t::iterator, candidate_container_t::iterator>>(candidate_container_t &trackStates, bool&, LoggerWrapper)>¶
Public Functions
-
inline CombinatorialKalmanFilterExtensions()¶
Default constructor which connects the default void components.
Public Members
-
BranchStopper branchStopper¶
-
KalmanFitterExtensions::Calibrator calibrator¶
The Calibrator is a dedicated calibration algorithm that allows to calibrate measurements using track information, this could be e.g.
sagging for wires, module deformations, etc.
-
MeasurementSelector measurementSelector¶
The measurement selector is called during the filtering by the Actor.
-
KalmanFitterExtensions::Smoother smoother¶
The smoother back-propagates measurement information along the track.
-
KalmanFitterExtensions::Updater updater¶
The updater incorporates measurement information into the track parameters.
Private Static Functions
-
static inline bool voidBranchStopper(const CombinatorialKalmanFilterTipState &tipState)¶
Default branch stopper which will never stop.
- Parameters
tipState – The tip state to decide whether to stop (unused)
- Returns
false
-
static inline Result<std::pair<std::vector<MultiTrajectory::TrackStateProxy>::iterator, std::vector<MultiTrajectory::TrackStateProxy>::iterator>> voidMeasurementSelector(std::vector<MultiTrajectory::TrackStateProxy> &candidates, bool &isOutlier, LoggerWrapper logger)¶
Default measurement selector which will return all measurements.
- Parameters
candidates – Measurement track state candidates
isOutlier – Output variable indicating whether the returned state is an outlier (unused)
logger – A logger instance
-
using BranchStopper = Delegate<bool(const CombinatorialKalmanFilterTipState&)>¶
-
template<typename source_link_accessor_t>
struct CombinatorialKalmanFilterOptions¶ - #include <Acts/TrackFinding/CombinatorialKalmanFilter.hpp>
Combined options for the combinatorial Kalman filter.
- tparam source_link_accessor_t
Source link accessor type, should be semiregular.
Public Types
-
using SourceLinkAccessor = source_link_accessor_t¶
Public Functions
-
inline CombinatorialKalmanFilterOptions(const GeometryContext &gctx, const MagneticFieldContext &mctx, std::reference_wrapper<const CalibrationContext> cctx, SourceLinkAccessor accessor_, CombinatorialKalmanFilterExtensions extensions_, LoggerWrapper logger_, const PropagatorPlainOptions &pOptions, const Surface *rSurface = nullptr, bool mScattering = true, bool eLoss = true, bool rSmoothing = true)¶
PropagatorOptions with context.
- Parameters
gctx – The geometry context for this track finding/fitting
mctx – The magnetic context for this track finding/fitting
cctx – The calibration context for this track finding/fitting
accessor_ – The source link accessor
extensions_ – The extension struct
logger_ – The logger wrapper
pOptions – The plain propagator options
rSurface – The reference surface for the eventual track fitting to be expressed at
mScattering – Whether to include multiple scattering
eLoss – Whether to include energy loss
rSmoothing – Whether to run smoothing to get fitted parameter
-
CombinatorialKalmanFilterOptions() = delete¶
Contexts are required and the options must not be default-constructible.
Public Members
-
std::reference_wrapper<const CalibrationContext> calibrationContext¶
context object for the calibration
-
bool energyLoss = true¶
Whether to consider energy loss.
-
CombinatorialKalmanFilterExtensions extensions¶
The filter extensions.
-
std::reference_wrapper<const GeometryContext> geoContext¶
Context object for the geometry.
-
LoggerWrapper logger¶
Logger instance.
-
std::reference_wrapper<const MagneticFieldContext> magFieldContext¶
Context object for the magnetic field.
-
bool multipleScattering = true¶
Whether to consider multiple scattering.
-
PropagatorPlainOptions propagatorPlainOptions¶
The trivial propagator options.
-
bool smoothing = true¶
Whether to run smoothing to get fitted parameter.
-
SourceLinkAccessor sourcelinkAccessor¶
The source link accessor.
-
struct CombinatorialKalmanFilterResult¶
- #include <Acts/TrackFinding/CombinatorialKalmanFilter.hpp>
Public Members
-
std::vector<std::pair<size_t, CombinatorialKalmanFilterTipState>> activeTips¶
-
bool filtered = false¶
-
bool finished = false¶
-
std::unordered_map<size_t, BoundTrackParameters> fittedParameters¶
-
MultiTrajectory fittedStates¶
-
size_t iSmoothed = 0¶
-
std::vector<size_t> lastMeasurementIndices¶
-
std::vector<size_t> lastTrackIndices¶
-
bool smoothed = false¶
-
MultiTrajectory stateBuffer¶
-
std::vector<MultiTrajectory::TrackStateProxy> trackStateCandidates¶
-
std::vector<std::pair<size_t, CombinatorialKalmanFilterTipState>> activeTips¶
-
struct CombinatorialKalmanFilterTipState¶
- #include <Acts/TrackFinding/CombinatorialKalmanFilter.hpp>
Track quality summary for one trajectory.
This could be used to decide if a track is to be recorded when the filtering is done or to be terminated due to its bad quality
-
template<typename propagator_t>