File indexing completed on 2024-04-06 12:31:38
0001 #ifndef CD_RecHitLessByDet_H_
0002 #define CD_RecHitLessByDet_H_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0014 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h"
0015
0016 class RecHitLessByDet {
0017 typedef TransientTrackingRecHit::ConstRecHitPointer RecHitPointer;
0018
0019 public:
0020 RecHitLessByDet(const PropagationDirection& dir) : theDirection(dir) {}
0021
0022 ~RecHitLessByDet() {}
0023
0024 bool operator()(const RecHitPointer& aHit, const RecHitPointer& bHit) const {
0025 return (theDirection == alongMomentum ? (aHit->surface()->toGlobal(aHit->localPosition()).mag() <
0026 bHit->surface()->toGlobal(bHit->localPosition()).mag())
0027 : (aHit->surface()->toGlobal(aHit->localPosition()).mag() >
0028 bHit->surface()->toGlobal(bHit->localPosition()).mag()));
0029 }
0030
0031 private:
0032 PropagationDirection theDirection;
0033 };
0034 #endif