41 GblData::GblData(
unsigned int aLabel,
double aValue,
double aPrec) :
42 theLabel(aLabel), theValue(aValue), thePrecision(aPrec), theDownWeight(
43 1.), thePrediction(0.), theParameters(), theDerivatives(), globalLabels(), globalDerivatives() {
64 const std::vector<unsigned int> &labDer,
const SMatrix55 &matDer,
65 unsigned int iOff,
const TMatrixD &derLocal,
66 const std::vector<int> &labGlobal,
const TMatrixD &derGlobal,
67 unsigned int extOff,
const TMatrixD &extDer) {
69 unsigned int nParMax = 5 + derLocal.GetNcols() + extDer.GetNcols();
73 for (
int i = 0; i < derLocal.GetNcols(); ++i)
75 if (derLocal(iRow - iOff, i)) {
81 for (
int i = 0; i < extDer.GetNcols(); ++i)
83 if (extDer(iRow - iOff, i)) {
89 for (
unsigned int i = 0; i < 5; ++i)
91 if (labDer[i] and matDer(iRow, i)) {
98 for (
int i = 0; i < derGlobal.GetNcols(); ++i)
112 const std::vector<unsigned int> &labDer,
const SMatrix27 &matDer,
113 unsigned int extOff,
const TMatrixD &extDer) {
115 unsigned int nParMax = 7 + extDer.GetNcols();
119 for (
int i = 0; i < extDer.GetNcols(); ++i)
121 if (extDer(iRow, i)) {
127 for (
unsigned int i = 0; i < 7; ++i)
129 if (labDer[i] and matDer(iRow, i)) {
143 const std::vector<double> &derivatives) {
144 for (
unsigned int i = 0; i < derivatives.size(); ++i)
146 if (derivatives[i]) {
172 if (scaledResidual < 4.6851) {
173 aWeight = (1.0 - 0.045558 * scaledResidual * scaledResidual);
178 }
else if (aMethod == 2)
180 if (scaledResidual >= 1.345) {
181 aWeight = 1.345 / scaledResidual;
183 }
else if (aMethod == 3)
185 aWeight = 1.0 / (1.0 + (scaledResidual * scaledResidual / 5.6877));
209 std::cout << std::endl;
214 std::cout << std::endl;
225 std::vector<unsigned int>* &indLocal, std::vector<double>* &derLocal) {
243 std::vector<unsigned int>* &indLocal, std::vector<double>* &derLocal,
244 std::vector<int>* &labGlobal, std::vector<double>* &derGlobal) {
262 double &aDownWeight, std::vector<unsigned int>* &indLocal,
263 std::vector<double>* &derLocal) {
double theDownWeight
Down-weighting factor (0-1)
double setDownWeighting(unsigned int aMethod)
Outlier down weighting with M-estimators (by GblTrajectory::fit).
double getChi2() const
Calculate Chi2 contribution.
unsigned int theLabel
Label (of measurements point)
void getAllData(double &aValue, double &aErr, std::vector< unsigned int > *&indLocal, std::vector< double > *&derLocal, std::vector< int > *&labGlobal, std::vector< double > *&derGlobal)
Get all Data for MP-II binary record.
std::vector< int > globalLabels
Labels for global derivatives.
double theValue
Value (residual)
std::vector< double > globalDerivatives
Global derivatives.
std::vector< unsigned int > theParameters
List of fit parameters (with non zero derivatives)
void addDerivatives(unsigned int iRow, const std::vector< unsigned int > &labDer, const SMatrix55 &matDer, unsigned int iOff, const TMatrixD &derLocal, const std::vector< int > &labGlobal, const TMatrixD &derGlobal, unsigned int nLocal, const TMatrixD &derTrans)
Add derivatives from measurement.
void setPrediction(const VVector &aVector)
Calculate prediction for data from fit (by GblTrajectory::fit).
double thePrecision
Precision (1/sigma**2)
void getResidual(double &aResidual, double &aVariance, double &aDownWeight, std::vector< unsigned int > *&indLocal, std::vector< double > *&derLocal)
Get data for residual (and errors).
std::vector< double > theDerivatives
List of derivatives for fit.
void printData() const
Print data block.
void getLocalData(double &aValue, double &aWeight, std::vector< unsigned int > *&indLocal, std::vector< double > *&derLocal)
Get Data for local fit.
double thePrediction
Prediction from fit.
Simple Vector based on std::vector<double>
double sqrt(double a)
sqrt for double
Namespace for the general broken lines package.