LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
geo::GeoObjectSorter Class Referenceabstract

#include "GeoObjectSorter.h"

Inheritance diagram for geo::GeoObjectSorter:
geo::GeoObjectSorterStandard

Public Member Functions

virtual ~GeoObjectSorter ()=default
 
void sort (std::vector< CryostatGeo > &cryostats) const
 
void sort (std::vector< TPCGeo > &tpcs) const
 
void sort (std::vector< OpDetGeo > &ods) const
 

Private Member Functions

virtual bool compareCryostats (CryostatGeo const &c1, CryostatGeo const &c2) const =0
 
virtual bool compareTPCs (TPCGeo const &t1, TPCGeo const &t2) const =0
 
virtual bool compareOpDets (OpDetGeo const &od1, OpDetGeo const &od2) const
 

Detailed Description

Definition at line 17 of file GeoObjectSorter.h.

Constructor & Destructor Documentation

virtual geo::GeoObjectSorter::~GeoObjectSorter ( )
virtualdefault

Member Function Documentation

virtual bool geo::GeoObjectSorter::compareCryostats ( CryostatGeo const &  c1,
CryostatGeo const &  c2 
) const
privatepure virtual

Implemented in geo::GeoObjectSorterStandard.

Referenced by sort().

bool geo::GeoObjectSorter::compareOpDets ( OpDetGeo const &  od1,
OpDetGeo const &  od2 
) const
privatevirtual

Definition at line 41 of file GeoObjectSorter.cxx.

References geo::OpDetGeo::GetCenter().

Referenced by sort().

42  {
43  auto const [xyz1, xyz2] = std::make_pair(od1.GetCenter(), od2.GetCenter());
44 
45  if (xyz1.Z() != xyz2.Z()) return xyz1.Z() > xyz2.Z();
46  if (xyz1.Y() != xyz2.Y()) return xyz1.Y() > xyz2.Y();
47  return xyz1.X() > xyz2.X();
48  }
virtual bool geo::GeoObjectSorter::compareTPCs ( TPCGeo const &  t1,
TPCGeo const &  t2 
) const
privatepure virtual

Implemented in geo::GeoObjectSorterStandard.

Referenced by sort().

void geo::GeoObjectSorter::sort ( std::vector< CryostatGeo > &  cryostats) const

Definition at line 26 of file GeoObjectSorter.cxx.

References compareCryostats().

Referenced by geo::CryostatGeo::SortSubVolumes().

27  {
28  std::sort(cryostats.begin(), cryostats.end(), bind(&GeoObjectSorter::compareCryostats, this));
29  }
virtual bool compareCryostats(CryostatGeo const &c1, CryostatGeo const &c2) const =0
void geo::GeoObjectSorter::sort ( std::vector< TPCGeo > &  tpcs) const

Definition at line 31 of file GeoObjectSorter.cxx.

References compareTPCs().

32  {
33  std::sort(tpcs.begin(), tpcs.end(), bind(&GeoObjectSorter::compareTPCs, this));
34  }
virtual bool compareTPCs(TPCGeo const &t1, TPCGeo const &t2) const =0
void geo::GeoObjectSorter::sort ( std::vector< OpDetGeo > &  ods) const

Definition at line 36 of file GeoObjectSorter.cxx.

References compareOpDets().

37  {
38  std::sort(ods.begin(), ods.end(), bind(&GeoObjectSorter::compareOpDets, this));
39  }
virtual bool compareOpDets(OpDetGeo const &od1, OpDetGeo const &od2) const

The documentation for this class was generated from the following files: