#include <GsfElectronProducer.h>
Public Member Functions | |
GsfElectronProducer (const edm::ParameterSet &) | |
virtual void | produce (edm::Event &, const edm::EventSetup &) |
virtual | ~GsfElectronProducer () |
Protected Member Functions | |
void | beginEvent (edm::Event &, const edm::EventSetup &) |
Private Member Functions | |
void | checkPfTranslatorParameters (edm::ParameterSetID const &) |
Private Attributes | |
bool | pfTranslatorParametersChecked_ |
Description: EDProducer of GsfElectron objects
Implementation: <Notes on="" implementation>="">
Definition at line 7 of file GsfElectronProducer.h.
GsfElectronProducer::GsfElectronProducer | ( | const edm::ParameterSet & | cfg | ) | [explicit] |
Definition at line 82 of file GsfElectronProducer.cc.
: GsfElectronBaseProducer(cfg), pfTranslatorParametersChecked_(false) {}
GsfElectronProducer::~GsfElectronProducer | ( | ) | [virtual] |
Definition at line 86 of file GsfElectronProducer.cc.
{}
void GsfElectronProducer::beginEvent | ( | edm::Event & | event, |
const edm::EventSetup & | setup | ||
) | [protected] |
Reimplemented from GsfElectronBaseProducer.
Definition at line 101 of file GsfElectronProducer.cc.
References checkPfTranslatorParameters(), GsfElectronBaseProducer::inputCfg_, GsfElectronAlgo::InputTagsConfiguration::pfMVA, pfTranslatorParametersChecked_, edm::HandleBase::provenance(), and funct::true.
Referenced by produce().
{ // extra configuration checks if (!pfTranslatorParametersChecked_) { pfTranslatorParametersChecked_ = true ; edm::Handle<edm::ValueMap<float> > pfMva ; event.getByLabel(inputCfg_.pfMVA,pfMva) ; checkPfTranslatorParameters(pfMva.provenance()->psetID()) ; } // call to base class GsfElectronBaseProducer::beginEvent(event,setup) ; }
void GsfElectronProducer::checkPfTranslatorParameters | ( | edm::ParameterSetID const & | psetid | ) | [private] |
Definition at line 116 of file GsfElectronProducer.cc.
References GsfElectronAlgo::StrategyConfiguration::applyPreselection, GsfElectronBaseProducer::cutsCfg_, GsfElectronBaseProducer::cutsCfgPflow_, Exception, edm::ParameterSet::getParameter(), instance, GsfElectronAlgo::CutsConfiguration::minMVA, and GsfElectronBaseProducer::strategyCfg_.
Referenced by beginEvent().
{ edm::ParameterSet pset ; edm::pset::Registry::instance()->getMapped(psetid,pset) ; edm::ParameterSet mvaBlock = pset.getParameter<edm::ParameterSet>("MVACutBlock") ; double pfTranslatorMinMva = mvaBlock.getParameter<double>("MVACut") ; double pfTranslatorUndefined = -99. ; if (strategyCfg_.applyPreselection&&(cutsCfgPflow_.minMVA<pfTranslatorMinMva)) { // For pure tracker seeded electrons, if MVA is under translatorMinMva, there is no supercluster // of any kind available, so GsfElectronCoreProducer has already discarded the electron. edm::LogWarning("GsfElectronAlgo|MvaCutTooLow") <<"Parameter minMVAPflow ("<<cutsCfgPflow_.minMVA<<") will have no effect on purely tracker seeded electrons." <<" It is inferior to the cut already applied by PFlow translator ("<<pfTranslatorMinMva<<")." ; } if (strategyCfg_.applyPreselection&&(cutsCfg_.minMVA<pfTranslatorMinMva)) { // For ecal seeded electrons, there is a cluster and GsfElectronCoreProducer has kept all electrons, // but when MVA is under translatorMinMva, the translator has not stored the supercluster and // forced the MVA value to translatorUndefined if (cutsCfg_.minMVA>pfTranslatorUndefined) { edm::LogWarning("GsfElectronAlgo|IncompletePflowInformation") <<"Parameter minMVA ("<<cutsCfg_.minMVA<<")is inferior to the cut applied by PFlow translator ("<<pfTranslatorMinMva<<")." <<" Some ecal (and eventually tracker) seeded electrons may lack their MVA value and PFlow supercluster." ; } else { // the MVA value has been forced to translatorUndefined, inferior minMVAPflow // so the cut actually applied is the PFlow one throw cms::Exception("GsfElectronAlgo|BadMvaCut") <<"Parameter minMVA is inferior to the lowest possible value." <<" Every electron will be blessed whatever other criteria." ; } } }
void GsfElectronProducer::produce | ( | edm::Event & | event, |
const edm::EventSetup & | setup | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 89 of file GsfElectronProducer.cc.
References GsfElectronAlgo::StrategyConfiguration::addPflowElectrons, GsfElectronAlgo::addPflowInfo(), GsfElectronBaseProducer::algo_, beginEvent(), GsfElectronAlgo::clonePreviousElectrons(), GsfElectronAlgo::completeElectrons(), GsfElectronBaseProducer::endEvent(), GsfElectronBaseProducer::fillEvent(), and GsfElectronBaseProducer::strategyCfg_.
{ beginEvent(event,setup) ; algo_->clonePreviousElectrons() ; // don't add pflow only electrons if one so wish if (strategyCfg_.addPflowElectrons) { algo_->completeElectrons() ; } algo_->addPflowInfo() ; fillEvent(event) ; endEvent() ; }
bool GsfElectronProducer::pfTranslatorParametersChecked_ [private] |
Definition at line 24 of file GsfElectronProducer.h.
Referenced by beginEvent().