#include <StringCutEventSelector.h>
Public Member Functions | |
bool | select (const edm::Event &e) const |
decision of the selector module | |
StringCutEventSelector (const edm::ParameterSet &pset) | |
Private Attributes | |
StringCutObjectSelector< Object > | f_ |
unsigned int | nFirst_ |
edm::InputTag | src_ |
Definition at line 10 of file StringCutEventSelector.h.
StringCutEventSelector< Object >::StringCutEventSelector | ( | const edm::ParameterSet & | pset | ) | [inline] |
Definition at line 12 of file StringCutEventSelector.h.
References EventSelector::description_, edm::ParameterSet::getParameter(), and StringCutEventSelector< Object >::src_.
: EventSelector(pset), src_(edm::Service<InputTagDistributorService>()->retrieve("src",pset)), f_(pset.getParameter<std::string>("cut")), //put this guy to 0 to do the check on "all" object in the collection nFirst_(pset.getParameter<unsigned int>("nFirst")) { std::stringstream ss; ss<<"string cut based selection on collection: "<<src_; description_.push_back(ss.str()); ss.str(""); description_.push_back(std::string("selection cut is: ")+pset.getParameter<std::string>("cut")); }
bool StringCutEventSelector< Object >::select | ( | const edm::Event & | ) | const [inline, virtual] |
decision of the selector module
Implements EventSelector.
Definition at line 26 of file StringCutEventSelector.h.
References StringCutEventSelector< Object >::f_, edm::Event::getByLabel(), i, StringCutEventSelector< Object >::nFirst_, connectstrParser::o, and StringCutEventSelector< Object >::src_.
{ edm::Handle<edm::View<Object> > oH; e.getByLabel(src_, oH); //reject events if not enough object in collection // if ((nFirst_!=0) && (oH->size()<nFirst_)) return false; unsigned int i=0; for (;i!=oH->size();i++) { //stop doing the check if reaching too far in the collection if ((nFirst_!=0) && (i>=nFirst_)) break; const Object & o = (*oH)[i]; if (!f_(o)) return false; } return true; }
StringCutObjectSelector<Object> StringCutEventSelector< Object >::f_ [private] |
Definition at line 44 of file StringCutEventSelector.h.
Referenced by StringCutEventSelector< Object >::select().
unsigned int StringCutEventSelector< Object >::nFirst_ [private] |
Definition at line 45 of file StringCutEventSelector.h.
Referenced by StringCutEventSelector< Object >::select().
edm::InputTag StringCutEventSelector< Object >::src_ [private] |
Definition at line 43 of file StringCutEventSelector.h.
Referenced by StringCutEventSelector< Object >::select(), and StringCutEventSelector< Object >::StringCutEventSelector().