Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:01:19

0001 #ifndef CommonTools_Utils_CutBinaryOperatorSetter_h
0002 #define CommonTools_Utils_CutBinaryOperatorSetter_h
0003 /* \class reco::parser::CutBinaryOperator
0004  *
0005  * Binary operator expression setter
0006  *
0007  * \author original version: Chris Jones, Cornell, 
0008  *         adapted by Luca Lista, INFN
0009  *
0010  * \version $Revision: 1.2 $
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