CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/RecoTracker/TrackProducer/interface/TrackingRecHitLess.h

Go to the documentation of this file.
00001 #ifndef TrackCandidate_TrackingRecHitLess_H
00002 #define TrackCandidate_TrackingRecHitLess_H
00003 
00004 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00005 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
00006 #include <functional>
00007 #include "Geometry/TrackerGeometryBuilder/interface/GeomDetLess.h"
00008 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
00009 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
00010 
00011 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00012 
00018 class TrackingRecHitLess {
00019 public:
00020 
00021   TrackingRecHitLess( const TrackingGeometry * geometry_, PropagationDirection dir = alongMomentum) :
00022     g_(geometry_){
00023     less_ = new GeomDetLess(dir);
00024   }
00025 
00026 
00027   bool operator()( const TrackingRecHit& a, const TrackingRecHit& b) const {
00028     
00029     return  less_->operator()(
00030                              g_->idToDet(a.geographicalId()), g_->idToDet(b.geographicalId()));
00031   }
00032 
00033  private:
00034   const TrackingGeometry * g_;
00035   GeomDetLess * less_;
00036 };
00037 
00038 #endif