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::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > > edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 GsfElectronProducer (const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~GsfElectronProducer ()
 
- Public Member Functions inherited from GsfElectronBaseProducer
 GsfElectronBaseProducer (const edm::ParameterSet &, const gsfAlgoHelpers::HeavyObjectCache *)
 
virtual ~GsfElectronBaseProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< gsfAlgoHelpers::HeavyObjectCache > >
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from GsfElectronBaseProducer
static void fillDescription (edm::ParameterSetDescription &)
 
static void globalEndJob (gsfAlgoHelpers::HeavyObjectCache const *)
 
static std::unique_ptr
< gsfAlgoHelpers::HeavyObjectCache
initializeGlobalCache (const edm::ParameterSet &conf)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
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_
 
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 ( )
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_, 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:84
void GsfElectronProducer::checkPfTranslatorParameters ( edm::ParameterSet const &  pset)
private

Definition at line 116 of file GsfElectronProducer.cc.

References GsfElectronAlgo::StrategyConfiguration::applyPreselection, GsfElectronBaseProducer::cutsCfg_, GsfElectronBaseProducer::cutsCfgPflow_, edm::hlt::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 
)
virtual

Implements edm::stream::EDProducerBase.

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().