89 retVal.
getCov() *= 1. / weight;
98 double sumOfWeights(0), weight(0);
120 sumOfWeights += weight;
123 retVal.
getCov() += covInv;
146 double normMin(9.99E99);
147 unsigned int iMin(0);
151 Exception e(
"KalmanFitterInfo::getClosestMeasurementOnPlane: Cannot compare measurements with different H-Matrices. Maybe you have to select a different multipleMeasurementHandling.", __LINE__,__FILE__);
157 double norm = sqrt(res.Norm2Sqr());
158 if (norm < normMin) {
192 bool first(
false), last(
false);
197 debugOut <<
"KalmanFitterInfo::getFittedState - Track is pruned and has " << tr->
getNumPoints() <<
" TrackPoints \n";
205 debugOut <<
"KalmanFitterInfo::getFittedState - has flag F \n";
211 debugOut <<
"KalmanFitterInfo::getFittedState - has flag L \n";
221 debugOut <<
"KalmanFitterInfo::getFittedState first " << first <<
", last " << last <<
"\n";
237 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
242 debugOut <<
"KalmanFitterInfo::getFittedState - biased at last measurement = forwardUpdate_ \n";
250 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
255 debugOut <<
"KalmanFitterInfo::getFittedState - biased at first measurement = backwardUpdate_ \n";
262 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
267 debugOut <<
"KalmanFitterInfo::getFittedState - biased = mean(forwardUpdate_, backwardPrediction_) \n";
278 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
283 debugOut <<
"KalmanFitterInfo::getFittedState - unbiased at last measurement = forwardPrediction_ \n";
291 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
296 debugOut <<
"KalmanFitterInfo::getFittedState - unbiased at first measurement = backwardPrediction_ \n";
302 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
307 debugOut <<
"KalmanFitterInfo::getFittedState - unbiased = mean(forwardPrediction_, backwardPrediction_) \n";
321 if(*(smoothedState.
getPlane()) != *plane) {
322 Exception e(
"KalmanFitterInfo::getResidual: smoothedState and measurement are not defined in the same plane.", __LINE__,__FILE__);
326 Exception e(
"KalmanFitterInfo::getResidual: smoothedState and measurement are not defined wrt the same TrackRep.", __LINE__,__FILE__);
334 TVectorD res(H->
Hv(smoothedState.
getState()));
338 if (onlyMeasurementErrors) {
355 return Rinv.Similarity(res.
getState());
419 for (std::vector<MeasurementOnPlane*>::const_iterator
m = measurementsOnPlane.begin(), mend = measurementsOnPlane.end();
m < mend; ++
m) {
433 for (std::vector<MeasurementOnPlane*>::const_iterator
m = measurementsOnPlane.begin(), mend = measurementsOnPlane.end();
m < mend; ++
m) {
466 Exception e(
"KalmanFitterInfo::setWeights: weights do not have the same size as measurementsOnPlane", __LINE__,__FILE__);
471 errorOut <<
"KalmanFitterInfo::setWeights - WARNING: setting weights even though weights are fixed!" << std::endl;
511 printOut <<
"genfit::KalmanFitterInfo. Belongs to TrackPoint " <<
trackPoint_ <<
"; TrackRep " <<
rep_ <<
"\n";
545 errorOut <<
"KalmanFitterInfo::checkConsistency(): trackPoint_ is nullptr" << std::endl;
557 if (plane.get() ==
nullptr) {
560 errorOut <<
"KalmanFitterInfo::checkConsistency(): plane is nullptr" << std::endl;
564 TVector3 oTest = plane->getO();
572 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurementsOnPlane_ do not all have the same dimensionality" << std::endl;
577 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurementsOnPlane_ have dimension 0" << std::endl;
586 errorOut <<
"KalmanFitterInfo::checkConsistency(): referenceState_ is not defined with the correct plane " <<
referenceState_->getPlane().get() <<
" vs. " << plane.get() << std::endl;
590 errorOut <<
"KalmanFitterInfo::checkConsistency(): referenceState_ is not defined with the correct TrackRep" << std::endl;
594 errorOut <<
"KalmanFitterInfo::checkConsistency(): referenceState_ does not have the right dimension!" << std::endl;
601 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardPrediction_ is not defined with the correct plane" << std::endl;
605 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardPrediction_ is not defined with the correct TrackRep" << std::endl;
609 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardPrediction_ does not have the right dimension!" << std::endl;
615 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ is not defined with the correct plane" << std::endl;
619 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ is not defined with the correct TrackRep" << std::endl;
623 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ does not have the right dimension!" << std::endl;
630 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardPrediction_ is not defined with the correct plane" << std::endl;
634 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardPrediction_ is not defined with the correct TrackRep" << std::endl;
638 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardPrediction_ does not have the right dimension!" << std::endl;
644 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ is not defined with the correct plane" << std::endl;
648 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ is not defined with the correct TrackRep" << std::endl;
652 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ does not have the right dimension!" << std::endl;
658 if((*it)->getPlane() !=
plane) {
659 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurement is not defined with the correct plane" << std::endl;
662 if((*it)->getRep() !=
rep_) {
663 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurement is not defined with the correct TrackRep" << std::endl;
666 if ((*it)->getState().GetNrows() == 0) {
667 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurement has dimension 0!" << std::endl;
672 if (flags ==
nullptr or !flags->
hasFlags(
"U")) {
675 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ w/o forwardPrediction_" << std::endl;
681 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ w/o backwardPrediction_" << std::endl;
685 if (flags ==
nullptr or !flags->
hasFlags(
"M")) {
687 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ w/o measurement" << std::endl;
692 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ w/o measurement" << std::endl;
704 void KalmanFitterInfo::Streamer(TBuffer &R__b)
709 typedef ::genfit::KalmanFitterInfo thisClass;
711 if (R__b.IsReading()) {
712 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
if (R__v) { }
715 baseClass0::Streamer(R__b);
728 if (flag & (1 << 1)) {
734 if (flag & (1 << 2)) {
740 if (flag & (1 << 3)) {
746 if (flag & (1 << 4)) {
753 std::vector<genfit::MeasurementOnPlane*,std::allocator<genfit::MeasurementOnPlane*> > &R__stl =
measurementsOnPlane_;
756 Error(
"measurementsOnPlane_ streamer",
"Missing the TClass object for genfit::MeasurementOnPlane!");
761 R__stl.reserve(R__n);
762 for (R__i = 0; R__i < R__n; R__i++) {
764 R__t->Streamer(R__b);
766 R__stl.push_back(R__t);
769 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
771 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
774 baseClass0::Streamer(R__b);
794 std::vector<genfit::MeasurementOnPlane*,std::allocator<genfit::MeasurementOnPlane*> > &R__stl =
measurementsOnPlane_;
795 int R__n=(&R__stl) ?
int(R__stl.size()) : 0;
798 std::vector<genfit::MeasurementOnPlane*,std::allocator<genfit::MeasurementOnPlane*> >::iterator R__k;
799 for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
800 (*R__k)->Streamer(R__b);
804 R__b.SetByteCount(R__c, kTRUE);