File indexing completed on 2024-04-06 12:01:18
0001 #ifndef CommonTools_Utils_CutBinaryOperator_h
0002 #define CommonTools_Utils_CutBinaryOperator_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "CommonTools/Utils/src/CutBase.h"
0014 #include "CommonTools/Utils/src/CutStack.h"
0015
0016 namespace reco {
0017 namespace parser {
0018 template<typename Op>
0019 struct CutBinaryOperator : public CutBase {
0020 virtual double value(const edm::ObjectWithDict& o) const {
0021 return op_((*lhs_).value(o), (*rhs_).value(o));
0022 }
0023 CutBinaryOperator(CutStack & cutStack) {
0024 rhs_ = cutStack.back(); cutStack.pop_back();
0025 lhs_ = cutStack.back(); cutStack.pop_back();
0026 }
0027 private:
0028 Op op_;
0029 CutPtr lhs_, rhs_;
0030 };
0031 }
0032 }
0033
0034 #endif