Belle II Software  release-08-01-10
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 GblFitterInfo:
Collaboration diagram for GblFitterInfo:

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. More...
 
void reset (unsigned int measurementDim=2, unsigned int repDim=5)
 (Initial) reset of fitter info More...
 
void setReferenceState (StateOnPlane &referenceState)
 Set the prediction and plane (from measurement if any) You should use the user constructor instead. More...
 
void setJacobian (TMatrixD jacobian)
 Set the Jacobian for further GblPoint construction. More...
 
TMatrixDSym getCovariance (double variance, TVector3 trackDirection, SharedPlanePtr measurementPlane) const
 Get scattering covariance projected into (measurement) plane. More...
 
gbl::GblPoint constructGblPoint ()
 Collect all data and create a GblPoint. More...
 
void updateFitResults (gbl::GblTrajectory &traj)
 Update fitter info from GBL fit results. More...
 
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). More...
 
MeasurementOnPlane getResidual (unsigned int=0, bool=false, bool onlyMeasurementErrors=true) const override
 Get the residual. More...
 
MeasurementOnPlane getKink () const
 Get kink (residual) with diagonalized covariance (2D) Covariance may be zero if not yet fitted or no scatterer! More...
 
TVectorD getKinks () const
 Get kink (residual) (2D) = 0 - ( (+)pred - (-)pred ) More...
 
MeasurementOnPlane getMeasurement () const
 Get the measurement on plane from stored measurement data (from last construction/update) More...
 
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. More...
 
StateOnPlane getReferenceState () const
 Returns (copy of) the stored reference 5D state at current plane with internal rep. More...
 
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) More...
 
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
 
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)
 

Protected Attributes

const TrackPointtrackPoint_
 Pointer to TrackPoint where the FitterInfo belongs to.
 
const AbsTrackReprep_
 No ownership. More...
 
SharedPlanePtr sharedPlane_
 No ownership.
 

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
 

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()

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.

27  : AbsFitterInfo(trackPoint, rep), jacobian_(TMatrixD(5, 5)) {
28  reset();
29 
30  // Retrieve jacobian from rep by default (may not be used ... at 1st point)
31  unsigned int dim = rep->getDim();
32  if (dim != 5)
33  throw new genfit::Exception("GblFitterInfo: Representation state is not 5D", __LINE__, __FILE__);
34  TMatrixDSym noise(dim, dim);
35  TVectorD dState(dim);
36  rep->getForwardJacobianAndNoise(jacobian_, noise, dState);
37 
38  setReferenceState(referenceState);
39  }
Exception class for error handling in GENFIT (provides storage for diagnostic information)
Definition: Exception.h:48
void setReferenceState(StateOnPlane &referenceState)
Set the prediction and plane (from measurement if any) You should use the user constructor instead.
void reset(unsigned int measurementDim=2, unsigned int repDim=5)
(Initial) reset of fitter info

Member Function Documentation

◆ constructGblPoint()

gbl::GblPoint constructGblPoint ( )

Collect all data and create a GblPoint.

  • Jacobian is taken from fitter info ... use setJaobian() to change it
  • A scatterer is added if ThinScatterer at point
  • A measurement (first MeasurementOnPlane in 1st RawMeasurement) is added.
  • Global and local derivatives are added for RawMesurement implementing ICalibrationParametersDerivatives interface. Using most up to date prediction.
Returns
gbl::GblPoint

Definition at line 111 of file GblFitterInfo.cc.

◆ getCovariance()

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

◆ getFittedState()

const MeasuredStateOnPlane & 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 AbsFitterInfo.

Definition at line 398 of file GblFitterInfo.cc.

◆ getKink()

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

◆ getKinks()

TVectorD getKinks ( ) const

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

Returns
TVectorD

Definition at line 462 of file GblFitterInfo.cc.

◆ getMeasurement()

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

◆ getReferenceState()

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

213 {return StateOnPlane(refPrediction_, sharedPlane_, rep_);}
SharedPlanePtr sharedPlane_
No ownership.
Definition: AbsFitterInfo.h:94
const AbsTrackRep * rep_
No ownership.
Definition: AbsFitterInfo.h:92

◆ getResidual()

MeasurementOnPlane 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 AbsFitterInfo.

Definition at line 416 of file GblFitterInfo.cc.

◆ recalculateJacobian()

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)

Parameters
prevFitterInfoPointer to GblFitterInfo of previous point
Returns
void

Definition at line 346 of file GblFitterInfo.cc.

◆ reset()

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

◆ setJacobian()

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

◆ setReferenceState()

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

◆ updateFitResults()

void updateFitResults ( gbl::GblTrajectory traj)

Update fitter info from GBL fit results.

Locates itself in track/trajectory and updates predictions, errors, etc.

Parameters
trajFitted GblTrajectory constructed with this point
Returns
void

Definition at line 246 of file GblFitterInfo.cc.

◆ updateMeasurementAndPlane()

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.

Returns
void

Definition at line 195 of file GblFitterInfo.cc.

Member Data Documentation

◆ rep_

const AbsTrackRep* rep_
protectedinherited

No ownership.

Pointer to AbsTrackRep with respect to which the FitterInfo is defined

Definition at line 92 of file AbsFitterInfo.h.


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