Skip to content

Commit

Permalink
FIX in GBL reference trajectories: add missing initialisations
Browse files Browse the repository at this point in the history
Adds missing matrix initialisations to the EIGEN matrices.
This was not needed in previous implementation of GBL based on ROOT TMatrix
(ROOT presets matrices to 0., EIGEN not).

Fix provided by @ckleinw
  • Loading branch information
uhh2-bot committed Sep 19, 2017
1 parent 9c60c7f commit 1294458
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Alignment/ReferenceTrajectories/src/GblTrajectory.cc
Expand Up @@ -603,6 +603,7 @@ namespace gbl {

int nOffset = aPoint.getOffset();

anIndex = {};
aJacobian.setZero();
if (nOffset < 0) // need interpolation
{
Expand Down Expand Up @@ -697,6 +698,7 @@ namespace gbl {

int nOffset = aPoint.getOffset();

anIndex = {};
aJacobian.setZero();

Matrix2d prevW, prevWJ, nextW, nextWJ;
Expand Down Expand Up @@ -1077,13 +1079,15 @@ namespace gbl {
if (measDim > 2) {
matPDer = matP * matDer;
} else { // 'shortcut' for position measurements
matPDer.setZero();
matPDer.block<2, 5>(3, 0) = matP.block<2, 2>(3, 3)
* matDer.block<2, 5>(3, 0);
}

if (numInnerTrans > 0) {
// transform for external parameters
proDer.resize(measDim, Eigen::NoChange);
proDer.setZero();
// match parameters
unsigned int ifirst = 0;
unsigned int ilabel = 0;
Expand Down Expand Up @@ -1151,6 +1155,7 @@ namespace gbl {
if (numInnerTrans > 0) {
// transform for external parameters
proDer.resize(nDim, Eigen::NoChange);
proDer.setZero();
// match parameters
unsigned int ifirst = 0;
unsigned int ilabel = 0;
Expand Down
Expand Up @@ -123,6 +123,7 @@ bool TwoBodyDecayTrajectory::construct(const TwoBodyDecayTrajectoryState& state,
trajectory2.gblInput().front().second*tbdToLocal2));
// add virtual mass measurement
theGblExtDerivatives.resize(1,nTbd);
theGblExtDerivatives.setZero();
theGblExtDerivatives(0,TwoBodyDecayParameters::mass) = 1.0;
theGblExtMeasurements.resize(1);
theGblExtMeasurements(0) = state.primaryMass() - state.decayParameters()[TwoBodyDecayParameters::mass];
Expand Down

0 comments on commit 1294458

Please sign in to comment.