ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::GsfMeasurementUpdator Namespace Reference

Functions

MultiComponentState update (Trk::MultiComponentState &&, const Trk::MeasurementBase &, FitQualityOnSurface &fitQoS)
 Method for updating the multi-state with a new measurement and calculate the fit qaulity at the same time.
FitQualityOnSurface fitQuality (const MultiComponentState &, const MeasurementBase &)
 Method for determining the chi2 of the multi-component state and the number of degrees of freedom.

Function Documentation

◆ fitQuality()

Trk::FitQualityOnSurface Trk::GsfMeasurementUpdator::fitQuality ( const MultiComponentState & updatedState,
const MeasurementBase & measurement )

Method for determining the chi2 of the multi-component state and the number of degrees of freedom.

Definition at line 846 of file GsfMeasurementUpdator.cxx.

848{
849 double chi2 = 0;
850 Trk::FitQualityOnSurface componentFitQuality;
851 for (const Trk::ComponentParameters& component: updatedState) {
852 stateFitQuality(componentFitQuality,
853 *component.params.get(),
854 measurement.localParameters(),
855 measurement.localCovariance());
856
857 chi2 += component.weight * componentFitQuality.chiSquared();
858 }
859
860 //The same measurement is included
861 return { chi2, componentFitQuality.numberDoF() };
862}
int numberDoF() const
returns the number of degrees of freedom of the overall track or vertex fit as integer
Definition FitQuality.h:60
double chiSquared() const
returns the of the overall track fit
Definition FitQuality.h:56
const LocalParameters & localParameters() const
Interface method to get the LocalParameters.
const Amg::MatrixX & localCovariance() const
Interface method to get the localError.
double chi2(TH1 *h0, TH1 *h1)

◆ update()

Trk::MultiComponentState Trk::GsfMeasurementUpdator::update ( Trk::MultiComponentState && stateBeforeUpdate,
const Trk::MeasurementBase & measurement,
FitQualityOnSurface & fitQoS )

Method for updating the multi-state with a new measurement and calculate the fit qaulity at the same time.

Definition at line 809 of file GsfMeasurementUpdator.cxx.

812{
813
814 // Check all components have associated error matrices
815 bool rebuildStateWithErrors = false;
816 // Perform initial check of state awaiting update. If all states have
817 // associated error matricies then no need to perform the rebuild
818 for (const Trk::ComponentParameters& component : stateBeforeUpdate) {
819 rebuildStateWithErrors =
820 rebuildStateWithErrors || invalidComponent(component.params.get());
821 }
822
823 if (rebuildStateWithErrors) {
824 Trk::MultiComponentState stateWithInsertedErrors =
825 rebuildState(std::move(stateBeforeUpdate));
826 // Perform the measurement update with the modified state
827 Trk::MultiComponentState updatedState = calculateFilterStep(
828 std::move(stateWithInsertedErrors), measurement, fitQoS);
829 if (updatedState.empty()) {
830 return {};
831 }
832 return updatedState;
833 }
834
835 // Perform the measurement update
836 Trk::MultiComponentState updatedState = calculateFilterStep(
837 std::move(stateBeforeUpdate), measurement, fitQoS);
838
839 if (updatedState.empty()) {
840 return {};
841 }
842 return updatedState;
843}
std::vector< ComponentParameters > MultiComponentState