47 const Eigen::VectorXd &aResiduals,
const Eigen::MatrixXd &aPrecision,
48 double minPrecision) {
52 if (aPrecision.cols() > 1) {
54 SelfAdjointEigenSolver<MatrixXd> measEigen(aPrecision);
81 const Eigen::MatrixXd &aPrecision,
double minPrecision) {
85 if (aPrecision.cols() > 1) {
87 SelfAdjointEigenSolver<MatrixXd> measEigen(aPrecision);
106#ifdef GBL_EIGEN_SUPPORT_ROOT
117 const TVectorD &aResiduals,
const TVectorD &aPrecision,
118 double minPrecision) {
120 measDim = aResiduals.GetNrows();
123 unsigned int iOff = 5 -
measDim;
124 for (
unsigned int i = 0; i <
measDim; ++i) {
127 for (
unsigned int j = 0; j <
measDim; ++j) {
144 const TVectorD &aResiduals,
const TMatrixDSym &aPrecision,
145 double minPrecision) {
147 measDim = aResiduals.GetNrows();
149 TMatrixDSymEigen measEigen(aPrecision);
151 tmpTransformation = measEigen.GetEigenVectors();
152 tmpTransformation.T();
154 TVectorD transResiduals = tmpTransformation * aResiduals;
155 TVectorD transPrecision = measEigen.GetEigenValues();
156 TMatrixD transProjection = tmpTransformation * aProjection;
158 unsigned int iOff = 5 -
measDim;
159 for (
unsigned int i = 0; i <
measDim; ++i) {
162 for (
unsigned int j = 0; j <
measDim; ++j) {
178 const TVectorD &aPrecision,
double minPrecision) {
180 measDim = aResiduals.GetNrows();
183 unsigned int iOff = 5 -
measDim;
184 for (
unsigned int i = 0; i <
measDim; ++i) {
201 const TMatrixDSym &aPrecision,
double minPrecision) {
203 measDim = aResiduals.GetNrows();
205 TMatrixDSymEigen measEigen(aPrecision);
207 tmpTransformation = measEigen.GetEigenVectors();
208 tmpTransformation.T();
210 TVectorD transResiduals = tmpTransformation * aResiduals;
211 TVectorD transPrecision = measEigen.GetEigenValues();
213 unsigned int iOff = 5 -
measDim;
214 for (
unsigned int i = 0; i <
measDim; ++i) {
217 for (
unsigned int j = 0; j <
measDim; ++j) {
248 const Eigen::MatrixXd &aDerivatives) {
261#ifdef GBL_EIGEN_SUPPORT_ROOT
269 unsigned int numDer = aDerivatives.GetNcols();
272 MatrixXd tmpDerivatives(
measDim, numDer);
273 for (
unsigned int i = 0; i <
measDim; ++i) {
274 for (
unsigned int j = 0; j < numDer; ++j)
275 tmpDerivatives(i, j) = aDerivatives(i, j);
292 const TMatrixD &aDerivatives) {
295 unsigned int numDer = aDerivatives.GetNcols();
298 MatrixXd tmpDerivatives(
measDim, numDer);
299 for (
unsigned int i = 0; i <
measDim; ++i) {
300 for (
unsigned int j = 0; j < numDer; ++j)
301 tmpDerivatives(i, j) = aDerivatives(i, j);
371 aTransformation.setIdentity();
413 std::vector<int> &aLabels, std::vector<double> &aDerivatives)
const {
428 std::cout <<
" GblMeasurement";
431 std::cout <<
", " <<
measDim <<
" dimensions";
434 std::cout <<
", disabled";
437 std::cout <<
", diagonalized";
446 std::cout << std::endl;
447 IOFormat CleanFmt(4, 0,
", ",
"\n",
"[",
"]");
449 std::cout <<
" Projection: " << std::endl
451 CleanFmt) << std::endl;
452 std::cout <<
" Residuals: "
455 std::cout <<
" Precision (min.: " <<
measPrecMin <<
"): "
460 std::cout <<
" Local Derivatives:" << std::endl
464 std::cout <<
" Global Labels:";
465 for (
unsigned int i = 0; i <
globalLabels.size(); ++i) {
468 std::cout << std::endl;
469 std::cout <<
" Global Derivatives:"
GblMeasurement (with optional derivatives) definition.
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
double getMeasPrecMin() const
get precision cutoff.
unsigned int getNumGlobals() const
Retrieve number of global derivatives from a point.
Vector5d measPrecision
Measurement precision (diagonal of inverse covariance matrix)
void addLocals(const Eigen::MatrixXd &aDerivatives)
Add local derivatives.
void getGlobalLabelsAndDerivatives(unsigned int aRow, std::vector< int > &aLabels, std::vector< double > &aDerivatives) const
Retrieve global derivatives from a point for a single row.
GblMeasurement(const Eigen::MatrixXd &aProjection, const Eigen::VectorXd &aResiduals, const Eigen::MatrixXd &aPrecision, double minPrecision=0.)
Create a measurement.
void getGlobalDerivatives(Eigen::MatrixXd &aDerivatives) const
Retrieve global derivatives from a point.
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
bool transFlag
Transformation exists?
double measPrecMin
Minimal measurement precision (for usage)
bool enabled
Enabled flag (to be used)
void getMeasTransformation(Eigen::MatrixXd &aTransformation) const
Get measurement transformation (from diagonalization).
void getGlobalLabels(std::vector< int > &aLabels) const
Retrieve global derivatives labels from a point.
Matrix5d measProjection
Projection from measurement to local system.
bool isEnabled() const
Get enabled flag.
void getMeasurement(Matrix5d &aProjection, Vector5d &aResiduals, Vector5d &aPrecision) const
Retrieve measurement of a point.
void printMeasurement(unsigned int level=0) const
Print GblMeasurement.
Eigen::MatrixXd localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
unsigned int getNumLocals() const
Retrieve number of local derivatives from a point.
Vector5d measResiduals
Measurement residuals.
virtual ~GblMeasurement()
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
unsigned int getMeasDim() const
Get measurement dimension.
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
void setEnabled(bool flag)
Set enabled flag.
const Eigen::MatrixXd & getLocalDerivatives() const
Retrieve local derivatives from a point.
void addGlobals(const std::vector< int > &aLabels, const Eigen::MatrixXd &aDerivatives)
Add global derivatives.
Namespace for the general broken lines package.
Eigen::Matrix< double, 5, 1 > Vector5d
Eigen::Matrix< double, 5, 5 > Matrix5d