CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/RecoTracker/MeasurementDet/plugins/NonPropagatingDetMeasurements.cc

Go to the documentation of this file.
00001 #include "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   throw cms::Exception("THIS SHOULD NOT BE CALLED");
00014   std::vector<TrajectoryMeasurement> result;
00015 
00016   MeasurementDet::RecHitContainer allHits = det.recHits( stateOnThisDet);
00017   for (MeasurementDet::RecHitContainer::const_iterator ihit=allHits.begin();
00018        ihit != allHits.end(); ihit++) {
00019     std::pair<bool,double> diffEst = est.estimate( stateOnThisDet, **ihit);
00020     if ( diffEst.first) {
00021       result.push_back( TrajectoryMeasurement( stateOnThisDet, *ihit, 
00022                                                diffEst.second));
00023     }
00024   }
00025   //GIO// std::cerr << "NonPropagatingDetMeasurements: " << allHits.size() << " => " << result.size() << std::endl;
00026   if ( result.empty()) {
00027     // create a TrajectoryMeasurement with an invalid RecHit and zero estimate
00028     result.push_back( TrajectoryMeasurement( stateOnThisDet, 
00029                                              InvalidTransientRecHit::build(&det.geomDet()), 0.F)); 
00030   }
00031   else {
00032     // sort results according to estimator value
00033     if ( result.size() > 1) {
00034       sort( result.begin(), result.end(), TrajMeasLessEstim());
00035     }
00036   }
00037   return result;
00038 }