File Chi2Fitter.hpp

namespace Acts

Note

This file is foreseen for the Geometry module to replace Extent

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

Chi2 fitter implementation.

Template Parameters

propagator_t – Type of the propagation class

Public Functions

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

Fit implementation of the GX2F.

Note

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

Parameters
  • it – Begin iterator for the fittable uncalibrated measurements

  • end – End iterator for the fittable uncalibrated measurements

  • sParameters – The initial track parameters

  • chi2FitterOptions – Chi2FitterOptions steering the fit

  • trackContainer – The target track container

Returns

the output as an output track

Private Types

using Chi2Navigator = typename propagator_t::Navigator

Private Functions

inline const Logger &logger() const

Private Members

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

A logger instance.

propagator_t m_propagator

The propgator for the transport and material update.

template<typename parameters_t>
class Aborter

Public Types

using action_type = Actor<parameters_t>

Broadcast the action_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 Logger&) const
template<typename parameters_t>
class Actor

Propagator Actor plugin for the Chi2Fitter.

The Chi2Actor does not rely on the measurements to be sorted along the track.

Template Parameters

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

Public Types

using result_type = Chi2FitterResult<traj_t>

Broadcast the result_type.

Public Functions

inline const Logger &logger() const
template<typename propagator_state_t, typename stepper_t>
inline void materialInteractor(const Surface *surface, propagator_state_t &state, stepper_t &stepper, const MaterialUpdateStage &updateStage) const

Chi2Fitter 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 Logger&) const

Chi square actor operation.

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 Result<void> processSurface(const Surface *surface, propagator_state_t &state, const stepper_t &stepper, result_type &result) const

Chi2 actor operation: process surface.

Template Parameters
  • propagator_state_t – is the type of Propagator 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

Public Members

const Logger *actorLogger = {nullptr}

A logger instance.

bool energyLoss = false

Whether to consider energy loss.

Chi2FitterExtensions<traj_t> extensions

Extension struct.

FreeToBoundCorrection freeToBoundCorrection

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

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

Allows retrieving measurements for a surface.

bool multipleScattering = false

Whether to consider multiple scattering.

int updateNumber = -1
template<typename traj_t>
struct Chi2FitterExtensions
#include <Acts/TrackFitting/Chi2Fitter.hpp>

Extension struct which holds delegates to customize the GX2F behavior.

Public Types

using Calibrator = Delegate<void(const GeometryContext&, 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

Public Functions

inline Chi2FitterExtensions()

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.

template<typename traj_t>
struct Chi2FitterOptions
#include <Acts/TrackFitting/Chi2Fitter.hpp>

Combined options for the GX2F fitter.

Template Parameters

traj_t – The trajectory type

Public Functions

inline Chi2FitterOptions(const GeometryContext &gctx, const MagneticFieldContext &mctx, std::reference_wrapper<const CalibrationContext> cctx, Chi2FitterExtensions<traj_t> extensions_, const PropagatorPlainOptions &pOptions, bool mScattering = false, bool eLoss = false, int nIter = 1, bool calcFinalChi2_ = true, const FreeToBoundCorrection &freeToBoundCorrection_ = FreeToBoundCorrection(false))

PropagatorOptions with context.

Parameters
  • gctx – The goemetry context for this fit

  • mctx – The magnetic context for this fit

  • cctx – The calibration context for this fit

  • extensions_ – The chi2 extensions

  • pOptions – The plain propagator options

  • mScattering – Whether to include multiple scattering

  • eLoss – Whether to include energy loss

  • nIter – Number of update steps to the parameters

  • calcFinalChi2_ – Whether to run additional propagation to calculate final chi2

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

Chi2FitterOptions() = delete

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

Public Members

bool calcFinalChi2 = true

Whether to do an additional propagation step, just to get the latest chi2 value.

std::reference_wrapper<const CalibrationContext> calibrationContext

context object for the calibration

bool energyLoss = false

Whether to consider energy loss.

Chi2FitterExtensions<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.

int nUpdates = 1

Number of iterations to improve chi2.

PropagatorPlainOptions propagatorPlainOptions

The trivial propagator options.

template<typename traj_t>
struct Chi2FitterResult
#include <Acts/TrackFitting/Chi2Fitter.hpp>

Public Members

ActsScalar chisquare = -1
std::vector<ActsScalar> chisquares
std::vector<ActsScalar> collectorCovariance
BoundVector collectorDerive1Chi2Sum = BoundVector::Zero()

first derivative of chi2 wrt starting track parameters

BoundMatrix collectorDerive2Chi2Sum = BoundMatrix::Zero()
std::vector<ActsScalar> collectorMeasurements
std::vector<ActsScalar> collectorResiduals
ActsDynamicMatrix covariance
bool finished = false
std::optional<BoundTrackParameters> fittedParameters
traj_t *fittedStates = {nullptr}
BoundMatrix jacobianFromStart = BoundMatrix::Identity()
size_t lastMeasurementIndex = SIZE_MAX
size_t lastTrackIndex = Acts::MultiTrajectoryTraits::kInvalid
size_t measurementHoles = 0
size_t measurementStates = 0
std::vector<const Surface*> missedActiveSurfaces
size_t processedStates = 0
ActsDynamicVector residuals
Result<void> result = {Result<void>::success()}