CMS 3D CMS Logo

Public Member Functions

DetLessZ Class Reference

#include <DetLessZ.h>

Inheritance diagram for DetLessZ:
binary_function

List of all members.

Public Member Functions

bool operator() (const Det *a, const Det *b) const

Detailed Description

Definition at line 11 of file DetLessZ.h.


Member Function Documentation

bool DetLessZ::operator() ( const Det a,
const Det b 
) const [inline]

Definition at line 13 of file DetLessZ.h.

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

                                                     {

    // multiply by 1+epsilon to make it numericaly stable
    // the epsilon should depend on the scalar precision,
    // this is just a quick fix!
    if (a->position().z() > 0) {
      return a->position().z()*1.000001 < b->position().z();
    }
    else if (b->position().z() < 0) {
      return a->position().z() < b->position().z()*1.000001;
    }
    else return true;
  }