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::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 &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

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
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

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:85
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
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.