#include <PhysicsTools/UtilAlgos/interface/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_ |
uint | 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(), StringCutEventSelector< Object >::src_, and ss.
00012 : 00013 EventSelector(pset), 00014 src_(edm::Service<InputTagDistributorService>()->retrieve("src",pset)), 00015 f_(pset.getParameter<std::string>("cut")), 00016 //put this guy to 0 to do the check on "all" object in the collection 00017 nFirst_(pset.getParameter<uint>("nFirst")) 00018 { 00019 std::stringstream ss; 00020 ss<<"string cut based selection on collection: "<<src_; 00021 description_.push_back(ss.str()); 00022 ss.str(""); 00023 description_.push_back(std::string("selection cut is: ")+pset.getParameter<std::string>("cut")); 00024 }
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_, and StringCutEventSelector< Object >::src_.
00026 { 00027 edm::Handle<edm::View<Object> > oH; 00028 e.getByLabel(src_, oH); 00029 //reject events if not enough object in collection 00030 // if ((nFirst_!=0) && (oH->size()<nFirst_)) return false; 00031 uint i=0; 00032 for (;i!=oH->size();i++) 00033 { 00034 //stop doing the check if reaching too far in the collection 00035 if ((nFirst_!=0) && (i>=nFirst_)) break; 00036 const Object & o = (*oH)[i]; 00037 if (!f_(o)) return false; 00038 } 00039 return true; 00040 }
StringCutObjectSelector<Object> StringCutEventSelector< Object >::f_ [private] |
Definition at line 44 of file StringCutEventSelector.h.
Referenced by StringCutEventSelector< Object >::select().
uint 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().