CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/TrackingTools/TrackFitters/interface/RecHitLessByDet.h

Go to the documentation of this file.
00001 #ifndef CD_RecHitLessByDet_H_
00002 #define CD_RecHitLessByDet_H_
00003 
00015 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00016 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
00017 
00018 class RecHitLessByDet {
00019 
00020   typedef TransientTrackingRecHit::ConstRecHitPointer RecHitPointer;
00021 public:
00022 
00023   RecHitLessByDet(const PropagationDirection& dir) :
00024     theDirection(dir) {}
00025 
00026   ~RecHitLessByDet() {}
00027 
00028   bool operator()(const RecHitPointer& aHit, const RecHitPointer& bHit) const{
00029 
00030     return (theDirection == alongMomentum ? 
00031             (aHit->surface()->toGlobal(aHit->localPosition()).mag() < 
00032              bHit->surface()->toGlobal(bHit->localPosition()).mag() ) :
00033             (aHit->surface()->toGlobal(aHit->localPosition()).mag() >
00034              bHit->surface()->toGlobal(bHit->localPosition()).mag()) );
00035   }
00036 
00037 private:
00038   
00039   PropagationDirection theDirection;
00040 
00041 };
00042 #endif //CD_RecHitLessByDet_H_