CMS 3D CMS Logo

Public Types | Public Member Functions | Private Attributes

ElectronVPlusJetsIDSelectionFunctor Class Reference

#include <ElectronVPlusJetsIDSelectionFunctor.h>

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

List of all members.

Public Types

enum  Version_t { SUMMER08, FIRSTDATA, N_VERSIONS }

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.

Private Attributes

index_type indexD0_
index_type indexED0_
index_type indexRelIso_
index_type indexSD0_
Version_t version_

Detailed Description

Definition at line 10 of file ElectronVPlusJetsIDSelectionFunctor.h.


Member Enumeration Documentation

Enumerator:
SUMMER08 
FIRSTDATA 
N_VERSIONS 

Definition at line 14 of file ElectronVPlusJetsIDSelectionFunctor.h.


Constructor & Destructor Documentation

ElectronVPlusJetsIDSelectionFunctor::ElectronVPlusJetsIDSelectionFunctor ( ) [inline]

Definition at line 16 of file ElectronVPlusJetsIDSelectionFunctor.h.

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

Definition at line 18 of file ElectronVPlusJetsIDSelectionFunctor.h.

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

                                                                           {

    std::string versionStr = parameters.getParameter<std::string>("version");
    if ( versionStr != "FIRSTDATA") {
      std::cout << "The version " << versionStr << " is deprecated. Setting to FIRSTDATA" << std::endl;
    }

    if (versionStr == "FIRSTDATA") {
      initialize( FIRSTDATA, 
                  parameters.getParameter<double>("D0"),
                  parameters.getParameter<double>("ED0"),
                  parameters.getParameter<double>("SD0"),
                  parameters.getParameter<double>("RelIso") );
      if ( parameters.exists("cutsToIgnore") )
        setIgnoredCuts( parameters.getParameter<std::vector<std::string> >("cutsToIgnore") );
    } else {
      throw cms::Exception("InvalidInput") << "Expect version to be one of SUMMER08, FIRSTDATA," << std::endl;
    }

    retInternal_ = getBitTemplate();
                
  }
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().

                                                            {
    initialize( version, d0, ed0, sd0, 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(), runTheMatrix::ret, pat::strbitset::set(), and Selector< pat::Electron >::setIgnored().

Referenced by operator()().

  {

    ret.set(false);
    double corr_d0 = electron.dB();
    double corr_ed0 = electron.edB();
    double corr_sd0 = ( corr_ed0 > 0.000000001 ) ? corr_d0 / corr_ed0 : 999.0;
        
    double hcalIso = electron.dr03HcalTowerSumEt();
    double ecalIso = electron.dr03EcalRecHitSumEt();
    double trkIso  = electron.dr03TkSumPt();
    double et      = electron.et() ;
    
    double relIso = (ecalIso + hcalIso + trkIso) / et;

    if ( fabs(corr_d0) <  cut(indexD0_,     double()) || ignoreCut(indexD0_)      ) passCut(ret, indexD0_     );
    if ( fabs(corr_ed0)<  cut(indexED0_,    double()) || ignoreCut(indexED0_)     ) passCut(ret, indexED0_    );
    if ( fabs(corr_sd0)<  cut(indexSD0_,    double()) || ignoreCut(indexSD0_)     ) passCut(ret, indexSD0_    );
    if ( relIso        <  cut(indexRelIso_, double()) || ignoreCut(indexRelIso_)  ) passCut(ret, indexRelIso_ );

    setIgnored(ret);
    return (bool)ret;
  }
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(), BeamSplash_cfg::version, and version_.

Referenced by ElectronVPlusJetsIDSelectionFunctor().

  {
    version_ = version;

    push_back("D0",        d0);
    push_back("ED0",       ed0);
    push_back("SD0",       sd0);
    push_back("RelIso",    reliso);
    
    // all on by default
    set("D0");
    set("ED0");
    set("SD0");
    set("RelIso");


    indexD0_            = index_type(&bits_, "D0"           );
    indexED0_           = index_type(&bits_, "ED0"          );
    indexSD0_           = index_type(&bits_, "SD0"          );
    indexRelIso_        = index_type(&bits_, "RelIso"       );
    
  }
bool ElectronVPlusJetsIDSelectionFunctor::operator() ( const pat::Electron t,
pat::strbitset ret 
) [inline, virtual]

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_.

  { 
    if ( version_ == FIRSTDATA ) return firstDataCuts( electron, ret );
    else {
      return false;
    }
  }

Member Data Documentation

Definition at line 119 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

Definition at line 120 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

Definition at line 122 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

Definition at line 121 of file ElectronVPlusJetsIDSelectionFunctor.h.

Referenced by firstDataCuts(), and initialize().

Definition at line 117 of file ElectronVPlusJetsIDSelectionFunctor.h.

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