IDepo.cxx
Go to the documentation of this file.
1 #include "WireCellIface/IDepo.h"
2 using namespace WireCell;
3 
5 {
6  IDepo::vector ret;
7  while (true) {
8  ret.push_back(last);
9  last = last->prior();
10  if (!last) { break; }
11  }
12  return ret;
13 }
14 
15 
16 
18 {
19  if (lhs->time() == rhs->time()) {
20  if (lhs->pos().x() == lhs->pos().x()) {
21  return lhs.get() < rhs.get(); // break tie by pointer
22  }
23  return lhs->pos().x() < lhs->pos().x();
24  }
25  return lhs->time() < rhs->time();
26 }
27 
28 /// Compare two IDepo::pointers for by time, descending. x is used to break tie
30 {
31  if (lhs->time() == rhs->time()) {
32  if (lhs->pos().x() == lhs->pos().x()) {
33  return lhs.get() > rhs.get(); // break tie by pointer
34  }
35  return lhs->pos().x() > lhs->pos().x();
36  }
37  return lhs->time() > rhs->time();
38 }
std::shared_ptr< const IDepo > pointer
Definition: IData.h:19
IDepo::vector depo_chain(IDepo::pointer recent)
Definition: IDepo.cxx:4
std::vector< pointer > vector
Definition: IData.h:21
Definition: Main.h:22
bool descending_time(const WireCell::IDepo::pointer &lhs, const WireCell::IDepo::pointer &rhs)
Compare two IDepo::pointers for by time, descending. x is used to break tie.
Definition: IDepo.cxx:29
bool ascending_time(const WireCell::IDepo::pointer &lhs, const WireCell::IDepo::pointer &rhs)
Compare two IDepo::pointer by time (ascending). x is used to break tie.
Definition: IDepo.cxx:17