1 #ifndef _VariableEventSelector_H 2 #define _VariableEventSelector_H 18 int open = ts.Index(
"[");
19 int close = ts.Index(
"]");
22 TString sub(ts(open, close - open));
24 vars_.insert(sub.Data());
26 open = ts.Index(
"[", open);
27 close = ts.Index(
"]", open);
31 std::set<std::string>::iterator v_it;
32 for (v_i = 0, v_it =
vars_.begin(); v_i !=
vars_.size(); ++v_i, ++v_it) {
33 ts.ReplaceAll(TString::Format(
"[%s]", v_it->c_str()), TString::Format(
"[%d]", v_i));
37 formula_ =
new TFormula(name_.c_str(), ts);
44 std::set<std::string>::iterator v_it;
46 for (v_i = 0, v_it =
vars_.begin(); v_i !=
vars_.size(); ++v_i, ++v_it) {
70 doMin_ = pset.
exists(
"min");
73 doMax_ = pset.
exists(
"max");
78 ss <<
"event selector based on VariableHelper variable: " << var_;
82 ss <<
"with minimum boundary: " << min_;
87 ss <<
"with maximum boundary: " << max_;
99 if (doMin_ && v < min_)
101 else if (doMax_ && v > max_)
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)