CMS 3D CMS Logo

Functions
DetLessZ.h File Reference
#include "TrackingTools/DetLayers/src/DetLessZ.h"
#include "TrackingTools/DetLayers/interface/GeometricSearchDet.h"

Go to the source code of this file.

Functions

bool isDetLessZ (const GeometricSearchDet *a, const GeometricSearchDet *b)
 

Function Documentation

bool isDetLessZ ( const GeometricSearchDet a,
const GeometricSearchDet b 
)
inline

Comparison operator for Dets based on the Z.

Definition at line 10 of file DetLessZ.h.

References GeometricSearchDet::position(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by BeamHaloNavigationSchool::reachableFromHorizontal(), SimpleNavigationSchool::splitForwardLayers(), and TIBLayer::TIBLayer().

10  {
11 
12  // multiply by 1+epsilon to make it numericaly stable
13  // the epsilon should depend on the scalar precision,
14  // this is just a quick fix!
15  if (a->position().z() > 0) {
16  return a->position().z()*1.000001 < b->position().z();
17  }
18  else if (b->position().z() < 0) {
19  return a->position().z() < b->position().z()*1.000001;
20  }
21  else return true;
22 }
T z() const
Definition: PV3DBase.h:64
virtual const Surface::PositionType & position() const
Returns position of the surface.