CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/RecoEgamma/ElectronIdentification/plugins/ElectronIDSelectorNeuralNet.cc

Go to the documentation of this file.
00001 #include "RecoEgamma/ElectronIdentification/plugins/ElectronIDSelectorNeuralNet.h"
00002 
00003 ElectronIDSelectorNeuralNet::ElectronIDSelectorNeuralNet (const edm::ParameterSet& conf) : conf_ (conf) 
00004 {
00005   doNeuralNet_ = conf_.getParameter<bool> ("doNeuralNet");
00006   
00007   if (doNeuralNet_) 
00008     neuralNetAlgo_ = new ElectronNeuralNet();
00009 }
00010 
00011 ElectronIDSelectorNeuralNet::~ElectronIDSelectorNeuralNet () 
00012 {
00013   if (doNeuralNet_) 
00014     delete neuralNetAlgo_ ;
00015 }
00016 
00017 void ElectronIDSelectorNeuralNet::newEvent (const edm::Event& e, const edm::EventSetup& es)
00018 {
00019   if (doNeuralNet_) 
00020     neuralNetAlgo_->setup (conf_);
00021 }
00022 
00023 double ElectronIDSelectorNeuralNet::operator () (const reco::GsfElectron & ele, const edm::Event& e, const edm::EventSetup& es) 
00024 {
00025   if (doNeuralNet_) 
00026         return static_cast<double>(neuralNetAlgo_->result (& (ele), e) );
00027   return 0. ;
00028 }