|
|
Go to the documentation of this file. 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");
206 out << buff << std::endl;
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;
void print(std::ostream &out) const
Print the cut flow.
ret
prodAgent to be discontinued
void setIgnored(pat::strbitset &ret)
set ignored bits
Functor that operates on <T>
pat::strbitset bits_
the bitset indexed by strings
virtual bool operator()(T const &t, pat::strbitset &ret)=0
This provides the interface for base classes to select objects.
pat::strbitset::index_type index_type
virtual void push_back(std::string const &s, double cut)
This is the registration of an individual cut string, with a double cut value.
strbitset & set(bool val=true)
set method of all bits
pat::strbitset retInternal_
internal ret if users don't care about return bits
std::pair< index_type, size_t > cut_flow_item
std::map< index_type, int > int_map
bool ignoreCut(std::string const &s) const
ignore the cut at index "s"
virtual bool operator()(T const &t, edm::EventBase const &e, pat::strbitset &ret)
This provides an alternative signature that includes extra information.
void clear()
clear the bitset and map
int_map intCuts_
the int-value cut map
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.
void set(std::string const &s, int cut, bool val=true)
Set a given selection cut, on or off, and reset int cut value.
void clear(std::string const &s)
Turn off a given selection cut.
double getPasses(std::string const &s) const
Return the number of passing cases.
void passCut(pat::strbitset &ret, index_type const &i)
void push_back(std::string s)
void set(std::string const &s, double cut, bool val=true)
Set a given selection cut, on or off, and reset int cut value.
void clear(index_type const &i)
double cut(std::string s, double val) const
Access the double cut values at index "s".
void printActiveCuts(std::ostream &out) const
Print the cuts being considered.
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
bool operator[](std::string const &s) const
double getPasses(index_type const &i) const
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
bool considerCut(std::string const &s) const
consider the cut at index "s"
cut_flow_map cutFlow_
map of cut flows in "human" order
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
void set(index_type const &i, bool val=true)
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
int cut(std::string s, int val) const
Access the int cut values at index "s".
Selector()
Constructor clears the bits.
bool considerCut(index_type const &i) const
int cut(index_type const &i, int val) const
Access the int cut values at index "s".
void set(index_type const &i, int cut, bool val=true)
bool ignoreCut(index_type const &i) const
virtual bool operator()(T const &t, edm::EventBase const &e)
This provides an alternative signature that includes extra information.
double cut(index_type const &i, double val) const
Access the double cut values at index "s".
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
std::vector< cut_flow_item > cut_flow_map
void set(index_type const &i, double cut, bool val=true)
std::map< index_type, double > double_map
bool operator[](index_type const &i) const