CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_9_patch3/src/RecoEgamma/ElectronIdentification/plugins/ElectronIDSelectorLikelihood.cc

Go to the documentation of this file.
00001 #include "RecoEgamma/ElectronIdentification/plugins/ElectronIDSelectorLikelihood.h"
00002 
00003 ElectronIDSelectorLikelihood::ElectronIDSelectorLikelihood (const edm::ParameterSet& conf) : conf_ (conf) 
00004 {
00005   doLikelihood_ = conf_.getParameter<bool> ("doLikelihood"); 
00006   reducedBarrelRecHitCollection_ = conf.getParameter<edm::InputTag>("reducedBarrelRecHitCollection");
00007   reducedEndcapRecHitCollection_ = conf.getParameter<edm::InputTag>("reducedEndcapRecHitCollection");
00008 
00009 }
00010 
00011 ElectronIDSelectorLikelihood::~ElectronIDSelectorLikelihood () 
00012 {
00013 }
00014 
00015 void ElectronIDSelectorLikelihood::newEvent (const edm::Event& e, const edm::EventSetup& es)
00016 {
00017   
00018   es.getData(likelihoodAlgo_) ;
00019 
00020 }
00021 
00022 double ElectronIDSelectorLikelihood::operator () (const reco::GsfElectron & ele, const edm::Event& e, const edm::EventSetup& es) 
00023 {
00024 
00025   if (doLikelihood_) {
00026     edm::Handle< EcalRecHitCollection > pEBRecHits;
00027     e.getByLabel( reducedBarrelRecHitCollection_, pEBRecHits );
00028 
00029     edm::Handle< EcalRecHitCollection > pEERecHits;
00030     e.getByLabel( reducedEndcapRecHitCollection_, pEERecHits );
00031 
00032     EcalClusterLazyTools lazyTools( e, es, reducedBarrelRecHitCollection_, reducedEndcapRecHitCollection_ ) ;    
00033     return static_cast<double>(likelihoodAlgo_->resultLog (ele,lazyTools)) ;
00034   }
00035   return 0; 
00036 
00037 }