47 double aPrec,
unsigned int aTraj,
unsigned int aPoint,
49 theLabel(aLabel), theRow(0), theType(aType), theValue(aValue), thePrecision(
50 aPrec), theTrajectory(aTraj), thePoint(aPoint), theMeas(aMeas), theDWMethod(
51 0), theDownWeight(1.), thePrediction(0.), theNumLocal(0), moreParameters(), moreDerivatives() {
65 const std::vector<double> &derivatives) {
66 for (
unsigned int i = 0; i < derivatives.size(); ++i)
102 if (scaledResidual < 4.6851) {
103 aWeight = (1.0 - 0.045558 * scaledResidual * scaledResidual);
108 }
else if (aMethod == 2)
110 if (scaledResidual >= 1.345) {
111 aWeight = 1.345 / scaledResidual;
113 }
else if (aMethod == 3)
115 aWeight = 1.0 / (1.0 + (scaledResidual * scaledResidual / 5.6877));
129 double chi2 = scaledResidual * scaledResidual;
132 if (scaledResidual < 4.6851) {
134 - pow(1.0 - 0.045558 * scaledResidual * scaledResidual, 3))
137 chi2 = 1.0 / (3. * 0.045558);
141 if (scaledResidual >= 1.345) {
142 chi2 = 1.345 * (2. * scaledResidual - 1.345);
146 chi2 = log(1.0 + (scaledResidual * scaledResidual / 5.6877)) * 5.6877;
155 std::cout <<
" measurement at label " <<
theLabel <<
" of type "
159 std::cout <<
" measurement at label " <<
theLabel <<
" of type "
170 std::cout << std::endl;
178 std::cout << std::endl;
206 unsigned int &numLocal,
unsigned int *&indLocal,
double *&derLocal) {
234 unsigned int *&indLocal,
double *&derLocal,
unsigned int &aTraj,
235 unsigned int &aPoint,
unsigned int &aMeas,
unsigned int &aRow) {
263 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)
unsigned int theMeas
Measurement number (at point)
double theDerivatives[9]
List of derivatives for fit.
double theDownWeight
Down-weighting factor (0-1)
double thePrediction
Prediction from fit.
unsigned int theTrajectory
Trajectory number.
unsigned int theNumLocal
Number of (non zero) local derivatives (max 9 for kinks+steps)
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 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) "long list".
unsigned int thePoint
Point number (on trajectory)
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.
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 &aMeas, unsigned int &aRow)
Get all Data for MP-II binary record.
double theValue
Value (residual)
unsigned int theParameters[9]
List of parameters (with non zero derivatives)
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.