#include <RecoEgamma/ElectronIdentification/plugins/ElectronIDExternalProducer.h>
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_ |
Definition at line 17 of file ElectronIDExternalProducer.h.
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 }
virtual ElectronIDExternalProducer< algo >::~ElectronIDExternalProducer | ( | ) | [inline, virtual] |
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 }
algo ElectronIDExternalProducer< algo >::select_ [private] |
Definition at line 32 of file ElectronIDExternalProducer.h.
Referenced by ElectronIDExternalProducer< algo >::produce().
edm::InputTag ElectronIDExternalProducer< algo >::src_ [private] |
Definition at line 31 of file ElectronIDExternalProducer.h.
Referenced by ElectronIDExternalProducer< algo >::produce().