File GlobalChiSquareFitter.hpp

namespace Acts


This file is foreseen for the Geometry module to replace Extent

namespace Experimental
template<typename propagator_t, typename traj_t>
class Gx2Fitter
#include <Acts/TrackFitting/GlobalChiSquareFitter.hpp>

Global Chi Square fitter (GX2F) implementation.

TODO Write description

Template Parameters

propagator_t – Type of the propagation class

Public Functions

inline Gx2Fitter(propagator_t pPropagator, std::unique_ptr<const Logger> _logger = getDefaultLogger("Gx2Fitter", Logging::INFO))

Fit implementation.


The input measurements are given in the form of SourceLink s. It’s the calibrators job to turn them into calibrated measurements used in the fit.

Template Parameters
  • source_link_iterator_t – Iterator type used to pass source links

  • start_parameters_t – Type of the initial parameters

  • parameters_t – Type of parameters used for local parameters

  • track_container_t – Type of the track container backend

  • holder_t – Type defining track container backend ownership

  • it – Begin iterator for the fittable uncalibrated measurements

  • end – End iterator for the fittable uncalibrated measurements

  • sParameters – The initial track parameters

  • gx2fOptions – Gx2FitterOptions steering the fit

  • trackContainer – Input track container storage to append into


the output as an output track

Private Types

using Gx2fNavigator = typename propagator_t::Navigator

The navigator type.

Private Functions

inline const Logger &logger() const

Private Members

std::unique_ptr<const Logger> m_actorLogger
std::unique_ptr<const Logger> m_logger

The logger instance.

propagator_t m_propagator

The propagator for the transport and material update.

Private Static Attributes

static constexpr bool isDirectNavigator = std::is_same<Gx2fNavigator, DirectNavigator>::value

The navigator has DirectNavigator type or not.

template<typename parameters_t>
class Aborter

Aborter can stay like this probably.

Public Types

using action_type = Actor<parameters_t>

Broadcast the result_type.

Public Functions

template<typename propagator_state_t, typename stepper_t, typename navigator_t, typename result_t>
inline bool operator()(propagator_state_t&, const stepper_t&, const navigator_t&, const result_t &result, const Logger&) const
template<typename parameters_t>
class Actor

Propagator Actor plugin for the GX2F.

The GX2FnActor does not rely on the measurements to be sorted along the track. /// TODO is this true?

Template Parameters
  • parameters_t – The type of parameters used for “local” parameters.

  • calibrator_t – The type of calibrator

  • outlier_finder_t – Type of the outlier finder class

Public Types

using result_type = Gx2FitterResult<traj_t>

Broadcast the result_type.

Public Functions

inline const Logger &logger() const

Logger helper.

template<typename propagator_state_t, typename stepper_t, typename navigator_t>
inline void operator()(propagator_state_t &state, const stepper_t &stepper, const navigator_t &navigator, result_type &result, const Logger&) const

Gx2f actor operation.

Template Parameters
  • propagator_state_t – is the type of Propagator state

  • stepper_t – Type of the stepper

  • navigator_t – Type of the navigator

  • state – is the mutable propagator state object

  • stepper – The stepper in use

  • navigator – The navigator in use

  • result – is the mutable result state object

Public Members

const Logger *actorLogger = {nullptr}

The logger instance.

const CalibrationContext *calibrationContext = {nullptr}

Calibration context for the fit.

bool energyLoss = false

TODO implement later.

Whether to consider energy loss.

Gx2FitterExtensions<traj_t> extensions
FreeToBoundCorrection freeToBoundCorrection

TODO implement later.

Whether to include non-linear correction during global to local transformation

const std::map<GeometryIdentifier, SourceLink> *inputMeasurements = nullptr

Allows retrieving measurements for a surface.

bool multipleScattering = false

Whether to consider multiple scattering.

std::shared_ptr<MultiTrajectory<traj_t>> outputStates

Input MultiTrajectory.

SurfaceReached targetReached

The Surface being.

const Surface *targetSurface = nullptr

The target surface.

template<typename traj_t>
struct Gx2FitterExtensions
#include <Acts/TrackFitting/GlobalChiSquareFitter.hpp>

Extension struct which holds delegates to customize the KF behavior.

Public Types

using Calibrator = Delegate<void(const GeometryContext&, const CalibrationContext&, const SourceLink&, TrackStateProxy)>
using ConstTrackStateProxy = typename MultiTrajectory<traj_t>::ConstTrackStateProxy
using OutlierFinder = Delegate<bool(ConstTrackStateProxy)>
using Parameters = typename TrackStateProxy::Parameters
using TrackStateProxy = typename MultiTrajectory<traj_t>::TrackStateProxy
using Updater = Delegate<Result<void>(const GeometryContext&, TrackStateProxy, Direction, const Logger&)>

Public Functions

inline Gx2FitterExtensions()

Default constructor which connects the default void components.

Public Members

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.

OutlierFinder outlierFinder

Determines whether a measurement is supposed to be considered as an outlier.

SourceLinkSurfaceAccessor surfaceAccessor

Retrieves the associated surface from a source link.

Updater updater

The updater incorporates measurement information into the track parameters.

template<typename traj_t>
struct Gx2FitterOptions
#include <Acts/TrackFitting/GlobalChiSquareFitter.hpp>

Combined options for the Global-Chi-Square fitter.

Template Parameters

traj_t – The trajectory type

Public Functions

Gx2FitterOptions() = delete

Contexts are required and the options must not be default-constructible.

inline Gx2FitterOptions(const GeometryContext &gctx, const MagneticFieldContext &mctx, std::reference_wrapper<const CalibrationContext> cctx, Gx2FitterExtensions<traj_t> extensions_, const PropagatorPlainOptions &pOptions, const Surface *rSurface = nullptr, bool mScattering = false, bool eLoss = false, const FreeToBoundCorrection &freeToBoundCorrection_ = FreeToBoundCorrection(false), const size_t nUpdateMax_ = 5)

PropagatorOptions with context.

  • gctx – The geometry context for this fit

  • mctx – The magnetic context for this fit

  • cctx – The calibration context for this fit

  • extensions_ – The KF extensions

  • pOptions – The plain propagator options

  • rSurface – The reference surface for the fit to be expressed at

  • mScattering – Whether to include multiple scattering

  • eLoss – Whether to include energy loss

  • freeToBoundCorrection_ – Correction for non-linearity effect during transform from free to bound

  • nUpdateMax_ – Max number of iterations for updating the parameters

Public Members

std::reference_wrapper<const CalibrationContext> calibrationContext

context object for the calibration

bool energyLoss = false

Whether to consider energy loss.

Gx2FitterExtensions<traj_t> extensions
FreeToBoundCorrection freeToBoundCorrection

Whether to include non-linear correction during global to local transformation.

std::reference_wrapper<const GeometryContext> geoContext

Context object for the geometry.

std::reference_wrapper<const MagneticFieldContext> magFieldContext

Context object for the magnetic field.

bool multipleScattering = false

Whether to consider multiple scattering.

size_t nUpdateMax = 5

Max number of iterations during the fit.

PropagatorPlainOptions propagatorPlainOptions

The trivial propagator options.

const Surface *referenceSurface = nullptr

The reference Surface.

template<typename traj_t>
struct Gx2FitterResult
#include <Acts/TrackFitting/GlobalChiSquareFitter.hpp>

Public Members

std::vector<ActsSquareMatrix<2>> collectorCovariance
std::vector<BoundMatrix> collectorJacobians
std::vector<ActsVector<2>> collectorResiduals
bool finished = false
std::optional<BoundTrackParameters> fittedParameters
traj_t *fittedStates = {nullptr}
BoundMatrix jacobianFromStart = BoundMatrix::Identity()
size_t lastMeasurementIndex = Acts::MultiTrajectoryTraits::kInvalid
size_t lastTrackIndex = Acts::MultiTrajectoryTraits::kInvalid
size_t measurementHoles = 0
size_t measurementStates = 0
std::vector<const Surface*> missedActiveSurfaces
std::vector<const Surface*> passedAgainSurfaces
size_t processedStates = 0
Result<void> result = {Result<void>::success()}
size_t surfaceCount = 0