Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:50

0001 #ifndef DataFormats_TrackerRecHit2D_TrackingRecHitLessFromGlobalPosition_H
0002 #define DataFormats_TrackerRecHit2D_TrackingRecHitLessFromGlobalPosition_H
0003 
0004 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
0005 #include "Geometry/CommonDetUnit/interface/GeomDet.h"
0006 #include <functional>
0007 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0008 #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h"
0009 /** Defines order of layers in the Tracker as seen by straight tracks
0010  *  coming from the interaction region.
0011  */
0012 
0013 class TrackingRecHitLessFromGlobalPosition {
0014 public:
0015   TrackingRecHitLessFromGlobalPosition(const TrackingGeometry* geometry_, PropagationDirection dir = alongMomentum)
0016       : geometry(geometry_), theDir(dir) {}
0017 
0018   bool operator()(const TrackingRecHit& a, const TrackingRecHit& b) const {
0019     if (theDir == alongMomentum)
0020       return insideOutLess(a, b);
0021     else
0022       return insideOutLess(b, a);
0023   }
0024 
0025 private:
0026   bool insideOutLess(const TrackingRecHit& a, const TrackingRecHit& b) const;
0027 
0028   bool barrelForwardLess(const TrackingRecHit& a, const TrackingRecHit& b) const;
0029 
0030   const TrackingGeometry* geometry;
0031   PropagationDirection theDir;
0032 };
0033 #endif