LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
WireReadoutSorterStandard.cxx
Go to the documentation of this file.
4 
5 #include <utility>
6 
7 namespace {
8  constexpr lar::util::RealComparisons<double> cmp{0.001 /*threshold in cm*/};
9 }
10 
11 namespace geo {
12 
15 
16  //----------------------------------------------------------------------------
17  bool WireReadoutSorterStandard::compareWires(WireGeo const& w1, WireGeo const& w2) const
18  {
19  auto const [c1, c2] = std::pair{w1.GetCenter(), w2.GetCenter()};
20 
21  // sort by z first
22  if (cmp.nonEqual(c1.Z(), c2.Z())) return c1.Z() < c2.Z();
23 
24  // if same z sort by y
25  if (cmp.nonEqual(c1.Y(), c2.Y())) return c1.Y() < c2.Y();
26 
27  // if same y sort by x
28  return c1.X() < c2.X();
29  }
30 
31 }
Geometry description of a TPC wireThe wire is a single straight segment on a wire plane...
Definition: WireGeo.h:112
Point_t const & GetCenter() const
Returns the world coordinate of the center of the wire [cm].
Definition: WireGeo.h:219
Provides simple real number checks.
Class for approximate comparisons.
bool compareWires(WireGeo const &w1, WireGeo const &w2) const override
TCanvas * c1
Definition: plotHisto.C:7
TCanvas * c2
Definition: plot_hist.C:75
Encapsulate the geometry of a wire .
ROOT libraries.
Interface to algorithm class for standard sorting of geo::XXXGeo objects .