CMS 3D CMS Logo

TrinarySelector.h
Go to the documentation of this file.
1 #ifndef CommonTools_Utils_TrinarySelector_h
2 #define CommonTools_Utils_TrinarySelector_h
3 /* \class reco::parser::TrinarySelector
4  *
5  * Trinary selector
6  *
7  * \author original version: Chris Jones, Cornell,
8  * adapted by Luca Lista, INFN
9  *
10  * \version $Revision: 1.2 $
11  *
12  */
16 
17 namespace reco {
18  namespace parser {
19  struct TrinarySelector : public SelectorBase {
20  TrinarySelector(std::shared_ptr<ExpressionBase> lhs,
21  std::shared_ptr<ComparisonBase> cmp1,
22  std::shared_ptr<ExpressionBase> mid,
23  std::shared_ptr<ComparisonBase> cmp2,
24  std::shared_ptr<ExpressionBase> rhs)
25  : lhs_(lhs), cmp1_(cmp1), mid_(mid), cmp2_(cmp2), rhs_(rhs) {}
26  bool operator()(const edm::ObjectWithDict& o) const override {
27  return cmp1_->compare(lhs_->value(o), mid_->value(o)) && cmp2_->compare(mid_->value(o), rhs_->value(o));
28  }
29  std::shared_ptr<ExpressionBase> lhs_;
30  std::shared_ptr<ComparisonBase> cmp1_;
31  std::shared_ptr<ExpressionBase> mid_;
32  std::shared_ptr<ComparisonBase> cmp2_;
33  std::shared_ptr<ExpressionBase> rhs_;
34  };
35  } // namespace parser
36 } // namespace reco
37 
38 #endif
TrinarySelector(std::shared_ptr< ExpressionBase > lhs, std::shared_ptr< ComparisonBase > cmp1, std::shared_ptr< ExpressionBase > mid, std::shared_ptr< ComparisonBase > cmp2, std::shared_ptr< ExpressionBase > rhs)
std::shared_ptr< ComparisonBase > cmp1_
std::shared_ptr< ExpressionBase > rhs_
std::shared_ptr< ExpressionBase > mid_
bool operator()(const edm::ObjectWithDict &o) const override
return true if the object is selected
std::shared_ptr< ComparisonBase > cmp2_
fixed size matrix
std::shared_ptr< ExpressionBase > lhs_