00001 #ifndef Utilities_CutBinaryOperator_h
00002 #define Utilities_CutBinaryOperator_h
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "PhysicsTools/Utilities/src/CutBase.h"
00014 #include "PhysicsTools/Utilities/src/CutStack.h"
00015
00016 namespace reco {
00017 namespace parser {
00018 template<typename Op>
00019 struct CutBinaryOperator : public CutBase {
00020 virtual double value(const ROOT::Reflex::Object& o) const {
00021 return op_((*lhs_).value(o), (*rhs_).value(o));
00022 }
00023 CutBinaryOperator(CutStack & cutStack) {
00024 rhs_ = cutStack.back(); cutStack.pop_back();
00025 lhs_ = cutStack.back(); cutStack.pop_back();
00026 }
00027 private:
00028 Op op_;
00029 CutPtr lhs_, rhs_;
00030 };
00031 }
00032 }
00033
00034 #endif