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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

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<>
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
 

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 looper::cfg, beamerCreator::create(), reco::get(), edm::ParameterSet::getParameter(), putToken_, regression_, and AlCaHLTBitMon_QueryRunRegistry::string.

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_.reset(ModifyObjectValueFactory::get()->create(mname, iconf, cc));
36 }
T getParameter(std::string const &) const
def create(alignables, pedeDump, additionalData, outputFile, config)
const edm::EDPutTokenT< reco::GsfElectronCollection > putToken_
std::unique_ptr< ModifyObjectValueBase > regression_
ParameterSet const & getParameterSet(std::string const &) const
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_
T get(const Candidate &c)
Definition: component.h:55

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(), DEFINE_FWK_MODULE, 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_
bool get(ProductID const &oid, Handle< PROD > &result) const
Definition: Event.h:326
std::unique_ptr< ModifyObjectValueBase > regression_
const edm::EDGetTokenT< reco::GsfElectronCollection > previousGsfElectrons_
def move(src, dest)
Definition: eostools.py:511

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 LowPtGsfElectronFinalizer(), and produce().

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

Definition at line 21 of file LowPtGsfElectronFinalizer.cc.

Referenced by LowPtGsfElectronFinalizer(), and produce().