Functor that operates on <T> More...
#include "CommonTools/Utils/interface/Selector.h"
Public Types | |
typedef std::pair< index_type, size_t > | cut_flow_item |
typedef std::vector< cut_flow_item > | cut_flow_map |
typedef T | data_type |
typedef std::map< index_type, double > | double_map |
typedef pat::strbitset::index_type | index_type |
typedef std::map< index_type, int > | int_map |
Public Member Functions | |
void | clear (index_type const &i) |
void | clear (std::string const &s) |
Turn off a given selection cut. More... | |
bool | considerCut (index_type const &i) const |
bool | considerCut (std::string const &s) const |
consider the cut at index "s" More... | |
double | cut (index_type const &i, double val) const |
Access the double cut values at index "s". More... | |
int | cut (index_type const &i, int val) const |
Access the int cut values at index "s". More... | |
double | cut (std::string s, double val) const |
Access the double cut values at index "s". More... | |
int | cut (std::string s, int val) const |
Access the int cut values at index "s". More... | |
pat::strbitset | getBitTemplate () const |
Get an empty bitset with the proper names. More... | |
double | getPasses (index_type const &i) const |
double | getPasses (std::string const &s) const |
Return the number of passing cases. More... | |
bool | ignoreCut (index_type const &i) const |
bool | ignoreCut (std::string const &s) const |
ignore the cut at index "s" More... | |
virtual bool | operator() (T const &t) |
This provides an alternative signature without the second ret. More... | |
virtual bool | operator() (T const &t, edm::EventBase const &e) |
This provides an alternative signature that includes extra information. More... | |
virtual bool | operator() (T const &t, edm::EventBase const &e, pat::strbitset &ret) |
This provides an alternative signature that includes extra information. More... | |
virtual bool | operator() (T const &t, pat::strbitset &ret)=0 |
This provides the interface for base classes to select objects. More... | |
bool | operator[] (index_type const &i) const |
bool | operator[] (std::string const &s) const |
void | passCut (pat::strbitset &ret, index_type const &i) |
void | passCut (pat::strbitset &ret, std::string const &s) |
Passing cuts. More... | |
void | print (std::ostream &out) const |
Print the cut flow. More... | |
void | printActiveCuts (std::ostream &out) const |
Print the cuts being considered. More... | |
virtual void | push_back (std::string const &s) |
This is the registration of an individual cut string. More... | |
virtual void | push_back (std::string const &s, double cut) |
This is the registration of an individual cut string, with a double cut value. More... | |
virtual void | push_back (std::string const &s, int cut) |
This is the registration of an individual cut string, with an int cut value. More... | |
Selector () | |
Constructor clears the bits. More... | |
void | set (index_type const &i, bool val=true) |
void | set (index_type const &i, double cut, bool val=true) |
void | set (index_type const &i, int cut, bool val=true) |
void | set (std::string const &s, bool val=true) |
Set a given selection cut, on or off. More... | |
void | set (std::string const &s, double cut, bool val=true) |
Set a given selection cut, on or off, and reset int cut value. More... | |
void | set (std::string const &s, int cut, bool val=true) |
Set a given selection cut, on or off, and reset int cut value. More... | |
void | setIgnored (pat::strbitset &ret) |
set ignored bits More... | |
void | setIgnoredCuts (std::vector< std::string > const &bitsToIgnore) |
set the bits to ignore from a vector More... | |
virtual | ~Selector () |
Protected Attributes | |
pat::strbitset | bits_ |
the bitset indexed by strings More... | |
cut_flow_map | cutFlow_ |
map of cut flows in "human" order More... | |
double_map | doubleCuts_ |
the double-value cut map More... | |
int_map | intCuts_ |
the int-value cut map More... | |
pat::strbitset | retInternal_ |
internal ret if users don't care about return bits More... | |
Functor that operates on <T>
Implements a string-indexed bit_vector.
class template that implements an interface to Selector utilities. This allows the user to access individual cuts based on a string index. The user can then turn individual cuts on and off at will.
Definition at line 22 of file Selector.h.
typedef std::pair<index_type, size_t> Selector< T >::cut_flow_item |
Definition at line 26 of file Selector.h.
typedef std::vector<cut_flow_item> Selector< T >::cut_flow_map |
Definition at line 27 of file Selector.h.
typedef std::map<index_type, double> Selector< T >::double_map |
Definition at line 29 of file Selector.h.
typedef pat::strbitset::index_type Selector< T >::index_type |
Definition at line 25 of file Selector.h.
typedef std::map<index_type, int> Selector< T >::int_map |
Definition at line 28 of file Selector.h.
Definition at line 39 of file Selector.h.
|
inline |
Definition at line 113 of file Selector.h.
Turn off a given selection cut.
Definition at line 111 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::clear().
|
inline |
Definition at line 124 of file Selector.h.
consider the cut at index "s"
Definition at line 123 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::print(), and Selector< edm::Ptr< reco::Photon > >::printActiveCuts().
|
inline |
|
inline |
Access the int cut values at index "s".
Definition at line 158 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::push_back(), and Selector< edm::Ptr< reco::Photon > >::set().
Access the double cut values at index "s".
Definition at line 165 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::cut().
Access the int cut values at index "s".
Definition at line 163 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::cut().
|
inline |
Get an empty bitset with the proper names.
Definition at line 168 of file Selector.h.
Referenced by SimpleJetFilter::filter(), WPlusJetsEventSelector::operator()(), Selector< edm::Ptr< reco::Photon > >::Selector(), and VersionedSelector< edm::Ptr< reco::Photon > >::VersionedSelector().
|
inline |
Definition at line 228 of file Selector.h.
Return the number of passing cases.
Definition at line 227 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::getPasses().
|
inline |
Definition at line 128 of file Selector.h.
ignore the cut at index "s"
Definition at line 127 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::getBitTemplate(), VersionedSelector< edm::Ptr< reco::Photon > >::operator()(), and Selector< edm::Ptr< reco::Photon > >::setIgnored().
This provides an alternative signature without the second ret.
Reimplemented in VersionedSelector< T >, VersionedSelector< edm::Ptr< reco::Photon > >, VersionedSelector< edm::Ptr< reco::Muon > >, VersionedSelector< edm::Ptr< reco::GsfElectron > >, VersionedSelector< edm::Ptr< pat::Photon > >, and VersionedSelector< edm::Ptr< pat::Electron > >.
Definition at line 74 of file Selector.h.
|
inlinevirtual |
This provides an alternative signature that includes extra information.
Reimplemented in VersionedSelector< T >, VersionedSelector< edm::Ptr< reco::Photon > >, VersionedSelector< edm::Ptr< reco::Muon > >, VersionedSelector< edm::Ptr< reco::GsfElectron > >, VersionedSelector< edm::Ptr< pat::Photon > >, and VersionedSelector< edm::Ptr< pat::Electron > >.
Definition at line 85 of file Selector.h.
|
inlinevirtual |
This provides an alternative signature that includes extra information.
Reimplemented in VersionedSelector< T >, MuonVPlusJetsIDSelectionFunctor, VersionedSelector< edm::Ptr< reco::Photon > >, VersionedSelector< edm::Ptr< reco::Muon > >, VersionedSelector< edm::Ptr< reco::GsfElectron > >, VersionedSelector< edm::Ptr< pat::Photon > >, and VersionedSelector< edm::Ptr< pat::Electron > >.
Definition at line 82 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::operator()().
|
pure virtual |
This provides the interface for base classes to select objects.
Implemented in PVObjectSelector, PVSelector, VersionedSelector< T >, MuonVPlusJetsIDSelectionFunctor, PFMuonSelector, JetIDSelectionFunctor, PFJetIDSelectionFunctor, SimpleCutBasedElectronIDSelectionFunctor, ElectronVPlusJetsIDSelectionFunctor, VersionedSelector< edm::Ptr< reco::Photon > >, VersionedSelector< edm::Ptr< reco::Muon > >, VersionedSelector< edm::Ptr< reco::GsfElectron > >, VersionedSelector< edm::Ptr< pat::Photon > >, and VersionedSelector< edm::Ptr< pat::Electron > >.
Referenced by Selector< edm::Ptr< reco::Photon > >::operator()().
|
inline |
Definition at line 120 of file Selector.h.
Access the selector cut at index "s". "true" means to consider the cut. "false" means to ignore the cut.
Definition at line 118 of file Selector.h.
|
inline |
Definition at line 144 of file Selector.h.
|
inline |
Passing cuts.
Definition at line 142 of file Selector.h.
Referenced by VersionedSelector< edm::Ptr< reco::Photon > >::operator()(), and Selector< edm::Ptr< reco::Photon > >::passCut().
Print the cut flow.
Definition at line 191 of file Selector.h.
Referenced by WPlusJetsEventSelector::printSelectors().
Print the cuts being considered.
Definition at line 211 of file Selector.h.
|
inlinevirtual |
This is the registration of an individual cut string, with a double cut value.
Definition at line 61 of file Selector.h.
|
inlinevirtual |
This is the registration of an individual cut string, with an int cut value.
Definition at line 51 of file Selector.h.
|
inline |
Definition at line 94 of file Selector.h.
|
inline |
Definition at line 105 of file Selector.h.
|
inline |
Set a given selection cut, on or off.
Definition at line 93 of file Selector.h.
Referenced by pat::Flags::get(), Selector< edm::Ptr< reco::Photon > >::set(), and Selector< edm::Ptr< reco::Photon > >::setIgnoredCuts().
|
inline |
Set a given selection cut, on or off, and reset int cut value.
Definition at line 104 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::set().
|
inline |
Set a given selection cut, on or off, and reset int cut value.
Definition at line 97 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::set().
|
inline |
set ignored bits
Definition at line 181 of file Selector.h.
Referenced by VersionedSelector< edm::Ptr< reco::Photon > >::operator()(), and Selector< edm::Ptr< reco::Photon > >::operator()().
|
inline |
|
protected |
the bitset indexed by strings
Definition at line 241 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::clear(), Selector< edm::Ptr< reco::Photon > >::considerCut(), Selector< edm::Ptr< reco::Photon > >::cut(), Selector< edm::Ptr< reco::Photon > >::getBitTemplate(), Selector< edm::Ptr< reco::Photon > >::getPasses(), Selector< edm::Ptr< reco::Photon > >::ignoreCut(), Selector< edm::Ptr< reco::Photon > >::operator[](), Selector< edm::Ptr< reco::Photon > >::passCut(), Selector< edm::Ptr< reco::Photon > >::push_back(), Selector< edm::Ptr< reco::Photon > >::Selector(), and Selector< edm::Ptr< reco::Photon > >::set().
|
protected |
map of cut flows in "human" order
Definition at line 245 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::getBitTemplate(), Selector< edm::Ptr< reco::Photon > >::getPasses(), Selector< edm::Ptr< reco::Photon > >::passCut(), Selector< edm::Ptr< reco::Photon > >::print(), Selector< edm::Ptr< reco::Photon > >::printActiveCuts(), Selector< edm::Ptr< reco::Photon > >::push_back(), Selector< edm::Ptr< reco::Photon > >::Selector(), and Selector< edm::Ptr< reco::Photon > >::setIgnored().
|
protected |
the double-value cut map
Definition at line 244 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::cut(), Selector< edm::Ptr< reco::Photon > >::push_back(), Selector< edm::Ptr< reco::Photon > >::Selector(), and Selector< edm::Ptr< reco::Photon > >::set().
the int-value cut map
Definition at line 243 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::cut(), Selector< edm::Ptr< reco::Photon > >::push_back(), Selector< edm::Ptr< reco::Photon > >::Selector(), and Selector< edm::Ptr< reco::Photon > >::set().
|
protected |
internal ret if users don't care about return bits
Definition at line 242 of file Selector.h.
Referenced by Selector< edm::Ptr< reco::Photon > >::operator()(), VersionedSelector< edm::Ptr< reco::Photon > >::operator()(), Selector< edm::Ptr< reco::Photon > >::Selector(), and VersionedSelector< edm::Ptr< reco::Photon > >::VersionedSelector().