CMS 3D CMS Logo

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::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > >

Public Member Functions

 GsfElectronProducer (const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~GsfElectronProducer () override
 
- Public Member Functions inherited from GsfElectronBaseProducer
 GsfElectronBaseProducer (const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
 
 ~GsfElectronBaseProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > >
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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 ()
 
const edm::OrphanHandle< reco::GsfElectronCollection > & orphanHandle () const
 

Private Member Functions

void checkPfTranslatorParameters (edm::ParameterSet const &)
 

Private Attributes

bool pfTranslatorParametersChecked_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Static Public Member Functions inherited from GsfElectronBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 
static void globalEndJob (gsfAlgoHelpers::HeavyObjectCache const *)
 
static std::unique_ptr< gsfAlgoHelpers::HeavyObjectCacheinitializeGlobalCache (const edm::ParameterSet &conf)
 
- Protected Attributes inherited from GsfElectronBaseProducer
GsfElectronAlgoalgo_
 
GsfElectronAlgo::CutsConfiguration cutsCfg_
 
GsfElectronAlgo::CutsConfiguration cutsCfgPflow_
 
ElectronHcalHelper::Configuration hcalCfg_
 
ElectronHcalHelper::Configuration hcalCfgPflow_
 
GsfElectronAlgo::InputTagsConfiguration inputCfg_
 
ElectronMVAEstimator::Configuration mva_Iso_Cfg_
 
SoftElectronMVAEstimator::Configuration mva_NIso_Cfg_
 
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,
const gsfAlgoHelpers::HeavyObjectCache hoc 
)
explicit

Definition at line 82 of file GsfElectronProducer.cc.

84  {}
GsfElectronBaseProducer(const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
GsfElectronProducer::~GsfElectronProducer ( )
override

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_, edm::parameterSet(), GsfElectronAlgo::InputTagsConfiguration::pfMVA, pfTranslatorParametersChecked_, edm::HandleBase::provenance(), and funct::true.

Referenced by produce().

102  {
103  // extra configuration checks
105  {
108  event.getByToken(inputCfg_.pfMVA,pfMva) ;
110  }
111 
112  // call to base class
114  }
void checkPfTranslatorParameters(edm::ParameterSet const &)
GsfElectronAlgo::InputTagsConfiguration inputCfg_
edm::EDGetTokenT< edm::ValueMap< float > > pfMVA
void beginEvent(edm::Event &, const edm::EventSetup &)
ParameterSet const & parameterSet(Provenance const &provenance)
Definition: Provenance.cc:11
Provenance const * provenance() const
Definition: HandleBase.h:83
void GsfElectronProducer::checkPfTranslatorParameters ( edm::ParameterSet const &  pset)
private

Definition at line 116 of file GsfElectronProducer.cc.

References GsfElectronAlgo::StrategyConfiguration::applyPreselection, GsfElectronBaseProducer::cutsCfg_, GsfElectronBaseProducer::cutsCfgPflow_, Exception, edm::ParameterSet::getParameter(), GsfElectronAlgo::CutsConfiguration::minMVA, and GsfElectronBaseProducer::strategyCfg_.

Referenced by beginEvent().

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

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(globalCache()) ; }
96  algo_->addPflowInfo() ;
97  fillEvent(event) ;
98  endEvent() ;
99  }
void clonePreviousElectrons()
void completeElectrons(const gsfAlgoHelpers::HeavyObjectCache *)
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().