1 #ifndef _VariableEventSelector_H 2 #define _VariableEventSelector_H 19 int open = ts.Index(
"[");
20 int close = ts.Index(
"]");
23 TString sub( ts(open,close-open));
25 vars_.insert( sub.Data() );
27 open = ts.Index(
"[",open);
28 close = ts.Index(
"]",open);
32 std::set<std::string>::iterator v_it;
33 for (v_i = 0, v_it=
vars_.begin();
34 v_i!=
vars_.size(); ++v_i,++v_it)
36 ts.ReplaceAll(TString::Format(
"[%s]", v_it->c_str()),TString::Format(
"[%d]", v_i));
40 formula_ =
new TFormula(name_.c_str(), ts);
47 std::set<std::string>::iterator v_it;
49 for (v_i = 0, v_it=
vars_.begin();
50 v_i!=
vars_.size(); ++v_i,++v_it)
53 if (!var->
compute(e))
return false;
82 ss<<
"event selector based on VariableHelper variable: "<<var_;
85 ss<<
"with minimum boundary: "<<min_;
88 ss<<
"with maximum boundary: "<<max_;
93 if (!var->
compute(e))
return false;
97 if (doMin_ && v<min_)
return false;
98 else if (doMax_ && v>max_)
return false;
T getParameter(std::string const &) const
bool exists(std::string const ¶meterName) const
checks if a parameter exists
VariableEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
bool select(const edm::Event &e) const override
decision of the selector module
bool compute(const edm::Event &iEvent) const
std::vector< std::string > description_
VariableEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)