Public Member Functions | Public Attributes | List of all members
WireCell::IDepoDriftCompare Struct Reference

#include <IDepo.h>

Public Member Functions

 IDepoDriftCompare (double drift_speed=1.6 *units::mm/units::microsecond)
 
bool operator() (const IDepo::pointer &lhs, const IDepo::pointer &rhs) const
 

Public Attributes

double drift_speed
 

Detailed Description

Compare how "far" two depositions are from the origin along the drift-line (metric: dT + dX/V_drift) given a drift velocity. Note: if drifting is toward a "back" face of an anode then the drift speed should be negative in order to indicate drift is in the postitive X direction..

Definition at line 63 of file IDepo.h.

Constructor & Destructor Documentation

WireCell::IDepoDriftCompare::IDepoDriftCompare ( double  drift_speed = 1.6 *units::mm/units::microsecond)
inline

Definition at line 65 of file IDepo.h.

Member Function Documentation

bool WireCell::IDepoDriftCompare::operator() ( const IDepo::pointer lhs,
const IDepo::pointer rhs 
) const
inline

Definition at line 67 of file IDepo.h.

67  {
68  double t1 = lhs->time() + lhs->pos().x()/drift_speed;
69  double t2 = rhs->time() + rhs->pos().x()/drift_speed;
70  if (t1 == t2) {
71  // make sure there are no ties due to precision!
72  return lhs.get() < rhs.get();
73  }
74  return t1 < t2;
75  }

Member Data Documentation

double WireCell::IDepoDriftCompare::drift_speed

Definition at line 64 of file IDepo.h.


The documentation for this struct was generated from the following file: