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.

References looper::cfg.

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 }
uint32_t cc[maxCellsPerHit]
Definition: gpuFishbone.h:49
const edm::EDPutTokenT< reco::GsfElectronCollection > putToken_
std::unique_ptr< ModifyObjectValueBase > regression_
#define get
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_

Member Function Documentation

◆ fillDescriptions()

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

◆ produce()

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

Definition at line 38 of file LowPtGsfElectronFinalizer.cc.

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

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_
std::unique_ptr< ModifyObjectValueBase > regression_
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1

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