GENFIT  Rev:NoNumberAvailable
Public Member Functions | Private Attributes | List of all members
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. More...
 
 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). More...
 
 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
 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. More...
 
MeasurementOnPlane getResidual (unsigned int=0, bool=false, bool onlyMeasurementErrors=true) const
 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. 1st raw Measurement with highest weight is constructed and stored as matrices. 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 ~GblFitterInfo ()
 
virtual GblFitterInfoclone () const
 Deep copy ctor for polymorphic class. More...
 
bool hasMeasurements () const
 
bool hasReferenceState () const
 
bool hasForwardPrediction () const
 
bool hasBackwardPrediction () const
 
bool hasForwardUpdate () const
 
bool hasBackwardUpdate () const
 
bool hasUpdate (int direction) const
 
bool hasPredictionsAndUpdates () const
 
void deleteForwardInfo ()
 
void deleteBackwardInfo ()
 
void deletePredictions ()
 
void deleteReferenceInfo ()
 
void deleteMeasurementInfo ()
 
virtual void Print (const Option_t *="") const
 
virtual bool checkConsistency (const genfit::PruneFlags *=NULL) const
 
- 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_
 
boost::scoped_ptr< MeasuredStateOnPlanefittedStateBwd_
 
boost::scoped_ptr< MeasuredStateOnPlanefittedStateFwd_
 cache More...
 

Additional Inherited Members

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

Detailed Description

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

Definition at line 55 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 reset().

Referenced by clone().

◆ 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::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::AbsTrackRep::getDim(), genfit::AbsTrackRep::getForwardJacobianAndNoise(), jacobian_, reset(), and setReferenceState().

◆ ~GblFitterInfo()

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

Definition at line 228 of file GblFitterInfo.h.

Member Function Documentation

◆ checkConsistency()

bool genfit::GblFitterInfo::checkConsistency ( const genfit::PruneFlags = NULL) const
virtual

Implements genfit::AbsFitterInfo.

Definition at line 475 of file GblFitterInfo.cc.

◆ clone()

GblFitterInfo * genfit::GblFitterInfo::clone ( ) const
virtual

◆ constructGblPoint()

gbl::GblPoint genfit::GblFitterInfo::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.

References gbl::GblPoint::addGlobals(), gbl::GblPoint::addLocals(), gbl::GblPoint::addMeasurement(), gbl::GblPoint::addScatterer(), genfit::ICalibrationParametersDerivatives::derivatives(), genfit::MeasuredStateOnPlane::getCov(), getCovariance(), genfit::MaterialProperties::getDensity(), genfit::StateOnPlane::getDir(), genfit::Track::getFitStatus(), getFittedState(), getKinks(), genfit::ThinScatterer::getMaterial(), genfit::TrackPoint::getMaterialInfo(), genfit::HMatrixU::getMatrix(), genfit::GblFitStatus::getMaxLocalFitParams(), genfit::StateOnPlane::getPlane(), genfit::TrackPoint::getRawMeasurement(), getResidual(), genfit::StateOnPlane::getState(), genfit::TrackPoint::getTrack(), hasMeasurements(), genfit::TrackPoint::hasThinScatterer(), hMatrix_, jacobian_, genfit::ICalibrationParametersDerivatives::labels(), genfit::ICalibrationParametersDerivatives::localDerivatives(), genfit::AbsFitterInfo::rep_, genfit::GblFitStatus::setMaxLocalFitParams(), genfit::AbsFitterInfo::sharedPlane_, and genfit::AbsFitterInfo::trackPoint_.

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

◆ deleteBackwardInfo()

void genfit::GblFitterInfo::deleteBackwardInfo ( )
inlinevirtual

Implements genfit::AbsFitterInfo.

Definition at line 240 of file GblFitterInfo.h.

Referenced by deletePredictions().

◆ deleteForwardInfo()

void genfit::GblFitterInfo::deleteForwardInfo ( )
inlinevirtual

Implements genfit::AbsFitterInfo.

Definition at line 239 of file GblFitterInfo.h.

Referenced by deletePredictions().

◆ deleteMeasurementInfo()

void genfit::GblFitterInfo::deleteMeasurementInfo ( )
inlinevirtual

Implements genfit::AbsFitterInfo.

Definition at line 246 of file GblFitterInfo.h.

◆ deletePredictions()

void genfit::GblFitterInfo::deletePredictions ( )
inline

Definition at line 241 of file GblFitterInfo.h.

References deleteBackwardInfo(), and deleteForwardInfo().

◆ deleteReferenceInfo()

void genfit::GblFitterInfo::deleteReferenceInfo ( )
inlinevirtual

Implements genfit::AbsFitterInfo.

Definition at line 245 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
virtual

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 397 of file GblFitterInfo.cc.

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

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

◆ 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 451 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 460 of file GblFitterInfo.cc.

References getFittedState().

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

◆ getMeasurement()

MeasurementOnPlane genfit::GblFitterInfo::getMeasurement ( ) const

◆ 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 216 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
virtual

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 414 of file GblFitterInfo.cc.

References genfit::AbsMeasurement::constructHMatrix(), getFittedState(), genfit::TrackPoint::getRawMeasurement(), 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
inlinevirtual

Implements genfit::AbsFitterInfo.

Definition at line 233 of file GblFitterInfo.h.

References hasReferenceState().

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

◆ hasBackwardUpdate()

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

Implements genfit::AbsFitterInfo.

Definition at line 235 of file GblFitterInfo.h.

References hasBackwardPrediction().

Referenced by hasPredictionsAndUpdates().

◆ hasForwardPrediction()

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

Implements genfit::AbsFitterInfo.

Definition at line 232 of file GblFitterInfo.h.

References hasReferenceState().

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

◆ hasForwardUpdate()

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

Implements genfit::AbsFitterInfo.

Definition at line 234 of file GblFitterInfo.h.

References hasForwardPrediction().

Referenced by hasPredictionsAndUpdates().

◆ hasMeasurements()

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

◆ hasPredictionsAndUpdates()

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

◆ hasReferenceState()

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

Implements genfit::AbsFitterInfo.

Definition at line 231 of file GblFitterInfo.h.

References refPrediction_.

Referenced by hasBackwardPrediction(), and hasForwardPrediction().

◆ hasUpdate()

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

Reimplemented from genfit::AbsFitterInfo.

Definition at line 236 of file GblFitterInfo.h.

References hasBackwardPrediction(), and hasForwardPrediction().

◆ Print()

void genfit::GblFitterInfo::Print ( const Option_t *  = "") const
virtual

◆ recalculateJacobian()

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

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

◆ 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::Track::getCovSeed(), genfit::StateOnPlane::getState(), genfit::TrackPoint::getTrack(), refPrediction_, genfit::AbsFitterInfo::trackPoint_, and updateMeasurementAndPlane().

Referenced by GblFitterInfo().

◆ updateFitResults()

void genfit::GblFitterInfo::updateFitResults ( gbl::GblTrajectory traj)

◆ 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 194 of file GblFitterInfo.cc.

References genfit::AbsMeasurement::constructMeasurementsOnPlane(), genfit::StateOnPlane::getPlane(), genfit::TrackPoint::getRawMeasurement(), genfit::TrackPoint::hasRawMeasurements(), hMatrix_, measCov_, measurement_, genfit::AbsFitterInfo::setPlane(), and genfit::AbsFitterInfo::trackPoint_.

Referenced by recalculateJacobian(), and setReferenceState().

Member Data Documentation

◆ bwdCov_

TMatrixDSym genfit::GblFitterInfo::bwdCov_
private

Definition at line 260 of file GblFitterInfo.h.

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

◆ bwdPrediction_

TVectorD genfit::GblFitterInfo::bwdPrediction_
private

◆ bwdStateCorrection_

TVectorD genfit::GblFitterInfo::bwdStateCorrection_
private

Definition at line 258 of file GblFitterInfo.h.

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

◆ fittedStateBwd_

boost::scoped_ptr<MeasuredStateOnPlane> genfit::GblFitterInfo::fittedStateBwd_
mutableprivate

◆ fittedStateFwd_

boost::scoped_ptr<MeasuredStateOnPlane> genfit::GblFitterInfo::fittedStateFwd_
mutableprivate

cache

Definition at line 272 of file GblFitterInfo.h.

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

◆ fwdCov_

TMatrixDSym genfit::GblFitterInfo::fwdCov_
private

Definition at line 261 of file GblFitterInfo.h.

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

◆ fwdPrediction_

TVectorD genfit::GblFitterInfo::fwdPrediction_
private

◆ fwdStateCorrection_

TVectorD genfit::GblFitterInfo::fwdStateCorrection_
private

Definition at line 259 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 257 of file GblFitterInfo.h.

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

◆ kinkResidualErrors_

TVectorD genfit::GblFitterInfo::kinkResidualErrors_
private

Definition at line 255 of file GblFitterInfo.h.

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

◆ kinkResiduals_

TVectorD genfit::GblFitterInfo::kinkResiduals_
private

Definition at line 254 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 256 of file GblFitterInfo.h.

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

◆ measResidualErrors_

TVectorD genfit::GblFitterInfo::measResidualErrors_
private

Definition at line 253 of file GblFitterInfo.h.

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

◆ measResiduals_

TVectorD genfit::GblFitterInfo::measResiduals_
private

Definition at line 252 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: