GeneralBrokenLines V03-01-03
using EIGEN
Public Member Functions | Private Attributes | List of all members
gbl::GblData Class Reference

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
 
GblDataoperator= (const GblData &)=default
 
 GblData (GblData &&)=default
 
GblDataoperator= (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...
 

Detailed Description

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.

Definition at line 58 of file GblData.h.

Constructor & Destructor Documentation

◆ GblData() [1/3]

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.

Parameters
[in]aLabelLabel of corresponding point
[in]aTypeType of (scalar) measurement
[in]aValueValue of (scalar) measurement
[in]aPrecPrecision of (scalar) measurement
[in]aTrajTrajectory number
[in]aPointPoint number
[in]aMeasmeasurement number

Definition at line 46 of file GblData.cpp.

◆ GblData() [2/3]

gbl::GblData::GblData ( const GblData )
default

◆ GblData() [3/3]

gbl::GblData::GblData ( GblData &&  )
default

◆ ~GblData()

gbl::GblData::~GblData ( )
virtual

Definition at line 55 of file GblData.cpp.

Member Function Documentation

◆ addDerivatives() [1/3]

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.

Parameters
[in]indexLabels for derivatives
[in]derivativesDerivatives (vector)

Definition at line 64 of file GblData.cpp.

References moreDerivatives, and moreParameters.

◆ addDerivatives() [2/3]

template<typename LocalDerivative , typename ExtDerivative >
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.

Template Parameters
LocalDerivativeLocal derivatives matrix
ExtDerivativeExternal derivatives matrix
Parameters
[in]iRowRow index (0-4) in up to 5D measurement
[in]labDerLabels for derivatives
[in]matDerDerivatives (matrix) 'measurement vs track fit parameters'
[in]iOffOffset for row index for additional parameters
[in]derLocalDerivatives (matrix) for additional local parameters
[in]extOffOffset for external parameters
[in]extDerDerivatives for external Parameters

Definition at line 147 of file GblData.h.

References moreDerivatives, moreParameters, theDerivatives, theNumLocal, theParameters, and theRow.

Referenced by gbl::GblTrajectory::prepare().

◆ addDerivatives() [3/3]

template<typename ExtDerivative >
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.

Template Parameters
ExtDerivativeExternal derivatives matrix
Parameters
[in]iRowRow index (0-3) in 2D kinks and steps
[in]nDerNumber of derivatives (7: kinks, 9: kinks+steps)
[in]labDerLabels for derivatives
[in]matDerDerivatives (matrix) 'kinks+steps vs track fit parameters'
[in]extOffOffset for external parameters
[in]extDerDerivatives for external Parameters

Definition at line 213 of file GblData.h.

References moreDerivatives, moreParameters, theDerivatives, theNumLocal, theParameters, and theRow.

◆ getAllData()

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.

Parameters
[out]aValueValue
[out]aErrError
[out]numLocalNumber of local labels/derivatives
[out]indLocalArray of labels of used (local) fit parameters
[out]derLocalArray of derivatives for used (local) fit parameters
[out]aTrajTrajectory number
[out]aPointPoint number
[out]aMeasMeasurements number
[out]aRowRow number

Definition at line 233 of file GblData.cpp.

References moreDerivatives, moreParameters, theDerivatives, theMeas, theNumLocal, theParameters, thePoint, thePrecision, theRow, theTrajectory, and theValue.

◆ getChi2()

double gbl::GblData::getChi2 ( ) const

Calculate Chi2 contribution.

For down-weighting with M-estimators the corresponding objective function is used.

Returns
(down-weighted) Chi2

Definition at line 127 of file GblData.cpp.

References theDWMethod, thePrecision, thePrediction, and theValue.

◆ getLabel()

unsigned int gbl::GblData::getLabel ( ) const

Get label.

Returns
label of corresponding point

Definition at line 185 of file GblData.cpp.

References theLabel.

◆ getLocalData()

void gbl::GblData::getLocalData ( double &  aValue,
double &  aWeight,
unsigned int &  numLocal,
unsigned int *&  indLocal,
double *&  derLocal 
)

Get Data for local fit.

Parameters
[out]aValueValue
[out]aWeightWeight
[out]numLocalNumber of local labels/derivatives
[out]indLocalArray of labels of used (local) fit parameters
[out]derLocalArray 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.

◆ getResidual() [1/2]

void gbl::GblData::getResidual ( double &  aResidual,
double &  aVariance 
)

Get data for residual (and errors) "short list".

Parameters
[out]aResidualMeasurement-Prediction
[out]aVarianceVariance (of measurement)

Definition at line 284 of file GblData.cpp.

References thePrecision, thePrediction, and theValue.

◆ getResidual() [2/2]

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

Parameters
[out]aResidualMeasurement-Prediction
[out]aVarianceVariance (of measurement)
[out]aDownWeightDown-weighting factor
[out]numLocalNumber of local labels/derivatives
[out]indLocalArray of labels of used (local) fit parameters
[out]derLocalArray 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.

◆ getType()

dataBlockType gbl::GblData::getType ( ) const

Get type.

Returns
type

Definition at line 193 of file GblData.cpp.

References theType.

◆ operator=() [1/2]

GblData & gbl::GblData::operator= ( const GblData )
default

◆ operator=() [2/2]

GblData & gbl::GblData::operator= ( GblData &&  )
default

◆ printData()

void gbl::GblData::printData ( ) const

◆ setDownWeighting()

double gbl::GblData::setDownWeighting ( unsigned int  aMethod)

Outlier down weighting with M-estimators (by GblTrajectory::fit).

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

Definition at line 95 of file GblData.cpp.

References theDownWeight, theDWMethod, thePrecision, thePrediction, and theValue.

◆ setPrediction()

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.

Member Data Documentation

◆ moreDerivatives

std::vector<double> gbl::GblData::moreDerivatives
private

List of derivatives for fit.

Definition at line 143 of file GblData.h.

Referenced by addDerivatives(), getAllData(), getLocalData(), getResidual(), printData(), and setPrediction().

◆ moreParameters

std::vector<unsigned int> gbl::GblData::moreParameters
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().

◆ theDerivatives

double gbl::GblData::theDerivatives[9]
private

List of derivatives for fit.

Definition at line 140 of file GblData.h.

Referenced by addDerivatives(), getAllData(), getLocalData(), getResidual(), printData(), and setPrediction().

◆ theDownWeight

double gbl::GblData::theDownWeight
private

Down-weighting factor (0-1)

Definition at line 135 of file GblData.h.

Referenced by getLocalData(), getResidual(), and setDownWeighting().

◆ theDWMethod

unsigned int gbl::GblData::theDWMethod
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().

◆ theLabel

unsigned int gbl::GblData::theLabel
private

Label (of corresponding point)

Definition at line 126 of file GblData.h.

Referenced by getLabel(), and printData().

◆ theMeas

unsigned int gbl::GblData::theMeas
private

Measurement number (at point)

Definition at line 133 of file GblData.h.

Referenced by getAllData(), and printData().

◆ theNumLocal

unsigned int gbl::GblData::theNumLocal
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().

◆ theParameters

unsigned int gbl::GblData::theParameters[9]
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().

◆ thePoint

unsigned int gbl::GblData::thePoint
private

Point number (on trajectory)

Definition at line 132 of file GblData.h.

Referenced by getAllData().

◆ thePrecision

double gbl::GblData::thePrecision
private

Precision (1/sigma**2)

Definition at line 130 of file GblData.h.

Referenced by getAllData(), getChi2(), getLocalData(), getResidual(), printData(), and setDownWeighting().

◆ thePrediction

double gbl::GblData::thePrediction
private

Prediction from fit.

Definition at line 136 of file GblData.h.

Referenced by getChi2(), getResidual(), setDownWeighting(), and setPrediction().

◆ theRow

unsigned int gbl::GblData::theRow
private

Row number (of measurement)

Definition at line 127 of file GblData.h.

Referenced by addDerivatives(), getAllData(), and printData().

◆ theTrajectory

unsigned int gbl::GblData::theTrajectory
private

Trajectory number.

Definition at line 131 of file GblData.h.

Referenced by getAllData().

◆ theType

dataBlockType gbl::GblData::theType
private

Type (None, InternalMeasurement, InternalKink, ExternalSeed, ExternalMeasurement)

Definition at line 128 of file GblData.h.

Referenced by getType(), and printData().

◆ theValue

double gbl::GblData::theValue
private

Value (residual)

Definition at line 129 of file GblData.h.

Referenced by getAllData(), getChi2(), getLocalData(), getResidual(), printData(), and setDownWeighting().


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