CMS 3D CMS Logo

Functions
CTPPSTimingLocalTrack.cc File Reference
#include "DataFormats/CTPPSReco/interface/CTPPSTimingLocalTrack.h"
#include <cmath>

Go to the source code of this file.

Functions

bool operator< (const CTPPSTimingLocalTrack &lhs, const CTPPSTimingLocalTrack &rhs)
 Comparison operator. More...
 

Function Documentation

bool operator< ( const CTPPSTimingLocalTrack lhs,
const CTPPSTimingLocalTrack rhs 
)

Comparison operator.

Definition at line 58 of file CTPPSTimingLocalTrack.cc.

References CTPPSTimingLocalTrack::getT(), CTPPSTimingLocalTrack::getX0(), CTPPSTimingLocalTrack::getY0(), and CTPPSTimingLocalTrack::getZ0().

59 {
60  // start to sort by temporal coordinate
61  if ( lhs.getT() < rhs.getT() ) return true;
62  if ( lhs.getT() > rhs.getT() ) return false;
63  // then sort by x-position
64  if ( lhs.getX0() < rhs.getX0() ) return true;
65  if ( lhs.getX0() > rhs.getX0() ) return false;
66  // ...and y-position
67  if ( lhs.getY0() < rhs.getY0() ) return true;
68  if ( lhs.getY0() > rhs.getY0() ) return false;
69  // ...and z-position
70  return ( lhs.getZ0() < rhs.getZ0() );
71 }