31 using namespace Eigen;
45 GblData::GblData(
unsigned int aLabel,
dataBlockType aType,
double aValue,
46 double aPrec,
unsigned int aTraj,
unsigned int aPoint) :
47 theLabel(aLabel), theRow(0), theType(aType), theValue(aValue), thePrecision(
48 aPrec), theTrajectory(aTraj), thePoint(aPoint), theDWMethod(0), theDownWeight(
49 1.), thePrediction(0.), theNumLocal(0), moreParameters(), moreDerivatives() {
63 const std::vector<double> &derivatives) {
64 for (
unsigned int i = 0; i < derivatives.size(); ++i)
100 if (scaledResidual < 4.6851) {
101 aWeight = (1.0 - 0.045558 * scaledResidual * scaledResidual);
106 }
else if (aMethod == 2)
108 if (scaledResidual >= 1.345) {
109 aWeight = 1.345 / scaledResidual;
111 }
else if (aMethod == 3)
113 aWeight = 1.0 / (1.0 + (scaledResidual * scaledResidual / 5.6877));
127 double chi2 = scaledResidual * scaledResidual;
130 if (scaledResidual < 4.6851) {
132 - pow(1.0 - 0.045558 * scaledResidual * scaledResidual, 3))
135 chi2 = 1.0 / (3. * 0.045558);
139 if (scaledResidual >= 1.345) {
140 chi2 = 1.345 * (2. * scaledResidual - 1.345);
144 chi2 = log(1.0 + (scaledResidual * scaledResidual / 5.6877)) * 5.6877;
152 std::cout <<
" measurement at label " <<
theLabel <<
" of type " <<
theType
162 std::cout << std::endl;
170 std::cout << std::endl;
198 unsigned int &numLocal,
unsigned int* &indLocal,
double* &derLocal) {
225 unsigned int* &indLocal,
double* &derLocal,
unsigned int &aTraj,
226 unsigned int &aPoint,
unsigned int &aRow) {
253 double &aDownWeight,
unsigned int &numLocal,
unsigned int* &indLocal,
double thePrecision
Precision (1/sigma**2)
std::vector< unsigned int > moreParameters
List of fit parameters (with non zero derivatives)
double theDownWeight
Down-weighting factor (0-1)
double theDerivatives[7]
List of derivatives for fit.
double thePrediction
Prediction from fit.
unsigned int theTrajectory
Trajectory number.
unsigned int theNumLocal
Number of (non zero) local derivatives (max 7 for kinks)
unsigned int theLabel
Label (of corresponding point)
dataBlockType theType
Type (None, InternalMeasurement, InternalKink, ExternalSeed, ExternalMeasurement)
unsigned int theDWMethod
Down-weighting method (0: None, 1: Tukey, 2: Huber, 3: Cauchy)
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.
dataBlockType getType() const
Get type.
unsigned int theParameters[7]
List of parameters (with non zero derivatives)
unsigned int getLabel() const
Get label.
unsigned int theRow
Row number (of measurement)
double getChi2() const
Calculate Chi2 contribution.
void printData() const
Print data block.
void getResidual(double &aResidual, double &aVariance, double &aDownWeight, unsigned int &numLocal, unsigned int *&indLocal, double *&derLocal)
Get data for residual (and errors).
unsigned int thePoint
Point number (on trajectory)
void getLocalData(double &aValue, double &aWeight, unsigned int &numLocal, unsigned int *&indLocal, double *&derLocal)
Get Data for local fit.
void getAllData(double &aValue, double &aErr, unsigned int &numLocal, unsigned int *&indLocal, double *&derLocal, unsigned int &aTraj, unsigned int &aPoint, unsigned int &aRow)
Get all Data for MP-II binary record.
double theValue
Value (residual)
double setDownWeighting(unsigned int aMethod)
Outlier down weighting with M-estimators (by GblTrajectory::fit).
std::vector< double > moreDerivatives
List of derivatives for fit.
void setPrediction(const VVector &aVector)
Calculate prediction for data from fit (by GblTrajectory::fit).
Simple Vector based on std::vector<double>
Namespace for the general broken lines package.