61 double aPrec,
unsigned int aTraj = 0,
unsigned int aPoint = 0,
62 unsigned int aMeas = 0);
82 template<
typename LocalDerivative,
typename ExtDerivative>
84 const std::array<unsigned int, 5> &labDer,
const Matrix5d &matDer,
86 const Eigen::MatrixBase<LocalDerivative> &derLocal,
88 const Eigen::MatrixBase<ExtDerivative> &extDer);
101 template<
typename ExtDerivative>
103 const std::array<unsigned int, 9> &labDer,
const Matrix49d &matDer,
105 const Eigen::MatrixBase<ExtDerivative> &extDer);
108 const std::vector<double> &derivatives);
116 void getLocalData(
double &aValue,
double &aWeight,
unsigned int &numLocal,
117 unsigned int *&indLocal,
double *&derLocal);
118 void getAllData(
double &aValue,
double &aErr,
unsigned int &numLocal,
119 unsigned int *&indLocal,
double *&derLocal,
unsigned int &aTraj,
120 unsigned int &aPoint,
unsigned int &aMeas,
unsigned int &aRow);
121 void getResidual(
double &aResidual,
double &aVariance,
double &aDownWeight,
122 unsigned int &numLocal,
unsigned int *&indLocal,
double *&derLocal);
123 void getResidual(
double &aResidual,
double &aVariance);
146template<
typename LocalDerivative,
typename ExtDerivative>
148 const std::array<unsigned int, 5> &labDer,
const Matrix5d &matDer,
149 unsigned int iOff,
const Eigen::MatrixBase<LocalDerivative> &derLocal,
150 unsigned int extOff,
const Eigen::MatrixBase<ExtDerivative> &extDer) {
152 unsigned int nParMax = 5 + derLocal.cols() + extDer.cols();
159 for (
int i = 0; i < derLocal.cols(); ++i)
161 if (derLocal(iRow - iOff, i)) {
167 for (
int i = 0; i < extDer.cols(); ++i)
169 if (extDer(iRow - iOff, i)) {
175 for (
size_t i = 0; i < labDer.size(); ++i)
177 if (labDer[i] and matDer(iRow, i)) {
184 for (
int i = 0; i < derLocal.cols(); ++i)
186 if (derLocal(iRow - iOff, i)) {
193 for (
int i = 0; i < extDer.cols(); ++i)
195 if (extDer(iRow - iOff, i)) {
201 for (
size_t i = 0; i < labDer.size(); ++i)
203 if (labDer[i] and matDer(iRow, i)) {
212template<
typename ExtDerivative>
214 const std::array<unsigned int, 9> &labDer,
const Matrix49d &matDer,
215 unsigned int extOff,
const Eigen::MatrixBase<ExtDerivative> &extDer) {
217 unsigned int nParMax = nDer + extDer.cols();
224 for (
int i = 0; i < extDer.cols(); ++i)
226 if (extDer(iRow, i)) {
232 for (
size_t i = 0; i < nDer; ++i)
234 if (labDer[i] and matDer(iRow, i)) {
241 for (
size_t i = 0; i < nDer; ++i)
243 if (labDer[i] and matDer(iRow, i)) {
Data (block) for independent scalar measurement.
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.
GblData & operator=(GblData &&)=default
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.
GblData(GblData &&)=default
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.
GblData(const GblData &)=default
void getLocalData(double &aValue, double &aWeight, unsigned int &numLocal, unsigned int *&indLocal, double *&derLocal)
Get Data for local fit.
GblData & operator=(const GblData &)=default
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.
Eigen::Matrix< double, 4, 9 > Matrix49d
Eigen::Matrix< double, 5, 5 > Matrix5d