CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
GsfElectronProducer Class Reference

#include <GsfElectronProducer.h>

Inheritance diagram for GsfElectronProducer:
GsfElectronBaseProducer edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

 GsfElectronProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~GsfElectronProducer ()
 
- Public Member Functions inherited from GsfElectronBaseProducer
 GsfElectronBaseProducer (const edm::ParameterSet &)
 
virtual ~GsfElectronBaseProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Protected Member Functions

void beginEvent (edm::Event &, const edm::EventSetup &)
 
- Protected Member Functions inherited from GsfElectronBaseProducer
void beginEvent (edm::Event &, const edm::EventSetup &)
 
void endEvent ()
 
void fillEvent (edm::Event &)
 
reco::GsfElectronnewElectron ()
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Private Member Functions

void checkPfTranslatorParameters (edm::ParameterSetID const &)
 

Private Attributes

bool pfTranslatorParametersChecked_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from GsfElectronBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Attributes inherited from GsfElectronBaseProducer
GsfElectronAlgoalgo_
 
GsfElectronAlgo::CutsConfiguration cutsCfg_
 
GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
 
ElectronHcalHelper::Configuration hcalCfg_
 
ElectronHcalHelper::Configuration hcalCfgPflow_
 
GsfElectronAlgo::InputTagsConfiguration inputCfg_
 
GsfElectronAlgo::StrategyConfiguration strategyCfg_
 

Detailed Description

Description: EDProducer of GsfElectron objects

Implementation: <Notes on="" implementation>="">

Definition at line 7 of file GsfElectronProducer.h.

Constructor & Destructor Documentation

GsfElectronProducer::GsfElectronProducer ( const edm::ParameterSet cfg)
explicit

Definition at line 82 of file GsfElectronProducer.cc.

84  {}
GsfElectronBaseProducer(const edm::ParameterSet &)
GsfElectronProducer::~GsfElectronProducer ( )
virtual

Definition at line 86 of file GsfElectronProducer.cc.

87  {}

Member Function Documentation

void GsfElectronProducer::beginEvent ( edm::Event event,
const edm::EventSetup setup 
)
protected

Definition at line 101 of file GsfElectronProducer.cc.

References GsfElectronBaseProducer::beginEvent(), checkPfTranslatorParameters(), GsfElectronBaseProducer::inputCfg_, GsfElectronAlgo::InputTagsConfiguration::pfMVA, pfTranslatorParametersChecked_, edm::HandleBase::provenance(), and funct::true.

Referenced by produce().

102  {
103  // extra configuration checks
105  {
108  event.getByLabel(inputCfg_.pfMVA,pfMva) ;
109  checkPfTranslatorParameters(pfMva.provenance()->psetID()) ;
110  }
111 
112  // call to base class
114  }
void checkPfTranslatorParameters(edm::ParameterSetID const &)
GsfElectronAlgo::InputTagsConfiguration inputCfg_
void beginEvent(edm::Event &, const edm::EventSetup &)
Provenance const * provenance() const
Definition: HandleBase.h:84
void GsfElectronProducer::checkPfTranslatorParameters ( edm::ParameterSetID const &  psetid)
private

Definition at line 116 of file GsfElectronProducer.cc.

References GsfElectronAlgo::StrategyConfiguration::applyPreselection, GsfElectronBaseProducer::cutsCfg_, GsfElectronBaseProducer::cutsCfgPflow_, edm::hlt::Exception, edm::detail::ThreadSafeRegistry< KEY, T, E >::getMapped(), edm::ParameterSet::getParameter(), edm::detail::ThreadSafeRegistry< KEY, T, E >::instance(), GsfElectronAlgo::CutsConfiguration::minMVA, and GsfElectronBaseProducer::strategyCfg_.

Referenced by beginEvent().

117  {
118  edm::ParameterSet pset ;
119  edm::pset::Registry::instance()->getMapped(psetid,pset) ;
120  edm::ParameterSet mvaBlock = pset.getParameter<edm::ParameterSet>("MVACutBlock") ;
121  double pfTranslatorMinMva = mvaBlock.getParameter<double>("MVACut") ;
122  double pfTranslatorUndefined = -99. ;
123  if (strategyCfg_.applyPreselection&&(cutsCfgPflow_.minMVA<pfTranslatorMinMva))
124  {
125  // For pure tracker seeded electrons, if MVA is under translatorMinMva, there is no supercluster
126  // of any kind available, so GsfElectronCoreProducer has already discarded the electron.
127  edm::LogWarning("GsfElectronAlgo|MvaCutTooLow")
128  <<"Parameter minMVAPflow ("<<cutsCfgPflow_.minMVA<<") will have no effect on purely tracker seeded electrons."
129  <<" It is inferior to the cut already applied by PFlow translator ("<<pfTranslatorMinMva<<")." ;
130  }
131  if (strategyCfg_.applyPreselection&&(cutsCfg_.minMVA<pfTranslatorMinMva))
132  {
133  // For ecal seeded electrons, there is a cluster and GsfElectronCoreProducer has kept all electrons,
134  // but when MVA is under translatorMinMva, the translator has not stored the supercluster and
135  // forced the MVA value to translatorUndefined
136  if (cutsCfg_.minMVA>pfTranslatorUndefined)
137  {
138  edm::LogWarning("GsfElectronAlgo|IncompletePflowInformation")
139  <<"Parameter minMVA ("<<cutsCfg_.minMVA<<")is inferior to the cut applied by PFlow translator ("<<pfTranslatorMinMva<<")."
140  <<" Some ecal (and eventually tracker) seeded electrons may lack their MVA value and PFlow supercluster." ;
141  }
142  else
143  {
144  // the MVA value has been forced to translatorUndefined, inferior minMVAPflow
145  // so the cut actually applied is the PFlow one
146  throw cms::Exception("GsfElectronAlgo|BadMvaCut")
147  <<"Parameter minMVA is inferior to the lowest possible value."
148  <<" Every electron will be blessed whatever other criteria." ;
149  }
150  }
151  }
T getParameter(std::string const &) const
static ThreadSafeRegistry * instance()
bool getMapped(key_type const &k, value_type &result) const
GsfElectronAlgo::CutsConfiguration cutsCfg_
GsfElectronAlgo::StrategyConfiguration strategyCfg_
GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
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_.

90  {
91  beginEvent(event,setup) ;
93  // don't add pflow only electrons if one so wish
95  { algo_->completeElectrons() ; }
96  algo_->addPflowInfo() ;
97  fillEvent(event) ;
98  endEvent() ;
99  }
void clonePreviousElectrons()
GsfElectronAlgo::StrategyConfiguration strategyCfg_
void beginEvent(edm::Event &, const edm::EventSetup &)

Member Data Documentation

bool GsfElectronProducer::pfTranslatorParametersChecked_
private

Definition at line 24 of file GsfElectronProducer.h.

Referenced by beginEvent().