00001 #ifndef FORIA_IFOURMOMENTUM_HH 00002 #define FORIA_IFOURMOMENTUM_HH 00003 00004 #include "boost/smart_ptr.hpp" 00005 00006 #include <ostream> 00007 #include <vector> 00008 00009 namespace ForIA{ 00010 00011 using std::vector; 00012 00013 class IFourMomentum; 00014 00015 typedef boost::shared_ptr<IFourMomentum> IFourMomentumPtr; 00016 typedef boost::shared_ptr<IFourMomentum const> IFourMomentumConstPtr; 00017 typedef vector<IFourMomentumConstPtr> MomentumVector; 00018 typedef vector<std::pair<float, IFourMomentumConstPtr> > ScaledMomentumVector; 00019 00020 class IFourMomentum{ 00021 00022 public: 00023 00024 virtual ~IFourMomentum(){}; 00025 00026 virtual double eta()const = 0; 00027 virtual double theta()const = 0; 00028 virtual double phi()const = 0; 00029 virtual double ET()const = 0; 00030 virtual double PT()const = 0; 00031 virtual double E()const = 0; 00032 00033 virtual double px()const = 0; 00034 virtual double py()const = 0; 00035 virtual double pz()const = 0; 00036 00037 struct Comparison{ 00038 virtual bool operator ()(IFourMomentumConstPtr left, IFourMomentumConstPtr right) = 0; 00039 virtual ~Comparison(){}; 00040 }; 00041 00043 struct ByEtaUp : public Comparison{ 00044 bool operator ()(IFourMomentumConstPtr left, IFourMomentumConstPtr right){ 00045 return left->eta() < right->eta(); 00046 } 00047 }; 00048 00050 struct ByEtaDown : public Comparison{ 00051 bool operator()(IFourMomentumConstPtr left, IFourMomentumConstPtr &right){ 00052 return ByEtaUp()(right, left); 00053 } 00054 }; 00055 00057 struct ByPTUp : public Comparison{ 00058 bool operator ()(IFourMomentumConstPtr left, IFourMomentumConstPtr right){ 00059 return left->PT() < right->PT(); 00060 } 00061 }; 00062 00064 struct ByPTDown : public Comparison{ 00065 bool operator ()(IFourMomentumConstPtr left, IFourMomentumConstPtr right){ 00066 return ByPTUp()(right, left); 00067 } 00068 }; 00069 00070 00071 private: 00072 00073 }; 00074 00075 std::ostream &operator << (std::ostream &out, IFourMomentumConstPtr vec); 00076 00077 } 00078 00079 #endif