GeneralBrokenLines V03-01-03
using EIGEN
|
Data (block) for independent scalar measurement. More...
#include <GblData.h>
Public Member Functions | |
GblData (unsigned int aLabel, dataBlockType aType, double aValue, double aPrec, unsigned int aTraj=0, unsigned int aPoint=0, unsigned int aMeas=0) | |
Create data block. More... | |
GblData (const GblData &)=default | |
GblData & | operator= (const GblData &)=default |
GblData (GblData &&)=default | |
GblData & | operator= (GblData &&)=default |
virtual | ~GblData () |
template<typename LocalDerivative , typename ExtDerivative > | |
void | addDerivatives (unsigned int iRow, const std::array< unsigned int, 5 > &labDer, const Matrix5d &matDer, unsigned int iOff, const Eigen::MatrixBase< LocalDerivative > &derLocal, unsigned int extOff, const Eigen::MatrixBase< ExtDerivative > &extDer) |
Add derivatives from measurement. More... | |
template<typename ExtDerivative > | |
void | addDerivatives (unsigned int iRow, unsigned int nDer, const std::array< unsigned int, 9 > &labDer, const Matrix49d &matDer, unsigned int extOff, const Eigen::MatrixBase< ExtDerivative > &extDer) |
Add derivatives from kink. More... | |
void | addDerivatives (const std::vector< unsigned int > &index, const std::vector< double > &derivatives) |
Add derivatives from external seed. More... | |
void | setPrediction (const VVector &aVector) |
Calculate prediction for data from fit (by GblTrajectory::fit). More... | |
double | setDownWeighting (unsigned int aMethod) |
Outlier down weighting with M-estimators (by GblTrajectory::fit). More... | |
double | getChi2 () const |
Calculate Chi2 contribution. More... | |
void | printData () const |
Print data block. More... | |
unsigned int | getLabel () const |
Get label. More... | |
dataBlockType | getType () const |
Get type. More... | |
void | getLocalData (double &aValue, double &aWeight, unsigned int &numLocal, unsigned int *&indLocal, double *&derLocal) |
Get Data for local fit. More... | |
void | getAllData (double &aValue, double &aErr, unsigned int &numLocal, unsigned int *&indLocal, double *&derLocal, unsigned int &aTraj, unsigned int &aPoint, unsigned int &aMeas, unsigned int &aRow) |
Get all Data for MP-II binary record. More... | |
void | getResidual (double &aResidual, double &aVariance, double &aDownWeight, unsigned int &numLocal, unsigned int *&indLocal, double *&derLocal) |
Get data for residual (and errors) "long list". More... | |
void | getResidual (double &aResidual, double &aVariance) |
Get data for residual (and errors) "short list". More... | |
Private Attributes | |
unsigned int | theLabel |
Label (of corresponding point) More... | |
unsigned int | theRow |
Row number (of measurement) More... | |
dataBlockType | theType |
Type (None, InternalMeasurement, InternalKink, ExternalSeed, ExternalMeasurement) More... | |
double | theValue |
Value (residual) More... | |
double | thePrecision |
Precision (1/sigma**2) More... | |
unsigned int | theTrajectory |
Trajectory number. More... | |
unsigned int | thePoint |
Point number (on trajectory) More... | |
unsigned int | theMeas |
Measurement number (at point) More... | |
unsigned int | theDWMethod |
Down-weighting method (0: None, 1: Tukey, 2: Huber, 3: Cauchy) More... | |
double | theDownWeight |
Down-weighting factor (0-1) More... | |
double | thePrediction |
Prediction from fit. More... | |
unsigned int | theNumLocal |
Number of (non zero) local derivatives (max 9 for kinks+steps) More... | |
unsigned int | theParameters [9] |
List of parameters (with non zero derivatives) More... | |
double | theDerivatives [9] |
List of derivatives for fit. More... | |
std::vector< unsigned int > | moreParameters |
List of fit parameters (with non zero derivatives) More... | |
std::vector< double > | moreDerivatives |
List of derivatives for fit. More... | |
Data (block) for independent scalar measurement.
Data (block) containing value, precision and derivatives for measurements, kinks and seeds. Created from attributes of GblPoints, used to construct linear equation system for track fit.
gbl::GblData::GblData | ( | unsigned int | aLabel, |
dataBlockType | aType, | ||
double | aValue, | ||
double | aPrec, | ||
unsigned int | aTraj = 0 , |
||
unsigned int | aPoint = 0 , |
||
unsigned int | aMeas = 0 |
||
) |
Create data block.
[in] | aLabel | Label of corresponding point |
[in] | aType | Type of (scalar) measurement |
[in] | aValue | Value of (scalar) measurement |
[in] | aPrec | Precision of (scalar) measurement |
[in] | aTraj | Trajectory number |
[in] | aPoint | Point number |
[in] | aMeas | measurement number |
Definition at line 46 of file GblData.cpp.
|
default |
|
default |
|
virtual |
Definition at line 55 of file GblData.cpp.
void gbl::GblData::addDerivatives | ( | const std::vector< unsigned int > & | index, |
const std::vector< double > & | derivatives | ||
) |
Add derivatives from external seed.
Add (non-zero) derivatives to data block. Fill list of labels of used fit parameters.
[in] | index | Labels for derivatives |
[in] | derivatives | Derivatives (vector) |
Definition at line 64 of file GblData.cpp.
References moreDerivatives, and moreParameters.
void gbl::GblData::addDerivatives | ( | unsigned int | iRow, |
const std::array< unsigned int, 5 > & | labDer, | ||
const Matrix5d & | matDer, | ||
unsigned int | iOff, | ||
const Eigen::MatrixBase< LocalDerivative > & | derLocal, | ||
unsigned int | extOff, | ||
const Eigen::MatrixBase< ExtDerivative > & | extDer | ||
) |
Add derivatives from measurement.
Add (non-zero) derivatives to data block. Fill list of labels of used fit parameters.
LocalDerivative | Local derivatives matrix |
ExtDerivative | External derivatives matrix |
[in] | iRow | Row index (0-4) in up to 5D measurement |
[in] | labDer | Labels for derivatives |
[in] | matDer | Derivatives (matrix) 'measurement vs track fit parameters' |
[in] | iOff | Offset for row index for additional parameters |
[in] | derLocal | Derivatives (matrix) for additional local parameters |
[in] | extOff | Offset for external parameters |
[in] | extDer | Derivatives for external Parameters |
Definition at line 147 of file GblData.h.
References moreDerivatives, moreParameters, theDerivatives, theNumLocal, theParameters, and theRow.
Referenced by gbl::GblTrajectory::prepare().
void gbl::GblData::addDerivatives | ( | unsigned int | iRow, |
unsigned int | nDer, | ||
const std::array< unsigned int, 9 > & | labDer, | ||
const Matrix49d & | matDer, | ||
unsigned int | extOff, | ||
const Eigen::MatrixBase< ExtDerivative > & | extDer | ||
) |
Add derivatives from kink.
Add (non-zero) derivatives to data block. Fill list of labels of used fit parameters.
ExtDerivative | External derivatives matrix |
[in] | iRow | Row index (0-3) in 2D kinks and steps |
[in] | nDer | Number of derivatives (7: kinks, 9: kinks+steps) |
[in] | labDer | Labels for derivatives |
[in] | matDer | Derivatives (matrix) 'kinks+steps vs track fit parameters' |
[in] | extOff | Offset for external parameters |
[in] | extDer | Derivatives for external Parameters |
Definition at line 213 of file GblData.h.
References moreDerivatives, moreParameters, theDerivatives, theNumLocal, theParameters, and theRow.
void gbl::GblData::getAllData | ( | double & | aValue, |
double & | aErr, | ||
unsigned int & | numLocal, | ||
unsigned int *& | indLocal, | ||
double *& | derLocal, | ||
unsigned int & | aTraj, | ||
unsigned int & | aPoint, | ||
unsigned int & | aMeas, | ||
unsigned int & | aRow | ||
) |
Get all Data for MP-II binary record.
[out] | aValue | Value |
[out] | aErr | Error |
[out] | numLocal | Number of local labels/derivatives |
[out] | indLocal | Array of labels of used (local) fit parameters |
[out] | derLocal | Array of derivatives for used (local) fit parameters |
[out] | aTraj | Trajectory number |
[out] | aPoint | Point number |
[out] | aMeas | Measurements number |
[out] | aRow | Row number |
Definition at line 233 of file GblData.cpp.
References moreDerivatives, moreParameters, theDerivatives, theMeas, theNumLocal, theParameters, thePoint, thePrecision, theRow, theTrajectory, and theValue.
double gbl::GblData::getChi2 | ( | ) | const |
Calculate Chi2 contribution.
For down-weighting with M-estimators the corresponding objective function is used.
Definition at line 127 of file GblData.cpp.
References theDWMethod, thePrecision, thePrediction, and theValue.
unsigned int gbl::GblData::getLabel | ( | ) | const |
Get label.
Definition at line 185 of file GblData.cpp.
References theLabel.
void gbl::GblData::getLocalData | ( | double & | aValue, |
double & | aWeight, | ||
unsigned int & | numLocal, | ||
unsigned int *& | indLocal, | ||
double *& | derLocal | ||
) |
Get Data for local fit.
[out] | aValue | Value |
[out] | aWeight | Weight |
[out] | numLocal | Number of local labels/derivatives |
[out] | indLocal | Array of labels of used (local) fit parameters |
[out] | derLocal | Array of derivatives for used (local) fit parameters |
Definition at line 205 of file GblData.cpp.
References moreDerivatives, moreParameters, theDerivatives, theDownWeight, theNumLocal, theParameters, thePrecision, and theValue.
void gbl::GblData::getResidual | ( | double & | aResidual, |
double & | aVariance | ||
) |
Get data for residual (and errors) "short list".
[out] | aResidual | Measurement-Prediction |
[out] | aVariance | Variance (of measurement) |
Definition at line 284 of file GblData.cpp.
References thePrecision, thePrediction, and theValue.
void gbl::GblData::getResidual | ( | double & | aResidual, |
double & | aVariance, | ||
double & | aDownWeight, | ||
unsigned int & | numLocal, | ||
unsigned int *& | indLocal, | ||
double *& | derLocal | ||
) |
Get data for residual (and errors) "long list".
[out] | aResidual | Measurement-Prediction |
[out] | aVariance | Variance (of measurement) |
[out] | aDownWeight | Down-weighting factor |
[out] | numLocal | Number of local labels/derivatives |
[out] | indLocal | Array of labels of used (local) fit parameters |
[out] | derLocal | Array of derivatives for used (local) fit parameters |
Definition at line 262 of file GblData.cpp.
References moreDerivatives, moreParameters, theDerivatives, theDownWeight, theNumLocal, theParameters, thePrecision, thePrediction, and theValue.
dataBlockType gbl::GblData::getType | ( | ) | const |
void gbl::GblData::printData | ( | ) | const |
Print data block.
Definition at line 152 of file GblData.cpp.
References gbl::InternalMeasurement, moreDerivatives, moreParameters, theDerivatives, theLabel, theMeas, theNumLocal, theParameters, thePrecision, theRow, theType, and theValue.
double gbl::GblData::setDownWeighting | ( | unsigned int | aMethod | ) |
Outlier down weighting with M-estimators (by GblTrajectory::fit).
[in] | aMethod | M-estimator (1: Tukey, 2:Huber, 3:Cauchy) |
Definition at line 95 of file GblData.cpp.
References theDownWeight, theDWMethod, thePrecision, thePrediction, and theValue.
void gbl::GblData::setPrediction | ( | const VVector & | aVector | ) |
Calculate prediction for data from fit (by GblTrajectory::fit).
Definition at line 76 of file GblData.cpp.
References moreDerivatives, moreParameters, theDerivatives, theNumLocal, theParameters, and thePrediction.
|
private |
List of derivatives for fit.
Definition at line 143 of file GblData.h.
Referenced by addDerivatives(), getAllData(), getLocalData(), getResidual(), printData(), and setPrediction().
|
private |
List of fit parameters (with non zero derivatives)
Definition at line 142 of file GblData.h.
Referenced by addDerivatives(), getAllData(), getLocalData(), getResidual(), printData(), and setPrediction().
|
private |
List of derivatives for fit.
Definition at line 140 of file GblData.h.
Referenced by addDerivatives(), getAllData(), getLocalData(), getResidual(), printData(), and setPrediction().
|
private |
Down-weighting factor (0-1)
Definition at line 135 of file GblData.h.
Referenced by getLocalData(), getResidual(), and setDownWeighting().
|
private |
Down-weighting method (0: None, 1: Tukey, 2: Huber, 3: Cauchy)
Definition at line 134 of file GblData.h.
Referenced by getChi2(), and setDownWeighting().
|
private |
Label (of corresponding point)
Definition at line 126 of file GblData.h.
Referenced by getLabel(), and printData().
|
private |
Measurement number (at point)
Definition at line 133 of file GblData.h.
Referenced by getAllData(), and printData().
|
private |
Number of (non zero) local derivatives (max 9 for kinks+steps)
Definition at line 138 of file GblData.h.
Referenced by addDerivatives(), getAllData(), getLocalData(), getResidual(), printData(), and setPrediction().
|
private |
List of parameters (with non zero derivatives)
Definition at line 139 of file GblData.h.
Referenced by addDerivatives(), getAllData(), getLocalData(), getResidual(), printData(), and setPrediction().
|
private |
|
private |
Precision (1/sigma**2)
Definition at line 130 of file GblData.h.
Referenced by getAllData(), getChi2(), getLocalData(), getResidual(), printData(), and setDownWeighting().
|
private |
Prediction from fit.
Definition at line 136 of file GblData.h.
Referenced by getChi2(), getResidual(), setDownWeighting(), and setPrediction().
|
private |
Row number (of measurement)
Definition at line 127 of file GblData.h.
Referenced by addDerivatives(), getAllData(), and printData().
|
private |
|
private |
Type (None, InternalMeasurement, InternalKink, ExternalSeed, ExternalMeasurement)
Definition at line 128 of file GblData.h.
Referenced by getType(), and printData().
|
private |
Value (residual)
Definition at line 129 of file GblData.h.
Referenced by getAllData(), getChi2(), getLocalData(), getResidual(), printData(), and setDownWeighting().