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

20  :
21  srcToken_(consumes<reco::GsfElectronCollection>(iConfig.getParameter<edm::InputTag>("src"))),
22  select_(iConfig, consumesCollector())
23  {
24  produces<edm::ValueMap<float> >();
25  }
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_
template<class algo >
ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer ( )
inlineoverride

Definition at line 27 of file ElectronIDExternalProducer.h.

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

27 {}

Member Function Documentation

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

Definition at line 38 of file ElectronIDExternalProducer.h.

References lowPtElectrons_cff::electrons, objects.autophobj::filler, edm::Event::getByToken(), eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), ElectronIDExternalProducer< algo >::select_, ElectronIDExternalProducer< algo >::srcToken_, and MuonErrorMatrixValues_cff::values.

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

38  {
39  // read input collection
41  iEvent.getByToken(srcToken_, electrons);
42 
43  // initialize common selector
44  select_.newEvent(iEvent, iSetup);
45 
46  // prepare room for output
47  std::vector<float> values; values.reserve(electrons->size());
48  for ( reco::GsfElectronCollection::const_iterator eleIt = electrons->begin () ;
49  eleIt != electrons->end () ;
50  ++eleIt ) {
51  values.push_back( float( select_((*eleIt),iEvent,iSetup) ) );
52  }
53 
54  // fill in the ValueMap
55  auto out = std::make_unique<edm::ValueMap<float>>();
57  filler.insert(electrons, values.begin(), values.end());
58  filler.fill();
59  // and put it into the event
60  iEvent.put(std::move(out));
61 
62 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
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