CMS 3D CMS Logo

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::GsfElectronCollectionpreviousGsfElectrons_
 
const edm::EDPutTokenT< reco::GsfElectronCollectionputToken_
 
std::unique_ptr< ModifyObjectValueBaseregression_
 

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::LowPtGsfElectronFinalizer ( const edm::ParameterSet cfg)
explicit

Definition at line 29 of file LowPtGsfElectronFinalizer.cc.

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 }

References looper::cfg.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 55 of file LowPtGsfElectronFinalizer.cc.

55  {
57  desc.add<edm::InputTag>("previousGsfElectronsTag", {});
59  psd.setUnknown();
60  desc.add<edm::ParameterSetDescription>("regressionConfig", psd);
61  descriptions.addWithDefaultLabel(desc);
62 }

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

◆ produce()

void LowPtGsfElectronFinalizer::produce ( edm::Event event,
const edm::EventSetup setup 
)
override

Definition at line 38 of file LowPtGsfElectronFinalizer.cc.

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 }

References HPSPFTauProducerPuppi_cfi::electron, eostools::move(), previousGsfElectrons_, putToken_, regression_, and singleTopDQM_cfi::setup.

Member Data Documentation

◆ previousGsfElectrons_

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

Definition at line 20 of file LowPtGsfElectronFinalizer.cc.

Referenced by produce().

◆ putToken_

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

Definition at line 23 of file LowPtGsfElectronFinalizer.cc.

Referenced by produce().

◆ regression_

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

Definition at line 21 of file LowPtGsfElectronFinalizer.cc.

Referenced by produce().

LowPtGsfElectronFinalizer::putToken_
const edm::EDPutTokenT< reco::GsfElectronCollection > putToken_
Definition: LowPtGsfElectronFinalizer.cc:23
LowPtGsfElectronFinalizer::regression_
std::unique_ptr< ModifyObjectValueBase > regression_
Definition: LowPtGsfElectronFinalizer.cc:21
LowPtGsfElectronFinalizer::previousGsfElectrons_
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_
Definition: LowPtGsfElectronFinalizer.cc:20
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
edm::ParameterSetDescription::setUnknown
void setUnknown()
Definition: ParameterSetDescription.cc:39
get
#define get
cc
HPSPFTauProducerPuppi_cfi.electron
electron
Definition: HPSPFTauProducerPuppi_cfi.py:13
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
looper.cfg
cfg
Definition: looper.py:296
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
event
Definition: event.py:1
edm::InputTag
Definition: InputTag.h:15
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87