CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
gbl::GblPoint Class Reference

Point on trajectory. More...

#include <GblPoint.h>

Public Member Functions

template<typename Derivative >
void addGlobals (const std::vector< int > &aLabels, const Eigen::MatrixBase< Derivative > &aDerivatives)
 Add global derivatives to a point. More...
 
template<typename Derivative >
void addLocals (const Eigen::MatrixBase< Derivative > &aDerivatives)
 Add local derivatives to a point. More...
 
template<typename Projection , typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * = nullptr, typename std::enable_if<(Precision::ColsAtCompileTime!=1)>::type * = nullptr>
void addMeasurement (const Eigen::MatrixBase< Projection > &aProjection, const Eigen::MatrixBase< Residuals > &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision, double minPrecision=0.)
 Add a measurement to a point. More...
 
template<typename Projection , typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * = nullptr, typename std::enable_if<(Precision::ColsAtCompileTime==1)>::type * = nullptr>
void addMeasurement (const Eigen::MatrixBase< Projection > &aProjection, const Eigen::MatrixBase< Residuals > &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision, double minPrecision=0.)
 
template<typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * = nullptr, typename std::enable_if<(Precision::ColsAtCompileTime!=1)>::type * = nullptr>
void addMeasurement (const Eigen::MatrixBase< Residuals > &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision, double minPrecision=0.)
 Add a measurement to a point. More...
 
template<typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * = nullptr, typename std::enable_if<(Precision::ColsAtCompileTime==1)>::type * = nullptr>
void addMeasurement (const Eigen::MatrixBase< Residuals > &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision, double minPrecision=0.)
 
void addNextJacobian (const Matrix5d &aJac)
 Define jacobian to next scatterer (by GBLTrajectory constructor) More...
 
void addPrevJacobian (const Matrix5d &aJac)
 Define jacobian to previous scatterer (by GBLTrajectory constructor) More...
 
template<typename Precision >
void addScatterer (const Eigen::Vector2d &aResiduals, const Eigen::MatrixBase< Precision > &aPrecision)
 Add a (thin) scatterer to a point. More...
 
void addScatterer (const Eigen::Vector2d &aResiduals, const Eigen::Vector2d &aPrecision)
 
 GblPoint (const Matrix5d &aJacobian)
 Create a point. More...
 
 GblPoint (const GblPoint &)=default
 
 GblPoint (GblPoint &&)=default
 
void getDerivatives (int aDirection, Eigen::Matrix2d &matW, Eigen::Matrix2d &matWJ, Eigen::Vector2d &vecWd) const
 Retrieve derivatives of local track model. More...
 
void getGlobalDerivatives (Eigen::MatrixXd &aDerivatives) const
 Retrieve global derivatives from a point. More...
 
void getGlobalLabels (std::vector< int > &aLabels) const
 Retrieve global derivatives labels from a point. More...
 
void getGlobalLabelsAndDerivatives (unsigned int aRow, std::vector< int > &aLabels, std::vector< double > &aDerivatives) const
 Retrieve global derivatives from a point for a single row. More...
 
unsigned int getLabel () const
 Retrieve label of point. More...
 
const Eigen::MatrixXd & getLocalDerivatives () const
 Retrieve local derivatives from a point. More...
 
double getMeasPrecMin () const
 get precision cutoff. More...
 
void getMeasTransformation (Eigen::MatrixXd &aTransformation) const
 Get measurement transformation (from diagonalization). More...
 
void getMeasurement (Matrix5d &aProjection, Vector5d &aResiduals, Vector5d &aPrecision) const
 Retrieve measurement of a point. More...
 
unsigned int getNumGlobals () const
 Retrieve number of global derivatives from a point. More...
 
unsigned int getNumLocals () const
 Retrieve number of local derivatives from a point. More...
 
int getOffset () const
 Retrieve offset for point. More...
 
const Matrix5dgetP2pJacobian () const
 Retrieve point-to-(previous)point jacobian. More...
 
void getScatterer (Eigen::Matrix2d &aTransformation, Eigen::Vector2d &aResiduals, Eigen::Vector2d &aPrecision) const
 Retrieve scatterer of a point. More...
 
void getScatTransformation (Eigen::Matrix2d &aTransformation) const
 Get scatterer transformation (from diagonalization). More...
 
unsigned int hasMeasurement () const
 Check for measurement at a point. More...
 
bool hasScatterer () const
 Check for scatterer at a point. More...
 
GblPointoperator= (const GblPoint &)=default
 
GblPointoperator= (GblPoint &&)=default
 
void printPoint (unsigned int level=0) const
 Print GblPoint. More...
 
void setLabel (unsigned int aLabel)
 Define label of point (by GBLTrajectory constructor) More...
 
void setOffset (int anOffset)
 Define offset for point (by GBLTrajectory constructor) More...
 
virtual ~GblPoint ()
 

Private Attributes

Eigen::MatrixXd globalDerivatives
 Derivatives of measurement vs additional global (MP-II) parameters. More...
 
std::vector< int > globalLabels
 Labels of global (MP-II) derivatives. More...
 
Eigen::MatrixXd localDerivatives
 Derivatives of measurement vs additional local (fit) parameters. More...
 
unsigned int measDim
 Dimension of measurement (1-5), 0 indicates absence of measurement. More...
 
Vector5d measPrecision
 Measurement precision (diagonal of inverse covariance matrix) More...
 
double measPrecMin
 Minimal measurement precision (for usage) More...
 
Matrix5d measProjection
 Projection from measurement to local system. More...
 
Vector5d measResiduals
 Measurement residuals. More...
 
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
 Transformation of diagonalization (of meas. precision matrix) More...
 
Matrix5d nextJacobian
 Jacobian to next scatterer (or last measurement) More...
 
Matrix5d p2pJacobian
 Point-to-point jacobian from previous point. More...
 
Matrix5d prevJacobian
 Jacobian to previous scatterer (or first measurement) More...
 
bool scatFlag
 Scatterer present? More...
 
Eigen::Vector2d scatPrecision
 Scattering precision (diagonal of inverse covariance matrix) More...
 
Eigen::Vector2d scatResiduals
 Scattering residuals (initial kinks if iterating) More...
 
Eigen::Matrix2d scatTransformation
 Transformation of diagonalization (of scat. precision matrix) More...
 
unsigned int theLabel
 Label identifying point. More...
 
int theOffset
 Offset number at point if not negative (else interpolation needed) More...
 
bool transFlag
 Transformation exists? More...
 

Detailed Description

Point on trajectory.

User supplied point on (initial) trajectory.

Must have jacobian for propagation from previous point. May have:

  1. Measurement (1D - 5D)
  2. Scatterer (thin, 2D kinks)
  3. Additional local parameters (with derivatives). Fitted together with track parameters.
  4. Additional global parameters (with labels and derivatives). Not fitted, only passed on to (binary) file for fitting with Millepede-II.

Definition at line 66 of file GblPoint.h.

Constructor & Destructor Documentation

gbl::GblPoint::GblPoint ( const Matrix5d aJacobian)

Create a point.

Create point on (initial) trajectory. Needs transformation jacobian from previous point.

Parameters
[in]aJacobianTransformation jacobian from previous point

Definition at line 41 of file GblPoint.cc.

References globalDerivatives, globalLabels, mps_fire::i, localDerivatives, measDim, measPrecMin, measTransformation, p2pJacobian, scatFlag, theLabel, theOffset, and transFlag.

41  :
42  theLabel(0), theOffset(0), p2pJacobian(aJacobian), measDim(0),
43  measPrecMin(0.), transFlag(false), measTransformation(), scatFlag(false),
45  {
46  }
bool transFlag
Transformation exists?
Definition: GblPoint.h:168
bool scatFlag
Scatterer present?
Definition: GblPoint.h:171
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:159
double measPrecMin
Minimal measurement precision (for usage)
Definition: GblPoint.h:164
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:177
Eigen::MatrixXd localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:175
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:176
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:158
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:170
Matrix5d p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:160
gbl::GblPoint::GblPoint ( const GblPoint )
default
gbl::GblPoint::GblPoint ( GblPoint &&  )
default
gbl::GblPoint::~GblPoint ( )
virtual

Member Function Documentation

template<typename Derivative >
void gbl::GblPoint::addGlobals ( const std::vector< int > &  aLabels,
const Eigen::MatrixBase< Derivative > &  aDerivatives 
)

Add global derivatives to a point.

Point needs to have a measurement.

Parameters
[in]aLabelsGlobal derivatives labels
[in]aDerivativesGlobal derivatives (matrix)

Definition at line 342 of file GblPoint.h.

References globalDerivatives, globalLabels, measDim, measTransformation, and transFlag.

Referenced by MillePedeAlignmentAlgorithm::addGlobalData(), and getLocalDerivatives().

344  {
345  if (measDim) {
346  globalLabels = aLabels;
347  globalDerivatives.resize(aDerivatives.rows(), aDerivatives.cols());
348  if (transFlag) {
349  globalDerivatives = measTransformation * aDerivatives;
350  } else {
351  globalDerivatives = aDerivatives;
352  }
353 
354  }
355  }
bool transFlag
Transformation exists?
Definition: GblPoint.h:168
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:177
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:176
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:170
template<typename Derivative >
void gbl::GblPoint::addLocals ( const Eigen::MatrixBase< Derivative > &  aDerivatives)

Add local derivatives to a point.

Point needs to have a measurement.

Parameters
[in]aDerivativesLocal derivatives (matrix)

Definition at line 323 of file GblPoint.h.

References localDerivatives, measDim, measTransformation, and transFlag.

Referenced by getScatTransformation().

324  {
325  if (measDim) {
326  localDerivatives.resize(aDerivatives.rows(), aDerivatives.cols());
327  if (transFlag) {
328  localDerivatives = measTransformation * aDerivatives;
329  } else {
330  localDerivatives = aDerivatives;
331  }
332  }
333  }
bool transFlag
Transformation exists?
Definition: GblPoint.h:168
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Eigen::MatrixXd localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:175
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:170
template<typename Projection , typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * , typename std::enable_if<(Precision::ColsAtCompileTime==1)>::type * >
void gbl::GblPoint::addMeasurement ( const Eigen::MatrixBase< Projection > &  aProjection,
const Eigen::MatrixBase< Residuals > &  aResiduals,
const Eigen::MatrixBase< Precision > &  aPrecision,
double  minPrecision = 0. 
)

Add a measurement to a point.

Add measurement (in meas. system) with diagonal or arbitrary precision (inverse covariance) matrix. Will be diagonalized. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aProjectionProjection from local to measurement system
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (matrix)
[in]minPrecisionMinimal precision to accept measurement

Add measurement (in meas. system) with diagonal or arbitrary precision (inverse covariance) matrix. Will be diagonalized. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aProjectionProjection from local to measurement system
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (diagonal)
[in]minPrecisionMinimal precision to accept measurement

Definition at line 194 of file GblPoint.h.

References measDim, measPrecision, measPrecMin, measProjection, measResiduals, measTransformation, and transFlag.

Referenced by ReferenceTrajectory::addMaterialEffectsCurvlinGbl(), ReferenceTrajectory::addMaterialEffectsLocalGbl(), addMeasurement(), and ~GblPoint().

198  {
199  measDim = aResiduals.rows();
200  measPrecMin = minPrecision;
201  // arbitrary precision matrix
202  Eigen::SelfAdjointEigenSolver<typename Precision::PlainObject> measEigen{aPrecision};
203  measTransformation = measEigen.eigenvectors().transpose();
204  transFlag = true;
205  measResiduals.tail(measDim) = measTransformation * aResiduals;
206  measPrecision.tail(measDim) = measEigen.eigenvalues();
207  measProjection.bottomRightCorner(measDim, measDim) =
208  measTransformation * aProjection;
209  }
Vector5d measResiduals
Measurement residuals.
Definition: GblPoint.h:166
bool transFlag
Transformation exists?
Definition: GblPoint.h:168
double measPrecMin
Minimal measurement precision (for usage)
Definition: GblPoint.h:164
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Vector5d measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:167
Matrix5d measProjection
Projection from measurement to local system.
Definition: GblPoint.h:165
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:170
template<typename Projection , typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * = nullptr, typename std::enable_if<(Precision::ColsAtCompileTime==1)>::type * = nullptr>
void gbl::GblPoint::addMeasurement ( const Eigen::MatrixBase< Projection > &  aProjection,
const Eigen::MatrixBase< Residuals > &  aResiduals,
const Eigen::MatrixBase< Precision > &  aPrecision,
double  minPrecision = 0. 
)
template<typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * , typename std::enable_if<(Precision::ColsAtCompileTime==1)>::type * >
void gbl::GblPoint::addMeasurement ( const Eigen::MatrixBase< Residuals > &  aResiduals,
const Eigen::MatrixBase< Precision > &  aPrecision,
double  minPrecision = 0. 
)

Add a measurement to a point.

Add measurement in local system with diagonal or arbitrary precision (inverse covariance) matrix. Will be diagonalized. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (matrix)
[in]minPrecisionMinimal precision to accept measurement

Add measurement in local system with diagonal or arbitrary precision (inverse covariance) matrix. Will be diagonalized. ((up to) 2D: position, 4D: slope+position, 5D: curvature+slope+position)

Parameters
[in]aResidualsMeasurement residuals
[in]aPrecisionMeasurement precision (diagonal)
[in]minPrecisionMinimal precision to accept measurement

Definition at line 249 of file GblPoint.h.

References addMeasurement(), measDim, measPrecision, measPrecMin, measProjection, measResiduals, measTransformation, and transFlag.

252  {
253  measDim = aResiduals.rows();
254  measPrecMin = minPrecision;
255  // arbitrary precision matrix
256  Eigen::SelfAdjointEigenSolver<typename Precision::PlainObject> measEigen{aPrecision};
257  measTransformation = measEigen.eigenvectors().transpose();
258  transFlag = true;
259  measResiduals.tail(measDim) = measTransformation * aResiduals;
260  measPrecision.tail(measDim) = measEigen.eigenvalues();
261  measProjection.bottomRightCorner(measDim, measDim) = measTransformation;
262  }
Vector5d measResiduals
Measurement residuals.
Definition: GblPoint.h:166
bool transFlag
Transformation exists?
Definition: GblPoint.h:168
double measPrecMin
Minimal measurement precision (for usage)
Definition: GblPoint.h:164
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Vector5d measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:167
Matrix5d measProjection
Projection from measurement to local system.
Definition: GblPoint.h:165
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:170
template<typename Residuals , typename Precision , typename std::enable_if<(Residuals::ColsAtCompileTime==1)>::type * = nullptr, typename std::enable_if<(Precision::ColsAtCompileTime==1)>::type * = nullptr>
void gbl::GblPoint::addMeasurement ( const Eigen::MatrixBase< Residuals > &  aResiduals,
const Eigen::MatrixBase< Precision > &  aPrecision,
double  minPrecision = 0. 
)
void gbl::GblPoint::addNextJacobian ( const Matrix5d aJac)

Define jacobian to next scatterer (by GBLTrajectory constructor)

Parameters
[in]aJacJacobian

Definition at line 487 of file GblPoint.cc.

References nextJacobian.

Referenced by gbl::GblTrajectory::calcJacobians().

487  {
488  nextJacobian = aJac;
489  }
Matrix5d nextJacobian
Jacobian to next scatterer (or last measurement)
Definition: GblPoint.h:162
void gbl::GblPoint::addPrevJacobian ( const Matrix5d aJac)

Define jacobian to previous scatterer (by GBLTrajectory constructor)

Parameters
[in]aJacJacobian

Definition at line 472 of file GblPoint.cc.

References prevJacobian.

472  {
473  // to optimize: need only two last rows of inverse
474  // prevJacobian = aJac.inverse();
475  // block matrix algebra
476  Matrix23d CA = aJac.block<2, 3>(3, 0) * aJac.block<3, 3>(0, 0).inverse(); // C*A^-1
477  Matrix2d DCAB = aJac.block<2, 2>(3, 3) - CA * aJac.block<3, 2>(0, 3); // D - C*A^-1 *B
478  Matrix2d DCABInv = DCAB.inverse();
479  prevJacobian.block<2, 2>(3, 3) = DCABInv;
480  prevJacobian.block<2, 3>(3, 0) = -DCABInv * CA;
481  }
Eigen::Matrix< double, 2, 3 > Matrix23d
Definition: GblPoint.h:48
Matrix5d prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition: GblPoint.h:161
template<typename Precision >
void gbl::GblPoint::addScatterer ( const Eigen::Vector2d &  aResiduals,
const Eigen::MatrixBase< Precision > &  aPrecision 
)

Add a (thin) scatterer to a point.

Add scatterer with diagonal or arbitrary precision (inverse covariance) matrix. Will be diagonalized. Changes local track direction.

The precision matrix for the local slopes is defined by the angular scattering error theta_0 and the scalar products c_1, c_2 of the offset directions in the local frame with the track direction:

       (1 - c_1*c_1 - c_2*c_2)   |  1 - c_1*c_1     - c_1*c_2  |
  P =  ----------------------- * |                             |
           theta_0*theta_0       |    - c_1*c_2   1 - c_2*c_2  |
Parameters
[in]aResidualsScatterer residuals
[in]aPrecisionScatterer precision (vector (with diagonal) or (full) matrix)

Definition at line 305 of file GblPoint.h.

References scatFlag, scatPrecision, scatResiduals, and scatTransformation.

Referenced by ReferenceTrajectory::addMaterialEffectsCurvlinGbl(), ReferenceTrajectory::addMaterialEffectsLocalGbl(), and getMeasTransformation().

307  {
308  scatFlag = true;
309  // arbitrary precision matrix
310  Eigen::SelfAdjointEigenSolver<typename Precision::PlainObject> scatEigen{aPrecision};
311  scatTransformation = scatEigen.eigenvectors();
312  scatTransformation.transposeInPlace();
313  scatResiduals = scatTransformation * aResiduals;
314  scatPrecision = scatEigen.eigenvalues();
315  }
bool scatFlag
Scatterer present?
Definition: GblPoint.h:171
Eigen::Vector2d scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:174
Eigen::Matrix2d scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:172
Eigen::Vector2d scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:173
void gbl::GblPoint::addScatterer ( const Eigen::Vector2d &  aResiduals,
const Eigen::Vector2d &  aPrecision 
)
void gbl::GblPoint::getDerivatives ( int  aDirection,
Eigen::Matrix2d &  matW,
Eigen::Matrix2d &  matWJ,
Eigen::Vector2d &  vecWd 
) const

Retrieve derivatives of local track model.

Linearized track model: F_u(q/p,u',u) = J*u + S*u' + d*q/p, W is inverse of S, negated for backward propagation.

Parameters
[in]aDirectionPropagation direction (>0 forward, else backward)
[out]matWW
[out]matWJW*J
[out]vecWdW*d
Exceptions
std::overflow_error: matrix S is singular.

Definition at line 501 of file GblPoint.cc.

References gather_cfg::cout, nextJacobian, and prevJacobian.

Referenced by gbl::GblTrajectory::getFitToKinkJacobian(), and gbl::GblTrajectory::getFitToLocalJacobian().

502  {
503 
504  Matrix2d matJ;
505  Vector2d vecd;
506  if (aDirection < 1) {
507  matJ = prevJacobian.block<2, 2>(3, 3);
508  matW = -prevJacobian.block<2, 2>(3, 1);
509  vecd = prevJacobian.block<2, 1>(3, 0);
510  } else {
511  matJ = nextJacobian.block<2, 2>(3, 3);
512  matW = nextJacobian.block<2, 2>(3, 1);
513  vecd = nextJacobian.block<2, 1>(3, 0);
514  }
515 
516  if (!matW.determinant()) {
517  std::cout << " GblPoint::getDerivatives failed to invert matrix "
518  << std::endl;
519  std::cout
520  << " Possible reason for singular matrix: multiple GblPoints at same arc-length"
521  << std::endl;
522  throw std::overflow_error("Singular matrix inversion exception");
523  }
524  matW = matW.inverse().eval();
525  matWJ = matW * matJ;
526  vecWd = matW * vecd;
527  }
Matrix5d nextJacobian
Jacobian to next scatterer (or last measurement)
Definition: GblPoint.h:162
Matrix5d prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition: GblPoint.h:161
void gbl::GblPoint::getGlobalDerivatives ( Eigen::MatrixXd &  aDerivatives) const

Retrieve global derivatives from a point.

Parameters
[out]aDerivativesGlobal derivatives

Definition at line 417 of file GblPoint.cc.

References globalDerivatives.

417  {
418  aDerivatives = globalDerivatives;
419  }
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:177
void gbl::GblPoint::getGlobalLabels ( std::vector< int > &  aLabels) const

Retrieve global derivatives labels from a point.

Parameters
[out]aLabelsGlobal labels

Definition at line 409 of file GblPoint.cc.

References globalLabels.

409  {
410  aLabels = globalLabels;
411  }
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:176
void gbl::GblPoint::getGlobalLabelsAndDerivatives ( unsigned int  aRow,
std::vector< int > &  aLabels,
std::vector< double > &  aDerivatives 
) const

Retrieve global derivatives from a point for a single row.

Parameters
[in]aRowRow number
[out]aLabelsGlobal labels
[out]aDerivativesGlobal derivatives

Definition at line 427 of file GblPoint.cc.

References globalDerivatives, globalLabels, and mps_fire::i.

428  {
429  aLabels.resize(globalDerivatives.cols());
430  aDerivatives.resize(globalDerivatives.cols());
431  for (unsigned int i = 0; i < globalDerivatives.cols(); ++i) {
432  aLabels[i] = globalLabels[i];
433  aDerivatives[i] = globalDerivatives(aRow, i);
434  }
435  }
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:177
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:176
unsigned int gbl::GblPoint::getLabel ( ) const

Retrieve label of point.

Definition at line 446 of file GblPoint.cc.

References theLabel.

446  {
447  return theLabel;
448  }
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:158
const MatrixXd & gbl::GblPoint::getLocalDerivatives ( ) const

Retrieve local derivatives from a point.

Definition at line 367 of file GblPoint.cc.

References addGlobals(), globalDerivatives, globalLabels, mps_fire::i, localDerivatives, measDim, measTransformation, and transFlag.

367  {
368  return localDerivatives;
369  }
Eigen::MatrixXd localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:175
double gbl::GblPoint::getMeasPrecMin ( ) const

get precision cutoff.

Returns
minimal measurement precision (for usage)

Definition at line 197 of file GblPoint.cc.

References measPrecMin.

197  {
198  return measPrecMin;
199  }
double measPrecMin
Minimal measurement precision (for usage)
Definition: GblPoint.h:164
void gbl::GblPoint::getMeasTransformation ( Eigen::MatrixXd &  aTransformation) const

Get measurement transformation (from diagonalization).

Parameters
[out]aTransformationTransformation matrix

Definition at line 219 of file GblPoint.cc.

References addScatterer(), mps_fire::i, measDim, measTransformation, scatFlag, scatPrecision, scatResiduals, scatTransformation, and transFlag.

219  {
220  aTransformation.resize(measDim, measDim);
221  if (transFlag) {
222  aTransformation = measTransformation;
223  } else {
224  aTransformation.setIdentity();
225  }
226  }
bool transFlag
Transformation exists?
Definition: GblPoint.h:168
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor, 5, 5 > measTransformation
Transformation of diagonalization (of meas. precision matrix)
Definition: GblPoint.h:170
void gbl::GblPoint::getMeasurement ( Matrix5d aProjection,
Vector5d aResiduals,
Vector5d aPrecision 
) const

Retrieve measurement of a point.

Parameters
[out]aProjectionProjection from (diagonalized) measurement to local system
[out]aResidualsMeasurement residuals
[out]aPrecisionMeasurement precision (diagonal)

Definition at line 207 of file GblPoint.cc.

References measDim, measPrecision, measProjection, and measResiduals.

208  {
209  aProjection.bottomRightCorner(measDim, measDim) =
210  measProjection.bottomRightCorner(measDim, measDim);
211  aResiduals.tail(measDim) = measResiduals.tail(measDim);
212  aPrecision.tail(measDim) = measPrecision.tail(measDim);
213  }
Vector5d measResiduals
Measurement residuals.
Definition: GblPoint.h:166
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Vector5d measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:167
Matrix5d measProjection
Projection from measurement to local system.
Definition: GblPoint.h:165
unsigned int gbl::GblPoint::getNumGlobals ( ) const

Retrieve number of global derivatives from a point.

Definition at line 401 of file GblPoint.cc.

References globalDerivatives.

401  {
402  return globalDerivatives.cols();
403  }
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:177
unsigned int gbl::GblPoint::getNumLocals ( ) const

Retrieve number of local derivatives from a point.

Definition at line 362 of file GblPoint.cc.

References localDerivatives.

362  {
363  return localDerivatives.cols();
364  }
Eigen::MatrixXd localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:175
int gbl::GblPoint::getOffset ( ) const

Retrieve offset for point.

Definition at line 459 of file GblPoint.cc.

References theOffset.

Referenced by gbl::GblTrajectory::getFitToKinkJacobian(), and gbl::GblTrajectory::getFitToLocalJacobian().

459  {
460  return theOffset;
461  }
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:159
const Matrix5d & gbl::GblPoint::getP2pJacobian ( ) const

Retrieve point-to-(previous)point jacobian.

Definition at line 464 of file GblPoint.cc.

References p2pJacobian.

Referenced by gbl::GblTrajectory::calcJacobians().

464  {
465  return p2pJacobian;
466  }
Matrix5d p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:160
void gbl::GblPoint::getScatterer ( Eigen::Matrix2d &  aTransformation,
Eigen::Vector2d &  aResiduals,
Eigen::Vector2d &  aPrecision 
) const

Retrieve scatterer of a point.

Parameters
[out]aTransformationScatterer transformation from diagonalization
[out]aResidualsScatterer residuals
[out]aPrecisionScatterer precision (diagonal)

Definition at line 317 of file GblPoint.cc.

References scatPrecision, scatResiduals, and scatTransformation.

318  {
319  aTransformation = scatTransformation;
320  aResiduals = scatResiduals;
321  aPrecision = scatPrecision;
322  }
Eigen::Vector2d scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:174
Eigen::Matrix2d scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:172
Eigen::Vector2d scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:173
void gbl::GblPoint::getScatTransformation ( Eigen::Matrix2d &  aTransformation) const

Get scatterer transformation (from diagonalization).

Parameters
[out]aTransformationTransformation matrix

Definition at line 328 of file GblPoint.cc.

References addLocals(), mps_fire::i, localDerivatives, measDim, measTransformation, scatFlag, scatTransformation, and transFlag.

328  {
329  if (scatFlag) {
330  aTransformation = scatTransformation;
331  } else {
332  aTransformation.setIdentity();
333  }
334  }
bool scatFlag
Scatterer present?
Definition: GblPoint.h:171
Eigen::Matrix2d scatTransformation
Transformation of diagonalization (of scat. precision matrix)
Definition: GblPoint.h:172
unsigned int gbl::GblPoint::hasMeasurement ( ) const

Check for measurement at a point.

Get dimension of measurement (0 = none).

Returns
measurement dimension

Definition at line 189 of file GblPoint.cc.

References measDim.

189  {
190  return measDim;
191  }
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
bool gbl::GblPoint::hasScatterer ( ) const

Check for scatterer at a point.

Definition at line 307 of file GblPoint.cc.

References scatFlag.

307  {
308  return scatFlag;
309  }
bool scatFlag
Scatterer present?
Definition: GblPoint.h:171
GblPoint& gbl::GblPoint::operator= ( const GblPoint )
default
GblPoint& gbl::GblPoint::operator= ( GblPoint &&  )
default
void gbl::GblPoint::printPoint ( unsigned int  level = 0) const

Print GblPoint.

Parameters
[in]levelprint level (0: minimum, >0: more)

Definition at line 533 of file GblPoint.cc.

References gather_cfg::cout, globalDerivatives, globalLabels, mps_fire::i, localDerivatives, measDim, measPrecision, measPrecMin, measProjection, measResiduals, nextJacobian, p2pJacobian, prevJacobian, scatFlag, scatPrecision, scatResiduals, theLabel, theOffset, and transFlag.

533  {
534  std::cout << " GblPoint";
535  if (theLabel) {
536  std::cout << ", label " << theLabel;
537  if (theOffset >= 0) {
538  std::cout << ", offset " << theOffset;
539  }
540  }
541  if (measDim) {
542  std::cout << ", " << measDim << " measurements";
543  }
544  if (scatFlag) {
545  std::cout << ", scatterer";
546  }
547  if (transFlag) {
548  std::cout << ", diagonalized";
549  }
550  if (localDerivatives.cols()) {
551  std::cout << ", " << localDerivatives.cols() << " local derivatives";
552  }
553  if (globalDerivatives.cols()) {
554  std::cout << ", " << globalDerivatives.cols() << " global derivatives";
555  }
556  std::cout << std::endl;
557  if (level > 0) {
558  IOFormat CleanFmt(4, 0, ", ", "\n", "[", "]");
559  if (measDim) {
560  std::cout << " Measurement" << std::endl;
561  std::cout << " Projection: " << std::endl
562  << measProjection.format(CleanFmt) << std::endl;
563  std::cout << " Residuals: "
564  << measResiduals.transpose().format(CleanFmt) << std::endl;
565  std::cout << " Precision (min.: " << measPrecMin << "): "
566  << measPrecision.transpose().format(CleanFmt) << std::endl;
567  }
568  if (scatFlag) {
569  std::cout << " Scatterer" << std::endl;
570  std::cout << " Residuals: "
571  << scatResiduals.transpose().format(CleanFmt) << std::endl;
572  std::cout << " Precision: "
573  << scatPrecision.transpose().format(CleanFmt) << std::endl;
574  }
575  if (localDerivatives.cols()) {
576  std::cout << " Local Derivatives:" << std::endl
577  << localDerivatives.format(CleanFmt) << std::endl;
578  }
579  if (globalDerivatives.cols()) {
580  std::cout << " Global Labels:";
581  for (unsigned int i = 0; i < globalLabels.size(); ++i) {
582  std::cout << " " << globalLabels[i];
583  }
584  std::cout << std::endl;
585  std::cout << " Global Derivatives:"
586  << globalDerivatives.format(CleanFmt) << std::endl;
587  }
588  std::cout << " Jacobian " << std::endl;
589  std::cout << " Point-to-point " << std::endl
590  << p2pJacobian.format(CleanFmt) << std::endl;
591  if (theLabel) {
592  std::cout << " To previous offset " << std::endl
593  << prevJacobian.format(CleanFmt) << std::endl;
594  std::cout << " To next offset " << std::endl
595  << nextJacobian.format(CleanFmt) << std::endl;
596  }
597  }
598  }
Vector5d measResiduals
Measurement residuals.
Definition: GblPoint.h:166
bool transFlag
Transformation exists?
Definition: GblPoint.h:168
bool scatFlag
Scatterer present?
Definition: GblPoint.h:171
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:159
Eigen::Vector2d scatPrecision
Scattering precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:174
double measPrecMin
Minimal measurement precision (for usage)
Definition: GblPoint.h:164
unsigned int measDim
Dimension of measurement (1-5), 0 indicates absence of measurement.
Definition: GblPoint.h:163
Eigen::MatrixXd globalDerivatives
Derivatives of measurement vs additional global (MP-II) parameters.
Definition: GblPoint.h:177
Eigen::MatrixXd localDerivatives
Derivatives of measurement vs additional local (fit) parameters.
Definition: GblPoint.h:175
std::vector< int > globalLabels
Labels of global (MP-II) derivatives.
Definition: GblPoint.h:176
Matrix5d nextJacobian
Jacobian to next scatterer (or last measurement)
Definition: GblPoint.h:162
Vector5d measPrecision
Measurement precision (diagonal of inverse covariance matrix)
Definition: GblPoint.h:167
Eigen::Vector2d scatResiduals
Scattering residuals (initial kinks if iterating)
Definition: GblPoint.h:173
Matrix5d measProjection
Projection from measurement to local system.
Definition: GblPoint.h:165
Matrix5d prevJacobian
Jacobian to previous scatterer (or first measurement)
Definition: GblPoint.h:161
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:158
Matrix5d p2pJacobian
Point-to-point jacobian from previous point.
Definition: GblPoint.h:160
void gbl::GblPoint::setLabel ( unsigned int  aLabel)

Define label of point (by GBLTrajectory constructor)

Parameters
[in]aLabelLabel identifying point

Definition at line 441 of file GblPoint.cc.

References theLabel.

Referenced by SequenceTypes.DummyModule::__init__(), SequenceTypes.DummyBooleanModule::__init__(), and Vispa.Gui.FindDialog.FindDialog::reset().

441  {
442  theLabel = aLabel;
443  }
unsigned int theLabel
Label identifying point.
Definition: GblPoint.h:158
void gbl::GblPoint::setOffset ( int  anOffset)

Define offset for point (by GBLTrajectory constructor)

Parameters
[in]anOffsetOffset number

Definition at line 454 of file GblPoint.cc.

References theOffset.

454  {
455  theOffset = anOffset;
456  }
int theOffset
Offset number at point if not negative (else interpolation needed)
Definition: GblPoint.h:159

Member Data Documentation

Eigen::MatrixXd gbl::GblPoint::globalDerivatives
private

Derivatives of measurement vs additional global (MP-II) parameters.

Definition at line 177 of file GblPoint.h.

Referenced by addGlobals(), GblPoint(), getGlobalDerivatives(), getGlobalLabelsAndDerivatives(), getLocalDerivatives(), getNumGlobals(), and printPoint().

std::vector<int> gbl::GblPoint::globalLabels
private

Labels of global (MP-II) derivatives.

Definition at line 176 of file GblPoint.h.

Referenced by addGlobals(), GblPoint(), getGlobalLabels(), getGlobalLabelsAndDerivatives(), getLocalDerivatives(), and printPoint().

Eigen::MatrixXd gbl::GblPoint::localDerivatives
private

Derivatives of measurement vs additional local (fit) parameters.

Definition at line 175 of file GblPoint.h.

Referenced by addLocals(), GblPoint(), getLocalDerivatives(), getNumLocals(), getScatTransformation(), and printPoint().

unsigned int gbl::GblPoint::measDim
private

Dimension of measurement (1-5), 0 indicates absence of measurement.

Definition at line 163 of file GblPoint.h.

Referenced by addGlobals(), addLocals(), addMeasurement(), GblPoint(), getLocalDerivatives(), getMeasTransformation(), getMeasurement(), getScatTransformation(), hasMeasurement(), printPoint(), and ~GblPoint().

Vector5d gbl::GblPoint::measPrecision
private

Measurement precision (diagonal of inverse covariance matrix)

Definition at line 167 of file GblPoint.h.

Referenced by addMeasurement(), getMeasurement(), printPoint(), and ~GblPoint().

double gbl::GblPoint::measPrecMin
private

Minimal measurement precision (for usage)

Definition at line 164 of file GblPoint.h.

Referenced by addMeasurement(), GblPoint(), getMeasPrecMin(), printPoint(), and ~GblPoint().

Matrix5d gbl::GblPoint::measProjection
private

Projection from measurement to local system.

Definition at line 165 of file GblPoint.h.

Referenced by addMeasurement(), getMeasurement(), printPoint(), and ~GblPoint().

Vector5d gbl::GblPoint::measResiduals
private

Measurement residuals.

Definition at line 166 of file GblPoint.h.

Referenced by addMeasurement(), getMeasurement(), printPoint(), and ~GblPoint().

Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor , 5, 5> gbl::GblPoint::measTransformation
private

Transformation of diagonalization (of meas. precision matrix)

Definition at line 170 of file GblPoint.h.

Referenced by addGlobals(), addLocals(), addMeasurement(), GblPoint(), getLocalDerivatives(), getMeasTransformation(), getScatTransformation(), and ~GblPoint().

Matrix5d gbl::GblPoint::nextJacobian
private

Jacobian to next scatterer (or last measurement)

Definition at line 162 of file GblPoint.h.

Referenced by addNextJacobian(), getDerivatives(), and printPoint().

Matrix5d gbl::GblPoint::p2pJacobian
private

Point-to-point jacobian from previous point.

Definition at line 160 of file GblPoint.h.

Referenced by GblPoint(), getP2pJacobian(), and printPoint().

Matrix5d gbl::GblPoint::prevJacobian
private

Jacobian to previous scatterer (or first measurement)

Definition at line 161 of file GblPoint.h.

Referenced by addPrevJacobian(), getDerivatives(), and printPoint().

bool gbl::GblPoint::scatFlag
private

Scatterer present?

Definition at line 171 of file GblPoint.h.

Referenced by addScatterer(), GblPoint(), getMeasTransformation(), getScatTransformation(), hasScatterer(), and printPoint().

Eigen::Vector2d gbl::GblPoint::scatPrecision
private

Scattering precision (diagonal of inverse covariance matrix)

Definition at line 174 of file GblPoint.h.

Referenced by addScatterer(), getMeasTransformation(), getScatterer(), and printPoint().

Eigen::Vector2d gbl::GblPoint::scatResiduals
private

Scattering residuals (initial kinks if iterating)

Definition at line 173 of file GblPoint.h.

Referenced by addScatterer(), getMeasTransformation(), getScatterer(), and printPoint().

Eigen::Matrix2d gbl::GblPoint::scatTransformation
private

Transformation of diagonalization (of scat. precision matrix)

Definition at line 172 of file GblPoint.h.

Referenced by addScatterer(), getMeasTransformation(), getScatterer(), and getScatTransformation().

unsigned int gbl::GblPoint::theLabel
private

Label identifying point.

Definition at line 158 of file GblPoint.h.

Referenced by GblPoint(), getLabel(), printPoint(), and setLabel().

int gbl::GblPoint::theOffset
private

Offset number at point if not negative (else interpolation needed)

Definition at line 159 of file GblPoint.h.

Referenced by GblPoint(), getOffset(), printPoint(), and setOffset().

bool gbl::GblPoint::transFlag
private