GeneralBrokenLines  V01-11-00
Public Member Functions | Private Member Functions | Private Attributes
GblTrajectory Class Reference

GBL trajectory. More...

#include <GblTrajectory.h>

List of all members.

Public Member Functions

 GblTrajectory (bool flagCurv=true, bool flagU1dir=true, bool flagU2dir=true)
 Create new trajectory.
virtual ~GblTrajectory ()
unsigned int addPoint (GblPoint aPoint)
 Add point to trajectory.
unsigned int getNumPoints () const
 Retrieve number of point from trajectory.
void addExternalSeed (unsigned int aLabel, const TMatrixDSym &aSeed)
 Add external seed to trajectory.
void getResults (int aSignedLabel, TVectorD &localPar, TMatrixDSym &localCov) const
 Get fit results at point.
unsigned int fit (double &Chi2, int &Ndf, double &lostWeight, std::string optionList="")
 Perform fit of trajectory.
void milleOut (MilleBinary &aMille)
 Write trajectory to Millepede-II binary file.
void kalmanGainFilter (double &Chi2, int &Ndf)

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.
void getFitToLocalJacobian (std::vector< unsigned int > &anIndex, SMatrix55 &aJacobian, GblPoint &aPoint, unsigned int measDim, unsigned int nJacobian=1) const
 Get (part of) jacobian for transformation from (trajectory) fit to track parameters at point.
void getFitToKinkJacobian (std::vector< unsigned int > &anIndex, SMatrix27 &aJacobian, GblPoint &aPoint) const
 Get jacobian for transformation from (trajectory) fit to kink parameters at point.
void defineOffsets ()
 Define offsets from list of points.
void calcJacobians ()
 Calculate Jacobians to previous/next scatterer from point to point ones.
void buildLinearEquationSystem ()
 Build linear equation system from data (blocks).
void prepare ()
 Prepare fit.
void predict ()
 Calculate predictions for all points.
double downWeight (unsigned int aMethod)
 Down-weight all points.

Private Attributes

unsigned int numPoints
 Number of point on trajectory.
unsigned int numOffsets
 Number of (points with) offsets on trajectory.
unsigned int numCurvature
 Number of curvature parameters (0 or 1)
unsigned int numParameters
 Number of fit parameters.
unsigned int numLocals
 Total number of (additional) local parameters.
unsigned int externalPoint
 Label of external point (or 0)
std::vector< unsigned int > theDimension
 List of active dimensions (0=u1, 1=u2) in fit.
std::vector< GblPointthePoints
 List of points on trajectory.
std::vector< GblDatatheData
 List of data blocks.
std::vector< unsigned int > externalIndex
 List of fit parameters used by external seed.
TMatrixDSym externalSeed
 Precision (inverse covariance matrix) of external seed.
VVector::VVector theVector
 Vector of linear equation system.
BorderedBandMatrix theMatrix
 (Bordered band) matrix of linear equation system

Detailed Description

GBL trajectory.

List of GblPoints ordered by arc length. Can be fitted and optionally written to MP-II binary file.

Definition at line 23 of file GblTrajectory.h.


Constructor & Destructor Documentation

GblTrajectory::GblTrajectory ( bool  flagCurv = true,
bool  flagU1dir = true,
bool  flagU2dir = true 
)

Create new trajectory.

Curved trajectory in space (default) or without curvature (q/p) or in one plane (u-direction) only.

Parameters:
[in]flagCurvUse q/p
[in]flagU1dirUse in u1 direction
[in]flagU2dirUse in u2 direction

Definition at line 91 of file GblTrajectory.cpp.

References theDimension, and thePoints.

Definition at line 102 of file GblTrajectory.cpp.


Member Function Documentation

void GblTrajectory::addExternalSeed ( unsigned int  aLabel,
const TMatrixDSym &  aSeed 
)

Add external seed to trajectory.

Parameters:
[in]aLabel(Signed) label of point for external seed (<0: in front, >0: after point, slope changes at scatterer!)
[in]aSeedPrecision matrix of external seed

Definition at line 130 of file GblTrajectory.cpp.

References externalPoint, and externalSeed.

Referenced by example1().

unsigned int GblTrajectory::addPoint ( GblPoint  aPoint)

Add point to trajectory.

Points have to be ordered in arc length.

Parameters:
[in]aPointPoint to add

Definition at line 111 of file GblTrajectory.cpp.

References GblPoint::getNumLocals(), numLocals, numPoints, GblPoint::setLabel(), and thePoints.

Referenced by example1().

Build linear equation system from data (blocks).

Definition at line 423 of file GblTrajectory.cpp.

References BorderedBandMatrix::addBlockMatrix(), numCurvature, numLocals, numParameters, BorderedBandMatrix::resize(), theData, theMatrix, and theVector.

Referenced by fit().

void GblTrajectory::calcJacobians ( ) [private]

Calculate Jacobians to previous/next scatterer from point to point ones.

Definition at line 162 of file GblTrajectory.cpp.

References numPoints, and thePoints.

Referenced by fit().

void GblTrajectory::defineOffsets ( ) [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 142 of file GblTrajectory.cpp.

References numCurvature, numLocals, numOffsets, numParameters, numPoints, theDimension, and thePoints.

Referenced by fit().

double GblTrajectory::downWeight ( unsigned int  aMethod) [private]

Down-weight all points.

Parameters:
[in]aMethodM-estimator (1: Tukey, 2:Huber, 3:Cauchy)

Definition at line 538 of file GblTrajectory.cpp.

References theData.

Referenced by fit().

unsigned int GblTrajectory::fit ( double &  Chi2,
int &  Ndf,
double &  lostWeight,
std::string  optionList = "" 
)

Perform fit of trajectory.

Optionally iterate for outlier down-weighting.

Parameters:
[out]Chi2Chi2 sum (corrected for down-weighting)
[out]NdfNumber of degrees of freedom
[out]lostWeightSum of weights lost due to down-weighting
[in]optionListIterations for down-weighting (One character per iteration: t,h,c (or T,H,C) for Tukey, Huber or Cauchy function)
Returns:
Error code (non zero value indicates failure of fit)

Definition at line 557 of file GblTrajectory.cpp.

References buildLinearEquationSystem(), calcJacobians(), defineOffsets(), downWeight(), numParameters, predict(), prepare(), BorderedBandMatrix::solveAndInvertBorderedBand(), theData, theMatrix, and theVector.

Referenced by example1().

void GblTrajectory::getFitToKinkJacobian ( std::vector< unsigned int > &  anIndex,
SMatrix27 aJacobian,
GblPoint aPoint 
) const [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.

Parameters:
[out]anIndexList of fit parameters with non zero derivatives
[out]aJacobianCorresponding transformation matrix
[in]aPointPoint to use

Definition at line 366 of file GblTrajectory.cpp.

References GblPoint::getDerivatives(), GblPoint::getOffset(), numCurvature, numLocals, and theDimension.

Referenced by prepare().

void GblTrajectory::getFitToLocalJacobian ( std::vector< unsigned int > &  anIndex,
SMatrix55 aJacobian,
GblPoint aPoint,
unsigned int  measDim,
unsigned int  nJacobian = 1 
) const [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.

Parameters:
[out]anIndexList of fit parameters with non zero derivatives
[out]aJacobianCorresponding transformation matrix
[in]aPointPoint to use
[in]measDimDimension of 'measurement' (<=2: calculate only offset part, >2: complete matrix)
[in]nJacobianDirection (0: to previous offset, 1: to next offset)

Definition at line 274 of file GblTrajectory.cpp.

References GblPoint::getDerivatives(), GblPoint::getOffset(), numCurvature, numLocals, and theDimension.

Referenced by getJacobian(), and prepare().

std::pair< std::vector< unsigned int >, TMatrixD > GblTrajectory::getJacobian ( int  aSignedLabel) const [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.

Parameters:
[in]aSignedLabel(Signed) label of point for external seed (<0: in front, >0: after point, slope changes at scatterer!)
Returns:
List of fit parameters with non zero derivatives and corresponding transformation matrix

Definition at line 210 of file GblTrajectory.cpp.

References getFitToLocalJacobian(), numCurvature, numLocals, numPoints, theDimension, and thePoints.

Referenced by getResults(), and prepare().

unsigned int GblTrajectory::getNumPoints ( ) const

Retrieve number of point from trajectory.

Definition at line 120 of file GblTrajectory.cpp.

References numPoints.

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

Parameters:
[in]aSignedLabel(Signed) label of point for external seed (<0: in front, >0: after point, slope changes at scatterer!)
[out]localParCorrections for local parameters
[out]localCovCovariance for local parameters

Definition at line 408 of file GblTrajectory.cpp.

References BorderedBandMatrix::getBlockMatrix(), getJacobian(), theMatrix, and theVector.

void GblTrajectory::kalmanGainFilter ( double &  Chi2,
int &  Ndf 
)

Definition at line 632 of file GblTrajectory.cpp.

References numPoints, and thePoints.

Write trajectory to Millepede-II binary file.

Definition at line 604 of file GblTrajectory.cpp.

References MilleBinary::addData(), theData, and MilleBinary::writeRecord().

void GblTrajectory::predict ( ) [private]

Calculate predictions for all points.

Definition at line 527 of file GblTrajectory.cpp.

References theData, and theVector.

Referenced by fit().

void GblTrajectory::prepare ( ) [private]

Prepare fit.

Generate data (blocks) from measurements, kinks and external seed.

Definition at line 444 of file GblTrajectory.cpp.

References GblData::addDerivatives(), externalIndex, externalPoint, externalSeed, getFitToKinkJacobian(), getFitToLocalJacobian(), getJacobian(), numOffsets, numPoints, theData, theDimension, and thePoints.

Referenced by fit().


Member Data Documentation

std::vector<unsigned int> GblTrajectory::externalIndex [private]

List of fit parameters used by external seed.

Definition at line 48 of file GblTrajectory.h.

Referenced by prepare().

unsigned int GblTrajectory::externalPoint [private]

Label of external point (or 0)

Definition at line 44 of file GblTrajectory.h.

Referenced by addExternalSeed(), and prepare().

TMatrixDSym GblTrajectory::externalSeed [private]

Precision (inverse covariance matrix) of external seed.

Definition at line 49 of file GblTrajectory.h.

Referenced by addExternalSeed(), and prepare().

unsigned int GblTrajectory::numCurvature [private]

Number of curvature parameters (0 or 1)

Definition at line 41 of file GblTrajectory.h.

Referenced by buildLinearEquationSystem(), defineOffsets(), getFitToKinkJacobian(), getFitToLocalJacobian(), and getJacobian().

unsigned int GblTrajectory::numLocals [private]

Total number of (additional) local parameters.

Definition at line 43 of file GblTrajectory.h.

Referenced by addPoint(), buildLinearEquationSystem(), defineOffsets(), getFitToKinkJacobian(), getFitToLocalJacobian(), and getJacobian().

unsigned int GblTrajectory::numOffsets [private]

Number of (points with) offsets on trajectory.

Definition at line 40 of file GblTrajectory.h.

Referenced by defineOffsets(), and prepare().

unsigned int GblTrajectory::numParameters [private]

Number of fit parameters.

Definition at line 42 of file GblTrajectory.h.

Referenced by buildLinearEquationSystem(), defineOffsets(), and fit().

unsigned int GblTrajectory::numPoints [private]

Number of point on trajectory.

Definition at line 39 of file GblTrajectory.h.

Referenced by addPoint(), calcJacobians(), defineOffsets(), getJacobian(), getNumPoints(), kalmanGainFilter(), and prepare().

std::vector<GblData> GblTrajectory::theData [private]

List of data blocks.

Definition at line 47 of file GblTrajectory.h.

Referenced by buildLinearEquationSystem(), downWeight(), fit(), milleOut(), predict(), and prepare().

std::vector<unsigned int> GblTrajectory::theDimension [private]

List of active dimensions (0=u1, 1=u2) in fit.

Definition at line 45 of file GblTrajectory.h.

Referenced by defineOffsets(), GblTrajectory(), getFitToKinkJacobian(), getFitToLocalJacobian(), getJacobian(), and prepare().

(Bordered band) matrix of linear equation system

Definition at line 51 of file GblTrajectory.h.

Referenced by buildLinearEquationSystem(), fit(), and getResults().

std::vector<GblPoint> GblTrajectory::thePoints [private]

List of points on trajectory.

Definition at line 46 of file GblTrajectory.h.

Referenced by addPoint(), calcJacobians(), defineOffsets(), GblTrajectory(), getJacobian(), kalmanGainFilter(), and prepare().

Vector of linear equation system.

Definition at line 50 of file GblTrajectory.h.

Referenced by buildLinearEquationSystem(), fit(), getResults(), and predict().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs