CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

algo select_
 
edm::EDGetTokenT
< reco::GsfElectronCollection
srcToken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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.

27 {}

Member Function Documentation

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

Implements edm::stream::EDProducerBase.

Definition at line 38 of file ElectronIDExternalProducer.h.

References HI_PhotonSkim_cff::electrons, edm::helper::Filler< Map >::fill(), edm::Event::getByToken(), edm::helper::Filler< Map >::insert(), dbtoconf::out, edm::Event::put(), and makeHLTPrescaleTable::values.

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  std::auto_ptr<edm::ValueMap<float> > out(new edm::ValueMap<float>());
57  filler.insert(electrons, values.begin(), values.end());
58  filler.fill();
59  // and put it into the event
60  iEvent.put(out);
61 
62 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< reco::GsfElectronCollection > srcToken_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:115
tuple out
Definition: dbtoconf.py:99

Member Data Documentation

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

Definition at line 33 of file ElectronIDExternalProducer.h.

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

Definition at line 32 of file ElectronIDExternalProducer.h.