35 m_cov_stdvec{250.,250.,0.25,0.25,0.000001},
36 m_thetaGainDampingValue(0.1),
40 declareProperty(
"InitialCovariances",m_cov_stdvec,
"default covariance to be used at start of filter");
41 declareProperty(
"FastTrackStateCovCalculation",m_useFruehwirth8a=
false,
"toggles which formula to use for updated cov");
42 declareInterface<IUpdator>(
this );
52 if (m_cov_stdvec.size() < 5) {
53 ATH_MSG_WARNING(
"Wrong-sized initial covariance given, so set to default: ");
54 m_cov_stdvec = {250.,250.,0.25, 0.25, 0.000001};
57 if (m_useFruehwirth8a) {
58 ATH_MSG_DEBUG(
"Fast computation will be used for track state cov matrices (Fruehwirth-1987 eq. 8a)." );
60 ATH_MSG_DEBUG(
"Track state cov matrix will be calculated according to Gelb-1975 p305." );
64 m_unitMatrix.SetDiagonal(IV);
66 return StatusCode::SUCCESS;
72 return StatusCode::SUCCESS;
79 if (msgLvl(
MSG::VERBOSE)) logStart(
"addToState(TP,LPOS,ERR)",inputTrkPar);
81 const int updatingSign = 1;
84 if (!getStartCov(covTrk,inputTrkPar,updatingSign))
return nullptr;
87 int nLocCoord = measLocCov.cols();
89 return calculateFilterStep_1D (inputTrkPar,
91 measLocPos[0],1,measLocCov,
92 updatingSign,fitQoS,
false);
93 }
if (nLocCoord == 2) {
94 return calculateFilterStep_2D (inputTrkPar,
98 updatingSign,fitQoS,
false);
100 ATH_MSG_WARNING(
" number (" << nLocCoord <<
") of local coordinates must be 1 or 2, can not update!" );
109 if (msgLvl(
MSG::VERBOSE)) logStart(
"addToState(TP,LPAR,ERR)",trkPar);
111 return prepareFilterStep (trkPar, measmtPar, measmtCov, 1, fitQoS,
false);
119 const int updatingSign = 1;
120 if (msgLvl(
MSG::VERBOSE)) logStart(
"addToState(TP,LPOS,ERR,FQ)",inputTP);
122 ATH_MSG_WARNING(
"expect nil FitQuality pointer, refuse operation to avoid mem leak!");
127 if (!getStartCov(covTrk,inputTP,updatingSign))
return nullptr;
129 int nLocCoord = measLocCov.cols();
130 if (nLocCoord == 1) {
131 return calculateFilterStep_1D (inputTP,
133 measLocPos[0],1,measLocCov,
134 updatingSign,fitQoS,
true);
135 }
if (nLocCoord == 2) {
136 return calculateFilterStep_2D (inputTP,
140 updatingSign,fitQoS,
true);
142 ATH_MSG_WARNING(
" number (" << nLocCoord <<
") of local coordinates must be 1 or 2, can not update!" );
153 if (msgLvl(
MSG::VERBOSE)) logStart(
"addToState(TP,LPAR,ERR,FQ)",trkPar);
156 <<
" avoid mem leak!" );
159 return prepareFilterStep (trkPar, measmtPar, measmtCov, 1, fitQoS,
true);
167 if (msgLvl(
MSG::VERBOSE)) logStart(
"removeFromState(TP,LPOS,ERR)",inputTP);
169 const int updatingSign = -1;
171 if (!getStartCov(covTrk,inputTP,updatingSign))
return nullptr;
173 int nLocCoord = measLocCov.cols();
174 if (nLocCoord == 1) {
175 return calculateFilterStep_1D (inputTP,
177 measLocPos[0],1,measLocCov,
178 updatingSign,fitQoS,
false);
179 }
if (nLocCoord == 2) {
180 return calculateFilterStep_2D (inputTP,
184 updatingSign,fitQoS,
false);
187 <<
"must be 1 or 2, can not un-update!" );
196 if (msgLvl(
MSG::DEBUG)) logStart(
"removeFromState(TP,LPAR,ERR)",trkPar);
198 return prepareFilterStep (trkPar, measmtPar, measmtCov,-1,fitQoS,
false);
206 const int updatingSign = -1;
207 if (msgLvl(
MSG::VERBOSE)) logStart(
"removeFromState(TP,LPOS,ERR,FQ)",inputTP);
209 msg(MSG::WARNING) <<
"expect nil FitQuality pointer, refuse operation to"
210 <<
" avoid mem leak!" <<
endmsg;
215 if (!getStartCov(covTrk,inputTP,updatingSign))
return nullptr;
217 int nLocCoord = measLocCov.cols();
218 if (nLocCoord == 1) {
219 return calculateFilterStep_1D (inputTP,
221 measLocPos[0],1,measLocCov,
222 updatingSign,fitQoS,
true);
223 }
if (nLocCoord == 2) {
224 return calculateFilterStep_2D (inputTP,
228 updatingSign,fitQoS,
true);
231 <<
" must be 1 or 2, can not un-update!" );
242 if (msgLvl(
MSG::VERBOSE)) logStart(
"removeFromState(TP,LPAR,ERR,FQ)",trkPar);
244 ATH_MSG_WARNING(
"expect nil FitQuality pointer, refuse operation to avoid mem leak!" );
247 return prepareFilterStep (trkPar, measmtPar, measmtCov, -1, fitQoS,
true);
259 if (!covOne && ! covTwo) {
260 ATH_MSG_WARNING(
"both parameters have no errors, invalid use of Updator::combineStates()" );
265 if (msgLvl(
MSG::VERBOSE)) logResult(
"combineStates(TP,TP)",
two.parameters(),*covTwo);
266 return std::unique_ptr<Trk::TrackParameters>(
two.clone());
269 if (msgLvl(
MSG::VERBOSE)) logResult(
"combineStates(TP,TP)",
one.parameters(),*covOne);
270 return std::unique_ptr<Trk::TrackParameters>(
one.clone());
278 for (
int i=0;
i<5; ++
i)
279 for (
int j=0; j<=
i; ++j) {
280 covOneSM(j,
i) = (*covOne)(j,
i);
299 if (!covOne && ! covTwo) {
300 ATH_MSG_WARNING(
"both parameters have no errors, invalid use of Updator::combineStates()" );
305 ATH_MSG_WARNING(
"expect nil FitQuality pointer, refuse operation to avoid mem leak!");
311 if (msgLvl(
MSG::VERBOSE)) logResult(
"combineStates(TP,TP)",
two.parameters(),*covTwo);
312 return std::unique_ptr<Trk::TrackParameters>(
two.clone());
315 if (msgLvl(
MSG::VERBOSE)) logResult(
"combineStates(TP,TP)",
one.parameters(),*covOne);
316 return std::unique_ptr<Trk::TrackParameters>(
one.clone());
321 for (
int i=0;
i<5; ++
i)
322 for (
int j=0; j<=
i; ++j) {
323 covOneSM(j,
i) = (*covOne)(j,
i);
338 ATH_MSG_DEBUG(
"--> entered KalmanUpdatorSMatrix::fullStateFitQuality(TP,LPOS,ERR)" );
340 if (!trkPar.covariance()) {
345 int nLocCoord = covRio.cols();
346 if (nLocCoord == 1) {
347 return makeChi2_1D(
SParVector5(&trkPar.parameters()[0],5),
348 (*trkPar.covariance()),
351 }
if (nLocCoord == 2) {
353 SmeasCov(0,0) = covRio(0,0);
354 SmeasCov(1,0) = covRio(0,1);
355 SmeasCov(1,1) = covRio(1,1);
356 return makeChi2_2D(
SParVector5(&trkPar.parameters()[0],5),
357 (*trkPar.covariance()),
372 ATH_MSG_VERBOSE(
"--> entered KalmanUpdatorSMatrix::fullStateFitQuality(TP,LPAR,ERR)" );
375 if (!trkPar.covariance()) {
380 if ( ! consistentParamDimensions(parRio,covRio.cols()) )
return {};
382 ROOT::Math::SVector<int,5> intAccessor;
384 if (nLocCoord == 1) {
385 return makeChi2_1D(
SParVector5(&trkPar.parameters()[0],5),
386 (*trkPar.covariance()),
387 parRio[s_enumAccessor.pardef[intAccessor(0)]],covRio(0,0),
389 }
if (nLocCoord == 2) {
391 for (
int i=0, irow=0;
i<5; ++
i) {
393 SmeasCov(0,irow) = covRio(0,irow);
394 SmeasCov(1,irow) = covRio(1,irow);
398 return makeChi2_2D(
SParVector5(&trkPar.parameters()[0],5),
399 (*trkPar.covariance()),
400 SParVector2(parRio[s_enumAccessor.pardef[intAccessor(0)]],
401 parRio[s_enumAccessor.pardef[intAccessor(1)]]),
403 }
if (nLocCoord == 5) {
404 return makeChi2_5D(
SParVector5(&trkPar.parameters()[0],5),
405 (*trkPar.covariance()),
417 if (parRio.
parameterKey()==31)
r = (parRio - trkPar.parameters());
418 else r = (parRio -
H*trkPar.parameters());
421 return makeChi2Object(
r,(*trkPar.covariance()),covRio,
H,-1);
430 ATH_MSG_VERBOSE(
"--> entered KalmanUpdatorSMatrix::predictedStateFitQuality(TP,LPOS,ERR)" );
432 if (!predPar.covariance()) {
433 ATH_MSG_WARNING(
"input state has no error matrix in predictedStateFitQuality()" );
437 int nLocCoord = covRio.cols();
438 if (nLocCoord == 1) {
439 return makeChi2_1D(
SParVector5(&predPar.parameters()[0],5),
440 (*predPar.covariance()),
443 }
if (nLocCoord == 2) {
445 SmeasCov(0,0) = covRio(0,0);
446 SmeasCov(1,0) = covRio(1,0);
447 SmeasCov(1,1) = covRio(1,1);
448 return makeChi2_2D(
SParVector5(&predPar.parameters()[0],5),
449 (*predPar.covariance()),
463 ATH_MSG_VERBOSE(
"--> entered KalmanUpdatorSMatrix::predictedStateFitQuality(TP,LPAR,ERR)" );
466 if (!predPar.covariance()) {
467 ATH_MSG_WARNING(
"input state has no error matrix in predictedStateFitQuality()" );
471 if ( ! consistentParamDimensions(parRio,covRio.cols()) )
return {};
473 ROOT::Math::SVector<int,5> intAccessor;
475 if (nLocCoord == 1) {
476 return makeChi2_1D(
SParVector5(&predPar.parameters()[0],5),
477 (*predPar.covariance()),
478 parRio[s_enumAccessor.pardef[intAccessor(0)]],covRio(0,0),
480 }
if (nLocCoord == 2) {
482 for (
int i=0, irow=0;
i<5; ++
i) {
484 SmeasCov(0,irow) = covRio(0,irow);
485 SmeasCov(1,irow) = covRio(1,irow);
489 return makeChi2_2D(
SParVector5(&predPar.parameters()[0],5),
490 (*predPar.covariance()),
491 SParVector2(parRio[s_enumAccessor.pardef[intAccessor(0)]],
492 parRio[s_enumAccessor.pardef[intAccessor(1)]]),
494 }
if (nLocCoord == 5 ) {
495 return makeChi2_5D(
SParVector5(&predPar.parameters()[0],5),
496 (*predPar.covariance()),
508 if (parRio.
parameterKey()==31)
r = parRio - predPar.parameters();
509 else r = parRio -
H * predPar.parameters();
512 return makeChi2Object(
r,(*predPar.covariance()),
521 ATH_MSG_VERBOSE(
"--> entered KalmanUpdatorSMatrix::predictedStateFitQuality(TP,TP)");
526 if (!covOne && ! covTwo) {
527 ATH_MSG_WARNING(
"both parameters have no errors, invalid use of Updator::fitQuality()" );
531 if (!covOne || ! covTwo) {
532 ATH_MSG_DEBUG(
"One parameter does not have uncertainties, assume initial state and return chi2=0.0");
535 return makeChi2_5D(
SParVector5(&trkParOne.parameters()[0],5),
542 std::vector<double>
E(5);
543 for (
int i=0;
i<5; ++
i)
E[
i] = std::sqrt(m_cov0(
i));
553 bool createFQoS )
const {
557 if (!getStartCov(covTrk,inputTrkPar,
sign))
return nullptr;
559 int nLocCoord = covRio.cols();
560 if ( ! consistentParamDimensions(parRio,nLocCoord) )
return nullptr;
561 if (msgLvl(
MSG::VERBOSE)) logInputCov(covTrk,parRio,covRio);
564 ROOT::Math::SVector<int,5> intAccessor;
567 if (nLocCoord==1)
return calculateFilterStep_1D (inputTrkPar,
SParVector5(&inputTrkPar.parameters()[0],5),covTrk,
568 parRio[s_enumAccessor.pardef[intAccessor(0)]],
570 sign,fitQoS,createFQoS);
571 if (nLocCoord==2)
return calculateFilterStep_2D (inputTrkPar,
SParVector5(&inputTrkPar.parameters()[0],5),covTrk,
572 SParVector2(parRio[s_enumAccessor.pardef[intAccessor(0)]],parRio[s_enumAccessor.pardef[intAccessor(1)]]),
574 sign,fitQoS,createFQoS);
576 if (nLocCoord==3)
return calculateFilterStep_3D (inputTrkPar,
SParVector5(&inputTrkPar.parameters()[0],5),covTrk,
578 sign,fitQoS,createFQoS);
579 if (nLocCoord==4)
return calculateFilterStep_4D (inputTrkPar,
SParVector5(&inputTrkPar.parameters()[0],5),covTrk,
581 sign,fitQoS,createFQoS);
582 if (nLocCoord==5)
return calculateFilterStep_5D (inputTrkPar,
SParVector5(&inputTrkPar.parameters()[0],5),covTrk,
584 sign,fitQoS,createFQoS);
589 std::unique_ptr<Trk::TrackParameters>
598 bool createFQoS )
const {
601 if (paramKey!=1)
for (
int i=0;
i<5; ++
i)
if (paramKey & (1<<
i)) mk=
i;
603 double r = measPar - trkPar(mk);
604 double R = (
sign * measCov(0,0)) + trkCov(mk,mk);
606 ATH_MSG_DEBUG(
"inversion of the error-on-the-residual failed.");
611 ROOT::Math::SMatrix<double,5,1,ROOT::Math::MatRepStd<double, 5, 1> >
612 K = trkCov.Sub<ROOT::Math::SMatrix<double,5,1,ROOT::Math::MatRepStd<double, 5, 1> > >(0,mk)*R;
617 <<std::setiosflags(std::ios::fixed | std::ios::showpoint | std::ios::right)
618 << std::setw(7) << std::setprecision(4) << K(0,0)<<
", "
619 << std::setw(7) << std::setprecision(4) << K(1,0)<<
", "
620 << std::setw(7) << std::setprecision(4) << K(2,0)<<
", "
621 << std::setw(7) << std::setprecision(4) << K(3,0)<<
", "
622 << std::setw(7) << std::setprecision(4) << K(4,0)<<
")"
623 << std::resetiosflags(std::ios::fixed));
629 if (!thetaWithinRange_5D(newPar)) {
632 ATH_MSG_DEBUG(
"calculateFS_1D(): decided to damp update of theta and re-calculate." );
635 newPar = trkPar + dampedCov * R *
r;
638 <<std::setiosflags(std::ios::fixed | std::ios::showpoint | std::ios::right)
639 << std::setw(7) << std::setprecision(4) << K(0,0)<<
", "
640 << std::setw(7) << std::setprecision(4) << K(1,0)<<
", "
641 << std::setw(7) << std::setprecision(4) << K(2,0)<<
", "
642 << std::setw(7) << std::setprecision(4) << K(3,0)<<
", "
643 << std::setw(7) << std::setprecision(4) << K(4,0)<<
")"
644 << std::resetiosflags(std::ios::fixed) );
646 ATH_MSG_DEBUG(
"-U- theta out of range but can not damp this update.");
654 << M(0,0)<<
"," << M(1,1)<<
","
655 << M(2,2)<<
"," << M(3,3)<<
","
658 if (!m_useFruehwirth8a) {
661 newCov = ROOT::Math::Similarity(M,trkCov)
662 +
sign*(ROOT::Math::Similarity(K,measuredSMatrix1D));
670 ROOT::Math::AssignSym::Evaluate(newCov, M * trkCov);
680 double predictedResidual = (
sign<0) ?
r:measPar - newPar(mk);
686 double chiSquared = measCov(0,0) - updatedCov(mk,mk);
688 ATH_MSG_DEBUG(
"division by zero in 1D chi2, set chi2 to 0.0 instead" );
693 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= 1" );
697 return convertToClonedTrackPars(TP,newPar,newCov,
sign,createFQoS,
"1D");
701 std::unique_ptr<Trk::TrackParameters>
710 bool createFQoS )
const {
712 ROOT::Math::SMatrix<double,2,5,ROOT::Math::MatRepStd<double, 2, 5> >
H;
715 for (
int i=0, irow=0;
i<5; ++
i) {
716 if (paramKey & (1<<
i)) {
718 H.Place_in_row(
v, irow, 0);
719 SmeasCov(0,irow) = measCov(0,irow);
720 SmeasCov(1,irow) = measCov(1,irow);
728 ATH_MSG_DEBUG(
"inversion of residual error matrix (2D) failed.");
733 ROOT::Math::SMatrix<double,5,2,ROOT::Math::MatRepStd<double, 5, 2> >
734 K = trkCov * ROOT::Math::Transpose(
H) * R;
737 logGainForm (2, trans_r.Place_at(
r,0),
738 trans_R.Place_at(R,0,0),
739 trans_K.Place_at(K,0,0));
744 if (!thetaWithinRange_5D(newPar)) {
746 ( std::abs(R(0,0)*
r(0))>1.0 || std::abs(R(1,1)*
r(1))>1.0 ||
748 ATH_MSG_DEBUG(
"calculateFS_2D(): decided to damp update of theta and re-calculate.");
751 newPar = trkPar + K *
r;
754 <<std::setiosflags(std::ios::fixed | std::ios::showpoint | std::ios::right)
755 << std::setw(7) << std::setprecision(4) << K(0,0)<<
", "
756 << std::setw(7) << std::setprecision(4) << K(1,0)<<
", "
757 << std::setw(7) << std::setprecision(4) << K(2,0)<<
", "
758 << std::setw(7) << std::setprecision(4) << K(3,0)<<
", "
759 << std::setw(7) << std::setprecision(4) << K(4,0)<<
")"
760 << std::resetiosflags(std::ios::fixed) <<
endmsg;
762 <<std::setiosflags(std::ios::fixed | std::ios::showpoint | std::ios::right)
763 << std::setw(7) << std::setprecision(4) << K(0,1)<<
", "
764 << std::setw(7) << std::setprecision(4) << K(1,1)<<
", "
765 << std::setw(7) << std::setprecision(4) << K(2,1)<<
", "
766 << std::setw(7) << std::setprecision(4) << K(3,1)<<
", "
767 << std::setw(7) << std::setprecision(4) << K(4,1)<<
")"
768 << std::resetiosflags(std::ios::fixed) <<
endmsg;
771 ATH_MSG_DEBUG(
"-U- theta out of range but can not damp this update.");
778 if (!m_useFruehwirth8a) {
781 newCov = ROOT::Math::Similarity(M,trkCov)
782 +
sign*(ROOT::Math::Similarity(K,SmeasCov));
789 ROOT::Math::AssignSym::Evaluate(newCov, M * trkCov);
800 ROOT::Math::Similarity(
r,R) :
802 ROOT::Math::Similarity(
r,-R);
804 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= 2" );
807 return convertToClonedTrackPars(TP,newPar,newCov,
sign,createFQoS,
"2D");
811 std::unique_ptr<Trk::TrackParameters>
819 bool createFQoS )
const {
824 ROOT::Math::SMatrix<double,3,5,ROOT::Math::MatRepStd<double, 3, 5> >
H;
825 for (
int i=0, irow=0;
i<5; ++
i) {
828 H.Place_in_row(
v, irow, 0);
829 SmeasCov(0,irow) = measCov(0,irow);
830 SmeasCov(1,irow) = measCov(1,irow);
831 SmeasCov(2,irow) = measCov(2,irow);
839 ATH_MSG_DEBUG(
"inversion of residual error matrix (3D) failed.");
844 ROOT::Math::SMatrix<double,5,3,ROOT::Math::MatRepStd<double, 5, 3> >
845 K = trkCov * ROOT::Math::Transpose(
H) * R;
849 logGainForm (3, trans_r.Place_at(
r,0),
850 trans_R.Place_at(R,0,0), trans_K.Place_at(K,0,0));
857 if (!m_useFruehwirth8a) {
860 newCov = ROOT::Math::Similarity(M,trkCov)
861 +
sign*(ROOT::Math::Similarity(K,SmeasCov));
868 ROOT::Math::AssignSym::Evaluate(newCov, M * trkCov);
880 SmeasPar -
H * newPar ;
888 if ( !R2.Invert() ) {
889 ATH_MSG_DEBUG(
"matrix (3D) inversion not possible, set chi2 to zero");
893 chiSquared = ROOT::Math::Similarity(predictedResidual,R2);
895 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= 3" );
899 return convertToClonedTrackPars(TP,newPar,newCov,
sign,createFQoS,
"3D");
903 std::unique_ptr<Trk::TrackParameters>
911 bool createFQoS )
const {
918 ROOT::Math::SMatrix<double,4,5,ROOT::Math::MatRepStd<double, 4, 5> >
H;
919 for (
int i=0, irow=0;
i<5; ++
i) {
922 H.Place_in_row(
v, irow, 0);
923 SmeasCov(0,irow) = measCov(0,irow);
924 SmeasCov(1,irow) = measCov(1,irow);
925 SmeasCov(2,irow) = measCov(2,irow);
926 SmeasCov(3,irow) = measCov(3,irow);
934 ATH_MSG_DEBUG(
"inversion of residual error matrix (4D) failed." );
939 ROOT::Math::SMatrix<double,5,4,ROOT::Math::MatRepStd<double, 5, 4> >
940 K = trkCov * ROOT::Math::Transpose(
H) * R;
944 logGainForm (4, trans_r.Place_at(
r,0),
945 trans_R.Place_at(R,0,0), trans_K.Place_at(K,0,0));
952 if (!m_useFruehwirth8a) {
955 newCov = ROOT::Math::Similarity(M,trkCov)
956 +
sign*(ROOT::Math::Similarity(K,SmeasCov));
963 ROOT::Math::AssignSym::Evaluate(newCov, M * trkCov);
981 if ( !R2.Invert() ) {
982 ATH_MSG_DEBUG(
"matrix (4D) inversion not possible, set chi2 to zero");
986 chiSquared = ROOT::Math::Similarity(predictedResidual,R2);
988 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= 4" );
992 return convertToClonedTrackPars(TP,newPar,newCov,
sign,createFQoS,
"4D");
996 std::unique_ptr<Trk::TrackParameters>
1004 bool createFQoS )
const {
1006 for (
int i=0;
i<5; ++
i)
1007 for (
int j=0; j<=
i; ++j) {
1008 trkCovTwo(j,
i) = measCov(j,
i);
1014 ATH_MSG_DEBUG(
"inversion of residual error matrix (5D) failed." );
1021 ATH_MSG_WARNING(
"calculateFS_5D(): bad angles in intermediate residual!" );
1038 ROOT::Math::AssignSym::Evaluate(newCov, K * trkCovTwo);
1047 bool goodMatrix(
true);
1048 for (
int i=0;
i<5; ++
i) {
1049 if (newCov(
i,
i) < 0.0 && goodMatrix ) goodMatrix=
false;
1055 newCov = ROOT::Math::Similarity(M,trkCovOne)
1056 +
sign*(ROOT::Math::Similarity(K,trkCovTwo));
1058 for (
int i=0;
i<5; ++
i) {
1059 if (newCov(
i,
i) < 0.0 && goodMatrix ) goodMatrix=
false;
1070 ROOT::Math::Similarity(
r,R) :
1072 ROOT::Math::Similarity(
r,-R);
1074 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= 5" );
1077 return convertToClonedTrackPars(TP,newPar,newCov,
sign,createFQoS,
"5D");
1090 if (
key!=1)
for (
int i=0;
i<5; ++
i)
if (
key & (1<<
i)) mk=
i;
1091 double r = valRio - parTrk(mk);
1095 ATH_MSG_DEBUG(
"inversion of the error-on-the-residual failed." );
1112 ROOT::Math::SVector<int,2>
index(0,1);
1114 for (
int i=0, irow=0;
i<5; ++
i)
1121 ATH_MSG_DEBUG(
"matrix inversion not possible, set chi2 to zero" );
1125 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= 2" );
1140 for (
int i=0;
i<5; ++
i)
1141 for (
int j=0; j<=
i; ++j) {
1142 ScovOne(
i,j) = covOne(
i,j);
1143 ScovTwo(
i,j) = covTwo(
i,j);
1149 ATH_MSG_DEBUG(
"matrix inversion not possible, set chi2 to zero" );
1153 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= 2" );
1158 std::unique_ptr<Trk::TrackParameters>
1164 std::string_view ndtext)
const {
1167 for (
int i=0;
i<5; ++
i) {
1168 for (
int j=0; j<=
i; ++j) {
1169 C.fillSymmetric(
i,j, covpar(
i,j));
1173 std::unique_ptr<Trk::TrackParameters> resultPar =
1177 char reportCalledInterface[80];
1179 memset(ndtext2,
'\0', 5 ); ndtext.copy(ndtext2,2);
1181 sprintf(reportCalledInterface,
"%s-%s,%s)",
1182 (ndtext==
"5D"?
"combineStates(TP,TP":
"addToState(TP,Meas"),
1183 ndtext2,(createFQoS?
"Err,FQ":
"Err"));
1185 sprintf(reportCalledInterface,
"%s,Meas-%s,%s)",
"removeFromState(TP,",
1186 ndtext2,(createFQoS?
"Err,FQ":
"Err"));
1187 logResult((std::string)reportCalledInterface, resultPar->parameters(),C);
1199 ROOT::Math::SVector<int,2> iv;
1200 for (
int i=0,
k=0;
i<5; ++
i) {
if (
key & (1<<
i)) iv(
k++)=
i; }
1202 for (
int i=0;
i<2; ++
i) {
1203 for (
int j=0; j<2; ++j) {
1204 covSubMatrix(
i,j) = M(iv(
i),iv(j));
1207 return covSubMatrix;
1214 ROOT::Math::SVector<int,2> iv;
1215 for (
int i=0,
k=0;
i<5; ++
i) {
if (
key & (1<<
i)) iv(
k++)=
i; }
1217 for (
int i=0;
i<2; ++
i) {
1218 for (
int j=0; j<2; ++j) {
1219 covSubMatrix(
i,j) = M(iv(
i),iv(j));
1222 return covSubMatrix;
1230 ROOT::Math::SVector<int,3> iv;
1231 for (
int i=0,
k=0;
i<5; ++
i) {
if (
key & (1<<
i)) iv(
k++)=
i; }
1233 for (
int i=0;
i<3; ++
i) {
1234 for (
int j=0; j<3; ++j) {
1235 covSubMatrix(
i,j) = M(iv(
i),iv(j));
1238 return covSubMatrix;
1247 ROOT::Math::SVector<int,4> iv;
1248 for (
int i=0,
k=0;
i<5; ++
i) {
if (
key & (1<<
i)) iv(
k++)=
i; }
1250 for (
int i=0;
i<4; ++
i) {
1251 for (
int j=0; j<4; ++j) {
1252 covSubMatrix(
i,j) = M(iv(
i),iv(j));
1255 return covSubMatrix;
1261 const int isign)
const
1264 const AmgSymMatrix(5)* covariance = inputParameters.covariance();
1267 ATH_MSG_WARNING (
"MeasuredTrackParameters == Null, can not calculate updated parameter state.");
1271 ATH_MSG_VERBOSE (
"-U- no covTrk at input - assign large error matrix for the time being.");
1272 M.SetDiagonal(m_cov0);
1276 for (
int i=0;
i<5; ++
i) {
1277 for (
int j=0; j<=
i; ++j) {
1278 M(
i,j) = (*covariance)(
i,j);
1295 ATH_MSG_DEBUG(
"matrix inversion not possible, set chi2 to zero" );
1301 <<
" state, chi2 :" <<
chiSquared <<
" / ndof= " << covRio.cols() );
1305 int numberDoF = covRio.cols();
1312 if (
P.dimension() != dimCov ) {
1313 ATH_MSG_WARNING (
"Inconsistency in dimension of local coord - problem with LocalParameters object?");
1314 ATH_MSG_WARNING (
"dim of local parameters: "<<
P.dimension()<<
" vs. dim of error matrix: "<<dimCov);
1368 ATH_MSG_DEBUG(
"--> entered KalmanUpdatorSMatrix::" << IDstring );
1369 ATH_MSG_VERBOSE(
"-U- TrkPar:" << std::setiosflags(std::ios::right)<<std::setprecision(4)
1370 << std::setw( 9)<<
tp.parameters()[0]<< std::setw(10)<<
tp.parameters()[1]<<std::setprecision(5)
1371 << std::setw(10)<<
tp.parameters()[2]<< std::setw(10)<<
tp.parameters()[3]<<std::setprecision(4)
1372 << std::setw(10)<<
tp.parameters()[4]);
1378 ATH_MSG_VERBOSE(
"-U- cov "<<std::setiosflags(std::ios::right)<<std::setprecision(3)
1379 << std::setw(9)<<covTrk(0,0)<<
" "<< std::setw(9)<<covTrk(0,1)<<
" "
1380 << std::setw(9)<<covTrk(0,2)<<
" "<< std::setw(9)<<covTrk(0,3)<<
" "
1381 << std::setw(9)<<covTrk(0,4));
1383 << std::setw(9)<<covTrk(1,1)<<
" "<< std::setw(9)<<covTrk(1,2)<<
" "
1384 << std::setw(9)<<covTrk(1,3)<<
" "<< std::setw(9)<<covTrk(1,4));
1386 << std::setw(9)<<covTrk(2,2)<<
" "<< std::setw(9)<<covTrk(2,3)<<
" "
1387 << std::setw(9)<<covTrk(2,4));
1389 << std::setw(9)<<covTrk(3,3)<<
" "<< std::setw(9)<<covTrk(3,4));
1391 << std::setw(9)<<covTrk(4,4)<<std::setprecision(6));
1393 int nLocCoord = covRio.cols();
1396 msg(
MSG::VERBOSE) <<
"-U- measurement (err)^2: " <<std::setprecision(4)<<covRio(0,0);
1412 for (
int i=0;
i<
nc;
i++)
1414 << (
i==0 ?
"-U- gain mtx K=(" :
" (" )
1415 << std::setiosflags(std::ios::fixed | std::ios::showpoint | std::ios::right )
1416 << std::setw(7) << std::setprecision(4) << K(0,
i)<<
", "
1417 << std::setw(7) << std::setprecision(4) << K(1,
i)<<
", "
1418 << std::setw(7) << std::setprecision(4) << K(2,
i)<<
", "
1419 << std::setw(7) << std::setprecision(4) << K(3,
i)<<
", "
1420 << std::setw(7) << std::setprecision(4) << K(4,
i)<<
")"
1421 << std::resetiosflags(std::ios::fixed) <<
"\n";
1430 msg(
MSG::VERBOSE) <<
"-U- new par"<<std::setiosflags(std::ios::right)<<std::setprecision(4)
1431 << std::setw( 9)<<
par[0]<< std::setw(10)<<
par[1]<<std::setprecision(5)
1432 << std::setw(10)<<
par[2]<< std::setw(10)<<
par[3]<<std::setprecision(4)
1433 << std::setw(10)<<
par[4] <<
"\n";
1434 msg(
MSG::VERBOSE) <<
"-U- new cov" <<std::setiosflags(std::ios::right)<<std::setprecision(3)
1435 << std::setw(9)<<(covPar)(0,0)<<
" "<< std::setw(9)<<(covPar)(0,1)<<
" "
1436 << std::setw(9)<<(covPar)(0,2)<<
" "<< std::setw(9)<<(covPar)(0,3)
1437 <<
" " << std::setw(9)<<(covPar)(0,4)<<
"\n";
1439 << std::setw(9)<<(covPar)(1,1)<<
" "<< std::setw(9)<<(covPar)(1,2)<<
" "
1440 << std::setw(9)<<(covPar)(1,3)<<
" "<< std::setw(9)<<(covPar)(1,4)<<
"\n";
1442 << std::setw(9)<<(covPar)(2,2) <<
" "<< std::setw(9)<<(covPar)(2,3) <<
" "
1443 << std::setw(9)<<(covPar)(2,4) <<
"\n";
1445 <<
" " <<std::setw(9)<<(covPar)(3,3) <<
" "
1446 << std::setw(9)<<(covPar)(3,4) <<
"\n";
1449 << std::setw(9)<<(covPar)(4,4) <<std::setprecision(6)<<
"\n";