Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:26

0001 #ifndef DetLayers_DetLessZ_H
0002 #define DetLayers_DetLessZ_H
0003 
0004 /** Comparison operator for Dets based on the Z.
0005  */
0006 
0007 #include "TrackingTools/DetLayers/interface/GeometricSearchDet.h"
0008 
0009 inline bool isDetLessZ(const GeometricSearchDet* a, const GeometricSearchDet* b) {
0010   // multiply by 1+epsilon to make it numericaly stable
0011   // the epsilon should depend on the scalar precision,
0012   // this is just a quick fix!
0013   if (a->position().z() > 0) {
0014     return a->position().z() * 1.000001 < b->position().z();
0015   } else if (b->position().z() < 0) {
0016     return a->position().z() < b->position().z() * 1.000001;
0017   } else
0018     return true;
0019 }
0020 
0021 #endif