CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ElectronIDExternalProducer< algo > Class Template Reference

#include <ElectronIDExternalProducer.h>

Inheritance diagram for ElectronIDExternalProducer< algo >:
edm::stream::EDProducer<>

Public Member Functions

 ElectronIDExternalProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
 ~ElectronIDExternalProducer () 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
 

Private Attributes

algo select_
 
edm::EDGetTokenT< reco::GsfElectronCollectionsrcToken_
 

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

template<class algo>
class ElectronIDExternalProducer< algo >

Definition at line 18 of file ElectronIDExternalProducer.h.

Constructor & Destructor Documentation

◆ ElectronIDExternalProducer()

template<class algo >
ElectronIDExternalProducer< algo >::ElectronIDExternalProducer ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 20 of file ElectronIDExternalProducer.h.

21  : srcToken_(consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("src"))),
22  select_(iConfig, consumesCollector()) {
23  produces<edm::ValueMap<float>>();
24  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_

◆ ~ElectronIDExternalProducer()

template<class algo >
ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer ( )
inlineoverride

Definition at line 26 of file ElectronIDExternalProducer.h.

26 {}

Member Function Documentation

◆ produce()

template<typename algo >
void ElectronIDExternalProducer< algo >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
override

Definition at line 36 of file ElectronIDExternalProducer.h.

References pwdgSkimBPark_cfi::electrons, trigObjTnPSource_cfi::filler, iEvent, eostools::move(), MillePedeFileConverter_cfg::out, and contentValuesCheck::values.

36  {
37  // read input collection
39  iEvent.getByToken(srcToken_, electrons);
40 
41  // initialize common selector
42  select_.newEvent(iEvent, iSetup);
43 
44  // prepare room for output
45  std::vector<float> values;
46  values.reserve(electrons->size());
47  for (reco::GsfElectronCollection::const_iterator eleIt = electrons->begin(); eleIt != electrons->end(); ++eleIt) {
48  values.push_back(float(select_((*eleIt), iEvent, iSetup)));
49  }
50 
51  // fill in the ValueMap
52  auto out = std::make_unique<edm::ValueMap<float>>();
54  filler.insert(electrons, values.begin(), values.end());
55  filler.fill();
56  // and put it into the event
57  iEvent.put(std::move(out));
58 }
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_
int iEvent
Definition: GenABIO.cc:224
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ select_

template<class algo >
algo ElectronIDExternalProducer< algo >::select_
private

Definition at line 32 of file ElectronIDExternalProducer.h.

◆ srcToken_

template<class algo >
edm::EDGetTokenT<reco::GsfElectronCollection> ElectronIDExternalProducer< algo >::srcToken_
private

Definition at line 31 of file ElectronIDExternalProducer.h.