#include <StringCutEventSelector.h>
Public Member Functions | |
bool | select (const edm::Event &e) const |
decision of the selector module | |
StringCutsEventSelector (const edm::ParameterSet &pset) | |
~StringCutsEventSelector () | |
Private Attributes | |
std::vector < StringCutObjectSelector < Object > * > | f_ |
edm::InputTag | src_ |
Definition at line 50 of file StringCutEventSelector.h.
StringCutsEventSelector< Object, existenceMatter >::StringCutsEventSelector | ( | const edm::ParameterSet & | pset | ) | [inline] |
Definition at line 52 of file StringCutEventSelector.h.
References EventSelector::description_, StringCutsEventSelector< Object, existenceMatter >::f_, edm::ParameterSet::getParameter(), i, corrVsCorr::selection, and StringCutsEventSelector< Object, existenceMatter >::src_.
: EventSelector(pset), src_(edm::Service<InputTagDistributorService>()->retrieve("src",pset)) { std::vector<std::string> selection=pset.getParameter<std::vector<std::string > >("cut"); std::stringstream ss; ss<<"string cut based selection on collection: "<<src_; description_.push_back(ss.str()); ss.str(""); description_.push_back("selection cuts are:"); for (unsigned int i=0;i!=selection.size();i++) if (selection[i]!="-"){ f_.push_back( new StringCutObjectSelector<Object>(selection[i])); ss<<"["<<i<<"]: "<<selection[i]; description_.push_back(ss.str()); ss.str(""); } else { f_.push_back(0); ss<<"["<<i<<"]: no selection"; description_.push_back(ss.str()); ss.str(""); } }
StringCutsEventSelector< Object, existenceMatter >::~StringCutsEventSelector | ( | ) | [inline] |
bool StringCutsEventSelector< Object, existenceMatter >::select | ( | const edm::Event & | ) | const [inline, virtual] |
decision of the selector module
Implements EventSelector.
Definition at line 76 of file StringCutEventSelector.h.
References StringCutsEventSelector< Object, existenceMatter >::f_, edm::Event::getByLabel(), i, python::connectstrParser::o, and StringCutsEventSelector< Object, existenceMatter >::src_.
{ edm::Handle<edm::View<Object> > oH; e.getByLabel(src_, oH); unsigned int i=0; if (existenceMatter && oH->size()<f_.size()) return false; for (;i!=f_.size();i++) { if (!existenceMatter && i==oH->size()) break; if (!f_[i]) continue; const Object & o = (*oH)[i]; if (!(*f_[i])(o)) return false; } return true; }
std::vector<StringCutObjectSelector<Object> *> StringCutsEventSelector< Object, existenceMatter >::f_ [private] |
edm::InputTag StringCutsEventSelector< Object, existenceMatter >::src_ [private] |
Definition at line 92 of file StringCutEventSelector.h.
Referenced by StringCutsEventSelector< Object, existenceMatter >::select(), and StringCutsEventSelector< Object, existenceMatter >::StringCutsEventSelector().