CMS 3D CMS Logo

ElectronIDSelectorCutBased.cc

Go to the documentation of this file.
00001 #include "RecoEgamma/ElectronIdentification/plugins/ElectronIDSelectorCutBased.h"
00002 
00003 ElectronIDSelectorCutBased::ElectronIDSelectorCutBased (const edm::ParameterSet& conf) : conf_ (conf) 
00004 {
00005   std::string algorithm_ = conf.getParameter<std::string> ("algorithm") ;
00006   
00007   if ( algorithm_ == "eIDCBClasses" )
00008      electronIDAlgo_ = new PTDRElectronID ();
00009   else if ( algorithm_ == "eIDCB" )
00010      electronIDAlgo_ = new CutBasedElectronID ();
00011   else 
00012   {
00013     edm::LogError("ElectronIDSelectorCutBased") << "Invalid algorithm parameter: must be eIDCBClasses or eIDCB." ;
00014     exit (1); 
00015   }
00016 }
00017 
00018 ElectronIDSelectorCutBased::~ElectronIDSelectorCutBased () 
00019 {
00020   delete electronIDAlgo_ ;
00021 }
00022 
00023 void ElectronIDSelectorCutBased::newEvent (const edm::Event& e, const edm::EventSetup& es)
00024 {
00025   electronIDAlgo_->setup (conf_);
00026 }
00027 
00028 double ElectronIDSelectorCutBased::operator () (const reco::GsfElectron & ele, const edm::Event& e, const edm::EventSetup& es) 
00029 {
00030   return electronIDAlgo_->result (& (ele), e, es) ;
00031 }

Generated on Tue Jun 9 17:43:28 2009 for CMSSW by  doxygen 1.5.4