1 #ifndef _StringCutEventSelector
2 #define _StringCutEventSelector
12 template<
typename Object,
bool any=false>
21 f_(pset.getParameter<std::
string>(
"cut")),
23 nFirst_(pset.getParameter<unsigned int>(
"nFirst")),
27 ss<<
"string cut based selection on collection: "<<
src_;
38 std::vector<const Object*> copyToSort(oH->size());
39 for (uint
i=0;
i!=oH->size();++
i) copyToSort[
i]= &(*oH)[
i];
46 for (;i!=oH->size();i++)
48 const Object &
o = *(copyToSort[
i]);
57 if (!
f_(o))
return false;
72 template<
typename Object,
bool existenceMatter=true>
85 ss<<
"string cut based selection on collection: "<<
src_;
88 for (
unsigned int i=0;
i!=selection.size();
i++)
89 if (selection[
i]!=
"-"){
91 ss<<
"["<<i<<
"]: "<<selection[
i];
97 ss<<
"["<<
i<<
"]: no selection";
105 for (;i!=
f_.size();i++)
115 std::vector<const Object*> copyToSort(oH->size());
116 for (uint
i=0;
i!=oH->size();++
i) copyToSort[
i]= &(*oH)[
i];
120 if (existenceMatter && oH->size()<
f_.size())
return false;
121 for (;i!=
f_.size();i++)
123 if (!existenceMatter && i==oH->size())
break;
124 if (!
f_[i])
continue;
125 const Object &
o = *(copyToSort[
i]);
126 if (!(*
f_[i])(
o))
return false;
134 std::vector<StringCutObjectSelector<Object> *>
f_;
T getParameter(std::string const &) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool any(const std::vector< T > &v, const T &what)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
bool select(const edm::Event &e) const
decision of the selector module
bool select(const edm::Event &e) const
decision of the selector module
StringCutsEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
StringCutEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &&iC)
std::vector< StringCutObjectSelector< Object > * > f_
~StringCutsEventSelector()
StringObjectFunction< Object > * order_
edm::EDGetTokenT< edm::View< Object > > srcToken_
edm::EDGetTokenT< edm::View< Object > > srcToken_
StringObjectFunction< Object > * order_
StringCutObjectSelector< Object > f_
std::vector< std::string > description_
StringCutsEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)
StringCutEventSelector(const edm::ParameterSet &pset, edm::ConsumesCollector &iC)