1 #ifndef PhysicsTools_SelectorUtils_Selector_h 2 #define PhysicsTools_SelectorUtils_Selector_h 28 typedef std::map<index_type, int>
int_map;
132 for (std::vector<std::string>::const_iterator ignoreBegin = bitsToIgnore.begin(),
133 ignoreEnd = bitsToIgnore.end(),
147 for (cut_flow_map::iterator cutsBegin =
cutFlow_.begin(), cutsEnd =
cutFlow_.end(), icut = cutsBegin;
148 icut != cutsEnd &&
found == cutsEnd;
150 if (icut->first ==
i) {
171 for (cut_flow_map::const_iterator cutsBegin =
cutFlow_.begin(), cutsEnd =
cutFlow_.end(), icut = cutsBegin;
175 ret[icut->first] =
true;
182 for (cut_flow_map::const_iterator cutsBegin =
cutFlow_.begin(), cutsEnd =
cutFlow_.end(), icut = cutsBegin;
186 ret[icut->first] =
true;
192 for (cut_flow_map::const_iterator cutsBegin =
cutFlow_.begin(), cutsEnd =
cutFlow_.end(), icut = cutsBegin;
199 static_cast<unsigned long>(icut - cutsBegin),
200 icut->first.str().c_str(),
201 static_cast<unsigned long>(icut->second));
204 buff,
"%6lu : %20s %10s", static_cast<unsigned long>(icut - cutsBegin), icut->first.str().c_str(),
"off");
212 bool already_printed_one =
false;
213 for (cut_flow_map::const_iterator cutsBegin =
cutFlow_.begin(), cutsEnd =
cutFlow_.end(), icut = cutsBegin;
217 if (already_printed_one)
220 already_printed_one =
true;
230 for (cut_flow_map::const_iterator cutsBegin =
cutFlow_.begin(), cutsEnd =
cutFlow_.end(), icut = cutsBegin;
231 icut != cutsEnd &&
found == cutsEnd;
233 if (icut->first ==
i) {
237 return found->second;
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
virtual bool operator()(T const &t, edm::EventBase const &e)
This provides an alternative signature that includes extra information.
virtual bool operator()(T const &t, pat::strbitset &ret)=0
This provides the interface for base classes to select objects.
std::map< index_type, int > int_map
void printActiveCuts(std::ostream &out) const
Print the cuts being considered.
bool operator[](std::string const &s) const
ret
prodAgent to be discontinued
virtual bool operator()(T const &t, edm::EventBase const &e, pat::strbitset &ret)
This provides an alternative signature that includes extra information.
void passCut(pat::strbitset &ret, index_type const &i)
pat::strbitset::index_type index_type
void setIgnored(pat::strbitset &ret)
set ignored bits
pat::strbitset retInternal_
internal ret if users don't care about return bits
std::pair< index_type, size_t > cut_flow_item
void clear(std::string const &s)
Turn off a given selection cut.
double cut(std::string s, double val) const
Access the double cut values at index "s".
double getPasses(std::string const &s) const
Return the number of passing cases.
void print(std::ostream &out) const
Print the cut flow.
virtual void push_back(std::string const &s, double cut)
This is the registration of an individual cut string, with a double cut value.
pat::strbitset bits_
the bitset indexed by strings
void clear(index_type const &i)
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
double getPasses(index_type const &i) const
std::vector< cut_flow_item > cut_flow_map
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Functor that operates on <T>
cut_flow_map cutFlow_
map of cut flows in "human" order
void clear()
clear the bitset and map
Selector()
Constructor clears the bits.
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
std::map< index_type, double > double_map
strbitset & set(bool val=true)
set method of all bits
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
bool considerCut(std::string const &s) const
consider the cut at index "s"
virtual bool operator()(T const &t)
This provides an alternative signature without the second ret.
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
bool ignoreCut(index_type const &i) const
bool considerCut(index_type const &i) const
bool operator[](index_type const &i) const
double cut(index_type const &i, double val) const
Access the double cut values at index "s".
double_map doubleCuts_
the double-value cut map
virtual void push_back(std::string const &s, int cut)
This is the registration of an individual cut string, with an int cut value.
int cut(std::string s, int val) const
Access the int cut values at index "s".
void push_back(std::string s)
int_map intCuts_
the int-value cut map
buff
***.cc ################