LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
AuxDetGeoObjectSorter.cxx
Go to the documentation of this file.
4 
5 #include <algorithm>
6 #include <utility>
7 
8 namespace {
9  template <typename T, typename Arg>
10  auto bind(bool (T::*ft)(Arg const&, Arg const&) const, T const* t)
11  {
12  return [t, ft](auto const& a, auto const& b) { return (t->*ft)(a, b); };
13  }
14 }
15 
16 namespace geo {
17 
18  void AuxDetGeoObjectSorter::sort(std::vector<AuxDetGeo>& ads) const
19  {
20  std::sort(ads.begin(), ads.end(), bind(&AuxDetGeoObjectSorter::compareAuxDets, this));
21  }
22 
23  void AuxDetGeoObjectSorter::sort(std::vector<AuxDetSensitiveGeo>& adss) const
24  {
25  std::sort(
26  adss.begin(), adss.end(), bind(&AuxDetGeoObjectSorter::compareAuxDetSensitives, this));
27  }
28 
29 }
virtual bool compareAuxDetSensitives(AuxDetSensitiveGeo const &ads1, AuxDetSensitiveGeo const &ads2) const =0
Encapsulate the geometry of the sensitive portion of an auxiliary detector .
virtual bool compareAuxDets(AuxDetGeo const &ad1, AuxDetGeo const &ad2) const =0
Encapsulate the geometry of an auxiliary detector.
ROOT libraries.
void sort(std::vector< AuxDetGeo > &ads) const