CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
ElectronVPlusJetsIDSelectionFunctor Class Reference

#include <ElectronVPlusJetsIDSelectionFunctor.h>

Inheritance diagram for ElectronVPlusJetsIDSelectionFunctor:
Selector< pat::Electron >

Public Types

enum  Version_t { SUMMER08, FIRSTDATA, N_VERSIONS }
 
- Public Types inherited from Selector< pat::Electron >
typedef std::binary_function
< pat::Electron,
pat::strbitset, bool > 
base_type
 
typedef std::pair< index_type,
size_t > 
cut_flow_item
 
typedef std::vector
< cut_flow_item
cut_flow_map
 
typedef pat::Electron 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

 ElectronVPlusJetsIDSelectionFunctor ()
 
 ElectronVPlusJetsIDSelectionFunctor (edm::ParameterSet const &parameters)
 
 ElectronVPlusJetsIDSelectionFunctor (Version_t version, double d0=0.2, double ed0=999.0, double sd0=999.0, double reliso=0.1)
 
bool firstDataCuts (const pat::Electron &electron, pat::strbitset &ret)
 
void initialize (Version_t version, double d0, double ed0, double sd0, double reliso)
 
bool operator() (const pat::Electron &electron, pat::strbitset &ret)
 This provides the interface for base classes to select objects. More...
 
- Public Member Functions inherited from Selector< pat::Electron >
void clear (std::string const &s)
 Turn off a given selection cut. More...
 
void clear (index_type const &i)
 
bool considerCut (std::string const &s) const
 consider the cut at index "s" More...
 
bool considerCut (index_type const &i) const
 
int cut (index_type const &i, int val) const
 Access the int cut values at index "s". More...
 
double cut (index_type const &i, 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...
 
double cut (std::string s, double val) const
 Access the double cut values at index "s". More...
 
pat::strbitset getBitTemplate () const
 Get an empty bitset with the proper names. More...
 
double getPasses (std::string const &s) const
 Return the number of passing cases. More...
 
double getPasses (index_type const &i) const
 
bool ignoreCut (std::string const &s) const
 ignore the cut at index "s" More...
 
bool ignoreCut (index_type const &i) const
 
virtual bool operator() (pat::Electronconst &t)
 This provides an alternative signature without the second ret. More...
 
virtual bool operator() (pat::Electronconst &t, edm::EventBase const &e, pat::strbitset &ret)
 This provides an alternative signature that includes extra information. More...
 
virtual bool operator() (pat::Electronconst &t, edm::EventBase const &e)
 This provides an alternative signature that includes extra information. More...
 
bool operator[] (std::string const &s) const
 
bool operator[] (index_type const &i) const
 
void passCut (pat::strbitset &ret, std::string const &s)
 Passing cuts. More...
 
void passCut (pat::strbitset &ret, index_type const &i)
 
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, int cut)
 This is the registration of an individual cut string, with an int cut value. 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...
 
 Selector ()
 Constructor clears the bits. More...
 
void set (std::string const &s, bool val=true)
 Set a given selection cut, on or off. More...
 
void set (index_type const &i, bool val=true)
 
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 set (index_type const &i, int cut, bool val=true)
 
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 (index_type const &i, double cut, bool val=true)
 
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 ()
 

Private Attributes

index_type indexD0_
 
index_type indexED0_
 
index_type indexRelIso_
 
index_type indexSD0_
 
Version_t version_
 

Additional Inherited Members

- Protected Attributes inherited from Selector< pat::Electron >
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...
 

Detailed Description

Definition at line 10 of file ElectronVPlusJetsIDSelectionFunctor.h.

Member Enumeration Documentation

Constructor & Destructor Documentation

ElectronVPlusJetsIDSelectionFunctor::ElectronVPlusJetsIDSelectionFunctor ( )
inline

Definition at line 16 of file ElectronVPlusJetsIDSelectionFunctor.h.

16 {}
ElectronVPlusJetsIDSelectionFunctor::ElectronVPlusJetsIDSelectionFunctor ( edm::ParameterSet const &  parameters)
inline

Definition at line 18 of file ElectronVPlusJetsIDSelectionFunctor.h.

References gather_cfg::cout, edm::hlt::Exception, edm::ParameterSet::exists(), FIRSTDATA, Selector< pat::Electron >::getBitTemplate(), edm::ParameterSet::getParameter(), initialize(), Selector< pat::Electron >::retInternal_, Selector< pat::Electron >::setIgnoredCuts(), and AlCaHLTBitMon_QueryRunRegistry::string.

18  {
19 
20  std::string versionStr = parameters.getParameter<std::string>("version");
21  if ( versionStr != "FIRSTDATA") {
22  std::cout << "The version " << versionStr << " is deprecated. Setting to FIRSTDATA" << std::endl;
23  }
24 
25  if (versionStr == "FIRSTDATA") {
27  parameters.getParameter<double>("D0"),
28  parameters.getParameter<double>("ED0"),
29  parameters.getParameter<double>("SD0"),
30  parameters.getParameter<double>("RelIso") );
31  if ( parameters.exists("cutsToIgnore") )
32  setIgnoredCuts( parameters.getParameter<std::vector<std::string> >("cutsToIgnore") );
33  } else {
34  throw cms::Exception("InvalidInput") << "Expect version to be one of SUMMER08, FIRSTDATA," << std::endl;
35  }
36 
38 
39  }
dictionary parameters
Definition: Parameters.py:2
pat::strbitset retInternal_
internal ret if users don&#39;t care about return bits
Definition: Selector.h:287
void initialize(Version_t version, double d0, double ed0, double sd0, double reliso)
pat::strbitset getBitTemplate() const
Get an empty bitset with the proper names.
Definition: Selector.h:212
tuple cout
Definition: gather_cfg.py:121
void setIgnoredCuts(std::vector< std::string > const &bitsToIgnore)
set the bits to ignore from a vector
Definition: Selector.h:167
ElectronVPlusJetsIDSelectionFunctor::ElectronVPlusJetsIDSelectionFunctor ( Version_t  version,
double  d0 = 0.2,
double  ed0 = 999.0,
double  sd0 = 999.0,
double  reliso = 0.1 
)
inline

Definition at line 42 of file ElectronVPlusJetsIDSelectionFunctor.h.

References initialize().

46  {
47  initialize( version, d0, ed0, sd0, reliso );
48  }
void initialize(Version_t version, double d0, double ed0, double sd0, double reliso)

Member Function Documentation

bool ElectronVPlusJetsIDSelectionFunctor::firstDataCuts ( const pat::Electron electron,
pat::strbitset ret 
)
inline

Definition at line 90 of file ElectronVPlusJetsIDSelectionFunctor.h.

References Selector< pat::Electron >::cut(), pat::Electron::dB(), reco::GsfElectron::dr03EcalRecHitSumEt(), reco::GsfElectron::dr03HcalTowerSumEt(), reco::GsfElectron::dr03TkSumPt(), pat::Electron::edB(), reco::LeafCandidate::et(), Selector< pat::Electron >::ignoreCut(), indexD0_, indexED0_, indexRelIso_, indexSD0_, Selector< pat::Electron >::passCut(), run_regression::ret, pat::strbitset::set(), and Selector< pat::Electron >::setIgnored().

Referenced by operator()().

91  {
92 
93  ret.set(false);
94  double corr_d0 = electron.dB();
95  double corr_ed0 = electron.edB();
96  double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
97 
98  double hcalIso = electron.dr03HcalTowerSumEt();
99  double ecalIso = electron.dr03EcalRecHitSumEt();
100  double trkIso = electron.dr03TkSumPt();
101  double et = electron.et() ;
102 
103  double relIso = (ecalIso + hcalIso + trkIso) / et;
104 
105  if ( fabs(corr_d0) < cut(indexD0_, double()) || ignoreCut(indexD0_) ) passCut(ret, indexD0_ );
106  if ( fabs(corr_ed0)< cut(indexED0_, double()) || ignoreCut(indexED0_) ) passCut(ret, indexED0_ );
107  if ( fabs(corr_sd0)< cut(indexSD0_, double()) || ignoreCut(indexSD0_) ) passCut(ret, indexSD0_ );
108  if ( relIso < cut(indexRelIso_, double()) || ignoreCut(indexRelIso_) ) passCut(ret, indexRelIso_ );
109 
110  setIgnored(ret);
111  return (bool)ret;
112  }
double edB(IpType type=None) const
Uncertainty on the corresponding impact parameter.
Definition: Electron.cc:404
virtual double et() const GCC11_FINAL
transverse energy
void setIgnored(pat::strbitset &ret)
set ignored bits
Definition: Selector.h:224
void passCut(pat::strbitset &ret, std::string const &s)
Passing cuts.
Definition: Selector.h:176
bool ignoreCut(std::string const &s) const
ignore the cut at index &quot;s&quot;
Definition: Selector.h:159
float dr03TkSumPt() const
Definition: GsfElectron.h:436
strbitset & set(bool val=true)
set method of all bits
Definition: strbitset.h:144
float dr03EcalRecHitSumEt() const
Definition: GsfElectron.h:437
float dr03HcalTowerSumEt() const
Definition: GsfElectron.h:440
double dB(IpType type=None) const
Impact parameter wrt primary vertex or beamspot.
Definition: Electron.cc:377
int cut(index_type const &i, int val) const
Access the int cut values at index &quot;s&quot;.
Definition: Selector.h:194
void ElectronVPlusJetsIDSelectionFunctor::initialize ( Version_t  version,
double  d0,
double  ed0,
double  sd0,
double  reliso 
)
inline

Definition at line 51 of file ElectronVPlusJetsIDSelectionFunctor.h.

References Selector< pat::Electron >::bits_, indexD0_, indexED0_, indexRelIso_, indexSD0_, Selector< pat::Electron >::push_back(), Selector< pat::Electron >::set(), BeamSplash_cfg::version, and version_.

Referenced by ElectronVPlusJetsIDSelectionFunctor().

56  {
57  version_ = version;
58 
59  push_back("D0", d0);
60  push_back("ED0", ed0);
61  push_back("SD0", sd0);
62  push_back("RelIso", reliso);
63 
64  // all on by default
65  set("D0");
66  set("ED0");
67  set("SD0");
68  set("RelIso");
69 
70 
71  indexD0_ = index_type(&bits_, "D0" );
72  indexED0_ = index_type(&bits_, "ED0" );
73  indexSD0_ = index_type(&bits_, "SD0" );
74  indexRelIso_ = index_type(&bits_, "RelIso" );
75 
76  }
void set(std::string const &s, bool val=true)
Set a given selection cut, on or off.
Definition: Selector.h:105
pat::strbitset::index_type index_type
Definition: Selector.h:29
pat::strbitset bits_
the bitset indexed by strings
Definition: Selector.h:286
virtual void push_back(std::string const &s)
This is the registration of an individual cut string.
Definition: Selector.h:46
bool ElectronVPlusJetsIDSelectionFunctor::operator() ( const pat::Electron t,
pat::strbitset ret 
)
inlinevirtual

This provides the interface for base classes to select objects.

Implements Selector< pat::Electron >.

Definition at line 79 of file ElectronVPlusJetsIDSelectionFunctor.h.

References FIRSTDATA, firstDataCuts(), and version_.

80  {
81  if ( version_ == FIRSTDATA ) return firstDataCuts( electron, ret );
82  else {
83  return false;
84  }
85  }
bool firstDataCuts(const pat::Electron &electron, pat::strbitset &ret)

Member Data Documentation

index_type ElectronVPlusJetsIDSelectionFunctor::indexD0_
private

Definition at line 119 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

index_type ElectronVPlusJetsIDSelectionFunctor::indexED0_
private

Definition at line 120 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

index_type ElectronVPlusJetsIDSelectionFunctor::indexRelIso_
private

Definition at line 122 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

index_type ElectronVPlusJetsIDSelectionFunctor::indexSD0_
private

Definition at line 121 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

Version_t ElectronVPlusJetsIDSelectionFunctor::version_
private

Definition at line 117 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by initialize(), and operator()().