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

◆ operator<()

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 }