00001 #ifndef Utilities_LogicalBinaryOperator_h 00002 #define Utilities_LogicalBinaryOperator_h 00003 /* \class reco::parser::LogicalBinaryOperator 00004 * 00005 * logical AND combiner 00006 * 00007 * \author original version: Chris Jones, Cornell, 00008 * adapted to Reflex by Luca Lista, INFN 00009 * 00010 * \version $Revision: 1.2 $ 00011 * 00012 */ 00013 #include "PhysicsTools/Utilities/src/SelectorBase.h" 00014 #include "PhysicsTools/Utilities/src/SelectorStack.h" 00015 00016 namespace reco { 00017 namespace parser { 00018 template<typename Op> 00019 struct LogicalBinaryOperator : public SelectorBase { 00020 LogicalBinaryOperator(SelectorStack & selStack) { 00021 rhs_ = selStack.back(); selStack.pop_back(); 00022 lhs_ = selStack.back(); selStack.pop_back(); 00023 } 00024 virtual bool operator()(const ROOT::Reflex::Object& o) const ; 00025 private: 00026 Op op_; 00027 SelectorPtr lhs_, rhs_; 00028 }; 00029 00030 template <> 00031 bool LogicalBinaryOperator<std::logical_and<bool> >::operator()(const ROOT::Reflex::Object &o) const ; 00032 template <> 00033 bool LogicalBinaryOperator<std::logical_or<bool> >::operator()(const ROOT::Reflex::Object &o) const ; 00034 } 00035 } 00036 00037 #endif