00001 #include "RecoTracker/MeasurementDet/interface/NonPropagatingDetMeasurements.h"
00002 #include "TrackingTools/PatternTools/interface/TrajectoryMeasurement.h"
00003 #include "TrackingTools/PatternTools/interface/MeasurementEstimator.h"
00004 #include "TrackingTools/PatternTools/interface/TrajMeasLessEstim.h"
00005 #include "TrackingTools/MeasurementDet/interface/MeasurementDet.h"
00006 #include "TrackingTools/TransientTrackingRecHit/interface/InvalidTransientRecHit.h"
00007
00008 std::vector<TrajectoryMeasurement>
00009 NonPropagatingDetMeasurements::get( const MeasurementDet& det,
00010 const TrajectoryStateOnSurface& stateOnThisDet,
00011 const MeasurementEstimator& est) const
00012 {
00013 std::vector<TrajectoryMeasurement> result;
00014
00015 MeasurementDet::RecHitContainer allHits = det.recHits( stateOnThisDet);
00016 for (MeasurementDet::RecHitContainer::const_iterator ihit=allHits.begin();
00017 ihit != allHits.end(); ihit++) {
00018 std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, **ihit);
00019 if ( diffEst.first) {
00020 result.push_back( TrajectoryMeasurement( stateOnThisDet, *ihit,
00021 diffEst.second));
00022 }
00023 }
00024 if ( result.empty()) {
00025
00026 result.push_back( TrajectoryMeasurement( stateOnThisDet,
00027 InvalidTransientRecHit::build(&det.geomDet()), 0.F));
00028 }
00029 else {
00030
00031 if ( result.size() > 1) {
00032 sort( result.begin(), result.end(), TrajMeasLessEstim());
00033 }
00034 }
00035 return result;
00036 }