89 retVal.
getCov() *= 1. / weight;
99 double sumOfWeights(0), weight(0);
121 sumOfWeights += weight;
124 retVal.
getCov() += covInv;
147 double normMin(9.99E99);
148 unsigned int iMin(0);
152 Exception e(
"KalmanFitterInfo::getClosestMeasurementOnPlane: Cannot compare measurements with different H-Matrices. Maybe you have to select a different multipleMeasurementHandling.", __LINE__,__FILE__);
158 double norm = sqrt(res.Norm2Sqr());
159 if (norm < normMin) {
193 bool first(
false), last(
false);
198 debugOut <<
"KalmanFitterInfo::getFittedState - Track is pruned and has " << tr->
getNumPoints() <<
" TrackPoints \n";
206 debugOut <<
"KalmanFitterInfo::getFittedState - has flag F \n";
212 debugOut <<
"KalmanFitterInfo::getFittedState - has flag L \n";
222 debugOut <<
"KalmanFitterInfo::getFittedState first " << first <<
", last " << last <<
"\n";
238 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
243 debugOut <<
"KalmanFitterInfo::getFittedState - biased at last measurement = forwardUpdate_ \n";
251 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
256 debugOut <<
"KalmanFitterInfo::getFittedState - biased at first measurement = backwardUpdate_ \n";
263 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
268 debugOut <<
"KalmanFitterInfo::getFittedState - biased = mean(forwardUpdate_, backwardPrediction_) \n";
279 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
284 debugOut <<
"KalmanFitterInfo::getFittedState - unbiased at last measurement = forwardPrediction_ \n";
292 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
297 debugOut <<
"KalmanFitterInfo::getFittedState - unbiased at first measurement = backwardPrediction_ \n";
303 Exception e(
"KalmanFitterInfo::getFittedState: Needed updates/predictions not available in this FitterInfo.", __LINE__,__FILE__);
308 debugOut <<
"KalmanFitterInfo::getFittedState - unbiased = mean(forwardPrediction_, backwardPrediction_) \n";
322 if(*(smoothedState.
getPlane()) != *plane) {
323 Exception e(
"KalmanFitterInfo::getResidual: smoothedState and measurement are not defined in the same plane.", __LINE__,__FILE__);
327 Exception e(
"KalmanFitterInfo::getResidual: smoothedState and measurement are not defined wrt the same TrackRep.", __LINE__,__FILE__);
335 TVectorD res(H->
Hv(smoothedState.
getState()));
339 if (onlyMeasurementErrors) {
356 return Rinv.Similarity(res.
getState());
420 for (std::vector<MeasurementOnPlane*>::const_iterator
m = measurementsOnPlane.begin(), mend = measurementsOnPlane.end();
m < mend; ++
m) {
434 for (std::vector<MeasurementOnPlane*>::const_iterator
m = measurementsOnPlane.begin(), mend = measurementsOnPlane.end();
m < mend; ++
m) {
467 Exception e(
"KalmanFitterInfo::setWeights: weights do not have the same size as measurementsOnPlane", __LINE__,__FILE__);
472 errorOut <<
"KalmanFitterInfo::setWeights - WARNING: setting weights even though weights are fixed!" << std::endl;
512 printOut <<
"genfit::KalmanFitterInfo. Belongs to TrackPoint " <<
trackPoint_ <<
"; TrackRep " <<
rep_ <<
"\n";
546 errorOut <<
"KalmanFitterInfo::checkConsistency(): trackPoint_ is nullptr" << std::endl;
558 if (plane.get() ==
nullptr) {
561 errorOut <<
"KalmanFitterInfo::checkConsistency(): plane is nullptr" << std::endl;
566 TVector3 oTest = plane->getO();
575 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurementsOnPlane_ do not all have the same dimensionality" << std::endl;
580 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurementsOnPlane_ have dimension 0" << std::endl;
589 errorOut <<
"KalmanFitterInfo::checkConsistency(): referenceState_ is not defined with the correct plane " <<
referenceState_->getPlane().get() <<
" vs. " << plane.get() << std::endl;
593 errorOut <<
"KalmanFitterInfo::checkConsistency(): referenceState_ is not defined with the correct TrackRep" << std::endl;
597 errorOut <<
"KalmanFitterInfo::checkConsistency(): referenceState_ does not have the right dimension!" << std::endl;
604 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardPrediction_ is not defined with the correct plane" << std::endl;
608 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardPrediction_ is not defined with the correct TrackRep" << std::endl;
612 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardPrediction_ does not have the right dimension!" << std::endl;
618 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ is not defined with the correct plane" << std::endl;
622 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ is not defined with the correct TrackRep" << std::endl;
626 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ does not have the right dimension!" << std::endl;
633 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardPrediction_ is not defined with the correct plane" << std::endl;
637 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardPrediction_ is not defined with the correct TrackRep" << std::endl;
641 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardPrediction_ does not have the right dimension!" << std::endl;
647 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ is not defined with the correct plane" << std::endl;
651 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ is not defined with the correct TrackRep" << std::endl;
655 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ does not have the right dimension!" << std::endl;
661 if((*it)->getPlane() !=
plane) {
662 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurement is not defined with the correct plane" << std::endl;
665 if((*it)->getRep() !=
rep_) {
666 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurement is not defined with the correct TrackRep" << std::endl;
669 if ((*it)->getState().GetNrows() == 0) {
670 errorOut <<
"KalmanFitterInfo::checkConsistency(): measurement has dimension 0!" << std::endl;
675 if (flags ==
nullptr or !flags->
hasFlags(
"U")) {
678 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ w/o forwardPrediction_" << std::endl;
684 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ w/o backwardPrediction_" << std::endl;
688 if (flags ==
nullptr or !flags->
hasFlags(
"M")) {
690 errorOut <<
"KalmanFitterInfo::checkConsistency(): forwardUpdate_ w/o measurement" << std::endl;
695 errorOut <<
"KalmanFitterInfo::checkConsistency(): backwardUpdate_ w/o measurement" << std::endl;
707 void KalmanFitterInfo::Streamer(TBuffer &R__b)
712 typedef ::genfit::KalmanFitterInfo thisClass;
714 if (R__b.IsReading()) {
715 Version_t R__v = R__b.ReadVersion(&R__s, &R__c);
if (R__v) { }
718 baseClass0::Streamer(R__b);
731 if (flag & (1 << 1)) {
737 if (flag & (1 << 2)) {
743 if (flag & (1 << 3)) {
749 if (flag & (1 << 4)) {
756 std::vector<genfit::MeasurementOnPlane*,std::allocator<genfit::MeasurementOnPlane*> > &R__stl =
measurementsOnPlane_;
759 Error(
"measurementsOnPlane_ streamer",
"Missing the TClass object for genfit::MeasurementOnPlane!");
764 R__stl.reserve(R__n);
765 for (R__i = 0; R__i < R__n; R__i++) {
767 R__t->Streamer(R__b);
769 R__stl.push_back(R__t);
772 R__b.CheckByteCount(R__s, R__c, thisClass::IsA());
774 R__c = R__b.WriteVersion(thisClass::IsA(), kTRUE);
777 baseClass0::Streamer(R__b);
797 std::vector<genfit::MeasurementOnPlane*,std::allocator<genfit::MeasurementOnPlane*> > &R__stl =
measurementsOnPlane_;
798 int R__n=int(R__stl.size());
801 std::vector<genfit::MeasurementOnPlane*,std::allocator<genfit::MeasurementOnPlane*> >::iterator R__k;
802 for (R__k = R__stl.begin(); R__k != R__stl.end(); ++R__k) {
803 (*R__k)->Streamer(R__b);
807 R__b.SetByteCount(R__c, kTRUE);