CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
CTPPSTimingLocalTrack.h File Reference
#include "DataFormats/Math/interface/Point3D.h"
#include "DataFormats/CTPPSReco/interface/CTPPSTimingRecHit.h"

Go to the source code of this file.

Classes

class  CTPPSTimingLocalTrack
 

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 52 of file CTPPSTimingLocalTrack.cc.

References CTPPSTimingLocalTrack::time(), CTPPSTimingLocalTrack::x0(), CTPPSTimingLocalTrack::y0(), and CTPPSTimingLocalTrack::z0().

52  {
53  // start to sort by temporal coordinate
54  if (lhs.time() < rhs.time())
55  return true;
56  if (lhs.time() > rhs.time())
57  return false;
58  // then sort by x-position
59  if (lhs.x0() < rhs.x0())
60  return true;
61  if (lhs.x0() > rhs.x0())
62  return false;
63  // ...and y-position
64  if (lhs.y0() < rhs.y0())
65  return true;
66  if (lhs.y0() > rhs.y0())
67  return false;
68  // ...and z-position
69  return (lhs.z0() < rhs.z0());
70 }