CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
LowPtGsfElectronFinalizer Class Reference
Inheritance diagram for LowPtGsfElectronFinalizer:
edm::stream::EDProducer<>

Public Member Functions

 LowPtGsfElectronFinalizer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Attributes

const edm::EDGetTokenT
< reco::GsfElectronCollection
previousGsfElectrons_
 
const edm::EDPutTokenT
< reco::GsfElectronCollection
putToken_
 
std::unique_ptr
< ModifyObjectValueBase
regression_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Definition at line 11 of file LowPtGsfElectronFinalizer.cc.

Constructor & Destructor Documentation

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

Definition at line 29 of file LowPtGsfElectronFinalizer.cc.

References edm::ParameterSet::getParameter().

30  : previousGsfElectrons_{consumes<GsfElectronCollection>(cfg.getParameter<InputTag>("previousGsfElectronsTag"))},
31  putToken_{produces<GsfElectronCollection>()} {
32  auto const& iconf = cfg.getParameterSet("regressionConfig");
33  auto const& mname = iconf.getParameter<std::string>("modifierName");
34  auto cc = consumesCollector();
35  regression_ = ModifyObjectValueFactory::get()->create(mname, iconf, cc);
36 }
const edm::EDPutTokenT< reco::GsfElectronCollection > putToken_
std::unique_ptr< ModifyObjectValueBase > regression_
ParameterSet const & getParameterSet(std::string const &) const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
#define get
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_

Member Function Documentation

void LowPtGsfElectronFinalizer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 55 of file LowPtGsfElectronFinalizer.cc.

References edm::ParameterSetDescription::add(), edm::ConfigurationDescriptions::addWithDefaultLabel(), submitPVResolutionJobs::desc, and edm::ParameterSetDescription::setUnknown().

55  {
57  desc.add<edm::InputTag>("previousGsfElectronsTag", {});
59  psd.setUnknown();
60  desc.add<edm::ParameterSetDescription>("regressionConfig", psd);
61  descriptions.addWithDefaultLabel(desc);
62 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void LowPtGsfElectronFinalizer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 38 of file LowPtGsfElectronFinalizer.cc.

References metsig::electron, edm::Event::get(), eostools::move(), previousGsfElectrons_, putToken_, and regression_.

38  {
39  // Setup regression for event
40  regression_->setEvent(event);
41  regression_->setEventContent(setup);
42 
43  // Create new modified electron collection
44  reco::GsfElectronCollection outputElectrons;
45  for (auto const& electron : event.get(previousGsfElectrons_)) {
46  outputElectrons.emplace_back(electron);
47  auto& newElectron = outputElectrons.back();
48  regression_->modifyObject(newElectron);
49  }
50 
51  // Emplace modified electrons to event
52  event.emplace(putToken_, std::move(outputElectrons));
53 }
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
const edm::EDPutTokenT< reco::GsfElectronCollection > putToken_
def move
Definition: eostools.py:511
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:346
std::unique_ptr< ModifyObjectValueBase > regression_
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_

Member Data Documentation

const edm::EDGetTokenT<reco::GsfElectronCollection> LowPtGsfElectronFinalizer::previousGsfElectrons_
private

Definition at line 20 of file LowPtGsfElectronFinalizer.cc.

Referenced by produce().

const edm::EDPutTokenT<reco::GsfElectronCollection> LowPtGsfElectronFinalizer::putToken_
private

Definition at line 23 of file LowPtGsfElectronFinalizer.cc.

Referenced by produce().

std::unique_ptr<ModifyObjectValueBase> LowPtGsfElectronFinalizer::regression_
private

Definition at line 21 of file LowPtGsfElectronFinalizer.cc.

Referenced by produce().