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

Public Member Functions

 ElectronIDExternalProducer (const edm::ParameterSet &iConfig)
 
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
 
virtual ~ElectronIDExternalProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

algo select_
 
edm::InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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 17 of file ElectronIDExternalProducer.h.

Constructor & Destructor Documentation

template<class algo >
ElectronIDExternalProducer< algo >::ElectronIDExternalProducer ( const edm::ParameterSet iConfig)
inlineexplicit

Definition at line 19 of file ElectronIDExternalProducer.h.

19  :
20  src_(iConfig.getParameter<edm::InputTag>("src")),
21  select_(iConfig)
22  {
23  produces<edm::ValueMap<float> >();
24  }
T getParameter(std::string const &) const
template<class algo >
virtual ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer ( )
inlinevirtual

Definition at line 26 of file ElectronIDExternalProducer.h.

26 {}

Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 37 of file ElectronIDExternalProducer.h.

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

37  {
38  // read input collection
40  iEvent.getByLabel(src_, electrons);
41 
42  // initialize common selector
43  select_.newEvent(iEvent, iSetup);
44 
45  // prepare room for output
46  std::vector<float> values; values.reserve(electrons->size());
47  for ( reco::GsfElectronCollection::const_iterator eleIt = electrons->begin () ;
48  eleIt != electrons->end () ;
49  ++eleIt ) {
50  values.push_back( float( select_((*eleIt),iEvent,iSetup) ) );
51  }
52 
53  // fill in the ValueMap
54  std::auto_ptr<edm::ValueMap<float> > out(new edm::ValueMap<float>());
56  filler.insert(electrons, values.begin(), values.end());
57  filler.fill();
58  // and put it into the event
59  iEvent.put(out);
60 
61 }
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
tuple out
Definition: dbtoconf.py:99

Member Data Documentation

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

Definition at line 32 of file ElectronIDExternalProducer.h.

template<class algo >
edm::InputTag ElectronIDExternalProducer< algo >::src_
private

Definition at line 31 of file ElectronIDExternalProducer.h.