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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Attributes

algo select_
 
edm::EDGetTokenT< reco::GsfElectronCollectionsrcToken_
 

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

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  }

◆ ~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.

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 }

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

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.

ElectronIDExternalProducer::select_
algo select_
Definition: ElectronIDExternalProducer.h:32
ElectronIDExternalProducer::srcToken_
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_
Definition: ElectronIDExternalProducer.h:31
edm::Handle< reco::GsfElectronCollection >
contentValuesCheck.values
values
Definition: contentValuesCheck.py:38
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
iEvent
int iEvent
Definition: GenABIO.cc:224
eostools.move
def move(src, dest)
Definition: eostools.py:511
pwdgSkimBPark_cfi.electrons
electrons
Definition: pwdgSkimBPark_cfi.py:6
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
edm::helper::Filler
Definition: ValueMap.h:22
edm::InputTag
Definition: InputTag.h:15