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
reco::parser::TrinarySelector::TrinarySelector
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)
Definition: TrinarySelector.h:20
reco::parser::TrinarySelector::cmp1_
std::shared_ptr< ComparisonBase > cmp1_
Definition: TrinarySelector.h:30
edm::ObjectWithDict
Definition: ObjectWithDict.h:17
writedatasetfile.parser
parser
Definition: writedatasetfile.py:7
reco::parser::TrinarySelector::rhs_
std::shared_ptr< ExpressionBase > rhs_
Definition: TrinarySelector.h:33
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
ExpressionBase.h
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
reco::parser::TrinarySelector::lhs_
std::shared_ptr< ExpressionBase > lhs_
Definition: TrinarySelector.h:29
reco::parser::TrinarySelector::cmp2_
std::shared_ptr< ComparisonBase > cmp2_
Definition: TrinarySelector.h:32
reco::parser::TrinarySelector::operator()
bool operator()(const edm::ObjectWithDict &o) const override
return true if the object is selected
Definition: TrinarySelector.h:26
reco::parser::TrinarySelector::mid_
std::shared_ptr< ExpressionBase > mid_
Definition: TrinarySelector.h:31
reco::parser::TrinarySelector
Definition: TrinarySelector.h:19
reco::parser::SelectorBase
Definition: SelectorBase.h:19
ComparisonBase.h
SelectorBase.h