Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:50:14

0001 #ifndef CommonTools_Utils_CutBinaryOperator_h
0002 #define CommonTools_Utils_CutBinaryOperator_h
0003 /* \class reco::parser::CutBinaryOperator
0004  *
0005  * Binary Operator expression
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/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