00001 #include "TrackingTools/TrajectoryState/interface/TrajectoryStateOnSurface.h" 00002 #include "TrackingTools/KalmanUpdators/interface/Chi2MeasurementEstimatorForTrackerHits.h" 00003 #include "TrackingTools/PatternTools/interface/MeasurementExtractor.h" 00004 #include "DataFormats/GeometrySurface/interface/BoundPlane.h" 00005 #include "DataFormats/Math/interface/invertPosDefMatrix.h" 00006 00007 std::pair<bool,double> 00008 Chi2MeasurementEstimatorForTrackerHits::estimate( 00009 const TrajectoryStateOnSurface& tsos, 00010 const TransientTrackingRecHit& aRecHit) const { 00011 if (!cacheUpToDate_) { 00012 AlgebraicVector5 par5 = tsos.localParameters().vector(); 00013 tsosMeasuredParameters_[0] = par5[3]; 00014 tsosMeasuredParameters_[1] = par5[4]; 00015 const AlgebraicSymMatrix55 &err5 = tsos.localError().matrix(); 00016 tsosMeasuredError_ = err5.Sub<AlgebraicSymMatrix22>(3,3); 00017 cacheUpToDate_ = true; 00018 } 00019 AlgebraicVector2 r = asSVector<2>(aRecHit.parameters()) - tsosMeasuredParameters_; 00020 AlgebraicSymMatrix22 R = asSMatrix<2>(aRecHit.parametersError()) + tsosMeasuredError_; 00021 invertPosDefMatrix(R); 00022 return returnIt( ROOT::Math::Similarity(r, R) ); 00023 } 00024