File indexing completed on 2024-04-06 12:01:19
0001 #ifndef CommonTools_Utils_CutBinaryOperatorSetter_h
0002 #define CommonTools_Utils_CutBinaryOperatorSetter_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #include "CommonTools/Utils/src/CutBinaryOperator.h"
0014 #include "CommonTools/Utils/src/CutStack.h"
0015 #include <cmath>
0016
0017 namespace reco {
0018 namespace parser {
0019
0020 template<typename T>
0021 struct power_of {
0022 T operator()(T lhs, T rhs) const { return pow(lhs, rhs); }
0023 };
0024
0025 template<typename Op>
0026 struct CutBinaryOperatorSetter {
0027 CutBinaryOperatorSetter(CutStack & stack) : stack_(stack) { }
0028 void operator()(const char*, const char*) const {
0029 stack_.push_back(CutPtr(new CutBinaryOperator<Op>(stack_)));
0030 }
0031 private:
0032 CutStack & stack_;
0033 };
0034 }
0035 }
0036
0037 #endif