CMS 3D CMS Logo

ElectronIDExternalProducer< algo > Class Template Reference

#include <RecoEgamma/ElectronIdentification/plugins/ElectronIDExternalProducer.h>

Inheritance diagram for ElectronIDExternalProducer< algo >:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 ElectronIDExternalProducer (const edm::ParameterSet &iConfig)
void produce (edm::Event &iEvent, const edm::EventSetup &iSetup)
virtual ~ElectronIDExternalProducer ()

Private Attributes

algo select_
edm::InputTag src_


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  )  [inline, explicit]

Definition at line 19 of file ElectronIDExternalProducer.h.

00019                                                                        :
00020             src_(iConfig.getParameter<edm::InputTag>("src")),
00021             select_(iConfig)
00022    {
00023         produces<edm::ValueMap<float> >();
00024    }

template<class algo>
virtual ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer (  )  [inline, virtual]

Definition at line 26 of file ElectronIDExternalProducer.h.

00026 {}


Member Function Documentation

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

Implements edm::EDProducer.

Definition at line 37 of file ElectronIDExternalProducer.h.

References edm::Event::getByLabel(), out, edm::Event::put(), ElectronIDExternalProducer< algo >::select_, ElectronIDExternalProducer< algo >::src_, and values.

00037                                                                                               {
00038      // read input collection
00039      edm::Handle<reco::GsfElectronCollection> electrons;
00040      iEvent.getByLabel(src_, electrons);
00041 
00042      // initialize common selector
00043      select_.newEvent(iEvent, iSetup);
00044 
00045      // prepare room for output
00046      std::vector<float> values; values.reserve(electrons->size());
00047      for ( reco::GsfElectronCollection::const_iterator eleIt = electrons->begin () ;
00048              eleIt != electrons->end () ;
00049              ++eleIt ) {
00050          values.push_back( float( select_((*eleIt),iEvent,iSetup) ) );
00051      }
00052 
00053      // fill in the ValueMap
00054      std::auto_ptr<edm::ValueMap<float> > out(new edm::ValueMap<float>());
00055      edm::ValueMap<float>::Filler filler(*out);
00056      filler.insert(electrons, values.begin(), values.end());
00057      filler.fill();
00058      // and put it into the event
00059      iEvent.put(out);
00060 
00061 }


Member Data Documentation

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

Definition at line 32 of file ElectronIDExternalProducer.h.

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

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

Definition at line 31 of file ElectronIDExternalProducer.h.

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


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:20:16 2009 for CMSSW by  doxygen 1.5.4