CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ExpressionEvaluatorCutWithEventContent.cc
Go to the documentation of this file.
3 
5 
7 public:
10 
11  result_type asCandidate(const argument_type& cand) const override final {
12  return (*cut_)(cand);
13  }
14 
15  void setConsumes(edm::ConsumesCollector& sumes) override final {
16  cut_->setConsumes(sumes);
17  }
18 
19  void getEventContent(const edm::EventBase& event) override final {
21  }
22 
23  double value(const reco::CandidatePtr& cand) const override final {
24  return cut_->value(cand);
25  }
26 
27  const std::string& name() const override final { return realname_; }
28 
29 private:
32 };
33 
37  realname_(c.getParameter<std::string>("realCutName"))
38 {
39  const std::string newline("\n");
40  const std::string close_function("; };");
41  const std::string candTypePreamble("CandidateType candidateType() const override final { return ");
42 
43  //construct the overload of candidateType()
44  const std::string& candType = c.getParameter<std::string>("candidateType");
45  const std::string candTypeExpr = candTypePreamble + candType + close_function;
46 
47  // read in the overload of operator()
48  const std::string& oprExpr = c.getParameter<std::string>("functionDef");
49 
50  // read in the overload of value()
51  const std::string& valExpr = c.getParameter<std::string>("valueDef");
52 
53  // read in the overload of setConsumes()
54  const std::string& setConsumesExpr =
55  c.getParameter<std::string>("setConsumesDef");
56 
57  // read in the overload of getEventContent()
58  const std::string& getEventContentExpr =
59  c.getParameter<std::string>("getEventContentDef");
60 
61 
62  // concatenate and evaluate the expression
63  const std::string total_expr = ( candTypeExpr + newline +
64  oprExpr + newline +
65  valExpr + newline +
66  setConsumesExpr + newline +
67  getEventContentExpr );
68  reco::ExpressionEvaluator eval("PhysicsTools/SelectorUtils",
69  "CutApplicatorWithEventContentBase",
70  total_expr.c_str());
72 
73 }
74 
75 
78  "ExpressionEvaluatorCutWithEventContent");
T getParameter(std::string const &) const
double value(const reco::CandidatePtr &cand) const overridefinal
result_type asCandidate(const argument_type &cand) const overridefinal
void setConsumes(edm::ConsumesCollector &sumes) overridefinal
virtual void getEventContent(const edm::EventBase &)=0
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void getEventContent(const edm::EventBase &event) overridefinal
string const
Definition: compareJSON.py:14
#define DEFINE_EDM_PLUGIN(factory, type, name)
virtual void setConsumes(edm::ConsumesCollector &)=0
virtual double value(const reco::CandidatePtr &) const =0