GENFIT Rev: NoNumberAvailable
Loading...
Searching...
No Matches
genfit::GblFitterInfo Class Reference

Collects information needed and produced by a GblFitter/GBL and is specific to one AbsTrackRep of the Track. More...

#include <GblFitterInfo.h>

Inheritance diagram for genfit::GblFitterInfo:
Inheritance graph
Collaboration diagram for genfit::GblFitterInfo:
Collaboration graph

Public Member Functions

 GblFitterInfo ()
 Constructor for ROOT I/O.
 
 GblFitterInfo (const TrackPoint *trackPoint, const AbsTrackRep *rep)
 Default (inherited) constructor Should not be used or the reference should set immediately upon construction (to set the plane).
 
 GblFitterInfo (const TrackPoint *trackPoint, const AbsTrackRep *rep, StateOnPlane &referenceState)
 Default user constructor.
 
void reset (unsigned int measurementDim=2, unsigned int repDim=5)
 (Initial) reset of fitter info
 
void setReferenceState (StateOnPlane &referenceState)
 Set the prediction and plane (from measurement if any) You should use the user constructor instead.
 
void setJacobian (TMatrixD jacobian)
 Set the Jacobian for further GblPoint construction.
 
TMatrixDSym getCovariance (double variance, TVector3 trackDirection, SharedPlanePtr measurementPlane) const
 Get scattering covariance projected into (measurement) plane.
 
gbl::GblPoint constructGblPoint ()
 Collect all data and create a GblPoint.
 
void updateFitResults (gbl::GblTrajectory &traj)
 Update fitter info from GBL fit results.
 
const MeasuredStateOnPlanegetFittedState (bool afterKink=true) const override
 Get the prediction at this point Always biased in GBL (global fit) There are 2 states, before and after kink (if there is a scatterer at this point). Per default the state after kink for forward propagation is returned.
 
MeasurementOnPlane getResidual (unsigned int=0, bool=false, bool onlyMeasurementErrors=true) const override
 Get the residual.
 
MeasurementOnPlane getKink () const
 Get kink (residual) with diagonalized covariance (2D) Covariance may be zero if not yet fitted or no scatterer!
 
TVectorD getKinks () const
 Get kink (residual) (2D) = 0 - ( (+)pred - (-)pred )
 
MeasurementOnPlane getMeasurement () const
 Get the measurement on plane from stored measurement data (from last construction/update)
 
void updateMeasurementAndPlane (const StateOnPlane &sop)
 SHOULD BE USED ONLY INTERNALY! Update the plane from measurement constructed with state or take plane from state if there is no measurement. 1st raw Measurement with highest weight is constructed and stored as matrices.
 
StateOnPlane getReferenceState () const
 Returns (copy of) the stored reference 5D state at current plane with internal rep.
 
void recalculateJacobian (GblFitterInfo *prevFitterInfo)
 Re-extrapolates between prevFitterInfo and this point using forward state to update the Jacobian (if planes and/or states changed, internal predictions are extrapolated to new planes)
 
virtual ~GblFitterInfo ()
 
virtual GblFitterInfoclone () const override
 Deep copy ctor for polymorphic class.
 
bool hasMeasurements () const override
 
bool hasReferenceState () const override
 
bool hasForwardPrediction () const override
 
bool hasBackwardPrediction () const override
 
bool hasForwardUpdate () const override
 
bool hasBackwardUpdate () const override
 
bool hasUpdate (int direction) const override
 
bool hasPredictionsAndUpdates () const
 
void deleteForwardInfo () override
 
void deleteBackwardInfo () override
 
void deletePredictions ()
 
void deleteReferenceInfo () override
 
void deleteMeasurementInfo () override
 
virtual void Print (const Option_t *="") const override
 
virtual bool checkConsistency (const genfit::PruneFlags *=nullptr) const override
 
- Public Member Functions inherited from genfit::AbsFitterInfo
 AbsFitterInfo ()
 
 AbsFitterInfo (const TrackPoint *trackPoint, const AbsTrackRep *rep)
 
virtual ~AbsFitterInfo ()
 
const TrackPointgetTrackPoint () const
 
const AbsTrackRepgetRep () const
 
void setTrackPoint (const TrackPoint *tp)
 
virtual void setRep (const AbsTrackRep *rep)
 
virtual bool hasPrediction (int direction) const
 
const SharedPlanePtrgetPlane () const
 
void setPlane (const SharedPlanePtr &plane)
 

Private Attributes

TMatrixD jacobian_
 
TVectorD measResiduals_
 
TVectorD measResidualErrors_
 
TVectorD kinkResiduals_
 
TVectorD kinkResidualErrors_
 
TVectorD measDownWeights_
 
TVectorD kinkDownWeights_
 
TVectorD bwdStateCorrection_
 
TVectorD fwdStateCorrection_
 
TMatrixDSym bwdCov_
 
TMatrixDSym fwdCov_
 
TVectorD fwdPrediction_
 
TVectorD bwdPrediction_
 
TVectorD refPrediction_
 
TVectorD measurement_
 
TMatrixDSym measCov_
 
TMatrixD hMatrix_
 
std::unique_ptr< MeasuredStateOnPlanefittedStateBwd_
 
std::unique_ptr< MeasuredStateOnPlanefittedStateFwd_
 cache
 

Additional Inherited Members

- Protected Attributes inherited from genfit::AbsFitterInfo
const TrackPointtrackPoint_
 
const AbsTrackReprep_
 No ownership.
 
SharedPlanePtr sharedPlane_
 No ownership.
 

Detailed Description

Collects information needed and produced by a GblFitter/GBL and is specific to one AbsTrackRep of the Track.

Definition at line 52 of file GblFitterInfo.h.

Constructor & Destructor Documentation

◆ GblFitterInfo() [1/3]

genfit::GblFitterInfo::GblFitterInfo ( )

Constructor for ROOT I/O.

Definition at line 10 of file GblFitterInfo.cc.

References genfit::AbsFitterInfo::AbsFitterInfo(), jacobian_, and reset().

Referenced by clone(), recalculateJacobian(), and updateFitResults().

◆ GblFitterInfo() [2/3]

genfit::GblFitterInfo::GblFitterInfo ( const TrackPoint * trackPoint,
const AbsTrackRep * rep )

Default (inherited) constructor Should not be used or the reference should set immediately upon construction (to set the plane).

Definition at line 14 of file GblFitterInfo.cc.

References genfit::AbsFitterInfo::AbsFitterInfo(), genfit::AbsTrackRep::getDim(), genfit::AbsTrackRep::getForwardJacobianAndNoise(), jacobian_, and reset().

◆ GblFitterInfo() [3/3]

genfit::GblFitterInfo::GblFitterInfo ( const TrackPoint * trackPoint,
const AbsTrackRep * rep,
StateOnPlane & referenceState )

Default user constructor.

Parameters
trackPointThe point at track to attach fitter info.
repThe representation this fitter info belongs to
referenceStateState from extrapolation to init predictions and plane

Definition at line 27 of file GblFitterInfo.cc.

References genfit::AbsFitterInfo::AbsFitterInfo(), genfit::AbsTrackRep::getDim(), genfit::AbsTrackRep::getForwardJacobianAndNoise(), jacobian_, reset(), and setReferenceState().

◆ ~GblFitterInfo()

virtual genfit::GblFitterInfo::~GblFitterInfo ( )
inlinevirtual

Definition at line 225 of file GblFitterInfo.h.

Member Function Documentation

◆ checkConsistency()

bool genfit::GblFitterInfo::checkConsistency ( const genfit::PruneFlags * = nullptr) const
overridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 477 of file GblFitterInfo.cc.

◆ clone()

◆ constructGblPoint()

◆ deleteBackwardInfo()

void genfit::GblFitterInfo::deleteBackwardInfo ( )
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 237 of file GblFitterInfo.h.

Referenced by deletePredictions().

◆ deleteForwardInfo()

void genfit::GblFitterInfo::deleteForwardInfo ( )
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 236 of file GblFitterInfo.h.

Referenced by deletePredictions().

◆ deleteMeasurementInfo()

void genfit::GblFitterInfo::deleteMeasurementInfo ( )
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 243 of file GblFitterInfo.h.

◆ deletePredictions()

void genfit::GblFitterInfo::deletePredictions ( )
inline

Definition at line 238 of file GblFitterInfo.h.

References deleteBackwardInfo(), and deleteForwardInfo().

◆ deleteReferenceInfo()

void genfit::GblFitterInfo::deleteReferenceInfo ( )
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 242 of file GblFitterInfo.h.

◆ getCovariance()

TMatrixDSym genfit::GblFitterInfo::getCovariance ( double variance,
TVector3 trackDirection,
SharedPlanePtr measurementPlane ) const

Get scattering covariance projected into (measurement) plane.

Parameters
varianceVariance of slopes in track frame
trackDirectionDirection of the track at the plane
measurementPlaneThe plane with measurement to which MS shall be projected
Returns
TMatrixDSym

Definition at line 96 of file GblFitterInfo.cc.

Referenced by constructGblPoint().

◆ getFittedState()

const MeasuredStateOnPlane & genfit::GblFitterInfo::getFittedState ( bool afterKink = true) const
overridevirtual

Get the prediction at this point Always biased in GBL (global fit) There are 2 states, before and after kink (if there is a scatterer at this point). Per default the state after kink for forward propagation is returned.

If not yet fitted, returns the reference state

Parameters
afterKinkIf true, returns prediction for forward propagation. If false, for backward
Returns
const genfit::MeasuredStateOnPlane&

Implements genfit::AbsFitterInfo.

Definition at line 398 of file GblFitterInfo.cc.

References bwdCov_, bwdPrediction_, fittedStateBwd_, fittedStateFwd_, fwdCov_, fwdPrediction_, genfit::AbsFitterInfo::rep_, and genfit::AbsFitterInfo::sharedPlane_.

Referenced by constructGblPoint(), getKinks(), getResidual(), recalculateJacobian(), and updateFitResults().

◆ getKink()

MeasurementOnPlane genfit::GblFitterInfo::getKink ( ) const

Get kink (residual) with diagonalized covariance (2D) Covariance may be zero if not yet fitted or no scatterer!

Returns
genfit::MeasurementOnPlane

Definition at line 453 of file GblFitterInfo.cc.

References getKinks(), kinkResidualErrors_, genfit::AbsFitterInfo::rep_, and genfit::AbsFitterInfo::sharedPlane_.

◆ getKinks()

TVectorD genfit::GblFitterInfo::getKinks ( ) const

Get kink (residual) (2D) = 0 - ( (+)pred - (-)pred )

Returns
TVectorD

Definition at line 462 of file GblFitterInfo.cc.

References getFittedState().

Referenced by constructGblPoint(), getKink(), and Print().

◆ getMeasurement()

MeasurementOnPlane genfit::GblFitterInfo::getMeasurement ( ) const

Get the measurement on plane from stored measurement data (from last construction/update)

Returns
genfit::MeasuredStateOnPlane

Definition at line 473 of file GblFitterInfo.cc.

References hasMeasurements(), measCov_, measurement_, genfit::AbsFitterInfo::rep_, genfit::AbsFitterInfo::sharedPlane_, and genfit::AbsFitterInfo::trackPoint_.

◆ getReferenceState()

StateOnPlane genfit::GblFitterInfo::getReferenceState ( ) const
inline

Returns (copy of) the stored reference 5D state at current plane with internal rep.

Returns
genfit::StateOnPlane

Definition at line 213 of file GblFitterInfo.h.

References refPrediction_, genfit::AbsFitterInfo::rep_, and genfit::AbsFitterInfo::sharedPlane_.

◆ getResidual()

MeasurementOnPlane genfit::GblFitterInfo::getResidual ( unsigned int = 0,
bool = false,
bool onlyMeasurementErrors = true ) const
overridevirtual

Get the residual.

Temporarily constructs measurements and calculates residual as meas - prediction.

Always biased. Always only one (1st) measurement!

Parameters
...
...
onlyMeasurementErrorsIf true, covariance of measurement returned. If false, diagonalized residual error incl. correlation from track fit is returned.
Returns
genfit::MeasurementOnPlane

Implements genfit::AbsFitterInfo.

Definition at line 416 of file GblFitterInfo.cc.

References getFittedState(), genfit::AbsFitterInfo::getRep(), hasMeasurements(), hMatrix_, measCov_, measResidualErrors_, measurement_, genfit::AbsFitterInfo::rep_, genfit::AbsFitterInfo::sharedPlane_, and genfit::AbsFitterInfo::trackPoint_.

Referenced by constructGblPoint(), and Print().

◆ hasBackwardPrediction()

bool genfit::GblFitterInfo::hasBackwardPrediction ( ) const
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 230 of file GblFitterInfo.h.

References hasReferenceState().

Referenced by hasBackwardUpdate(), hasPredictionsAndUpdates(), and hasUpdate().

◆ hasBackwardUpdate()

bool genfit::GblFitterInfo::hasBackwardUpdate ( ) const
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 232 of file GblFitterInfo.h.

References hasBackwardPrediction().

Referenced by hasPredictionsAndUpdates().

◆ hasForwardPrediction()

bool genfit::GblFitterInfo::hasForwardPrediction ( ) const
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 229 of file GblFitterInfo.h.

References hasReferenceState().

Referenced by hasForwardUpdate(), hasPredictionsAndUpdates(), and hasUpdate().

◆ hasForwardUpdate()

bool genfit::GblFitterInfo::hasForwardUpdate ( ) const
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 231 of file GblFitterInfo.h.

References hasForwardPrediction().

Referenced by hasPredictionsAndUpdates().

◆ hasMeasurements()

bool genfit::GblFitterInfo::hasMeasurements ( ) const
inlineoverridevirtual

◆ hasPredictionsAndUpdates()

bool genfit::GblFitterInfo::hasPredictionsAndUpdates ( ) const
inline

◆ hasReferenceState()

bool genfit::GblFitterInfo::hasReferenceState ( ) const
inlineoverridevirtual

Implements genfit::AbsFitterInfo.

Definition at line 228 of file GblFitterInfo.h.

References refPrediction_.

Referenced by hasBackwardPrediction(), and hasForwardPrediction().

◆ hasUpdate()

bool genfit::GblFitterInfo::hasUpdate ( int direction) const
inlineoverridevirtual

Reimplemented from genfit::AbsFitterInfo.

Definition at line 233 of file GblFitterInfo.h.

References hasBackwardPrediction(), and hasForwardPrediction().

◆ Print()

◆ recalculateJacobian()

void genfit::GblFitterInfo::recalculateJacobian ( GblFitterInfo * prevFitterInfo)

Re-extrapolates between prevFitterInfo and this point using forward state to update the Jacobian (if planes and/or states changed, internal predictions are extrapolated to new planes)

Parameters
prevFitterInfoPointer to GblFitterInfo of previous point
Returns
void

Definition at line 346 of file GblFitterInfo.cc.

References bwdCov_, bwdPrediction_, fittedStateBwd_, fittedStateFwd_, fwdCov_, fwdPrediction_, GblFitterInfo(), getFittedState(), genfit::AbsFitterInfo::getPlane(), genfit::StateOnPlane::getState(), hasMeasurements(), jacobian_, genfit::AbsFitterInfo::rep_, genfit::AbsFitterInfo::sharedPlane_, genfit::AbsFitterInfo::trackPoint_, and updateMeasurementAndPlane().

Referenced by genfit::GblFitter::processTrackWithRep().

◆ reset()

void genfit::GblFitterInfo::reset ( unsigned int measurementDim = 2,
unsigned int repDim = 5 )

(Initial) reset of fitter info

Parameters
measurementDimMeasurement dimesion (2)
repDimRepresentation dimesion (5)
Returns
void

Definition at line 41 of file GblFitterInfo.cc.

References bwdCov_, bwdPrediction_, bwdStateCorrection_, fwdCov_, fwdPrediction_, fwdStateCorrection_, genfit::HMatrixUV::getMatrix(), hMatrix_, kinkDownWeights_, kinkResidualErrors_, kinkResiduals_, measCov_, measDownWeights_, measResidualErrors_, measResiduals_, measurement_, and refPrediction_.

Referenced by GblFitterInfo(), GblFitterInfo(), and GblFitterInfo().

◆ setJacobian()

void genfit::GblFitterInfo::setJacobian ( TMatrixD jacobian)

Set the Jacobian for further GblPoint construction.

Parameters
jacobian5x5 TMatrixD with Jacobian for propagation of the state from previous point to this point.
Returns
void

Definition at line 91 of file GblFitterInfo.cc.

References jacobian_.

Referenced by genfit::GblFitter::constructGblInfo().

◆ setReferenceState()

void genfit::GblFitterInfo::setReferenceState ( StateOnPlane & referenceState)

Set the prediction and plane (from measurement if any) You should use the user constructor instead.

Reference gets not updated internally in fitter info. After updateFitResults(...), updates affect the +/- predictions directly.

Should be called only once (so rather use constructor). Otherwise will rewrite fitted state by reference (and you have to update from fit again)

Parameters
referenceStateStateOnPlane from extrapolation to this point
Returns
void

Definition at line 78 of file GblFitterInfo.cc.

References bwdPrediction_, fittedStateBwd_, fittedStateFwd_, fwdPrediction_, genfit::StateOnPlane::getAuxInfo(), genfit::StateOnPlane::getState(), refPrediction_, genfit::AbsFitterInfo::rep_, genfit::AbsFitterInfo::sharedPlane_, genfit::AbsFitterInfo::trackPoint_, and updateMeasurementAndPlane().

Referenced by GblFitterInfo().

◆ updateFitResults()

◆ updateMeasurementAndPlane()

void genfit::GblFitterInfo::updateMeasurementAndPlane ( const StateOnPlane & sop)

SHOULD BE USED ONLY INTERNALY! Update the plane from measurement constructed with state or take plane from state if there is no measurement. 1st raw Measurement with highest weight is constructed and stored as matrices.

Returns
void

Definition at line 195 of file GblFitterInfo.cc.

References genfit::StateOnPlane::getPlane(), hMatrix_, measCov_, measurement_, genfit::AbsFitterInfo::setPlane(), and genfit::AbsFitterInfo::trackPoint_.

Referenced by recalculateJacobian(), and setReferenceState().

Member Data Documentation

◆ bwdCov_

TMatrixDSym genfit::GblFitterInfo::bwdCov_
private

◆ bwdPrediction_

TVectorD genfit::GblFitterInfo::bwdPrediction_
private

◆ bwdStateCorrection_

TVectorD genfit::GblFitterInfo::bwdStateCorrection_
private

Definition at line 255 of file GblFitterInfo.h.

Referenced by clone(), Print(), reset(), and updateFitResults().

◆ fittedStateBwd_

std::unique_ptr<MeasuredStateOnPlane> genfit::GblFitterInfo::fittedStateBwd_
mutableprivate

◆ fittedStateFwd_

std::unique_ptr<MeasuredStateOnPlane> genfit::GblFitterInfo::fittedStateFwd_
mutableprivate

cache

Definition at line 268 of file GblFitterInfo.h.

Referenced by getFittedState(), recalculateJacobian(), setReferenceState(), and updateFitResults().

◆ fwdCov_

TMatrixDSym genfit::GblFitterInfo::fwdCov_
private

◆ fwdPrediction_

TVectorD genfit::GblFitterInfo::fwdPrediction_
private

◆ fwdStateCorrection_

TVectorD genfit::GblFitterInfo::fwdStateCorrection_
private

Definition at line 256 of file GblFitterInfo.h.

Referenced by clone(), Print(), reset(), and updateFitResults().

◆ hMatrix_

TMatrixD genfit::GblFitterInfo::hMatrix_
private

◆ jacobian_

TMatrixD genfit::GblFitterInfo::jacobian_
private

◆ kinkDownWeights_

TVectorD genfit::GblFitterInfo::kinkDownWeights_
private

Definition at line 254 of file GblFitterInfo.h.

Referenced by clone(), Print(), reset(), and updateFitResults().

◆ kinkResidualErrors_

TVectorD genfit::GblFitterInfo::kinkResidualErrors_
private

Definition at line 252 of file GblFitterInfo.h.

Referenced by clone(), getKink(), Print(), reset(), and updateFitResults().

◆ kinkResiduals_

TVectorD genfit::GblFitterInfo::kinkResiduals_
private

Definition at line 251 of file GblFitterInfo.h.

Referenced by clone(), Print(), reset(), and updateFitResults().

◆ measCov_

TMatrixDSym genfit::GblFitterInfo::measCov_
private

◆ measDownWeights_

TVectorD genfit::GblFitterInfo::measDownWeights_
private

Definition at line 253 of file GblFitterInfo.h.

Referenced by clone(), Print(), reset(), and updateFitResults().

◆ measResidualErrors_

TVectorD genfit::GblFitterInfo::measResidualErrors_
private

Definition at line 250 of file GblFitterInfo.h.

Referenced by clone(), getResidual(), Print(), reset(), and updateFitResults().

◆ measResiduals_

TVectorD genfit::GblFitterInfo::measResiduals_
private

Definition at line 249 of file GblFitterInfo.h.

Referenced by clone(), Print(), reset(), and updateFitResults().

◆ measurement_

TVectorD genfit::GblFitterInfo::measurement_
private

◆ refPrediction_

TVectorD genfit::GblFitterInfo::refPrediction_
private

The documentation for this class was generated from the following files: