CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10/src/CommonTools/Utils/src/AndCombiner.h

Go to the documentation of this file.
00001 #ifndef CommonTools_Utils_AndCombiner_h
00002 #define CommonTools_Utils_AndCombiner_h
00003 /* \class reco::parser::AndCombiner
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.1 $
00011  *
00012  */
00013 #include "CommonTools/Utils/src/SelectorBase.h"
00014 #include "CommonTools/Utils/src/SelectorPtr.h"
00015 
00016 namespace reco {
00017   namespace parser {    
00018      struct AndCombiner : public SelectorBase {
00019       AndCombiner(SelectorPtr lhs, SelectorPtr rhs) :
00020         lhs_(lhs), rhs_(rhs) { }
00021       virtual bool operator()(const Reflex::Object& o) const {
00022         return (*lhs_)(o) && (*rhs_)(o);
00023       }
00024     private:
00025       SelectorPtr lhs_, rhs_;
00026     };
00027   }
00028 }
00029 
00030 #endif