GENFIT
Rev:NoNumberAvailable
|
GBL trajectory. More...
#include <GblTrajectory.h>
Public Member Functions | |
GblTrajectory (const std::vector< GblPoint > &aPointList, bool flagCurv=true, bool flagU1dir=true, bool flagU2dir=true) | |
Create new (simple) trajectory from list of points. More... | |
GblTrajectory (const std::vector< GblPoint > &aPointList, unsigned int aLabel, const TMatrixDSym &aSeed, bool flagCurv=true, bool flagU1dir=true, bool flagU2dir=true) | |
Create new (simple) trajectory from list of points with external seed. More... | |
GblTrajectory (const std::vector< std::pair< std::vector< GblPoint >, TMatrixD > > &aPointaAndTransList) | |
Create new composed trajectory from list of points and transformations. More... | |
GblTrajectory (const std::vector< std::pair< std::vector< GblPoint >, TMatrixD > > &aPointaAndTransList, const TMatrixD &extDerivatives, const TVectorD &extMeasurements, const TVectorD &extPrecisions) | |
Create new composed trajectory from list of points and transformations with (independent) external measurements. More... | |
virtual | ~GblTrajectory () |
bool | isValid () const |
Retrieve validity of trajectory. More... | |
unsigned int | getNumPoints () const |
Retrieve number of point from trajectory. More... | |
unsigned int | getResults (int aSignedLabel, TVectorD &localPar, TMatrixDSym &localCov) const |
Get fit results at point. More... | |
unsigned int | getMeasResults (unsigned int aLabel, unsigned int &numRes, TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors, TVectorD &aDownWeights) |
Get residuals at point from measurement. More... | |
unsigned int | getScatResults (unsigned int aLabel, unsigned int &numRes, TVectorD &aResiduals, TVectorD &aMeasErrors, TVectorD &aResErrors, TVectorD &aDownWeights) |
Get (kink) residuals at point from scatterer. More... | |
void | getLabels (std::vector< unsigned int > &aLabelList) |
Get (list of) labels of points on (simple) trajectory. More... | |
void | getLabels (std::vector< std::vector< unsigned int > > &aLabelList) |
Get (list of lists of) labels of points on (composed) trajectory. More... | |
unsigned int | fit (double &Chi2, int &Ndf, double &lostWeight, std::string optionList="") |
Perform fit of trajectory. More... | |
void | milleOut (MilleBinary &aMille) |
Write valid trajectory to Millepede-II binary file. More... | |
void | printTrajectory (unsigned int level=0) |
Print GblTrajectory. More... | |
void | printPoints (unsigned int level=0) |
Print GblPoints on trajectory. More... | |
void | printData () |
Print GblData blocks for trajectory. More... | |
Private Member Functions | |
std::pair< std::vector < unsigned int >, TMatrixD > | getJacobian (int aSignedLabel) const |
Get jacobian for transformation from fit to track parameters at point. More... | |
void | getFitToLocalJacobian (std::vector< unsigned int > &anIndex, SMatrix55 &aJacobian, const GblPoint &aPoint, unsigned int measDim, unsigned int nJacobian=1) const |
Get (part of) jacobian for transformation from (trajectory) fit to track parameters at point. More... | |
void | getFitToKinkJacobian (std::vector< unsigned int > &anIndex, SMatrix27 &aJacobian, const GblPoint &aPoint) const |
Get jacobian for transformation from (trajectory) fit to kink parameters at point. More... | |
void | construct () |
Construct trajectory from list of points. More... | |
void | defineOffsets () |
Define offsets from list of points. More... | |
void | calcJacobians () |
Calculate Jacobians to previous/next scatterer from point to point ones. More... | |
void | prepare () |
Prepare fit for simple or composed trajectory. More... | |
void | buildLinearEquationSystem () |
Build linear equation system from data (blocks). More... | |
void | predict () |
Calculate predictions for all points. More... | |
double | downWeight (unsigned int aMethod) |
Down-weight all points. More... | |
void | getResAndErr (unsigned int aData, double &aResidual, double &aMeadsError, double &aResError, double &aDownWeight) |
Get residual and errors from data block. More... | |
Private Attributes | |
unsigned int | numAllPoints |
Number of all points on trajectory. More... | |
std::vector< unsigned int > | numPoints |
Number of points on (sub)trajectory. More... | |
unsigned int | numTrajectories |
Number of trajectories (in composed trajectory) More... | |
unsigned int | numOffsets |
Number of (points with) offsets on trajectory. More... | |
unsigned int | numInnerTrans |
Number of inner transformations to external parameters. More... | |
unsigned int | numCurvature |
Number of curvature parameters (0 or 1) or external parameters. More... | |
unsigned int | numParameters |
Number of fit parameters. More... | |
unsigned int | numLocals |
Total number of (additional) local parameters. More... | |
unsigned int | numMeasurements |
Total number of measurements. More... | |
unsigned int | externalPoint |
Label of external point (or 0) More... | |
bool | constructOK |
Trajectory has been successfully constructed (ready for fit/output) More... | |
bool | fitOK |
Trajectory has been successfully fitted (results are valid) More... | |
std::vector< unsigned int > | theDimension |
List of active dimensions (0=u1, 1=u2) in fit. More... | |
std::vector< std::vector < GblPoint > > | thePoints |
(list of) List of points on trajectory More... | |
std::vector< GblData > | theData |
List of data blocks. More... | |
std::vector< unsigned int > | measDataIndex |
mapping points to data blocks from measurements More... | |
std::vector< unsigned int > | scatDataIndex |
mapping points to data blocks from scatterers More... | |
TMatrixDSym | externalSeed |
Precision (inverse covariance matrix) of external seed. More... | |
std::vector< TMatrixD > | innerTransformations |
Transformations at innermost points of. More... | |
TMatrixD | externalDerivatives |
TVectorD | externalMeasurements |
TVectorD | externalPrecisions |
VVector | theVector |
Vector of linear equation system. More... | |
BorderedBandMatrix | theMatrix |
(Bordered band) matrix of linear equation system More... | |
GBL trajectory.
List of GblPoints ordered by arc length. Can be fitted and optionally written to MP-II binary file.
Definition at line 26 of file GblTrajectory.h.
gbl::GblTrajectory::GblTrajectory | ( | const std::vector< GblPoint > & | aPointList, |
bool | flagCurv = true , |
||
bool | flagU1dir = true , |
||
bool | flagU2dir = true |
||
) |
Create new (simple) trajectory from list of points.
Curved trajectory in space (default) or without curvature (q/p) or in one plane (u-direction) only.
[in] | aPointList | List of points |
[in] | flagCurv | Use q/p |
[in] | flagU1dir | Use in u1 direction |
[in] | flagU2dir | Use in u2 direction |
Definition at line 116 of file GblTrajectory.cc.
References construct(), numAllPoints, numPoints, theDimension, and thePoints.
gbl::GblTrajectory::GblTrajectory | ( | const std::vector< GblPoint > & | aPointList, |
unsigned int | aLabel, | ||
const TMatrixDSym & | aSeed, | ||
bool | flagCurv = true , |
||
bool | flagU1dir = true , |
||
bool | flagU2dir = true |
||
) |
Create new (simple) trajectory from list of points with external seed.
Curved trajectory in space (default) or without curvature (q/p) or in one plane (u-direction) only.
[in] | aPointList | List of points |
[in] | aLabel | (Signed) label of point for external seed (<0: in front, >0: after point, slope changes at scatterer!) |
[in] | aSeed | Precision matrix of external seed |
[in] | flagCurv | Use q/p |
[in] | flagU1dir | Use in u1 direction |
[in] | flagU2dir | Use in u2 direction |
Definition at line 144 of file GblTrajectory.cc.
References construct(), numAllPoints, numPoints, theDimension, and thePoints.
gbl::GblTrajectory::GblTrajectory | ( | const std::vector< std::pair< std::vector< GblPoint >, TMatrixD > > & | aPointsAndTransList | ) |
Create new composed trajectory from list of points and transformations.
Composed of curved trajectory in space.
[in] | aPointsAndTransList | List containing pairs with list of points and transformation (at inner (first) point) |
Definition at line 167 of file GblTrajectory.cc.
References construct(), innerTransformations, numAllPoints, numCurvature, numPoints, theDimension, and thePoints.
gbl::GblTrajectory::GblTrajectory | ( | const std::vector< std::pair< std::vector< GblPoint >, TMatrixD > > & | aPointsAndTransList, |
const TMatrixD & | extDerivatives, | ||
const TVectorD & | extMeasurements, | ||
const TVectorD & | extPrecisions | ||
) |
Create new composed trajectory from list of points and transformations with (independent) external measurements.
Composed of curved trajectory in space.
[in] | aPointsAndTransList | List containing pairs with list of points and transformation (at inner (first) point) |
[in] | extDerivatives | Derivatives of external measurements vs external parameters |
[in] | extMeasurements | External measurements (residuals) |
[in] | extPrecisions | Precision of external measurements |
Definition at line 193 of file GblTrajectory.cc.
References construct(), innerTransformations, numAllPoints, numCurvature, numPoints, theDimension, and thePoints.
|
virtual |
Definition at line 215 of file GblTrajectory.cc.
|
private |
Build linear equation system from data (blocks).
Definition at line 691 of file GblTrajectory.cc.
References gbl::BorderedBandMatrix::addBlockMatrix(), numCurvature, numLocals, numParameters, gbl::VVector::resize(), gbl::BorderedBandMatrix::resize(), theData, theMatrix, and theVector.
Referenced by fit().
|
private |
Calculate Jacobians to previous/next scatterer from point to point ones.
Definition at line 296 of file GblTrajectory.cc.
References gbl::GblPoint::addNextJacobian(), gbl::GblPoint::getP2pJacobian(), numTrajectories, and thePoints.
Referenced by construct().
|
private |
Construct trajectory from list of points.
Trajectory is prepared for fit or output to binary file, may consists of sub-trajectories.
Definition at line 232 of file GblTrajectory.cc.
References calcJacobians(), constructOK, defineOffsets(), fitOK, numAllPoints, numCurvature, numInnerTrans, numLocals, numMeasurements, numOffsets, numParameters, numTrajectories, prepare(), theDimension, and thePoints.
Referenced by GblTrajectory().
|
private |
Define offsets from list of points.
Define offsets at points with scatterers and first and last point. All other points need interpolation from adjacent points with offsets.
Definition at line 274 of file GblTrajectory.cc.
References numOffsets, numTrajectories, and thePoints.
Referenced by construct().
|
private |
Down-weight all points.
[in] | aMethod | M-estimator (1: Tukey, 2:Huber, 3:Cauchy) |
Definition at line 936 of file GblTrajectory.cc.
References theData.
Referenced by fit().
unsigned int gbl::GblTrajectory::fit | ( | double & | Chi2, |
int & | Ndf, | ||
double & | lostWeight, | ||
std::string | optionList = "" |
||
) |
Perform fit of trajectory.
Optionally iterate for outlier down-weighting.
[out] | Chi2 | Chi2 sum (corrected for down-weighting) |
[out] | Ndf | Number of degrees of freedom |
[out] | lostWeight | Sum of weights lost due to down-weighting |
[in] | optionList | Iterations for down-weighting (One character per iteration: t,h,c (or T,H,C) for Tukey, Huber or Cauchy function) |
Definition at line 955 of file GblTrajectory.cc.
References buildLinearEquationSystem(), constructOK, downWeight(), fitOK, numParameters, predict(), gbl::BorderedBandMatrix::solveAndInvertBorderedBand(), theData, theMatrix, and theVector.
Referenced by genfit::GFGbl::processTrackWithRep(), and genfit::GblFitter::processTrackWithRep().
|
private |
Get jacobian for transformation from (trajectory) fit to kink parameters at point.
Jacobian broken lines (q/p,..,u_i-1,u_i,u_i+1..) to kink (du') parameters.
[out] | anIndex | List of fit parameters with non zero derivatives |
[out] | aJacobian | Corresponding transformation matrix |
[in] | aPoint | Point to use |
Definition at line 513 of file GblTrajectory.cc.
References gbl::GblPoint::getDerivatives(), gbl::GblPoint::getOffset(), numCurvature, numLocals, and theDimension.
Referenced by prepare().
|
private |
Get (part of) jacobian for transformation from (trajectory) fit to track parameters at point.
Jacobian broken lines (q/p,..,u_i,u_i+1..) to local (q/p,u',u) parameters.
[out] | anIndex | List of fit parameters with non zero derivatives |
[out] | aJacobian | Corresponding transformation matrix |
[in] | aPoint | Point to use |
[in] | measDim | Dimension of 'measurement' (<=2: calculate only offset part, >2: complete matrix) |
[in] | nJacobian | Direction (0: to previous offset, 1: to next offset) |
Definition at line 418 of file GblTrajectory.cc.
References gbl::GblPoint::getDerivatives(), gbl::GblPoint::getOffset(), numCurvature, numLocals, and theDimension.
Referenced by getJacobian(), and prepare().
|
private |
Get jacobian for transformation from fit to track parameters at point.
Jacobian broken lines (q/p,..,u_i,u_i+1..) to track (q/p,u',u) parameters including additional local parameters.
[in] | aSignedLabel | (Signed) label of point for external seed (<0: in front, >0: after point, slope changes at scatterer!) |
Definition at line 342 of file GblTrajectory.cc.
References getFitToLocalJacobian(), numCurvature, numLocals, numPoints, numTrajectories, theDimension, and thePoints.
Referenced by getResults(), and prepare().
void gbl::GblTrajectory::getLabels | ( | std::vector< unsigned int > & | aLabelList | ) |
Get (list of) labels of points on (simple) trajectory.
[out] | aLabelList | List of labels (aLabelList[i] = i+1) |
Definition at line 635 of file GblTrajectory.cc.
References thePoints.
void gbl::GblTrajectory::getLabels | ( | std::vector< std::vector< unsigned int > > & | aLabelList | ) |
Get (list of lists of) labels of points on (composed) trajectory.
[out] | aLabelList | List of of lists of labels |
Definition at line 648 of file GblTrajectory.cc.
References numTrajectories, and thePoints.
unsigned int gbl::GblTrajectory::getMeasResults | ( | unsigned int | aLabel, |
unsigned int & | numData, | ||
TVectorD & | aResiduals, | ||
TVectorD & | aMeasErrors, | ||
TVectorD & | aResErrors, | ||
TVectorD & | aDownWeights | ||
) |
Get residuals at point from measurement.
Get (diagonalized) residual, error of measurement and residual and down-weighting factor for measurement at point
[in] | aLabel | Label of point on trajectory |
[out] | numData | Number of data blocks from measurement at point |
[out] | aResiduals | Measurements-Predictions |
[out] | aMeasErrors | Errors of Measurements |
[out] | aResErrors | Errors of Residuals (including correlations from track fit) |
[out] | aDownWeights | Down-Weighting factors |
Definition at line 586 of file GblTrajectory.cc.
References fitOK, getResAndErr(), and measDataIndex.
Referenced by genfit::GFGbl::processTrackWithRep(), and genfit::GblFitterInfo::updateFitResults().
unsigned int gbl::GblTrajectory::getNumPoints | ( | ) | const |
Retrieve number of point from trajectory.
Definition at line 224 of file GblTrajectory.cc.
References numAllPoints.
Referenced by genfit::GblFitterInfo::updateFitResults().
|
private |
Get residual and errors from data block.
Get residual, error of measurement and residual and down-weighting factor for (single) data block
[in] | aData | Label of data block |
[out] | aResidual | Measurement-Prediction |
[out] | aMeasError | Error of Measurement |
[out] | aResError | Error of Residual (including correlations from track fit) |
[out] | aDownWeight | Down-Weighting factor |
Definition at line 671 of file GblTrajectory.cc.
References gbl::BorderedBandMatrix::getBlockMatrix(), theData, and theMatrix.
Referenced by getMeasResults(), and getScatResults().
unsigned int gbl::GblTrajectory::getResults | ( | int | aSignedLabel, |
TVectorD & | localPar, | ||
TMatrixDSym & | localCov | ||
) | const |
Get fit results at point.
Get corrections and covariance matrix for local track and additional parameters in forward or backward direction.
[in] | aSignedLabel | (Signed) label of point on trajectory (<0: in front, >0: after point, slope changes at scatterer!) |
[out] | localPar | Corrections for local parameters |
[out] | localCov | Covariance for local parameters |
Definition at line 556 of file GblTrajectory.cc.
References fitOK, gbl::BorderedBandMatrix::getBlockMatrix(), getJacobian(), theMatrix, and theVector.
Referenced by genfit::GFGbl::processTrackWithRep(), and genfit::GblFitterInfo::updateFitResults().
unsigned int gbl::GblTrajectory::getScatResults | ( | unsigned int | aLabel, |
unsigned int & | numData, | ||
TVectorD & | aResiduals, | ||
TVectorD & | aMeasErrors, | ||
TVectorD & | aResErrors, | ||
TVectorD & | aDownWeights | ||
) |
Get (kink) residuals at point from scatterer.
Get (diagonalized) residual, error of measurement and residual and down-weighting factor for scatterering kinks at point
[in] | aLabel | Label of point on trajectory |
[out] | numData | Number of data blocks from scatterer at point |
[out] | aResiduals | (kink)Measurements-(kink)Predictions |
[out] | aMeasErrors | Errors of (kink)Measurements |
[out] | aResErrors | Errors of Residuals (including correlations from track fit) |
[out] | aDownWeights | Down-Weighting factors |
Definition at line 615 of file GblTrajectory.cc.
References fitOK, getResAndErr(), and scatDataIndex.
Referenced by genfit::GblFitterInfo::updateFitResults().
bool gbl::GblTrajectory::isValid | ( | ) | const |
Retrieve validity of trajectory.
Definition at line 219 of file GblTrajectory.cc.
References constructOK.
Referenced by genfit::GFGbl::processTrackWithRep(), genfit::GblFitterInfo::updateFitResults(), and genfit::GblFitter::updateGblInfo().
void gbl::GblTrajectory::milleOut | ( | MilleBinary & | aMille | ) |
Write valid trajectory to Millepede-II binary file.
Definition at line 1003 of file GblTrajectory.cc.
References gbl::MilleBinary::addData(), constructOK, theData, and gbl::MilleBinary::writeRecord().
Referenced by genfit::GFGbl::processTrackWithRep().
|
private |
Calculate predictions for all points.
Definition at line 925 of file GblTrajectory.cc.
References theData, and theVector.
Referenced by fit().
|
private |
Prepare fit for simple or composed trajectory.
Generate data (blocks) from measurements, kinks, external seed and measurements.
Definition at line 712 of file GblTrajectory.cc.
References gbl::GblData::addDerivatives(), externalDerivatives, externalMeasurements, externalPoint, externalPrecisions, externalSeed, getFitToKinkJacobian(), getFitToLocalJacobian(), getJacobian(), innerTransformations, measDataIndex, numAllPoints, numCurvature, numInnerTrans, numLocals, numMeasurements, numOffsets, numTrajectories, scatDataIndex, theData, theDimension, and thePoints.
Referenced by construct().
void gbl::GblTrajectory::printData | ( | ) |
Print GblData blocks for trajectory.
Definition at line 1107 of file GblTrajectory.cc.
References theData.
void gbl::GblTrajectory::printPoints | ( | unsigned int | level = 0 | ) |
Print GblPoints on trajectory.
[in] | level | print level (0: minimum, >0: more) |
Definition at line 1095 of file GblTrajectory.cc.
References numTrajectories, and thePoints.
void gbl::GblTrajectory::printTrajectory | ( | unsigned int | level = 0 | ) |
Print GblTrajectory.
[in] | level | print level (0: minimum, >0: more) |
Definition at line 1029 of file GblTrajectory.cc.
References constructOK, externalDerivatives, externalMeasurements, externalPoint, externalPrecisions, externalSeed, fitOK, innerTransformations, numAllPoints, numInnerTrans, numMeasurements, numOffsets, numParameters, gbl::VVector::print(), gbl::BorderedBandMatrix::printMatrix(), theDimension, theMatrix, and theVector.
|
private |
Trajectory has been successfully constructed (ready for fit/output)
Definition at line 70 of file GblTrajectory.h.
Referenced by construct(), fit(), isValid(), milleOut(), and printTrajectory().
|
private |
Definition at line 80 of file GblTrajectory.h.
Referenced by prepare(), and printTrajectory().
|
private |
Definition at line 81 of file GblTrajectory.h.
Referenced by prepare(), and printTrajectory().
|
private |
Label of external point (or 0)
Definition at line 69 of file GblTrajectory.h.
Referenced by prepare(), and printTrajectory().
|
private |
Definition at line 82 of file GblTrajectory.h.
Referenced by prepare(), and printTrajectory().
|
private |
Precision (inverse covariance matrix) of external seed.
Definition at line 77 of file GblTrajectory.h.
Referenced by prepare(), and printTrajectory().
|
private |
Trajectory has been successfully fitted (results are valid)
Definition at line 71 of file GblTrajectory.h.
Referenced by construct(), fit(), getMeasResults(), getResults(), getScatResults(), and printTrajectory().
|
private |
Transformations at innermost points of.
Definition at line 78 of file GblTrajectory.h.
Referenced by GblTrajectory(), prepare(), and printTrajectory().
|
private |
mapping points to data blocks from measurements
Definition at line 75 of file GblTrajectory.h.
Referenced by getMeasResults(), and prepare().
|
private |
Number of all points on trajectory.
Definition at line 60 of file GblTrajectory.h.
Referenced by construct(), GblTrajectory(), getNumPoints(), prepare(), and printTrajectory().
|
private |
Number of curvature parameters (0 or 1) or external parameters.
Definition at line 65 of file GblTrajectory.h.
Referenced by buildLinearEquationSystem(), construct(), GblTrajectory(), getFitToKinkJacobian(), getFitToLocalJacobian(), getJacobian(), and prepare().
|
private |
Number of inner transformations to external parameters.
Definition at line 64 of file GblTrajectory.h.
Referenced by construct(), prepare(), and printTrajectory().
|
private |
Total number of (additional) local parameters.
Definition at line 67 of file GblTrajectory.h.
Referenced by buildLinearEquationSystem(), construct(), getFitToKinkJacobian(), getFitToLocalJacobian(), getJacobian(), and prepare().
|
private |
Total number of measurements.
Definition at line 68 of file GblTrajectory.h.
Referenced by construct(), prepare(), and printTrajectory().
|
private |
Number of (points with) offsets on trajectory.
Definition at line 63 of file GblTrajectory.h.
Referenced by construct(), defineOffsets(), prepare(), and printTrajectory().
|
private |
Number of fit parameters.
Definition at line 66 of file GblTrajectory.h.
Referenced by buildLinearEquationSystem(), construct(), fit(), and printTrajectory().
|
private |
Number of points on (sub)trajectory.
Definition at line 61 of file GblTrajectory.h.
Referenced by GblTrajectory(), and getJacobian().
|
private |
Number of trajectories (in composed trajectory)
Definition at line 62 of file GblTrajectory.h.
Referenced by calcJacobians(), construct(), defineOffsets(), getJacobian(), getLabels(), prepare(), and printPoints().
|
private |
mapping points to data blocks from scatterers
Definition at line 76 of file GblTrajectory.h.
Referenced by getScatResults(), and prepare().
|
private |
List of data blocks.
Definition at line 74 of file GblTrajectory.h.
Referenced by buildLinearEquationSystem(), downWeight(), fit(), getResAndErr(), milleOut(), predict(), prepare(), and printData().
|
private |
List of active dimensions (0=u1, 1=u2) in fit.
Definition at line 72 of file GblTrajectory.h.
Referenced by construct(), GblTrajectory(), getFitToKinkJacobian(), getFitToLocalJacobian(), getJacobian(), prepare(), and printTrajectory().
|
private |
(Bordered band) matrix of linear equation system
Definition at line 84 of file GblTrajectory.h.
Referenced by buildLinearEquationSystem(), fit(), getResAndErr(), getResults(), and printTrajectory().
|
private |
(list of) List of points on trajectory
Definition at line 73 of file GblTrajectory.h.
Referenced by calcJacobians(), construct(), defineOffsets(), GblTrajectory(), getJacobian(), getLabels(), prepare(), and printPoints().
|
private |
Vector of linear equation system.
Definition at line 83 of file GblTrajectory.h.
Referenced by buildLinearEquationSystem(), fit(), getResults(), predict(), and printTrajectory().