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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ElectronIDExternalProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup) override
 
virtual ~ElectronIDExternalProducer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
template<class algo >
virtual ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer ( )
inlinevirtual

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 genericTrackCleaner_cfi::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:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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