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 hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () 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

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
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_
template<class algo >
ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer ( )
inlineoverride

Definition at line 26 of file ElectronIDExternalProducer.h.

References iEvent, and ElectronIDExternalProducer< algo >::produce().

26 {}

Member Function Documentation

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, edm::Event::getByToken(), eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), ElectronIDExternalProducer< algo >::select_, ElectronIDExternalProducer< algo >::srcToken_, and contentValuesCheck::values.

Referenced by ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer().

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 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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