CMS 3D CMS Logo

TrinarySelector.h

Go to the documentation of this file.
00001 #ifndef Utilities_TrinarySelector_h
00002 #define Utilities_TrinarySelector_h
00003 /* \class reco::parser::TrinarySelector
00004  *
00005  * Trinary selector
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 "PhysicsTools/Utilities/src/SelectorBase.h"
00014 #include "PhysicsTools/Utilities/src/ExpressionBase.h"
00015 #include "PhysicsTools/Utilities/src/ComparisonBase.h"
00016 #include <boost/shared_ptr.hpp>
00017 
00018 namespace reco {
00019   namespace parser {    
00020     struct TrinarySelector : public SelectorBase {
00021       TrinarySelector( boost::shared_ptr<ExpressionBase> lhs,
00022                        boost::shared_ptr<ComparisonBase> cmp1,
00023                        boost::shared_ptr<ExpressionBase> mid,
00024                        boost::shared_ptr<ComparisonBase> cmp2,
00025                        boost::shared_ptr<ExpressionBase> rhs ) :
00026         lhs_( lhs ), cmp1_( cmp1 ), mid_( mid ), cmp2_( cmp2 ),rhs_( rhs ) {}
00027       virtual bool operator()( const ROOT::Reflex::Object& o ) const {
00028         return 
00029           cmp1_->compare( lhs_->value( o ), mid_->value( o ) ) &&
00030           cmp2_->compare( mid_->value( o ), rhs_->value( o ) );
00031       }
00032       boost::shared_ptr<ExpressionBase> lhs_;
00033       boost::shared_ptr<ComparisonBase> cmp1_;
00034       boost::shared_ptr<ExpressionBase> mid_;
00035       boost::shared_ptr<ComparisonBase> cmp2_;
00036       boost::shared_ptr<ExpressionBase> rhs_;
00037     };
00038   }
00039 }
00040 
00041 #endif

Generated on Tue Jun 9 17:42:53 2009 for CMSSW by  doxygen 1.5.4