File indexing completed on 2025-04-19 09:09:56
0001 #ifndef ATOOLS_Phys_Ordering_H
0002 #define ATOOLS_Phys_Ordering_H
0003
0004 #include "ATOOLS/Phys/Particle.H"
0005 #include "ATOOLS/Org/Getter_Function.H"
0006
0007 namespace ATOOLS {
0008
0009 typedef bool (*Order_Vec_Func)(const Vec4D &a,const Vec4D &b);
0010 typedef bool (*Order_Part_Func)(const Particle &a,const Particle &b);
0011 typedef bool (*Order_PPart_Func)(Particle *const &a,Particle *const &b);
0012
0013
0014 class Order_Base {
0015 protected:
0016
0017 Order_Vec_Func p_vec;
0018 Order_Part_Func p_part;
0019 Order_PPart_Func p_ppart;
0020
0021 Order_Base(Order_Vec_Func vec,Order_Part_Func part,Order_PPart_Func ppart):
0022 p_vec(vec), p_part(part), p_ppart(ppart) {}
0023
0024 private:
0025
0026 Order_Base(): p_vec(NULL), p_part(NULL), p_ppart(NULL) {}
0027
0028 public:
0029
0030 virtual ~Order_Base();
0031
0032 inline bool operator()(const Vec4D &a,const Vec4D &b) const
0033 { return (*p_vec)(a,b); }
0034 inline bool operator()(const Particle &a,const Particle &b) const
0035 { return (*p_part)(a,b); }
0036 inline bool operator()(Particle *const &a,Particle *const &b) const
0037 { return (*p_ppart)(a,b); }
0038
0039 void ShowOrders(const int mode=1);
0040
0041 };
0042
0043 typedef Getter_Function<Order_Base,std::string> Order_Getter;
0044
0045 }
0046 #endif